| @@ -0,0 +1,23 @@ | |||
| apiVersion: argoproj.io/v1alpha1 | |||
| kind: Workflow | |||
| metadata: | |||
| generateName: arguments-parameters- | |||
| spec: | |||
| entrypoint: whalesay | |||
| # Parameters can be passed/overridden via the argo CLI. | |||
| # To override the printed message, run `argo submit` with the -p option: | |||
| # $ argo submit examples/arguments-parameters.yaml -p message="goodbye world" | |||
| arguments: | |||
| parameters: | |||
| - name: message | |||
| value: hello world | |||
| templates: | |||
| - name: whalesay | |||
| inputs: | |||
| parameters: | |||
| - name: message | |||
| container: | |||
| image: ccr.ccs.tencentyun.com/somunslotus/huoshi-ubuntu-nginx:1.18-20.04_beta-arm64 | |||
| command: [echo] | |||
| args: ["{{inputs.parameters.message}}"] | |||
| @@ -0,0 +1,51 @@ | |||
| apiVersion: apps/v1 | |||
| kind: Deployment | |||
| metadata: | |||
| name: pipeline-convert | |||
| namespace: argo | |||
| spec: | |||
| replicas: 1 | |||
| selector: | |||
| matchLabels: | |||
| app: pipeline-convert | |||
| template: | |||
| metadata: | |||
| labels: | |||
| app: pipeline-convert | |||
| spec: | |||
| serviceAccountName: default | |||
| containers: | |||
| - name: pipeline-convert | |||
| image: ccr.ccs.tencentyun.com/somunslotus/pipeline-convert:202410241506-arm | |||
| imagePullPolicy: IfNotPresent | |||
| ports: | |||
| - containerPort: 80 | |||
| volumeMounts: | |||
| - mountPath: /var/log/pipeline-convert | |||
| name: pipeline-convert-log | |||
| volumes: | |||
| - name: pipeline-convert-log | |||
| hostPath: | |||
| path: /work/pipeline-convert/log | |||
| type: DirectoryOrCreate | |||
| --- | |||
| apiVersion: v1 | |||
| kind: Service | |||
| metadata: | |||
| name: pipeline-convert-service | |||
| namespace: argo | |||
| spec: | |||
| selector: | |||
| app: pipeline-convert | |||
| type: NodePort | |||
| ports: | |||
| - port: 80 | |||
| targetPort: 80 | |||
| protocol: TCP | |||
| nodePort: 31000 | |||
| @@ -0,0 +1,15 @@ | |||
| <!-- This is an auto-generated file. DO NOT EDIT --> | |||
| # volcano | |||
| * Needs: | |||
| * Image: 172.20.32.187/pipeline-service/argo-volcano-job-plugin:v1 | |||
| Install: | |||
| kubectl apply -f volcano-executor-plugin-configmap.yaml | |||
| Uninstall: | |||
| kubectl delete cm volcano-executor-plugin | |||
| @@ -0,0 +1,82 @@ | |||
| apiVersion: argoproj.io/v1alpha1 | |||
| kind: Workflow | |||
| metadata: | |||
| generateName: hello- | |||
| spec: | |||
| automountServiceAccountToken: true | |||
| entrypoint: main | |||
| templates: | |||
| - name: main | |||
| executor: | |||
| serviceAccountName: volcano-executor-plugin | |||
| plugin: | |||
| volcano: | |||
| job: | |||
| apiVersion: batch.volcano.sh/v1alpha1 | |||
| kind: Job | |||
| metadata: | |||
| name: "{{workflow.name}}" | |||
| namespace: "{{workflow.namespace}}" | |||
| ownerReferences: | |||
| - apiVersion: argoproj.io/v1alpha1 | |||
| blockOwnerDeletion: true | |||
| controller: true | |||
| kind: Workflow | |||
| name: "{{workflow.name}}" | |||
| uid: "{{workflow.uid}}" | |||
| spec: | |||
| minAvailable: 3 | |||
| schedulerName: volcano | |||
| plugins: | |||
| env: [] | |||
| svc: [] | |||
| queue: default | |||
| policies: | |||
| - event: PodEvicted | |||
| action: RestartJob | |||
| - event: TaskCompleted | |||
| action: CompleteJob | |||
| tasks: | |||
| - replicas: 1 | |||
| name: ps | |||
| template: | |||
| spec: | |||
| containers: | |||
| - command: | |||
| - sh | |||
| - -c | |||
| - | | |||
| PS_HOST=`cat /etc/volcano/ps.host | sed 's/$/&:2222/g' | sed 's/^/"/;s/$/"/' | tr "\n" ","`; | |||
| WORKER_HOST=`cat /etc/volcano/worker.host | sed 's/$/&:2222/g' | sed 's/^/"/;s/$/"/' | tr "\n" ","`; | |||
| export TF_CONFIG={\"cluster\":{\"ps\":[${PS_HOST}],\"worker\":[${WORKER_HOST}]},\"task\":{\"type\":\"ps\",\"index\":${VK_TASK_INDEX}},\"environment\":\"cloud\"}; | |||
| python /var/tf_dist_mnist/dist_mnist.py | |||
| image: volcanosh/dist-mnist-tf-example:0.0.1 | |||
| name: tensorflow | |||
| ports: | |||
| - containerPort: 2222 | |||
| name: tfjob-port | |||
| resources: {} | |||
| restartPolicy: Never | |||
| - replicas: 2 | |||
| name: worker | |||
| policies: | |||
| - event: TaskCompleted | |||
| action: CompleteJob | |||
| template: | |||
| spec: | |||
| containers: | |||
| - command: | |||
| - sh | |||
| - -c | |||
| - | | |||
| PS_HOST=`cat /etc/volcano/ps.host | sed 's/$/&:2222/g' | sed 's/^/"/;s/$/"/' | tr "\n" ","`; | |||
| WORKER_HOST=`cat /etc/volcano/worker.host | sed 's/$/&:2222/g' | sed 's/^/"/;s/$/"/' | tr "\n" ","`; | |||
| export TF_CONFIG={\"cluster\":{\"ps\":[${PS_HOST}],\"worker\":[${WORKER_HOST}]},\"task\":{\"type\":\"worker\",\"index\":${VK_TASK_INDEX}},\"environment\":\"cloud\"}; | |||
| python /var/tf_dist_mnist/dist_mnist.py | |||
| image: volcanosh/dist-mnist-tf-example:0.0.1 | |||
| name: tensorflow | |||
| ports: | |||
| - containerPort: 2222 | |||
| name: tfjob-port | |||
| resources: {} | |||
| restartPolicy: Never | |||
| @@ -0,0 +1,11 @@ | |||
| apiVersion: v1 | |||
| kind: Pod | |||
| metadata: | |||
| name: sleep-pod | |||
| spec: | |||
| containers: | |||
| - name: sleep-container | |||
| image: ccr.ccs.tencentyun.com/somunslotus/argo-execturo-plugin:v1-arm | |||
| command: ["sleep", "3600"] | |||
| restartPolicy: Never | |||
| @@ -0,0 +1,25 @@ | |||
| apiVersion: argoproj.io/v1alpha1 | |||
| kind: ExecutorPlugin | |||
| metadata: | |||
| name: volcano | |||
| spec: | |||
| sidecar: | |||
| container: | |||
| image: 172.20.32.187/pipeline-service/argo-volcano-job-plugin:v1 | |||
| name: volcano-executor-plugin | |||
| args: | |||
| - server | |||
| - --port | |||
| - 8080 | |||
| ports: | |||
| - containerPort: 8080 | |||
| securityContext: | |||
| runAsNonRoot: true | |||
| runAsUser: 65534 # nobody | |||
| resources: | |||
| requests: | |||
| memory: "64Mi" | |||
| cpu: "250m" | |||
| limits: | |||
| memory: "512Mi" | |||
| cpu: "1" | |||
| @@ -0,0 +1,38 @@ | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| kind: RoleBinding | |||
| metadata: | |||
| name: executor-role-bind | |||
| namespace: argo | |||
| roleRef: | |||
| apiGroup: rbac.authorization.k8s.io | |||
| kind: Role | |||
| name: executor-vcjob | |||
| subjects: | |||
| - kind: ServiceAccount | |||
| name: default | |||
| namespace: argo | |||
| - kind: ServiceAccount | |||
| name: volcano-executor-plugin | |||
| namespace: argo | |||
| - kind: ServiceAccount | |||
| name: argo | |||
| namespace: argo | |||
| --- | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| kind: Role | |||
| metadata: | |||
| name: executor-vcjob | |||
| namespace: argo | |||
| annotations: | |||
| workflows.argoproj.io/description: | | |||
| Recommended minimum permissions for the `docker` executor. | |||
| This executor is superseded by the `emmisary` executor, so we do not recommend you use it anymore. | |||
| rules: | |||
| - apiGroups: | |||
| - "argoproj.io" | |||
| resources: | |||
| - "*" | |||
| verbs: | |||
| - "*" | |||
| @@ -0,0 +1,34 @@ | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| kind: RoleBinding | |||
| metadata: | |||
| name: executor-role-bind | |||
| namespace: argo | |||
| roleRef: | |||
| apiGroup: rbac.authorization.k8s.io | |||
| kind: Role | |||
| name: executor-vcjob | |||
| subjects: | |||
| - kind: ServiceAccount | |||
| name: default | |||
| namespace: argo | |||
| --- | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| kind: Role | |||
| metadata: | |||
| name: executor-vcjob | |||
| namespace: argo | |||
| annotations: | |||
| workflows.argoproj.io/description: | | |||
| Recommended minimum permissions for the `docker` executor. | |||
| This executor is superseded by the `emmisary` executor, so we do not recommend you use it anymore. | |||
| rules: | |||
| - apiGroups: | |||
| - argoproj.io | |||
| resources: | |||
| - workflowtaskresults | |||
| - workflowtasksets/status | |||
| verbs: | |||
| - create | |||
| - patch | |||
| @@ -0,0 +1,6 @@ | |||
| apiVersion: v1 | |||
| kind: ServiceAccount | |||
| metadata: | |||
| name: volcano-executor-plugin | |||
| namespace: argo | |||
| @@ -0,0 +1,30 @@ | |||
| kind: ClusterRole | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| metadata: | |||
| name: volcano-atp | |||
| rules: | |||
| - apiGroups: ["apiextensions.k8s.io"] | |||
| resources: ["customresourcedefinitions"] | |||
| verbs: ["create", "get", "list", "watch", "delete"] | |||
| - apiGroups: ["batch.volcano.sh"] | |||
| resources: ["jobs"] | |||
| verbs: ["create","get", "list", "watch", "update", "delete"] | |||
| - apiGroups: ["batch.volcano.sh"] | |||
| resources: ["jobs/status", "jobs/finalizers"] | |||
| verbs: ["update", "patch"] | |||
| --- | |||
| kind: ClusterRoleBinding | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| metadata: | |||
| name: atp-volcano | |||
| subjects: | |||
| - kind: ServiceAccount | |||
| name: default | |||
| namespace: argo | |||
| - kind: ServiceAccount | |||
| name: volcano-executor-plugin | |||
| namespace: argo | |||
| roleRef: | |||
| kind: ClusterRole | |||
| name: volcano-atp | |||
| apiGroup: rbac.authorization.k8s.io | |||
| @@ -0,0 +1,27 @@ | |||
| kind: ClusterRole | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| metadata: | |||
| name: volcano-atp | |||
| rules: | |||
| - apiGroups: ["apiextensions.k8s.io"] | |||
| resources: ["customresourcedefinitions"] | |||
| verbs: ["create", "get", "list", "watch", "delete"] | |||
| - apiGroups: ["batch.volcano.sh"] | |||
| resources: ["jobs"] | |||
| verbs: ["create","get", "list", "watch", "update", "delete"] | |||
| - apiGroups: ["batch.volcano.sh"] | |||
| resources: ["jobs/status", "jobs/finalizers"] | |||
| verbs: ["update", "patch"] | |||
| --- | |||
| kind: ClusterRoleBinding | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| metadata: | |||
| name: atp-volcano | |||
| subjects: | |||
| - kind: ServiceAccount | |||
| name: default | |||
| namespace: argo | |||
| roleRef: | |||
| kind: ClusterRole | |||
| name: volcano-atp | |||
| apiGroup: rbac.authorization.k8s.io | |||
| @@ -0,0 +1,7 @@ | |||
| apiVersion: v1 | |||
| kind: Secret | |||
| metadata: | |||
| name: volcano-executor-plugin.service-account-token | |||
| annotations: | |||
| kubernetes.io/service-account.name: volcano-executor-plugin | |||
| type: kubernetes.io/service-account-token | |||
| @@ -0,0 +1,7 @@ | |||
| apiVersion: v1 | |||
| kind: Secret | |||
| metadata: | |||
| name: argo.service-account-token | |||
| annotations: | |||
| kubernetes.io/service-account.name: argo | |||
| type: kubernetes.io/service-account-token | |||
| @@ -0,0 +1,181 @@ | |||
| apiVersion: argoproj.io/v1alpha1 | |||
| kind: Workflow | |||
| metadata: | |||
| generateName: volcano-dag-job- | |||
| spec: | |||
| entrypoint: volcano-dag-job | |||
| serviceAccountName: argo | |||
| templates: | |||
| - name: volcano-dag-job | |||
| dag: | |||
| tasks: | |||
| - name: echo-start | |||
| template: start | |||
| arguments: | |||
| parameters: [{name: message, value: echo start}] | |||
| - name: wholesay | |||
| template: hello-tmpl | |||
| arguments: | |||
| parameters: [{name: message, value: hello2a}, {name: task, value: hello2a}] | |||
| dependencies: [echo-start] | |||
| - name: echo-end | |||
| template: end | |||
| arguments: | |||
| parameters: [{name: message, value: echo end}] | |||
| dependencies: [wholesay] | |||
| - name: start | |||
| inputs: | |||
| parameters: | |||
| - name: message | |||
| plugin: | |||
| volcano: | |||
| job: | |||
| apiVersion: batch.volcano.sh/v1alpha1 | |||
| kind: Job | |||
| metadata: | |||
| namespace: "{{workflow.namespace}}" | |||
| name: "{{workflow.name}}-echo-start" | |||
| ownerReferences: | |||
| - apiVersion: argoproj.io/v1alpha1 | |||
| blockOwnerDeletion: true | |||
| kind: Workflow | |||
| name: "{{workflow.name}}" | |||
| uid: "{{workflow.uid}}" | |||
| spec: | |||
| minAvailable: 1 | |||
| schedulerName: volcano | |||
| policies: | |||
| - event: PodEvicted | |||
| action: RestartJob | |||
| plugins: | |||
| ssh: [] | |||
| env: [] | |||
| svc: [] | |||
| maxRetry: 1 | |||
| #queue: vc-queue | |||
| tasks: | |||
| - name: "task1" | |||
| replicas: 1 | |||
| template: | |||
| metadata: | |||
| name: helloworld1 | |||
| spec: | |||
| containers: | |||
| - image: ccr.ccs.tencentyun.com/somunslotus/alpine:latest-arm | |||
| name: echo | |||
| imagePullPolicy: IfNotPresent | |||
| command: [echo, "{{inputs.parameters.message}}"] | |||
| resources: | |||
| requests: | |||
| cpu: "100m" | |||
| restartPolicy: Never | |||
| - name: end | |||
| inputs: | |||
| parameters: | |||
| - name: message | |||
| plugin: | |||
| volcano: | |||
| job: | |||
| apiVersion: batch.volcano.sh/v1alpha1 | |||
| kind: Job | |||
| metadata: | |||
| namespace: "{{workflow.namespace}}" | |||
| name: "{{workflow.name}}-echo-end" | |||
| ownerReferences: | |||
| - apiVersion: argoproj.io/v1alpha1 | |||
| blockOwnerDeletion: true | |||
| kind: Workflow | |||
| name: "{{workflow.name}}" | |||
| uid: "{{workflow.uid}}" | |||
| spec: | |||
| minAvailable: 1 | |||
| schedulerName: volcano | |||
| policies: | |||
| - event: PodEvicted | |||
| action: RestartJob | |||
| plugins: | |||
| ssh: [] | |||
| env: [] | |||
| svc: [] | |||
| maxRetry: 1 | |||
| #queue: vc-queue | |||
| tasks: | |||
| - name: "task1" | |||
| replicas: 1 | |||
| template: | |||
| metadata: | |||
| name: helloworld1 | |||
| spec: | |||
| containers: | |||
| - image: ccr.ccs.tencentyun.com/somunslotus/alpine:latest-arm | |||
| name: echo | |||
| imagePullPolicy: IfNotPresent | |||
| command: [echo, "{{inputs.parameters.message}}"] | |||
| resources: | |||
| requests: | |||
| cpu: "100m" | |||
| restartPolicy: Never | |||
| - name: hello-tmpl | |||
| inputs: | |||
| parameters: | |||
| - name: message | |||
| - name: task | |||
| plugin: | |||
| volcano: | |||
| job: | |||
| apiVersion: batch.volcano.sh/v1alpha1 | |||
| kind: Job | |||
| metadata: | |||
| namespace: "{{workflow.namespace}}" | |||
| name: "{{workflow.name}}-main-task" | |||
| ownerReferences: | |||
| - apiVersion: argoproj.io/v1alpha1 | |||
| blockOwnerDeletion: true | |||
| kind: Workflow | |||
| name: "{{workflow.name}}" | |||
| uid: "{{workflow.uid}}" | |||
| spec: | |||
| minAvailable: 1 | |||
| schedulerName: volcano | |||
| policies: | |||
| - event: PodEvicted | |||
| action: RestartJob | |||
| plugins: | |||
| ssh: [] | |||
| env: [] | |||
| svc: [] | |||
| maxRetry: 1 | |||
| #queue: vc-queue | |||
| tasks: | |||
| - name: "task999" | |||
| replicas: 1 | |||
| template: | |||
| metadata: | |||
| name: helloworld1 | |||
| spec: | |||
| containers: | |||
| - image: ccr.ccs.tencentyun.com/somunslotus/alpine:latest-arm | |||
| imagePullPolicy: IfNotPresent | |||
| command: ["/bin/sh", "-c"] | |||
| args: [sleep 60] | |||
| name: hello111 | |||
| resources: | |||
| requests: | |||
| cpu: "2" | |||
| memory: "8Gi" | |||
| restartPolicy: Never | |||
| - name: "task999999" | |||
| replicas: 1 | |||
| template: | |||
| metadata: | |||
| name: helloworld222 | |||
| spec: | |||
| containers: | |||
| - image: ccr.ccs.tencentyun.com/somunslotus/alpine:latest-arm | |||
| imagePullPolicy: IfNotPresent | |||
| command: [echo, "{{inputs.parameters.message}}"] | |||
| name: hello222 | |||
| resources: | |||
| requests: | |||
| cpu: "100m" | |||
| restartPolicy: Never | |||
| @@ -0,0 +1,29 @@ | |||
| # This is an auto-generated file. DO NOT EDIT | |||
| apiVersion: v1 | |||
| data: | |||
| sidecar.automountServiceAccountToken: "true" | |||
| sidecar.container: | | |||
| args: | |||
| - server | |||
| - --port | |||
| - "8080" | |||
| image: ccr.ccs.tencentyun.com/somunslotus/argo-execturo-plugin:v1-arm | |||
| name: volcano-executor-plugin | |||
| ports: | |||
| - containerPort: 8080 | |||
| resources: | |||
| limits: | |||
| cpu: "1" | |||
| memory: 512Mi | |||
| requests: | |||
| cpu: 250m | |||
| memory: 64Mi | |||
| securityContext: | |||
| runAsNonRoot: false | |||
| runAsUser: 0 | |||
| kind: ConfigMap | |||
| metadata: | |||
| creationTimestamp: null | |||
| labels: | |||
| workflows.argoproj.io/configmap-type: ExecutorPlugin | |||
| name: volcano-executor-plugin | |||
| @@ -0,0 +1,68 @@ | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| kind: Role | |||
| metadata: | |||
| name: custom-workflow | |||
| namespace: argo | |||
| rules: | |||
| - apiGroups: | |||
| - argoproj.io | |||
| resources: | |||
| - workflows | |||
| verbs: | |||
| - create | |||
| - get | |||
| - list | |||
| - watch | |||
| - update | |||
| - patch | |||
| - delete | |||
| - apiGroups: | |||
| - "" | |||
| resources: | |||
| - pods | |||
| - services | |||
| verbs: | |||
| - get | |||
| - list | |||
| - watch | |||
| - create | |||
| - update | |||
| - patch | |||
| - delete | |||
| - apiGroups: | |||
| - "" | |||
| resources: | |||
| - pods/exec | |||
| verbs: | |||
| - create | |||
| - get | |||
| - list | |||
| - watch | |||
| - update | |||
| - patch | |||
| - delete | |||
| - apiGroups: | |||
| - "apps" | |||
| resources: | |||
| - deployments | |||
| verbs: | |||
| - get | |||
| - list | |||
| - watch | |||
| - create | |||
| - update | |||
| - patch | |||
| - delete | |||
| --- | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| kind: RoleBinding | |||
| metadata: | |||
| name: custom-workflow-default | |||
| roleRef: | |||
| apiGroup: rbac.authorization.k8s.io | |||
| kind: Role | |||
| name: custom-workflow | |||
| subjects: | |||
| - kind: ServiceAccount | |||
| name: default | |||
| @@ -0,0 +1,48 @@ | |||
| FROM arm64v8/ubuntu:latest | |||
| ENV DEBIAN_FRONTEND=noninteractive PATH="/root/miniconda3/bin:${PATH}" TZ=Asia/Shanghai PIP_ROOT_USER_ACTION=ignore | |||
| ARG PATH="/root/miniconda3/bin:${PATH}" | |||
| ADD Miniconda3-py311_24.3.0-0-Linux-aarch64.sh . | |||
| RUN bash *.sh -b -u && ~/miniconda3/bin/conda init bash && rm -rf Miniconda3* ~/.cache | |||
| RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone &&\ | |||
| rm -rf /etc/apt/sources.list.d/cuda* /etc/apt/sources.list.d/* && gpg --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC 2>&1 > /dev/null &&\ | |||
| gpg --export --armor A4B469963BF863CC | apt-key add - 2>&1 > /dev/null && apt-get update &&\ | |||
| apt-get install -y tmux screen vim wget curl net-tools apt-utils unzip zip git openssl libaio1 libaio-dev iputils-ping openssh-server openssh-client &&\ | |||
| apt-get install -y git-lfs libssl-dev openssl make gcc libffi-dev zlib1g-dev libbz2-dev software-properties-common nginx lsof iftop htop tcpdump sysstat &&\ | |||
| apt-get install -y locate cmake g++ build-essential zlib1g-dev libncurses5-dev libgdbm-dev language-pack-zh-hans tree libgl1 libglib2.0-0 &&\ | |||
| apt-get install -y libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev libjpeg-dev &&\ | |||
| apt-get install -y build-essential liblzma-dev libsqlite3-dev pkg-config libnuma-dev libgl1-mesa-glx xvfb &&\ | |||
| apt-get install -y libssh2-1-dev ca-certificates libfreetype6-dev mlocate swig llvm libncursesw5-dev tk-dev &&\ | |||
| apt-get install -y openmpi-bin openmpi-common libopenmpi-dev && apt-get clean && rm -rf /var/lib/apt/lists/* | |||
| RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg &&\ | |||
| echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null &&\ | |||
| apt update && apt install gh && apt-get clean && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/* | |||
| RUN pip install --upgrade pip | |||
| RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && pip config set install.trusted-host pypi.tuna.tsinghua.edu.cn && pip config set global.timeout 60 | |||
| RUN pip install --no-cache-dir huggingface_hub modelscope cloudpickle tensorboard jupyterlab jupyterlab-language-pack-zh-CN | |||
| ADD plugin.jupyterlab-settings /root/.jupyter/lab/user-settings/\@jupyterlab/translation-extension/ | |||
| RUN jupyter lab --generate-config | |||
| RUN echo "c.ServerApp.allow_root = True\nc.ExtensionApp.open_browser = False\nc.ServerApp.password_required = False\nc.ServerApp.ip = '*'\nc.ServerApp.token = ''\nc.ServerApp.root_dir = '/opt/notebooks/'\nc.ServerApp.tornado_settings = {'headers':{'Content-Security-Policy':\"frame-ancestors 'self' * \"}}\nc.NotebookApp.terminado_settings = {'shell_command' : ['/bin/bash']}" >> /root/.jupyter/jupyter_lab_config.py | |||
| # 设置环境变量以避免在Jupyter中出现问题 | |||
| ENV LANG C.UTF-8 | |||
| # 设置工作目录 | |||
| WORKDIR /opt | |||
| # 启动Jupyter Notebook服务器,并且让它在后台持续运行 | |||
| CMD ["jupyter", "lab"] | |||
| @@ -0,0 +1,13 @@ | |||
| FROM ccr.ccs.tencentyun.com/somunslotus/jupyter:test1 | |||
| ENV DEBIAN_FRONTEND=noninteractive PATH="/root/miniconda3/bin:${PATH}" TZ=Asia/Shanghai PIP_ROOT_USER_ACTION=ignore | |||
| ARG PATH="/root/miniconda3/bin:${PATH}" | |||
| ENV LANG C.UTF-8 | |||
| # 设置工作目录 | |||
| WORKDIR /opt | |||
| # 启动Jupyter Notebook服务器,并且让它在后台持续运行 | |||
| CMD ["jupyter", "lab"] | |||
| @@ -0,0 +1,15 @@ | |||
| { | |||
| // Extension Manager | |||
| // @jupyterlab/extensionmanager-extension:plugin | |||
| // Extension manager settings. | |||
| // ********************************************* | |||
| // Disclaimed Status | |||
| // Whether the user understand that extensions managed through this interface run arbitrary code that may be dangerous | |||
| "disclaimed": true, | |||
| // Enabled Status | |||
| // Enables extension manager (requires Node.js/npm). | |||
| // WARNING: installing untrusted extensions may be unsafe. | |||
| "enabled": true | |||
| } | |||
| @@ -0,0 +1,161 @@ | |||
| apiVersion: v1 | |||
| kind: Namespace | |||
| metadata: | |||
| name: local-path-storage | |||
| --- | |||
| apiVersion: v1 | |||
| kind: ServiceAccount | |||
| metadata: | |||
| name: local-path-provisioner-service-account | |||
| namespace: local-path-storage | |||
| --- | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| kind: Role | |||
| metadata: | |||
| name: local-path-provisioner-role | |||
| namespace: local-path-storage | |||
| rules: | |||
| - apiGroups: [""] | |||
| resources: ["pods"] | |||
| verbs: ["get", "list", "watch", "create", "patch", "update", "delete"] | |||
| --- | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| kind: ClusterRole | |||
| metadata: | |||
| name: local-path-provisioner-role | |||
| rules: | |||
| - apiGroups: [""] | |||
| resources: ["nodes", "persistentvolumeclaims", "configmaps", "pods", "pods/log"] | |||
| verbs: ["get", "list", "watch"] | |||
| - apiGroups: [""] | |||
| resources: ["persistentvolumes"] | |||
| verbs: ["get", "list", "watch", "create", "patch", "update", "delete"] | |||
| - apiGroups: [""] | |||
| resources: ["events"] | |||
| verbs: ["create", "patch"] | |||
| - apiGroups: ["storage.k8s.io"] | |||
| resources: ["storageclasses"] | |||
| verbs: ["get", "list", "watch"] | |||
| --- | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| kind: RoleBinding | |||
| metadata: | |||
| name: local-path-provisioner-bind | |||
| namespace: local-path-storage | |||
| roleRef: | |||
| apiGroup: rbac.authorization.k8s.io | |||
| kind: Role | |||
| name: local-path-provisioner-role | |||
| subjects: | |||
| - kind: ServiceAccount | |||
| name: local-path-provisioner-service-account | |||
| namespace: local-path-storage | |||
| --- | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| kind: ClusterRoleBinding | |||
| metadata: | |||
| name: local-path-provisioner-bind | |||
| roleRef: | |||
| apiGroup: rbac.authorization.k8s.io | |||
| kind: ClusterRole | |||
| name: local-path-provisioner-role | |||
| subjects: | |||
| - kind: ServiceAccount | |||
| name: local-path-provisioner-service-account | |||
| namespace: local-path-storage | |||
| --- | |||
| apiVersion: apps/v1 | |||
| kind: Deployment | |||
| metadata: | |||
| name: local-path-provisioner | |||
| namespace: local-path-storage | |||
| spec: | |||
| replicas: 1 | |||
| selector: | |||
| matchLabels: | |||
| app: local-path-provisioner | |||
| template: | |||
| metadata: | |||
| labels: | |||
| app: local-path-provisioner | |||
| spec: | |||
| serviceAccountName: local-path-provisioner-service-account | |||
| containers: | |||
| - name: local-path-provisioner | |||
| image: ccr.ccs.tencentyun.com/somunslotus/rancher-local-path-provisioner:v0.0.30-arm | |||
| imagePullPolicy: IfNotPresent | |||
| command: | |||
| - local-path-provisioner | |||
| - --debug | |||
| - start | |||
| - --config | |||
| - /etc/config/config.json | |||
| volumeMounts: | |||
| - name: config-volume | |||
| mountPath: /etc/config/ | |||
| env: | |||
| - name: POD_NAMESPACE | |||
| valueFrom: | |||
| fieldRef: | |||
| fieldPath: metadata.namespace | |||
| - name: CONFIG_MOUNT_PATH | |||
| value: /etc/config/ | |||
| volumes: | |||
| - name: config-volume | |||
| configMap: | |||
| name: local-path-config | |||
| --- | |||
| apiVersion: storage.k8s.io/v1 | |||
| kind: StorageClass | |||
| metadata: | |||
| name: local-path | |||
| provisioner: rancher.io/local-path | |||
| volumeBindingMode: WaitForFirstConsumer | |||
| reclaimPolicy: Delete | |||
| --- | |||
| kind: ConfigMap | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: local-path-config | |||
| namespace: local-path-storage | |||
| data: | |||
| config.json: |- | |||
| { | |||
| "nodePathMap":[ | |||
| { | |||
| "node":"DEFAULT_PATH_FOR_NON_LISTED_NODES", | |||
| "paths":["/opt/local-path-provisioner"] | |||
| } | |||
| ] | |||
| } | |||
| setup: |- | |||
| #!/bin/sh | |||
| set -eu | |||
| mkdir -m 0777 -p "$VOL_DIR" | |||
| teardown: |- | |||
| #!/bin/sh | |||
| set -eu | |||
| rm -rf "$VOL_DIR" | |||
| helperPod.yaml: |- | |||
| apiVersion: v1 | |||
| kind: Pod | |||
| metadata: | |||
| name: helper-pod | |||
| spec: | |||
| priorityClassName: system-node-critical | |||
| tolerations: | |||
| - key: node.kubernetes.io/disk-pressure | |||
| operator: Exists | |||
| effect: NoSchedule | |||
| containers: | |||
| - name: helper-pod | |||
| image: busybox | |||
| imagePullPolicy: IfNotPresent | |||
| @@ -0,0 +1,84 @@ | |||
| #apiVersion: v1 | |||
| #kind: PersistentVolumeClaim | |||
| #metadata: | |||
| # name: grafana-pvc | |||
| #spec: | |||
| # storageClassName: juicefs-sc | |||
| # accessModes: | |||
| # - ReadWriteOnce | |||
| # resources: | |||
| # requests: | |||
| # storage: 10Gi | |||
| #--- | |||
| apiVersion: apps/v1 | |||
| kind: Deployment | |||
| metadata: | |||
| labels: | |||
| app: grafana | |||
| name: grafana | |||
| spec: | |||
| selector: | |||
| matchLabels: | |||
| app: grafana | |||
| template: | |||
| metadata: | |||
| labels: | |||
| app: grafana | |||
| spec: | |||
| securityContext: | |||
| fsGroup: 472 | |||
| supplementalGroups: | |||
| - 0 | |||
| containers: | |||
| - name: grafana | |||
| image: grafana/grafana:latest | |||
| imagePullPolicy: IfNotPresent | |||
| ports: | |||
| - containerPort: 3000 | |||
| name: http-grafana | |||
| protocol: TCP | |||
| readinessProbe: | |||
| failureThreshold: 3 | |||
| httpGet: | |||
| path: /robots.txt | |||
| port: 3000 | |||
| scheme: HTTP | |||
| initialDelaySeconds: 10 | |||
| periodSeconds: 30 | |||
| successThreshold: 1 | |||
| timeoutSeconds: 2 | |||
| livenessProbe: | |||
| failureThreshold: 3 | |||
| initialDelaySeconds: 30 | |||
| periodSeconds: 10 | |||
| successThreshold: 1 | |||
| tcpSocket: | |||
| port: 3000 | |||
| timeoutSeconds: 1 | |||
| resources: | |||
| requests: | |||
| cpu: 1000m | |||
| memory: 2000Mi | |||
| # volumeMounts: | |||
| # - mountPath: /var/lib/grafana | |||
| # name: grafana-hostpath | |||
| # subPath: grafana | |||
| # volumes: | |||
| # - name: grafana-hostpath | |||
| # hostPath: | |||
| # path: /platform-data | |||
| --- | |||
| apiVersion: v1 | |||
| kind: Service | |||
| metadata: | |||
| name: grafana | |||
| spec: | |||
| ports: | |||
| - port: 3000 | |||
| protocol: TCP | |||
| targetPort: http-grafana | |||
| nodePort: 31825 | |||
| selector: | |||
| app: grafana | |||
| sessionAffinity: None | |||
| type: NodePort | |||
| @@ -0,0 +1,8 @@ | |||
| ## Install grafana on Loki-log | |||
| 安装之前需要确认storageclass是否存在,如果不存在,则需要创建storageclass | |||
| ``` | |||
| kubectl create namespace loki-log | |||
| kubectl apply -f grafana.yaml | |||
| ``` | |||
| @@ -0,0 +1,29 @@ | |||
| #!/bin/bash | |||
| # Define images and tags | |||
| images=( | |||
| "ccr.ccs.tencentyun.com/somunslotus/quay.io-prometheus-operator-prometheus-config-reloader:v0.67.1-arm quay.io/prometheus-operator/prometheus-config-reloader:v0.67.1" | |||
| "ccr.ccs.tencentyun.com/somunslotus/grafana-agent:v0.39.1-arm grafana/agent:v0.39.1" | |||
| "ccr.ccs.tencentyun.com/somunslotus/grafana-promtail:latest-arm grafana/promtail:latest" | |||
| "ccr.ccs.tencentyun.com/somunslotus/nginxinc/nginx-unprivileged:1.24-alpine-arm nginxinc/nginx-unprivileged:1.24-alpine" | |||
| "ccr.ccs.tencentyun.com/somunslotus/grafana-agent-operator:v0.39.1-arm grafana/agent-operator:v0.39.1" | |||
| "ccr.ccs.tencentyun.com/somunslotus/grafana-loki:2.9.3-arm grafana/loki:2.9.3" | |||
| "ccr.ccs.tencentyun.com/somunslotus/grafana-grafana:latest-arm grafana/grafana:latest" | |||
| ) | |||
| # Loop through each image, pull, and tag | |||
| for image in "${images[@]}"; do | |||
| # Split each entry into source and destination | |||
| src="${image%% *}" | |||
| dst="${image##* }" | |||
| # Pull the source image | |||
| echo "Pulling $src..." | |||
| docker pull "$src" | |||
| # Tag the image to the original target | |||
| echo "Tagging $src as $dst..." | |||
| docker tag "$src" "$dst" | |||
| done | |||
| echo "All images have been pulled and retagged." | |||
| @@ -0,0 +1,8 @@ | |||
| ## Install Loki | |||
| 安装前先确认values.yaml里面的strorageclass和s3(minio)配置正确 | |||
| ### | |||
| ``` | |||
| kubectl create namespace loki-log | |||
| helm upgrade --install loki ./loki -n loki-log -f values.yaml | |||
| ``` | |||
| @@ -0,0 +1,22 @@ | |||
| loki: | |||
| enabled: true | |||
| persistence: | |||
| enabled: true | |||
| storageClassName: hostpath | |||
| accessModes: | |||
| - ReadWriteOnce | |||
| size: 10Gi | |||
| promtail: | |||
| enabled: true | |||
| grafana: | |||
| enabled: true | |||
| service: | |||
| type: NodePort | |||
| persistence: | |||
| enabled: true | |||
| storageClassName: hostpath | |||
| accessModes: | |||
| - ReadWriteOnce | |||
| size: 10Gi | |||
| @@ -0,0 +1,9 @@ | |||
| dependencies: | |||
| - name: minio | |||
| repository: https://charts.min.io/ | |||
| version: 4.0.15 | |||
| - name: grafana-agent-operator | |||
| repository: https://grafana.github.io/helm-charts | |||
| version: 0.3.15 | |||
| digest: sha256:b7a42cd0e56544f6168a586fde03e26c801bb20cf69bc004a8f6000d93b98100 | |||
| generated: "2024-01-27T21:57:28.190462917+05:30" | |||
| @@ -0,0 +1,26 @@ | |||
| apiVersion: v2 | |||
| appVersion: 2.9.3 | |||
| dependencies: | |||
| - alias: minio | |||
| condition: minio.enabled | |||
| name: minio | |||
| repository: https://charts.min.io/ | |||
| version: 4.0.15 | |||
| - alias: grafana-agent-operator | |||
| condition: monitoring.selfMonitoring.grafanaAgent.installOperator | |||
| name: grafana-agent-operator | |||
| repository: https://grafana.github.io/helm-charts | |||
| version: 0.3.15 | |||
| description: Helm chart for Grafana Loki in simple, scalable mode | |||
| home: https://grafana.github.io/helm-charts | |||
| icon: https://grafana.com/docs/loki/latest/logo_and_name.png | |||
| maintainers: | |||
| - name: trevorwhitney | |||
| - name: jeschkies | |||
| name: loki | |||
| sources: | |||
| - https://github.com/grafana/loki | |||
| - https://grafana.com/oss/loki/ | |||
| - https://grafana.com/docs/loki/latest/ | |||
| type: application | |||
| version: 5.42.0 | |||
| @@ -0,0 +1,7 @@ | |||
| .DEFAULT_GOAL := all | |||
| .PHONY: lint lint-yaml | |||
| lint: lint-yaml | |||
| lint-yaml: | |||
| yamllint -c $(CURDIR)/src/.yamllint.yaml $(CURDIR)/src | |||
| @@ -0,0 +1,20 @@ | |||
| # loki | |||
|    | |||
| Helm chart for Grafana Loki in simple, scalable mode | |||
| ## Source Code | |||
| * <https://github.com/grafana/loki> | |||
| * <https://grafana.com/oss/loki/> | |||
| * <https://grafana.com/docs/loki/latest/> | |||
| ## Requirements | |||
| | Repository | Name | Version | | |||
| |------------|------|---------| | |||
| | https://charts.min.io/ | minio(minio) | 4.0.15 | | |||
| | https://grafana.github.io/helm-charts | grafana-agent-operator(grafana-agent-operator) | 0.3.15 | | |||
| Find more information in the Loki Helm Chart [documentation](https://grafana.com/docs/loki/next/installation/helm). | |||
| @@ -0,0 +1,22 @@ | |||
| # Patterns to ignore when building packages. | |||
| # This supports shell glob matching, relative path matching, and | |||
| # negation (prefixed with !). Only one pattern per line. | |||
| .DS_Store | |||
| # Common VCS dirs | |||
| .git/ | |||
| .gitignore | |||
| .bzr/ | |||
| .bzrignore | |||
| .hg/ | |||
| .hgignore | |||
| .svn/ | |||
| # Common backup files | |||
| *.swp | |||
| *.bak | |||
| *.tmp | |||
| *~ | |||
| # Various IDEs | |||
| .project | |||
| .idea/ | |||
| *.tmproj | |||
| .vscode/ | |||
| @@ -0,0 +1,13 @@ | |||
| apiVersion: v2 | |||
| appVersion: 0.39.1 | |||
| description: A Helm chart for Grafana Agent Operator | |||
| home: https://grafana.com/docs/agent/v0.39/ | |||
| icon: https://raw.githubusercontent.com/grafana/agent/v0.39.1/docs/sources/assets/logo_and_name.png | |||
| maintainers: | |||
| - email: grafana-agent-team@googlegroups.com | |||
| name: Grafana Agent Team | |||
| name: grafana-agent-operator | |||
| sources: | |||
| - https://github.com/grafana/agent/tree/v0.39.1/pkg/operator | |||
| type: application | |||
| version: 0.3.15 | |||
| @@ -0,0 +1,78 @@ | |||
| # grafana-agent-operator | |||
|    | |||
| A Helm chart for Grafana Agent Operator | |||
| ⚠️ **Please create issues relating to this Helm chart in the [Agent](https://github.com/grafana/agent/issues) repo.** | |||
| ## Source Code | |||
| * <https://github.com/grafana/agent/tree/v0.39.1/pkg/operator> | |||
| Note that this chart does not provision custom resources like `GrafanaAgent` and `MetricsInstance` (formerly `PrometheusInstance`) or any `*Monitor` resources. | |||
| To learn how to deploy these resources, please see Grafana's [Agent Operator getting started guide](https://grafana.com/docs/agent/latest/operator/getting-started/). | |||
| ## CRDs | |||
| The CRDs are synced into this chart manually (for now) from the Grafana Agent [GitHub repo](https://github.com/grafana/agent/tree/main/operations/agent-static-operator/crds). To learn more about how Helm manages CRDs, please see [Custom Resource Definitions](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/) from the Helm docs. | |||
| ## Get Repo Info | |||
| ```console | |||
| helm repo add grafana https://grafana.github.io/helm-charts | |||
| helm repo update | |||
| ``` | |||
| _See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._ | |||
| ## Installing the Chart | |||
| To install the chart with the release name `my-release`: | |||
| ```console | |||
| helm install my-release grafana/grafana-agent-operator | |||
| ``` | |||
| ## Uninstalling the Chart | |||
| To uninstall/delete the my-release deployment: | |||
| ```console | |||
| helm delete my-release | |||
| ``` | |||
| The command removes all the Kubernetes components associated with the chart and deletes the release. | |||
| ## Upgrading an existing Release to a new major version | |||
| A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions. Until this chart's version reaches `v1.0`, there are no promises of backwards compatibility. | |||
| ## Values | |||
| | Key | Type | Default | Description | | |||
| |-----|------|---------|-------------| | |||
| | affinity | object | `{}` | Pod affinity configuration | | |||
| | annotations | object | `{}` | Annotations for the Deployment | | |||
| | containerSecurityContext | object | `{}` | Container security context (allowPrivilegeEscalation, etc.) | | |||
| | extraArgs | list | `[]` | List of additional cli arguments to configure agent-operator (example: `--log.level`) | | |||
| | fullnameOverride | string | `""` | Overrides the chart's computed fullname | | |||
| | hostAliases | list | `[]` | hostAliases to add | | |||
| | image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | | |||
| | image.pullSecrets | list | `[]` | Image pull secrets | | |||
| | image.registry | string | `"docker.io"` | Image registry | | |||
| | image.repository | string | `"grafana/agent-operator"` | Image repo | | |||
| | image.tag | string | `"v0.39.1"` | Image tag | | |||
| | kubeletService | object | `{"namespace":"default","serviceName":"kubelet"}` | If both are set, Agent Operator will create and maintain a service for scraping kubelets https://grafana.com/docs/agent/latest/operator/getting-started/#monitor-kubelets | | |||
| | nameOverride | string | `""` | Overrides the chart's name | | |||
| | nodeSelector | object | `{}` | nodeSelector configuration | | |||
| | podAnnotations | object | `{}` | Annotations for the Deployment Pods | | |||
| | podLabels | object | `{}` | Annotations for the Deployment Pods | | |||
| | podSecurityContext | object | `{}` | Pod security context (runAsUser, etc.) | | |||
| | rbac.create | bool | `true` | Toggle to create ClusterRole and ClusterRoleBinding | | |||
| | rbac.podSecurityPolicyName | string | `""` | Name of a PodSecurityPolicy to use in the ClusterRole. If unset, no PodSecurityPolicy is used. | | |||
| | resources | object | `{}` | Resource limits and requests config | | |||
| | serviceAccount.create | bool | `true` | Toggle to create ServiceAccount | | |||
| | serviceAccount.name | string | `nil` | Service account name | | |||
| | tolerations | list | `[]` | Tolerations applied to Pods | | |||
| @@ -0,0 +1,52 @@ | |||
| {{ template "chart.header" . }} | |||
| {{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} | |||
| {{ template "chart.description" . }} | |||
| ⚠️ **Please create issues relating to this Helm chart in the [Agent](https://github.com/grafana/agent/issues) repo.** | |||
| {{ template "chart.sourcesSection" . }} | |||
| {{ template "chart.requirementsSection" . }} | |||
| Note that this chart does not provision custom resources like `GrafanaAgent` and `MetricsInstance` (formerly `PrometheusInstance`) or any `*Monitor` resources. | |||
| To learn how to deploy these resources, please see Grafana's [Agent Operator getting started guide](https://grafana.com/docs/agent/latest/operator/getting-started/). | |||
| ## CRDs | |||
| The CRDs are synced into this chart manually (for now) from the Grafana Agent [GitHub repo](https://github.com/grafana/agent/tree/main/operations/agent-static-operator/crds). To learn more about how Helm manages CRDs, please see [Custom Resource Definitions](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/) from the Helm docs. | |||
| ## Get Repo Info | |||
| ```console | |||
| helm repo add grafana https://grafana.github.io/helm-charts | |||
| helm repo update | |||
| ``` | |||
| _See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._ | |||
| ## Installing the Chart | |||
| To install the chart with the release name `my-release`: | |||
| ```console | |||
| helm install my-release grafana/grafana-agent-operator | |||
| ``` | |||
| ## Uninstalling the Chart | |||
| To uninstall/delete the my-release deployment: | |||
| ```console | |||
| helm delete my-release | |||
| ``` | |||
| The command removes all the Kubernetes components associated with the chart and deletes the release. | |||
| ## Upgrading an existing Release to a new major version | |||
| A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions. Until this chart's version reaches `v1.0`, there are no promises of backwards compatibility. | |||
| {{ template "chart.valuesSection" . }} | |||
| @@ -0,0 +1,679 @@ | |||
| --- | |||
| apiVersion: apiextensions.k8s.io/v1 | |||
| kind: CustomResourceDefinition | |||
| metadata: | |||
| annotations: | |||
| controller-gen.kubebuilder.io/version: v0.9.2 | |||
| creationTimestamp: null | |||
| name: podmonitors.monitoring.coreos.com | |||
| spec: | |||
| group: monitoring.coreos.com | |||
| names: | |||
| categories: | |||
| - prometheus-operator | |||
| kind: PodMonitor | |||
| listKind: PodMonitorList | |||
| plural: podmonitors | |||
| shortNames: | |||
| - pmon | |||
| singular: podmonitor | |||
| scope: Namespaced | |||
| versions: | |||
| - name: v1 | |||
| schema: | |||
| openAPIV3Schema: | |||
| description: PodMonitor defines monitoring for a set of pods. | |||
| properties: | |||
| apiVersion: | |||
| description: 'APIVersion defines the versioned schema of this representation | |||
| of an object. Servers should convert recognized schemas to the latest | |||
| internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | |||
| type: string | |||
| kind: | |||
| description: 'Kind is a string value representing the REST resource this | |||
| object represents. Servers may infer this from the endpoint the client | |||
| submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | |||
| type: string | |||
| metadata: | |||
| type: object | |||
| spec: | |||
| description: Specification of desired Pod selection for target discovery | |||
| by Prometheus. | |||
| properties: | |||
| attachMetadata: | |||
| description: Attaches node metadata to discovered targets. Requires | |||
| Prometheus v2.35.0 and above. | |||
| properties: | |||
| node: | |||
| description: When set to true, Prometheus must have permissions | |||
| to get Nodes. | |||
| type: boolean | |||
| type: object | |||
| jobLabel: | |||
| description: The label to use to retrieve the job name from. | |||
| type: string | |||
| labelLimit: | |||
| description: Per-scrape limit on number of labels that will be accepted | |||
| for a sample. Only valid in Prometheus versions 2.27.0 and newer. | |||
| format: int64 | |||
| type: integer | |||
| labelNameLengthLimit: | |||
| description: Per-scrape limit on length of labels name that will be | |||
| accepted for a sample. Only valid in Prometheus versions 2.27.0 | |||
| and newer. | |||
| format: int64 | |||
| type: integer | |||
| labelValueLengthLimit: | |||
| description: Per-scrape limit on length of labels value that will | |||
| be accepted for a sample. Only valid in Prometheus versions 2.27.0 | |||
| and newer. | |||
| format: int64 | |||
| type: integer | |||
| namespaceSelector: | |||
| description: Selector to select which namespaces the Endpoints objects | |||
| are discovered from. | |||
| properties: | |||
| any: | |||
| description: Boolean describing whether all namespaces are selected | |||
| in contrast to a list restricting them. | |||
| type: boolean | |||
| matchNames: | |||
| description: List of namespace names to select from. | |||
| items: | |||
| type: string | |||
| type: array | |||
| type: object | |||
| podMetricsEndpoints: | |||
| description: A list of endpoints allowed as part of this PodMonitor. | |||
| items: | |||
| description: PodMetricsEndpoint defines a scrapeable endpoint of | |||
| a Kubernetes Pod serving Prometheus metrics. | |||
| properties: | |||
| authorization: | |||
| description: Authorization section for this endpoint | |||
| properties: | |||
| credentials: | |||
| description: The secret's key that contains the credentials | |||
| of the request | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: | |||
| description: Set the authentication type. Defaults to Bearer, | |||
| Basic will cause an error | |||
| type: string | |||
| type: object | |||
| basicAuth: | |||
| description: 'BasicAuth allow an endpoint to authenticate over | |||
| basic authentication. More info: https://prometheus.io/docs/operating/configuration/#endpoint' | |||
| properties: | |||
| password: | |||
| description: The secret in the service monitor namespace | |||
| that contains the password for authentication. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| username: | |||
| description: The secret in the service monitor namespace | |||
| that contains the username for authentication. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| bearerTokenSecret: | |||
| description: Secret to mount to read bearer token for scraping | |||
| targets. The secret needs to be in the same namespace as the | |||
| pod monitor and accessible by the Prometheus Operator. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| enableHttp2: | |||
| description: Whether to enable HTTP2. | |||
| type: boolean | |||
| filterRunning: | |||
| description: 'Drop pods that are not running. (Failed, Succeeded). | |||
| Enabled by default. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase' | |||
| type: boolean | |||
| followRedirects: | |||
| description: FollowRedirects configures whether scrape requests | |||
| follow HTTP 3xx redirects. | |||
| type: boolean | |||
| honorLabels: | |||
| description: HonorLabels chooses the metric's labels on collisions | |||
| with target labels. | |||
| type: boolean | |||
| honorTimestamps: | |||
| description: HonorTimestamps controls whether Prometheus respects | |||
| the timestamps present in scraped data. | |||
| type: boolean | |||
| interval: | |||
| description: Interval at which metrics should be scraped If | |||
| not specified Prometheus' global scrape interval is used. | |||
| pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ | |||
| type: string | |||
| metricRelabelings: | |||
| description: MetricRelabelConfigs to apply to samples before | |||
| ingestion. | |||
| items: | |||
| description: 'RelabelConfig allows dynamic rewriting of the | |||
| label set, being applied to samples before ingestion. It | |||
| defines `<metric_relabel_configs>`-section of Prometheus | |||
| configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' | |||
| properties: | |||
| action: | |||
| default: replace | |||
| description: Action to perform based on regex matching. | |||
| Default is 'replace'. uppercase and lowercase actions | |||
| require Prometheus >= 2.36. | |||
| enum: | |||
| - replace | |||
| - Replace | |||
| - keep | |||
| - Keep | |||
| - drop | |||
| - Drop | |||
| - hashmod | |||
| - HashMod | |||
| - labelmap | |||
| - LabelMap | |||
| - labeldrop | |||
| - LabelDrop | |||
| - labelkeep | |||
| - LabelKeep | |||
| - lowercase | |||
| - Lowercase | |||
| - uppercase | |||
| - Uppercase | |||
| - keepequal | |||
| - KeepEqual | |||
| - dropequal | |||
| - DropEqual | |||
| type: string | |||
| modulus: | |||
| description: Modulus to take of the hash of the source | |||
| label values. | |||
| format: int64 | |||
| type: integer | |||
| regex: | |||
| description: Regular expression against which the extracted | |||
| value is matched. Default is '(.*)' | |||
| type: string | |||
| replacement: | |||
| description: Replacement value against which a regex replace | |||
| is performed if the regular expression matches. Regex | |||
| capture groups are available. Default is '$1' | |||
| type: string | |||
| separator: | |||
| description: Separator placed between concatenated source | |||
| label values. default is ';'. | |||
| type: string | |||
| sourceLabels: | |||
| description: The source labels select values from existing | |||
| labels. Their content is concatenated using the configured | |||
| separator and matched against the configured regular | |||
| expression for the replace, keep, and drop actions. | |||
| items: | |||
| description: LabelName is a valid Prometheus label name | |||
| which may only contain ASCII letters, numbers, as | |||
| well as underscores. | |||
| pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ | |||
| type: string | |||
| type: array | |||
| targetLabel: | |||
| description: Label to which the resulting value is written | |||
| in a replace action. It is mandatory for replace actions. | |||
| Regex capture groups are available. | |||
| type: string | |||
| type: object | |||
| type: array | |||
| oauth2: | |||
| description: OAuth2 for the URL. Only valid in Prometheus versions | |||
| 2.27.0 and newer. | |||
| properties: | |||
| clientId: | |||
| description: The secret or configmap containing the OAuth2 | |||
| client id | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its | |||
| key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| clientSecret: | |||
| description: The secret containing the OAuth2 client secret | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| endpointParams: | |||
| additionalProperties: | |||
| type: string | |||
| description: Parameters to append to the token URL | |||
| type: object | |||
| scopes: | |||
| description: OAuth2 scopes used for the token request | |||
| items: | |||
| type: string | |||
| type: array | |||
| tokenUrl: | |||
| description: The URL to fetch the token from | |||
| minLength: 1 | |||
| type: string | |||
| required: | |||
| - clientId | |||
| - clientSecret | |||
| - tokenUrl | |||
| type: object | |||
| params: | |||
| additionalProperties: | |||
| items: | |||
| type: string | |||
| type: array | |||
| description: Optional HTTP URL parameters | |||
| type: object | |||
| path: | |||
| description: HTTP path to scrape for metrics. If empty, Prometheus | |||
| uses the default value (e.g. `/metrics`). | |||
| type: string | |||
| port: | |||
| description: Name of the pod port this endpoint refers to. Mutually | |||
| exclusive with targetPort. | |||
| type: string | |||
| proxyUrl: | |||
| description: ProxyURL eg http://proxyserver:2195 Directs scrapes | |||
| to proxy through this endpoint. | |||
| type: string | |||
| relabelings: | |||
| description: 'RelabelConfigs to apply to samples before scraping. | |||
| Prometheus Operator automatically adds relabelings for a few | |||
| standard Kubernetes fields. The original scrape job''s name | |||
| is available via the `__tmp_prometheus_job_name` label. More | |||
| info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config' | |||
| items: | |||
| description: 'RelabelConfig allows dynamic rewriting of the | |||
| label set, being applied to samples before ingestion. It | |||
| defines `<metric_relabel_configs>`-section of Prometheus | |||
| configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' | |||
| properties: | |||
| action: | |||
| default: replace | |||
| description: Action to perform based on regex matching. | |||
| Default is 'replace'. uppercase and lowercase actions | |||
| require Prometheus >= 2.36. | |||
| enum: | |||
| - replace | |||
| - Replace | |||
| - keep | |||
| - Keep | |||
| - drop | |||
| - Drop | |||
| - hashmod | |||
| - HashMod | |||
| - labelmap | |||
| - LabelMap | |||
| - labeldrop | |||
| - LabelDrop | |||
| - labelkeep | |||
| - LabelKeep | |||
| - lowercase | |||
| - Lowercase | |||
| - uppercase | |||
| - Uppercase | |||
| - keepequal | |||
| - KeepEqual | |||
| - dropequal | |||
| - DropEqual | |||
| type: string | |||
| modulus: | |||
| description: Modulus to take of the hash of the source | |||
| label values. | |||
| format: int64 | |||
| type: integer | |||
| regex: | |||
| description: Regular expression against which the extracted | |||
| value is matched. Default is '(.*)' | |||
| type: string | |||
| replacement: | |||
| description: Replacement value against which a regex replace | |||
| is performed if the regular expression matches. Regex | |||
| capture groups are available. Default is '$1' | |||
| type: string | |||
| separator: | |||
| description: Separator placed between concatenated source | |||
| label values. default is ';'. | |||
| type: string | |||
| sourceLabels: | |||
| description: The source labels select values from existing | |||
| labels. Their content is concatenated using the configured | |||
| separator and matched against the configured regular | |||
| expression for the replace, keep, and drop actions. | |||
| items: | |||
| description: LabelName is a valid Prometheus label name | |||
| which may only contain ASCII letters, numbers, as | |||
| well as underscores. | |||
| pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ | |||
| type: string | |||
| type: array | |||
| targetLabel: | |||
| description: Label to which the resulting value is written | |||
| in a replace action. It is mandatory for replace actions. | |||
| Regex capture groups are available. | |||
| type: string | |||
| type: object | |||
| type: array | |||
| scheme: | |||
| description: HTTP scheme to use for scraping. `http` and `https` | |||
| are the expected values unless you rewrite the `__scheme__` | |||
| label via relabeling. If empty, Prometheus uses the default | |||
| value `http`. | |||
| enum: | |||
| - http | |||
| - https | |||
| type: string | |||
| scrapeTimeout: | |||
| description: Timeout after which the scrape is ended If not | |||
| specified, the Prometheus global scrape interval is used. | |||
| pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ | |||
| type: string | |||
| targetPort: | |||
| anyOf: | |||
| - type: integer | |||
| - type: string | |||
| description: 'Deprecated: Use ''port'' instead.' | |||
| x-kubernetes-int-or-string: true | |||
| tlsConfig: | |||
| description: TLS configuration to use when scraping the endpoint. | |||
| properties: | |||
| ca: | |||
| description: Certificate authority used when verifying server | |||
| certificates. | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its | |||
| key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| cert: | |||
| description: Client certificate to present when doing client-authentication. | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its | |||
| key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| insecureSkipVerify: | |||
| description: Disable target certificate validation. | |||
| type: boolean | |||
| keySecret: | |||
| description: Secret containing the client key file for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| serverName: | |||
| description: Used to verify the hostname for the targets. | |||
| type: string | |||
| type: object | |||
| type: object | |||
| type: array | |||
| podTargetLabels: | |||
| description: PodTargetLabels transfers labels on the Kubernetes Pod | |||
| onto the target. | |||
| items: | |||
| type: string | |||
| type: array | |||
| sampleLimit: | |||
| description: SampleLimit defines per-scrape limit on number of scraped | |||
| samples that will be accepted. | |||
| format: int64 | |||
| type: integer | |||
| selector: | |||
| description: Selector to select Pod objects. | |||
| properties: | |||
| matchExpressions: | |||
| description: matchExpressions is a list of label selector requirements. | |||
| The requirements are ANDed. | |||
| items: | |||
| description: A label selector requirement is a selector that | |||
| contains values, a key, and an operator that relates the key | |||
| and values. | |||
| properties: | |||
| key: | |||
| description: key is the label key that the selector applies | |||
| to. | |||
| type: string | |||
| operator: | |||
| description: operator represents a key's relationship to | |||
| a set of values. Valid operators are In, NotIn, Exists | |||
| and DoesNotExist. | |||
| type: string | |||
| values: | |||
| description: values is an array of string values. If the | |||
| operator is In or NotIn, the values array must be non-empty. | |||
| If the operator is Exists or DoesNotExist, the values | |||
| array must be empty. This array is replaced during a strategic | |||
| merge patch. | |||
| items: | |||
| type: string | |||
| type: array | |||
| required: | |||
| - key | |||
| - operator | |||
| type: object | |||
| type: array | |||
| matchLabels: | |||
| additionalProperties: | |||
| type: string | |||
| description: matchLabels is a map of {key,value} pairs. A single | |||
| {key,value} in the matchLabels map is equivalent to an element | |||
| of matchExpressions, whose key field is "key", the operator | |||
| is "In", and the values array contains only "value". The requirements | |||
| are ANDed. | |||
| type: object | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| targetLimit: | |||
| description: TargetLimit defines a limit on the number of scraped | |||
| targets that will be accepted. | |||
| format: int64 | |||
| type: integer | |||
| required: | |||
| - podMetricsEndpoints | |||
| - selector | |||
| type: object | |||
| required: | |||
| - spec | |||
| type: object | |||
| served: true | |||
| storage: true | |||
| @@ -0,0 +1,722 @@ | |||
| --- | |||
| apiVersion: apiextensions.k8s.io/v1 | |||
| kind: CustomResourceDefinition | |||
| metadata: | |||
| annotations: | |||
| controller-gen.kubebuilder.io/version: v0.9.2 | |||
| creationTimestamp: null | |||
| name: probes.monitoring.coreos.com | |||
| spec: | |||
| group: monitoring.coreos.com | |||
| names: | |||
| categories: | |||
| - prometheus-operator | |||
| kind: Probe | |||
| listKind: ProbeList | |||
| plural: probes | |||
| shortNames: | |||
| - prb | |||
| singular: probe | |||
| scope: Namespaced | |||
| versions: | |||
| - name: v1 | |||
| schema: | |||
| openAPIV3Schema: | |||
| description: Probe defines monitoring for a set of static targets or ingresses. | |||
| properties: | |||
| apiVersion: | |||
| description: 'APIVersion defines the versioned schema of this representation | |||
| of an object. Servers should convert recognized schemas to the latest | |||
| internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | |||
| type: string | |||
| kind: | |||
| description: 'Kind is a string value representing the REST resource this | |||
| object represents. Servers may infer this from the endpoint the client | |||
| submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | |||
| type: string | |||
| metadata: | |||
| type: object | |||
| spec: | |||
| description: Specification of desired Ingress selection for target discovery | |||
| by Prometheus. | |||
| properties: | |||
| authorization: | |||
| description: Authorization section for this endpoint | |||
| properties: | |||
| credentials: | |||
| description: The secret's key that contains the credentials of | |||
| the request | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must be | |||
| a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must be | |||
| defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: | |||
| description: Set the authentication type. Defaults to Bearer, | |||
| Basic will cause an error | |||
| type: string | |||
| type: object | |||
| basicAuth: | |||
| description: 'BasicAuth allow an endpoint to authenticate over basic | |||
| authentication. More info: https://prometheus.io/docs/operating/configuration/#endpoint' | |||
| properties: | |||
| password: | |||
| description: The secret in the service monitor namespace that | |||
| contains the password for authentication. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must be | |||
| a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must be | |||
| defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| username: | |||
| description: The secret in the service monitor namespace that | |||
| contains the username for authentication. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must be | |||
| a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must be | |||
| defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| bearerTokenSecret: | |||
| description: Secret to mount to read bearer token for scraping targets. | |||
| The secret needs to be in the same namespace as the probe and accessible | |||
| by the Prometheus Operator. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must be a | |||
| valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| interval: | |||
| description: Interval at which targets are probed using the configured | |||
| prober. If not specified Prometheus' global scrape interval is used. | |||
| pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ | |||
| type: string | |||
| jobName: | |||
| description: The job name assigned to scraped metrics by default. | |||
| type: string | |||
| labelLimit: | |||
| description: Per-scrape limit on number of labels that will be accepted | |||
| for a sample. Only valid in Prometheus versions 2.27.0 and newer. | |||
| format: int64 | |||
| type: integer | |||
| labelNameLengthLimit: | |||
| description: Per-scrape limit on length of labels name that will be | |||
| accepted for a sample. Only valid in Prometheus versions 2.27.0 | |||
| and newer. | |||
| format: int64 | |||
| type: integer | |||
| labelValueLengthLimit: | |||
| description: Per-scrape limit on length of labels value that will | |||
| be accepted for a sample. Only valid in Prometheus versions 2.27.0 | |||
| and newer. | |||
| format: int64 | |||
| type: integer | |||
| metricRelabelings: | |||
| description: MetricRelabelConfigs to apply to samples before ingestion. | |||
| items: | |||
| description: 'RelabelConfig allows dynamic rewriting of the label | |||
| set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section | |||
| of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' | |||
| properties: | |||
| action: | |||
| default: replace | |||
| description: Action to perform based on regex matching. Default | |||
| is 'replace'. uppercase and lowercase actions require Prometheus | |||
| >= 2.36. | |||
| enum: | |||
| - replace | |||
| - Replace | |||
| - keep | |||
| - Keep | |||
| - drop | |||
| - Drop | |||
| - hashmod | |||
| - HashMod | |||
| - labelmap | |||
| - LabelMap | |||
| - labeldrop | |||
| - LabelDrop | |||
| - labelkeep | |||
| - LabelKeep | |||
| - lowercase | |||
| - Lowercase | |||
| - uppercase | |||
| - Uppercase | |||
| - keepequal | |||
| - KeepEqual | |||
| - dropequal | |||
| - DropEqual | |||
| type: string | |||
| modulus: | |||
| description: Modulus to take of the hash of the source label | |||
| values. | |||
| format: int64 | |||
| type: integer | |||
| regex: | |||
| description: Regular expression against which the extracted | |||
| value is matched. Default is '(.*)' | |||
| type: string | |||
| replacement: | |||
| description: Replacement value against which a regex replace | |||
| is performed if the regular expression matches. Regex capture | |||
| groups are available. Default is '$1' | |||
| type: string | |||
| separator: | |||
| description: Separator placed between concatenated source label | |||
| values. default is ';'. | |||
| type: string | |||
| sourceLabels: | |||
| description: The source labels select values from existing labels. | |||
| Their content is concatenated using the configured separator | |||
| and matched against the configured regular expression for | |||
| the replace, keep, and drop actions. | |||
| items: | |||
| description: LabelName is a valid Prometheus label name which | |||
| may only contain ASCII letters, numbers, as well as underscores. | |||
| pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ | |||
| type: string | |||
| type: array | |||
| targetLabel: | |||
| description: Label to which the resulting value is written in | |||
| a replace action. It is mandatory for replace actions. Regex | |||
| capture groups are available. | |||
| type: string | |||
| type: object | |||
| type: array | |||
| module: | |||
| description: 'The module to use for probing specifying how to probe | |||
| the target. Example module configuring in the blackbox exporter: | |||
| https://github.com/prometheus/blackbox_exporter/blob/master/example.yml' | |||
| type: string | |||
| oauth2: | |||
| description: OAuth2 for the URL. Only valid in Prometheus versions | |||
| 2.27.0 and newer. | |||
| properties: | |||
| clientId: | |||
| description: The secret or configmap containing the OAuth2 client | |||
| id | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| clientSecret: | |||
| description: The secret containing the OAuth2 client secret | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must be | |||
| a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must be | |||
| defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| endpointParams: | |||
| additionalProperties: | |||
| type: string | |||
| description: Parameters to append to the token URL | |||
| type: object | |||
| scopes: | |||
| description: OAuth2 scopes used for the token request | |||
| items: | |||
| type: string | |||
| type: array | |||
| tokenUrl: | |||
| description: The URL to fetch the token from | |||
| minLength: 1 | |||
| type: string | |||
| required: | |||
| - clientId | |||
| - clientSecret | |||
| - tokenUrl | |||
| type: object | |||
| prober: | |||
| description: Specification for the prober to use for probing targets. | |||
| The prober.URL parameter is required. Targets cannot be probed if | |||
| left empty. | |||
| properties: | |||
| path: | |||
| default: /probe | |||
| description: Path to collect metrics from. Defaults to `/probe`. | |||
| type: string | |||
| proxyUrl: | |||
| description: Optional ProxyURL. | |||
| type: string | |||
| scheme: | |||
| description: HTTP scheme to use for scraping. `http` and `https` | |||
| are the expected values unless you rewrite the `__scheme__` | |||
| label via relabeling. If empty, Prometheus uses the default | |||
| value `http`. | |||
| enum: | |||
| - http | |||
| - https | |||
| type: string | |||
| url: | |||
| description: Mandatory URL of the prober. | |||
| type: string | |||
| required: | |||
| - url | |||
| type: object | |||
| sampleLimit: | |||
| description: SampleLimit defines per-scrape limit on number of scraped | |||
| samples that will be accepted. | |||
| format: int64 | |||
| type: integer | |||
| scrapeTimeout: | |||
| description: Timeout for scraping metrics from the Prometheus exporter. | |||
| If not specified, the Prometheus global scrape timeout is used. | |||
| pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ | |||
| type: string | |||
| targetLimit: | |||
| description: TargetLimit defines a limit on the number of scraped | |||
| targets that will be accepted. | |||
| format: int64 | |||
| type: integer | |||
| targets: | |||
| description: Targets defines a set of static or dynamically discovered | |||
| targets to probe. | |||
| properties: | |||
| ingress: | |||
| description: ingress defines the Ingress objects to probe and | |||
| the relabeling configuration. If `staticConfig` is also defined, | |||
| `staticConfig` takes precedence. | |||
| properties: | |||
| namespaceSelector: | |||
| description: From which namespaces to select Ingress objects. | |||
| properties: | |||
| any: | |||
| description: Boolean describing whether all namespaces | |||
| are selected in contrast to a list restricting them. | |||
| type: boolean | |||
| matchNames: | |||
| description: List of namespace names to select from. | |||
| items: | |||
| type: string | |||
| type: array | |||
| type: object | |||
| relabelingConfigs: | |||
| description: 'RelabelConfigs to apply to the label set of | |||
| the target before it gets scraped. The original ingress | |||
| address is available via the `__tmp_prometheus_ingress_address` | |||
| label. It can be used to customize the probed URL. The original | |||
| scrape job''s name is available via the `__tmp_prometheus_job_name` | |||
| label. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config' | |||
| items: | |||
| description: 'RelabelConfig allows dynamic rewriting of | |||
| the label set, being applied to samples before ingestion. | |||
| It defines `<metric_relabel_configs>`-section of Prometheus | |||
| configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' | |||
| properties: | |||
| action: | |||
| default: replace | |||
| description: Action to perform based on regex matching. | |||
| Default is 'replace'. uppercase and lowercase actions | |||
| require Prometheus >= 2.36. | |||
| enum: | |||
| - replace | |||
| - Replace | |||
| - keep | |||
| - Keep | |||
| - drop | |||
| - Drop | |||
| - hashmod | |||
| - HashMod | |||
| - labelmap | |||
| - LabelMap | |||
| - labeldrop | |||
| - LabelDrop | |||
| - labelkeep | |||
| - LabelKeep | |||
| - lowercase | |||
| - Lowercase | |||
| - uppercase | |||
| - Uppercase | |||
| - keepequal | |||
| - KeepEqual | |||
| - dropequal | |||
| - DropEqual | |||
| type: string | |||
| modulus: | |||
| description: Modulus to take of the hash of the source | |||
| label values. | |||
| format: int64 | |||
| type: integer | |||
| regex: | |||
| description: Regular expression against which the extracted | |||
| value is matched. Default is '(.*)' | |||
| type: string | |||
| replacement: | |||
| description: Replacement value against which a regex | |||
| replace is performed if the regular expression matches. | |||
| Regex capture groups are available. Default is '$1' | |||
| type: string | |||
| separator: | |||
| description: Separator placed between concatenated source | |||
| label values. default is ';'. | |||
| type: string | |||
| sourceLabels: | |||
| description: The source labels select values from existing | |||
| labels. Their content is concatenated using the configured | |||
| separator and matched against the configured regular | |||
| expression for the replace, keep, and drop actions. | |||
| items: | |||
| description: LabelName is a valid Prometheus label | |||
| name which may only contain ASCII letters, numbers, | |||
| as well as underscores. | |||
| pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ | |||
| type: string | |||
| type: array | |||
| targetLabel: | |||
| description: Label to which the resulting value is written | |||
| in a replace action. It is mandatory for replace actions. | |||
| Regex capture groups are available. | |||
| type: string | |||
| type: object | |||
| type: array | |||
| selector: | |||
| description: Selector to select the Ingress objects. | |||
| properties: | |||
| matchExpressions: | |||
| description: matchExpressions is a list of label selector | |||
| requirements. The requirements are ANDed. | |||
| items: | |||
| description: A label selector requirement is a selector | |||
| that contains values, a key, and an operator that | |||
| relates the key and values. | |||
| properties: | |||
| key: | |||
| description: key is the label key that the selector | |||
| applies to. | |||
| type: string | |||
| operator: | |||
| description: operator represents a key's relationship | |||
| to a set of values. Valid operators are In, NotIn, | |||
| Exists and DoesNotExist. | |||
| type: string | |||
| values: | |||
| description: values is an array of string values. | |||
| If the operator is In or NotIn, the values array | |||
| must be non-empty. If the operator is Exists or | |||
| DoesNotExist, the values array must be empty. | |||
| This array is replaced during a strategic merge | |||
| patch. | |||
| items: | |||
| type: string | |||
| type: array | |||
| required: | |||
| - key | |||
| - operator | |||
| type: object | |||
| type: array | |||
| matchLabels: | |||
| additionalProperties: | |||
| type: string | |||
| description: matchLabels is a map of {key,value} pairs. | |||
| A single {key,value} in the matchLabels map is equivalent | |||
| to an element of matchExpressions, whose key field is | |||
| "key", the operator is "In", and the values array contains | |||
| only "value". The requirements are ANDed. | |||
| type: object | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| staticConfig: | |||
| description: 'staticConfig defines the static list of targets | |||
| to probe and the relabeling configuration. If `ingress` is also | |||
| defined, `staticConfig` takes precedence. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#static_config.' | |||
| properties: | |||
| labels: | |||
| additionalProperties: | |||
| type: string | |||
| description: Labels assigned to all metrics scraped from the | |||
| targets. | |||
| type: object | |||
| relabelingConfigs: | |||
| description: 'RelabelConfigs to apply to the label set of | |||
| the targets before it gets scraped. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config' | |||
| items: | |||
| description: 'RelabelConfig allows dynamic rewriting of | |||
| the label set, being applied to samples before ingestion. | |||
| It defines `<metric_relabel_configs>`-section of Prometheus | |||
| configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' | |||
| properties: | |||
| action: | |||
| default: replace | |||
| description: Action to perform based on regex matching. | |||
| Default is 'replace'. uppercase and lowercase actions | |||
| require Prometheus >= 2.36. | |||
| enum: | |||
| - replace | |||
| - Replace | |||
| - keep | |||
| - Keep | |||
| - drop | |||
| - Drop | |||
| - hashmod | |||
| - HashMod | |||
| - labelmap | |||
| - LabelMap | |||
| - labeldrop | |||
| - LabelDrop | |||
| - labelkeep | |||
| - LabelKeep | |||
| - lowercase | |||
| - Lowercase | |||
| - uppercase | |||
| - Uppercase | |||
| - keepequal | |||
| - KeepEqual | |||
| - dropequal | |||
| - DropEqual | |||
| type: string | |||
| modulus: | |||
| description: Modulus to take of the hash of the source | |||
| label values. | |||
| format: int64 | |||
| type: integer | |||
| regex: | |||
| description: Regular expression against which the extracted | |||
| value is matched. Default is '(.*)' | |||
| type: string | |||
| replacement: | |||
| description: Replacement value against which a regex | |||
| replace is performed if the regular expression matches. | |||
| Regex capture groups are available. Default is '$1' | |||
| type: string | |||
| separator: | |||
| description: Separator placed between concatenated source | |||
| label values. default is ';'. | |||
| type: string | |||
| sourceLabels: | |||
| description: The source labels select values from existing | |||
| labels. Their content is concatenated using the configured | |||
| separator and matched against the configured regular | |||
| expression for the replace, keep, and drop actions. | |||
| items: | |||
| description: LabelName is a valid Prometheus label | |||
| name which may only contain ASCII letters, numbers, | |||
| as well as underscores. | |||
| pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ | |||
| type: string | |||
| type: array | |||
| targetLabel: | |||
| description: Label to which the resulting value is written | |||
| in a replace action. It is mandatory for replace actions. | |||
| Regex capture groups are available. | |||
| type: string | |||
| type: object | |||
| type: array | |||
| static: | |||
| description: The list of hosts to probe. | |||
| items: | |||
| type: string | |||
| type: array | |||
| type: object | |||
| type: object | |||
| tlsConfig: | |||
| description: TLS configuration to use when scraping the endpoint. | |||
| properties: | |||
| ca: | |||
| description: Certificate authority used when verifying server | |||
| certificates. | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| cert: | |||
| description: Client certificate to present when doing client-authentication. | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| insecureSkipVerify: | |||
| description: Disable target certificate validation. | |||
| type: boolean | |||
| keySecret: | |||
| description: Secret containing the client key file for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must be | |||
| a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must be | |||
| defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| serverName: | |||
| description: Used to verify the hostname for the targets. | |||
| type: string | |||
| type: object | |||
| type: object | |||
| required: | |||
| - spec | |||
| type: object | |||
| served: true | |||
| storage: true | |||
| @@ -0,0 +1,709 @@ | |||
| --- | |||
| apiVersion: apiextensions.k8s.io/v1 | |||
| kind: CustomResourceDefinition | |||
| metadata: | |||
| annotations: | |||
| controller-gen.kubebuilder.io/version: v0.9.2 | |||
| creationTimestamp: null | |||
| name: servicemonitors.monitoring.coreos.com | |||
| spec: | |||
| group: monitoring.coreos.com | |||
| names: | |||
| categories: | |||
| - prometheus-operator | |||
| kind: ServiceMonitor | |||
| listKind: ServiceMonitorList | |||
| plural: servicemonitors | |||
| shortNames: | |||
| - smon | |||
| singular: servicemonitor | |||
| scope: Namespaced | |||
| versions: | |||
| - name: v1 | |||
| schema: | |||
| openAPIV3Schema: | |||
| description: ServiceMonitor defines monitoring for a set of services. | |||
| properties: | |||
| apiVersion: | |||
| description: 'APIVersion defines the versioned schema of this representation | |||
| of an object. Servers should convert recognized schemas to the latest | |||
| internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | |||
| type: string | |||
| kind: | |||
| description: 'Kind is a string value representing the REST resource this | |||
| object represents. Servers may infer this from the endpoint the client | |||
| submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | |||
| type: string | |||
| metadata: | |||
| type: object | |||
| spec: | |||
| description: Specification of desired Service selection for target discovery | |||
| by Prometheus. | |||
| properties: | |||
| attachMetadata: | |||
| description: Attaches node metadata to discovered targets. Requires | |||
| Prometheus v2.37.0 and above. | |||
| properties: | |||
| node: | |||
| description: When set to true, Prometheus must have permissions | |||
| to get Nodes. | |||
| type: boolean | |||
| type: object | |||
| endpoints: | |||
| description: A list of endpoints allowed as part of this ServiceMonitor. | |||
| items: | |||
| description: Endpoint defines a scrapeable endpoint serving Prometheus | |||
| metrics. | |||
| properties: | |||
| authorization: | |||
| description: Authorization section for this endpoint | |||
| properties: | |||
| credentials: | |||
| description: The secret's key that contains the credentials | |||
| of the request | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: | |||
| description: Set the authentication type. Defaults to Bearer, | |||
| Basic will cause an error | |||
| type: string | |||
| type: object | |||
| basicAuth: | |||
| description: 'BasicAuth allow an endpoint to authenticate over | |||
| basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints' | |||
| properties: | |||
| password: | |||
| description: The secret in the service monitor namespace | |||
| that contains the password for authentication. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| username: | |||
| description: The secret in the service monitor namespace | |||
| that contains the username for authentication. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| bearerTokenFile: | |||
| description: File to read bearer token for scraping targets. | |||
| type: string | |||
| bearerTokenSecret: | |||
| description: Secret to mount to read bearer token for scraping | |||
| targets. The secret needs to be in the same namespace as the | |||
| service monitor and accessible by the Prometheus Operator. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| enableHttp2: | |||
| description: Whether to enable HTTP2. | |||
| type: boolean | |||
| filterRunning: | |||
| description: 'Drop pods that are not running. (Failed, Succeeded). | |||
| Enabled by default. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase' | |||
| type: boolean | |||
| followRedirects: | |||
| description: FollowRedirects configures whether scrape requests | |||
| follow HTTP 3xx redirects. | |||
| type: boolean | |||
| honorLabels: | |||
| description: HonorLabels chooses the metric's labels on collisions | |||
| with target labels. | |||
| type: boolean | |||
| honorTimestamps: | |||
| description: HonorTimestamps controls whether Prometheus respects | |||
| the timestamps present in scraped data. | |||
| type: boolean | |||
| interval: | |||
| description: Interval at which metrics should be scraped If | |||
| not specified Prometheus' global scrape interval is used. | |||
| pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ | |||
| type: string | |||
| metricRelabelings: | |||
| description: MetricRelabelConfigs to apply to samples before | |||
| ingestion. | |||
| items: | |||
| description: 'RelabelConfig allows dynamic rewriting of the | |||
| label set, being applied to samples before ingestion. It | |||
| defines `<metric_relabel_configs>`-section of Prometheus | |||
| configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' | |||
| properties: | |||
| action: | |||
| default: replace | |||
| description: Action to perform based on regex matching. | |||
| Default is 'replace'. uppercase and lowercase actions | |||
| require Prometheus >= 2.36. | |||
| enum: | |||
| - replace | |||
| - Replace | |||
| - keep | |||
| - Keep | |||
| - drop | |||
| - Drop | |||
| - hashmod | |||
| - HashMod | |||
| - labelmap | |||
| - LabelMap | |||
| - labeldrop | |||
| - LabelDrop | |||
| - labelkeep | |||
| - LabelKeep | |||
| - lowercase | |||
| - Lowercase | |||
| - uppercase | |||
| - Uppercase | |||
| - keepequal | |||
| - KeepEqual | |||
| - dropequal | |||
| - DropEqual | |||
| type: string | |||
| modulus: | |||
| description: Modulus to take of the hash of the source | |||
| label values. | |||
| format: int64 | |||
| type: integer | |||
| regex: | |||
| description: Regular expression against which the extracted | |||
| value is matched. Default is '(.*)' | |||
| type: string | |||
| replacement: | |||
| description: Replacement value against which a regex replace | |||
| is performed if the regular expression matches. Regex | |||
| capture groups are available. Default is '$1' | |||
| type: string | |||
| separator: | |||
| description: Separator placed between concatenated source | |||
| label values. default is ';'. | |||
| type: string | |||
| sourceLabels: | |||
| description: The source labels select values from existing | |||
| labels. Their content is concatenated using the configured | |||
| separator and matched against the configured regular | |||
| expression for the replace, keep, and drop actions. | |||
| items: | |||
| description: LabelName is a valid Prometheus label name | |||
| which may only contain ASCII letters, numbers, as | |||
| well as underscores. | |||
| pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ | |||
| type: string | |||
| type: array | |||
| targetLabel: | |||
| description: Label to which the resulting value is written | |||
| in a replace action. It is mandatory for replace actions. | |||
| Regex capture groups are available. | |||
| type: string | |||
| type: object | |||
| type: array | |||
| oauth2: | |||
| description: OAuth2 for the URL. Only valid in Prometheus versions | |||
| 2.27.0 and newer. | |||
| properties: | |||
| clientId: | |||
| description: The secret or configmap containing the OAuth2 | |||
| client id | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its | |||
| key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| clientSecret: | |||
| description: The secret containing the OAuth2 client secret | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| endpointParams: | |||
| additionalProperties: | |||
| type: string | |||
| description: Parameters to append to the token URL | |||
| type: object | |||
| scopes: | |||
| description: OAuth2 scopes used for the token request | |||
| items: | |||
| type: string | |||
| type: array | |||
| tokenUrl: | |||
| description: The URL to fetch the token from | |||
| minLength: 1 | |||
| type: string | |||
| required: | |||
| - clientId | |||
| - clientSecret | |||
| - tokenUrl | |||
| type: object | |||
| params: | |||
| additionalProperties: | |||
| items: | |||
| type: string | |||
| type: array | |||
| description: Optional HTTP URL parameters | |||
| type: object | |||
| path: | |||
| description: HTTP path to scrape for metrics. If empty, Prometheus | |||
| uses the default value (e.g. `/metrics`). | |||
| type: string | |||
| port: | |||
| description: Name of the service port this endpoint refers to. | |||
| Mutually exclusive with targetPort. | |||
| type: string | |||
| proxyUrl: | |||
| description: ProxyURL eg http://proxyserver:2195 Directs scrapes | |||
| to proxy through this endpoint. | |||
| type: string | |||
| relabelings: | |||
| description: 'RelabelConfigs to apply to samples before scraping. | |||
| Prometheus Operator automatically adds relabelings for a few | |||
| standard Kubernetes fields. The original scrape job''s name | |||
| is available via the `__tmp_prometheus_job_name` label. More | |||
| info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config' | |||
| items: | |||
| description: 'RelabelConfig allows dynamic rewriting of the | |||
| label set, being applied to samples before ingestion. It | |||
| defines `<metric_relabel_configs>`-section of Prometheus | |||
| configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' | |||
| properties: | |||
| action: | |||
| default: replace | |||
| description: Action to perform based on regex matching. | |||
| Default is 'replace'. uppercase and lowercase actions | |||
| require Prometheus >= 2.36. | |||
| enum: | |||
| - replace | |||
| - Replace | |||
| - keep | |||
| - Keep | |||
| - drop | |||
| - Drop | |||
| - hashmod | |||
| - HashMod | |||
| - labelmap | |||
| - LabelMap | |||
| - labeldrop | |||
| - LabelDrop | |||
| - labelkeep | |||
| - LabelKeep | |||
| - lowercase | |||
| - Lowercase | |||
| - uppercase | |||
| - Uppercase | |||
| - keepequal | |||
| - KeepEqual | |||
| - dropequal | |||
| - DropEqual | |||
| type: string | |||
| modulus: | |||
| description: Modulus to take of the hash of the source | |||
| label values. | |||
| format: int64 | |||
| type: integer | |||
| regex: | |||
| description: Regular expression against which the extracted | |||
| value is matched. Default is '(.*)' | |||
| type: string | |||
| replacement: | |||
| description: Replacement value against which a regex replace | |||
| is performed if the regular expression matches. Regex | |||
| capture groups are available. Default is '$1' | |||
| type: string | |||
| separator: | |||
| description: Separator placed between concatenated source | |||
| label values. default is ';'. | |||
| type: string | |||
| sourceLabels: | |||
| description: The source labels select values from existing | |||
| labels. Their content is concatenated using the configured | |||
| separator and matched against the configured regular | |||
| expression for the replace, keep, and drop actions. | |||
| items: | |||
| description: LabelName is a valid Prometheus label name | |||
| which may only contain ASCII letters, numbers, as | |||
| well as underscores. | |||
| pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ | |||
| type: string | |||
| type: array | |||
| targetLabel: | |||
| description: Label to which the resulting value is written | |||
| in a replace action. It is mandatory for replace actions. | |||
| Regex capture groups are available. | |||
| type: string | |||
| type: object | |||
| type: array | |||
| scheme: | |||
| description: HTTP scheme to use for scraping. `http` and `https` | |||
| are the expected values unless you rewrite the `__scheme__` | |||
| label via relabeling. If empty, Prometheus uses the default | |||
| value `http`. | |||
| enum: | |||
| - http | |||
| - https | |||
| type: string | |||
| scrapeTimeout: | |||
| description: Timeout after which the scrape is ended If not | |||
| specified, the Prometheus global scrape timeout is used unless | |||
| it is less than `Interval` in which the latter is used. | |||
| pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ | |||
| type: string | |||
| targetPort: | |||
| anyOf: | |||
| - type: integer | |||
| - type: string | |||
| description: Name or number of the target port of the Pod behind | |||
| the Service, the port must be specified with container port | |||
| property. Mutually exclusive with port. | |||
| x-kubernetes-int-or-string: true | |||
| tlsConfig: | |||
| description: TLS configuration to use when scraping the endpoint | |||
| properties: | |||
| ca: | |||
| description: Certificate authority used when verifying server | |||
| certificates. | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its | |||
| key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| caFile: | |||
| description: Path to the CA cert in the Prometheus container | |||
| to use for the targets. | |||
| type: string | |||
| cert: | |||
| description: Client certificate to present when doing client-authentication. | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its | |||
| key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| certFile: | |||
| description: Path to the client cert file in the Prometheus | |||
| container for the targets. | |||
| type: string | |||
| insecureSkipVerify: | |||
| description: Disable target certificate validation. | |||
| type: boolean | |||
| keyFile: | |||
| description: Path to the client key file in the Prometheus | |||
| container for the targets. | |||
| type: string | |||
| keySecret: | |||
| description: Secret containing the client key file for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| serverName: | |||
| description: Used to verify the hostname for the targets. | |||
| type: string | |||
| type: object | |||
| type: object | |||
| type: array | |||
| jobLabel: | |||
| description: "JobLabel selects the label from the associated Kubernetes | |||
| service which will be used as the `job` label for all metrics. \n | |||
| For example: If in `ServiceMonitor.spec.jobLabel: foo` and in `Service.metadata.labels.foo: | |||
| bar`, then the `job=\"bar\"` label is added to all metrics. \n If | |||
| the value of this field is empty or if the label doesn't exist for | |||
| the given Service, the `job` label of the metrics defaults to the | |||
| name of the Kubernetes Service." | |||
| type: string | |||
| labelLimit: | |||
| description: Per-scrape limit on number of labels that will be accepted | |||
| for a sample. Only valid in Prometheus versions 2.27.0 and newer. | |||
| format: int64 | |||
| type: integer | |||
| labelNameLengthLimit: | |||
| description: Per-scrape limit on length of labels name that will be | |||
| accepted for a sample. Only valid in Prometheus versions 2.27.0 | |||
| and newer. | |||
| format: int64 | |||
| type: integer | |||
| labelValueLengthLimit: | |||
| description: Per-scrape limit on length of labels value that will | |||
| be accepted for a sample. Only valid in Prometheus versions 2.27.0 | |||
| and newer. | |||
| format: int64 | |||
| type: integer | |||
| namespaceSelector: | |||
| description: Selector to select which namespaces the Kubernetes Endpoints | |||
| objects are discovered from. | |||
| properties: | |||
| any: | |||
| description: Boolean describing whether all namespaces are selected | |||
| in contrast to a list restricting them. | |||
| type: boolean | |||
| matchNames: | |||
| description: List of namespace names to select from. | |||
| items: | |||
| type: string | |||
| type: array | |||
| type: object | |||
| podTargetLabels: | |||
| description: PodTargetLabels transfers labels on the Kubernetes `Pod` | |||
| onto the created metrics. | |||
| items: | |||
| type: string | |||
| type: array | |||
| sampleLimit: | |||
| description: SampleLimit defines per-scrape limit on number of scraped | |||
| samples that will be accepted. | |||
| format: int64 | |||
| type: integer | |||
| selector: | |||
| description: Selector to select Endpoints objects. | |||
| properties: | |||
| matchExpressions: | |||
| description: matchExpressions is a list of label selector requirements. | |||
| The requirements are ANDed. | |||
| items: | |||
| description: A label selector requirement is a selector that | |||
| contains values, a key, and an operator that relates the key | |||
| and values. | |||
| properties: | |||
| key: | |||
| description: key is the label key that the selector applies | |||
| to. | |||
| type: string | |||
| operator: | |||
| description: operator represents a key's relationship to | |||
| a set of values. Valid operators are In, NotIn, Exists | |||
| and DoesNotExist. | |||
| type: string | |||
| values: | |||
| description: values is an array of string values. If the | |||
| operator is In or NotIn, the values array must be non-empty. | |||
| If the operator is Exists or DoesNotExist, the values | |||
| array must be empty. This array is replaced during a strategic | |||
| merge patch. | |||
| items: | |||
| type: string | |||
| type: array | |||
| required: | |||
| - key | |||
| - operator | |||
| type: object | |||
| type: array | |||
| matchLabels: | |||
| additionalProperties: | |||
| type: string | |||
| description: matchLabels is a map of {key,value} pairs. A single | |||
| {key,value} in the matchLabels map is equivalent to an element | |||
| of matchExpressions, whose key field is "key", the operator | |||
| is "In", and the values array contains only "value". The requirements | |||
| are ANDed. | |||
| type: object | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| targetLabels: | |||
| description: TargetLabels transfers labels from the Kubernetes `Service` | |||
| onto the created metrics. | |||
| items: | |||
| type: string | |||
| type: array | |||
| targetLimit: | |||
| description: TargetLimit defines a limit on the number of scraped | |||
| targets that will be accepted. | |||
| format: int64 | |||
| type: integer | |||
| required: | |||
| - endpoints | |||
| - selector | |||
| type: object | |||
| required: | |||
| - spec | |||
| type: object | |||
| served: true | |||
| storage: true | |||
| @@ -0,0 +1,500 @@ | |||
| --- | |||
| apiVersion: apiextensions.k8s.io/v1 | |||
| kind: CustomResourceDefinition | |||
| metadata: | |||
| annotations: | |||
| controller-gen.kubebuilder.io/version: v0.9.2 | |||
| creationTimestamp: null | |||
| name: logsinstances.monitoring.grafana.com | |||
| spec: | |||
| group: monitoring.grafana.com | |||
| names: | |||
| categories: | |||
| - agent-operator | |||
| kind: LogsInstance | |||
| listKind: LogsInstanceList | |||
| plural: logsinstances | |||
| singular: logsinstance | |||
| scope: Namespaced | |||
| versions: | |||
| - name: v1alpha1 | |||
| schema: | |||
| openAPIV3Schema: | |||
| description: LogsInstance controls an individual logs instance within a Grafana | |||
| Agent deployment. | |||
| properties: | |||
| apiVersion: | |||
| description: 'APIVersion defines the versioned schema of this representation | |||
| of an object. Servers should convert recognized schemas to the latest | |||
| internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | |||
| type: string | |||
| kind: | |||
| description: 'Kind is a string value representing the REST resource this | |||
| object represents. Servers may infer this from the endpoint the client | |||
| submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | |||
| type: string | |||
| metadata: | |||
| type: object | |||
| spec: | |||
| description: Spec holds the specification of the desired behavior for | |||
| the logs instance. | |||
| properties: | |||
| additionalScrapeConfigs: | |||
| description: "AdditionalScrapeConfigs allows specifying a key of a | |||
| Secret containing additional Grafana Agent logging scrape configurations. | |||
| Scrape configurations specified are appended to the configurations | |||
| generated by the Grafana Agent Operator. \n Job configurations specified | |||
| must have the form as specified in the official Promtail documentation: | |||
| \n https://grafana.com/docs/loki/latest/clients/promtail/configuration/#scrape_configs | |||
| \n As scrape configs are appended, the user is responsible to make | |||
| sure it is valid. Note that using this feature may expose the possibility | |||
| to break upgrades of Grafana Agent. It is advised to review both | |||
| Grafana Agent and Promtail release notes to ensure that no incompatible | |||
| scrape configs are going to break Grafana Agent after the upgrade." | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must be a | |||
| valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| clients: | |||
| description: Clients controls where logs are written to for this instance. | |||
| items: | |||
| description: LogsClientSpec defines the client integration for logs, | |||
| indicating which Loki server to send logs to. | |||
| properties: | |||
| backoffConfig: | |||
| description: Configures how to retry requests to Loki when a | |||
| request fails. Defaults to a minPeriod of 500ms, maxPeriod | |||
| of 5m, and maxRetries of 10. | |||
| properties: | |||
| maxPeriod: | |||
| description: Maximum backoff time between retries. | |||
| type: string | |||
| maxRetries: | |||
| description: Maximum number of retries to perform before | |||
| giving up a request. | |||
| type: integer | |||
| minPeriod: | |||
| description: Initial backoff time between retries. Time | |||
| between retries is increased exponentially. | |||
| type: string | |||
| type: object | |||
| basicAuth: | |||
| description: BasicAuth for the Loki server. | |||
| properties: | |||
| password: | |||
| description: The secret in the service monitor namespace | |||
| that contains the password for authentication. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| username: | |||
| description: The secret in the service monitor namespace | |||
| that contains the username for authentication. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| batchSize: | |||
| description: Maximum batch size (in bytes) of logs to accumulate | |||
| before sending the batch to Loki. | |||
| type: integer | |||
| batchWait: | |||
| description: Maximum amount of time to wait before sending a | |||
| batch, even if that batch isn't full. | |||
| type: string | |||
| bearerToken: | |||
| description: BearerToken used for remote_write. | |||
| type: string | |||
| bearerTokenFile: | |||
| description: BearerTokenFile used to read bearer token. | |||
| type: string | |||
| externalLabels: | |||
| additionalProperties: | |||
| type: string | |||
| description: ExternalLabels are labels to add to any time series | |||
| when sending data to Loki. | |||
| type: object | |||
| oauth2: | |||
| description: Oauth2 for URL | |||
| properties: | |||
| clientId: | |||
| description: The secret or configmap containing the OAuth2 | |||
| client id | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its | |||
| key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| clientSecret: | |||
| description: The secret containing the OAuth2 client secret | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| endpointParams: | |||
| additionalProperties: | |||
| type: string | |||
| description: Parameters to append to the token URL | |||
| type: object | |||
| scopes: | |||
| description: OAuth2 scopes used for the token request | |||
| items: | |||
| type: string | |||
| type: array | |||
| tokenUrl: | |||
| description: The URL to fetch the token from | |||
| minLength: 1 | |||
| type: string | |||
| required: | |||
| - clientId | |||
| - clientSecret | |||
| - tokenUrl | |||
| type: object | |||
| proxyUrl: | |||
| description: ProxyURL to proxy requests through. Optional. | |||
| type: string | |||
| tenantId: | |||
| description: Tenant ID used by default to push logs to Loki. | |||
| If omitted assumes remote Loki is running in single-tenant | |||
| mode or an authentication layer is used to inject an X-Scope-OrgID | |||
| header. | |||
| type: string | |||
| timeout: | |||
| description: Maximum time to wait for a server to respond to | |||
| a request. | |||
| type: string | |||
| tlsConfig: | |||
| description: TLSConfig to use for the client. Only used when | |||
| the protocol of the URL is https. | |||
| properties: | |||
| ca: | |||
| description: Certificate authority used when verifying server | |||
| certificates. | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its | |||
| key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| caFile: | |||
| description: Path to the CA cert in the Prometheus container | |||
| to use for the targets. | |||
| type: string | |||
| cert: | |||
| description: Client certificate to present when doing client-authentication. | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its | |||
| key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| certFile: | |||
| description: Path to the client cert file in the Prometheus | |||
| container for the targets. | |||
| type: string | |||
| insecureSkipVerify: | |||
| description: Disable target certificate validation. | |||
| type: boolean | |||
| keyFile: | |||
| description: Path to the client key file in the Prometheus | |||
| container for the targets. | |||
| type: string | |||
| keySecret: | |||
| description: Secret containing the client key file for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| serverName: | |||
| description: Used to verify the hostname for the targets. | |||
| type: string | |||
| type: object | |||
| url: | |||
| description: 'URL is the URL where Loki is listening. Must be | |||
| a full HTTP URL, including protocol. Required. Example: https://logs-prod-us-central1.grafana.net/loki/api/v1/push.' | |||
| type: string | |||
| required: | |||
| - url | |||
| type: object | |||
| type: array | |||
| podLogsNamespaceSelector: | |||
| description: Set of labels to determine which namespaces should be | |||
| watched for PodLogs. If not provided, checks only namespace of the | |||
| instance. | |||
| properties: | |||
| matchExpressions: | |||
| description: matchExpressions is a list of label selector requirements. | |||
| The requirements are ANDed. | |||
| items: | |||
| description: A label selector requirement is a selector that | |||
| contains values, a key, and an operator that relates the key | |||
| and values. | |||
| properties: | |||
| key: | |||
| description: key is the label key that the selector applies | |||
| to. | |||
| type: string | |||
| operator: | |||
| description: operator represents a key's relationship to | |||
| a set of values. Valid operators are In, NotIn, Exists | |||
| and DoesNotExist. | |||
| type: string | |||
| values: | |||
| description: values is an array of string values. If the | |||
| operator is In or NotIn, the values array must be non-empty. | |||
| If the operator is Exists or DoesNotExist, the values | |||
| array must be empty. This array is replaced during a strategic | |||
| merge patch. | |||
| items: | |||
| type: string | |||
| type: array | |||
| required: | |||
| - key | |||
| - operator | |||
| type: object | |||
| type: array | |||
| matchLabels: | |||
| additionalProperties: | |||
| type: string | |||
| description: matchLabels is a map of {key,value} pairs. A single | |||
| {key,value} in the matchLabels map is equivalent to an element | |||
| of matchExpressions, whose key field is "key", the operator | |||
| is "In", and the values array contains only "value". The requirements | |||
| are ANDed. | |||
| type: object | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| podLogsSelector: | |||
| description: Determines which PodLogs should be selected for including | |||
| in this instance. | |||
| properties: | |||
| matchExpressions: | |||
| description: matchExpressions is a list of label selector requirements. | |||
| The requirements are ANDed. | |||
| items: | |||
| description: A label selector requirement is a selector that | |||
| contains values, a key, and an operator that relates the key | |||
| and values. | |||
| properties: | |||
| key: | |||
| description: key is the label key that the selector applies | |||
| to. | |||
| type: string | |||
| operator: | |||
| description: operator represents a key's relationship to | |||
| a set of values. Valid operators are In, NotIn, Exists | |||
| and DoesNotExist. | |||
| type: string | |||
| values: | |||
| description: values is an array of string values. If the | |||
| operator is In or NotIn, the values array must be non-empty. | |||
| If the operator is Exists or DoesNotExist, the values | |||
| array must be empty. This array is replaced during a strategic | |||
| merge patch. | |||
| items: | |||
| type: string | |||
| type: array | |||
| required: | |||
| - key | |||
| - operator | |||
| type: object | |||
| type: array | |||
| matchLabels: | |||
| additionalProperties: | |||
| type: string | |||
| description: matchLabels is a map of {key,value} pairs. A single | |||
| {key,value} in the matchLabels map is equivalent to an element | |||
| of matchExpressions, whose key field is "key", the operator | |||
| is "In", and the values array contains only "value". The requirements | |||
| are ANDed. | |||
| type: object | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| targetConfig: | |||
| description: Configures how tailed targets are watched. | |||
| properties: | |||
| syncPeriod: | |||
| description: Period to resync directories being watched and files | |||
| being tailed to discover new ones or stop watching removed ones. | |||
| type: string | |||
| type: object | |||
| type: object | |||
| type: object | |||
| served: true | |||
| storage: true | |||
| @@ -0,0 +1,861 @@ | |||
| --- | |||
| apiVersion: apiextensions.k8s.io/v1 | |||
| kind: CustomResourceDefinition | |||
| metadata: | |||
| annotations: | |||
| controller-gen.kubebuilder.io/version: v0.9.2 | |||
| creationTimestamp: null | |||
| name: metricsinstances.monitoring.grafana.com | |||
| spec: | |||
| group: monitoring.grafana.com | |||
| names: | |||
| categories: | |||
| - agent-operator | |||
| kind: MetricsInstance | |||
| listKind: MetricsInstanceList | |||
| plural: metricsinstances | |||
| singular: metricsinstance | |||
| scope: Namespaced | |||
| versions: | |||
| - name: v1alpha1 | |||
| schema: | |||
| openAPIV3Schema: | |||
| description: MetricsInstance controls an individual Metrics instance within | |||
| a Grafana Agent deployment. | |||
| properties: | |||
| apiVersion: | |||
| description: 'APIVersion defines the versioned schema of this representation | |||
| of an object. Servers should convert recognized schemas to the latest | |||
| internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | |||
| type: string | |||
| kind: | |||
| description: 'Kind is a string value representing the REST resource this | |||
| object represents. Servers may infer this from the endpoint the client | |||
| submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | |||
| type: string | |||
| metadata: | |||
| type: object | |||
| spec: | |||
| description: Spec holds the specification of the desired behavior for | |||
| the Metrics instance. | |||
| properties: | |||
| additionalScrapeConfigs: | |||
| description: 'AdditionalScrapeConfigs lets you specify a key of a | |||
| Secret containing additional Grafana Agent Prometheus scrape configurations. | |||
| The specified scrape configurations are appended to the configurations | |||
| generated by Grafana Agent Operator. Specified job configurations | |||
| must have the form specified in the official Prometheus documentation: | |||
| https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config. | |||
| As scrape configs are appended, you must make sure the configuration | |||
| is still valid. Note that it''s possible that this feature will | |||
| break future upgrades of Grafana Agent. Review both Grafana Agent | |||
| and Prometheus release notes to ensure that no incompatible scrape | |||
| configs will break Grafana Agent after the upgrade.' | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must be a | |||
| valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| maxWALTime: | |||
| description: MaxWALTime is the maximum amount of time that series | |||
| and samples can exist in the WAL before being forcibly deleted. | |||
| type: string | |||
| minWALTime: | |||
| description: MinWALTime is the minimum amount of time that series | |||
| and samples can exist in the WAL before being considered for deletion. | |||
| type: string | |||
| podMonitorNamespaceSelector: | |||
| description: PodMonitorNamespaceSelector are the set of labels to | |||
| determine which namespaces to watch for PodMonitor discovery. If | |||
| nil, it only checks its own namespace. | |||
| properties: | |||
| matchExpressions: | |||
| description: matchExpressions is a list of label selector requirements. | |||
| The requirements are ANDed. | |||
| items: | |||
| description: A label selector requirement is a selector that | |||
| contains values, a key, and an operator that relates the key | |||
| and values. | |||
| properties: | |||
| key: | |||
| description: key is the label key that the selector applies | |||
| to. | |||
| type: string | |||
| operator: | |||
| description: operator represents a key's relationship to | |||
| a set of values. Valid operators are In, NotIn, Exists | |||
| and DoesNotExist. | |||
| type: string | |||
| values: | |||
| description: values is an array of string values. If the | |||
| operator is In or NotIn, the values array must be non-empty. | |||
| If the operator is Exists or DoesNotExist, the values | |||
| array must be empty. This array is replaced during a strategic | |||
| merge patch. | |||
| items: | |||
| type: string | |||
| type: array | |||
| required: | |||
| - key | |||
| - operator | |||
| type: object | |||
| type: array | |||
| matchLabels: | |||
| additionalProperties: | |||
| type: string | |||
| description: matchLabels is a map of {key,value} pairs. A single | |||
| {key,value} in the matchLabels map is equivalent to an element | |||
| of matchExpressions, whose key field is "key", the operator | |||
| is "In", and the values array contains only "value". The requirements | |||
| are ANDed. | |||
| type: object | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| podMonitorSelector: | |||
| description: PodMonitorSelector determines which PodMonitors to selected | |||
| for target discovery. Experimental. | |||
| properties: | |||
| matchExpressions: | |||
| description: matchExpressions is a list of label selector requirements. | |||
| The requirements are ANDed. | |||
| items: | |||
| description: A label selector requirement is a selector that | |||
| contains values, a key, and an operator that relates the key | |||
| and values. | |||
| properties: | |||
| key: | |||
| description: key is the label key that the selector applies | |||
| to. | |||
| type: string | |||
| operator: | |||
| description: operator represents a key's relationship to | |||
| a set of values. Valid operators are In, NotIn, Exists | |||
| and DoesNotExist. | |||
| type: string | |||
| values: | |||
| description: values is an array of string values. If the | |||
| operator is In or NotIn, the values array must be non-empty. | |||
| If the operator is Exists or DoesNotExist, the values | |||
| array must be empty. This array is replaced during a strategic | |||
| merge patch. | |||
| items: | |||
| type: string | |||
| type: array | |||
| required: | |||
| - key | |||
| - operator | |||
| type: object | |||
| type: array | |||
| matchLabels: | |||
| additionalProperties: | |||
| type: string | |||
| description: matchLabels is a map of {key,value} pairs. A single | |||
| {key,value} in the matchLabels map is equivalent to an element | |||
| of matchExpressions, whose key field is "key", the operator | |||
| is "In", and the values array contains only "value". The requirements | |||
| are ANDed. | |||
| type: object | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| probeNamespaceSelector: | |||
| description: ProbeNamespaceSelector is the set of labels that determines | |||
| which namespaces to watch for Probe discovery. If nil, it only checks | |||
| own namespace. | |||
| properties: | |||
| matchExpressions: | |||
| description: matchExpressions is a list of label selector requirements. | |||
| The requirements are ANDed. | |||
| items: | |||
| description: A label selector requirement is a selector that | |||
| contains values, a key, and an operator that relates the key | |||
| and values. | |||
| properties: | |||
| key: | |||
| description: key is the label key that the selector applies | |||
| to. | |||
| type: string | |||
| operator: | |||
| description: operator represents a key's relationship to | |||
| a set of values. Valid operators are In, NotIn, Exists | |||
| and DoesNotExist. | |||
| type: string | |||
| values: | |||
| description: values is an array of string values. If the | |||
| operator is In or NotIn, the values array must be non-empty. | |||
| If the operator is Exists or DoesNotExist, the values | |||
| array must be empty. This array is replaced during a strategic | |||
| merge patch. | |||
| items: | |||
| type: string | |||
| type: array | |||
| required: | |||
| - key | |||
| - operator | |||
| type: object | |||
| type: array | |||
| matchLabels: | |||
| additionalProperties: | |||
| type: string | |||
| description: matchLabels is a map of {key,value} pairs. A single | |||
| {key,value} in the matchLabels map is equivalent to an element | |||
| of matchExpressions, whose key field is "key", the operator | |||
| is "In", and the values array contains only "value". The requirements | |||
| are ANDed. | |||
| type: object | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| probeSelector: | |||
| description: ProbeSelector determines which Probes to select for target | |||
| discovery. | |||
| properties: | |||
| matchExpressions: | |||
| description: matchExpressions is a list of label selector requirements. | |||
| The requirements are ANDed. | |||
| items: | |||
| description: A label selector requirement is a selector that | |||
| contains values, a key, and an operator that relates the key | |||
| and values. | |||
| properties: | |||
| key: | |||
| description: key is the label key that the selector applies | |||
| to. | |||
| type: string | |||
| operator: | |||
| description: operator represents a key's relationship to | |||
| a set of values. Valid operators are In, NotIn, Exists | |||
| and DoesNotExist. | |||
| type: string | |||
| values: | |||
| description: values is an array of string values. If the | |||
| operator is In or NotIn, the values array must be non-empty. | |||
| If the operator is Exists or DoesNotExist, the values | |||
| array must be empty. This array is replaced during a strategic | |||
| merge patch. | |||
| items: | |||
| type: string | |||
| type: array | |||
| required: | |||
| - key | |||
| - operator | |||
| type: object | |||
| type: array | |||
| matchLabels: | |||
| additionalProperties: | |||
| type: string | |||
| description: matchLabels is a map of {key,value} pairs. A single | |||
| {key,value} in the matchLabels map is equivalent to an element | |||
| of matchExpressions, whose key field is "key", the operator | |||
| is "In", and the values array contains only "value". The requirements | |||
| are ANDed. | |||
| type: object | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| remoteFlushDeadline: | |||
| description: RemoteFlushDeadline is the deadline for flushing data | |||
| when an instance shuts down. | |||
| type: string | |||
| remoteWrite: | |||
| description: RemoteWrite controls remote_write settings for this instance. | |||
| items: | |||
| description: RemoteWriteSpec defines the remote_write configuration | |||
| for Prometheus. | |||
| properties: | |||
| basicAuth: | |||
| description: BasicAuth for the URL. | |||
| properties: | |||
| password: | |||
| description: The secret in the service monitor namespace | |||
| that contains the password for authentication. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| username: | |||
| description: The secret in the service monitor namespace | |||
| that contains the username for authentication. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| bearerToken: | |||
| description: BearerToken used for remote_write. | |||
| type: string | |||
| bearerTokenFile: | |||
| description: BearerTokenFile used to read bearer token. | |||
| type: string | |||
| headers: | |||
| additionalProperties: | |||
| type: string | |||
| description: Headers is a set of custom HTTP headers to be sent | |||
| along with each remote_write request. Be aware that any headers | |||
| set by Grafana Agent itself can't be overwritten. | |||
| type: object | |||
| metadataConfig: | |||
| description: MetadataConfig configures the sending of series | |||
| metadata to remote storage. | |||
| properties: | |||
| send: | |||
| description: Send enables metric metadata to be sent to | |||
| remote storage. | |||
| type: boolean | |||
| sendInterval: | |||
| description: SendInterval controls how frequently metric | |||
| metadata is sent to remote storage. | |||
| type: string | |||
| type: object | |||
| name: | |||
| description: Name of the remote_write queue. Must be unique | |||
| if specified. The name is used in metrics and logging in order | |||
| to differentiate queues. | |||
| type: string | |||
| oauth2: | |||
| description: Oauth2 for URL | |||
| properties: | |||
| clientId: | |||
| description: The secret or configmap containing the OAuth2 | |||
| client id | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its | |||
| key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| clientSecret: | |||
| description: The secret containing the OAuth2 client secret | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| endpointParams: | |||
| additionalProperties: | |||
| type: string | |||
| description: Parameters to append to the token URL | |||
| type: object | |||
| scopes: | |||
| description: OAuth2 scopes used for the token request | |||
| items: | |||
| type: string | |||
| type: array | |||
| tokenUrl: | |||
| description: The URL to fetch the token from | |||
| minLength: 1 | |||
| type: string | |||
| required: | |||
| - clientId | |||
| - clientSecret | |||
| - tokenUrl | |||
| type: object | |||
| proxyUrl: | |||
| description: ProxyURL to proxy requests through. Optional. | |||
| type: string | |||
| queueConfig: | |||
| description: QueueConfig allows tuning of the remote_write queue | |||
| parameters. | |||
| properties: | |||
| batchSendDeadline: | |||
| description: BatchSendDeadline is the maximum time a sample | |||
| will wait in the buffer. | |||
| type: string | |||
| capacity: | |||
| description: Capacity is the number of samples to buffer | |||
| per shard before samples start being dropped. | |||
| type: integer | |||
| maxBackoff: | |||
| description: MaxBackoff is the maximum retry delay. | |||
| type: string | |||
| maxRetries: | |||
| description: MaxRetries is the maximum number of times to | |||
| retry a batch on recoverable errors. | |||
| type: integer | |||
| maxSamplesPerSend: | |||
| description: MaxSamplesPerSend is the maximum number of | |||
| samples per send. | |||
| type: integer | |||
| maxShards: | |||
| description: MaxShards is the maximum number of shards, | |||
| i.e., the amount of concurrency. | |||
| type: integer | |||
| minBackoff: | |||
| description: MinBackoff is the initial retry delay. MinBackoff | |||
| is doubled for every retry. | |||
| type: string | |||
| minShards: | |||
| description: MinShards is the minimum number of shards, | |||
| i.e., the amount of concurrency. | |||
| type: integer | |||
| retryOnRateLimit: | |||
| description: RetryOnRateLimit retries requests when encountering | |||
| rate limits. | |||
| type: boolean | |||
| type: object | |||
| remoteTimeout: | |||
| description: RemoteTimeout is the timeout for requests to the | |||
| remote_write endpoint. | |||
| type: string | |||
| sigv4: | |||
| description: SigV4 configures SigV4-based authentication to | |||
| the remote_write endpoint. SigV4-based authentication is used | |||
| if SigV4 is defined, even with an empty object. | |||
| properties: | |||
| accessKey: | |||
| description: AccessKey holds the secret of the AWS API access | |||
| key to use for signing. If not provided, the environment | |||
| variable AWS_ACCESS_KEY_ID is used. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| profile: | |||
| description: Profile is the named AWS profile to use for | |||
| authentication. | |||
| type: string | |||
| region: | |||
| description: Region of the AWS endpoint. If blank, the region | |||
| from the default credentials chain is used. | |||
| type: string | |||
| roleARN: | |||
| description: RoleARN is the AWS Role ARN to use for authentication, | |||
| as an alternative for using the AWS API keys. | |||
| type: string | |||
| secretKey: | |||
| description: SecretKey of the AWS API to use for signing. | |||
| If blank, the environment variable AWS_SECRET_ACCESS_KEY | |||
| is used. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| tlsConfig: | |||
| description: TLSConfig to use for remote_write. | |||
| properties: | |||
| ca: | |||
| description: Certificate authority used when verifying server | |||
| certificates. | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its | |||
| key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| caFile: | |||
| description: Path to the CA cert in the Prometheus container | |||
| to use for the targets. | |||
| type: string | |||
| cert: | |||
| description: Client certificate to present when doing client-authentication. | |||
| properties: | |||
| configMap: | |||
| description: ConfigMap containing data to use for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key to select. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the ConfigMap or its | |||
| key must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| secret: | |||
| description: Secret containing data to use for the targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, | |||
| uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key | |||
| must be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| type: object | |||
| certFile: | |||
| description: Path to the client cert file in the Prometheus | |||
| container for the targets. | |||
| type: string | |||
| insecureSkipVerify: | |||
| description: Disable target certificate validation. | |||
| type: boolean | |||
| keyFile: | |||
| description: Path to the client key file in the Prometheus | |||
| container for the targets. | |||
| type: string | |||
| keySecret: | |||
| description: Secret containing the client key file for the | |||
| targets. | |||
| properties: | |||
| key: | |||
| description: The key of the secret to select from. Must | |||
| be a valid secret key. | |||
| type: string | |||
| name: | |||
| description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | |||
| TODO: Add other useful fields. apiVersion, kind, uid?' | |||
| type: string | |||
| optional: | |||
| description: Specify whether the Secret or its key must | |||
| be defined | |||
| type: boolean | |||
| required: | |||
| - key | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| serverName: | |||
| description: Used to verify the hostname for the targets. | |||
| type: string | |||
| type: object | |||
| url: | |||
| description: URL of the endpoint to send samples to. | |||
| type: string | |||
| writeRelabelConfigs: | |||
| description: WriteRelabelConfigs holds relabel_configs to relabel | |||
| samples before they are sent to the remote_write endpoint. | |||
| items: | |||
| description: 'RelabelConfig allows dynamic rewriting of the | |||
| label set, being applied to samples before ingestion. It | |||
| defines `<metric_relabel_configs>`-section of Prometheus | |||
| configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' | |||
| properties: | |||
| action: | |||
| default: replace | |||
| description: Action to perform based on regex matching. | |||
| Default is 'replace'. uppercase and lowercase actions | |||
| require Prometheus >= 2.36. | |||
| enum: | |||
| - replace | |||
| - Replace | |||
| - keep | |||
| - Keep | |||
| - drop | |||
| - Drop | |||
| - hashmod | |||
| - HashMod | |||
| - labelmap | |||
| - LabelMap | |||
| - labeldrop | |||
| - LabelDrop | |||
| - labelkeep | |||
| - LabelKeep | |||
| - lowercase | |||
| - Lowercase | |||
| - uppercase | |||
| - Uppercase | |||
| - keepequal | |||
| - KeepEqual | |||
| - dropequal | |||
| - DropEqual | |||
| type: string | |||
| modulus: | |||
| description: Modulus to take of the hash of the source | |||
| label values. | |||
| format: int64 | |||
| type: integer | |||
| regex: | |||
| description: Regular expression against which the extracted | |||
| value is matched. Default is '(.*)' | |||
| type: string | |||
| replacement: | |||
| description: Replacement value against which a regex replace | |||
| is performed if the regular expression matches. Regex | |||
| capture groups are available. Default is '$1' | |||
| type: string | |||
| separator: | |||
| description: Separator placed between concatenated source | |||
| label values. default is ';'. | |||
| type: string | |||
| sourceLabels: | |||
| description: The source labels select values from existing | |||
| labels. Their content is concatenated using the configured | |||
| separator and matched against the configured regular | |||
| expression for the replace, keep, and drop actions. | |||
| items: | |||
| description: LabelName is a valid Prometheus label name | |||
| which may only contain ASCII letters, numbers, as | |||
| well as underscores. | |||
| pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ | |||
| type: string | |||
| type: array | |||
| targetLabel: | |||
| description: Label to which the resulting value is written | |||
| in a replace action. It is mandatory for replace actions. | |||
| Regex capture groups are available. | |||
| type: string | |||
| type: object | |||
| type: array | |||
| required: | |||
| - url | |||
| type: object | |||
| type: array | |||
| serviceMonitorNamespaceSelector: | |||
| description: ServiceMonitorNamespaceSelector is the set of labels | |||
| that determine which namespaces to watch for ServiceMonitor discovery. | |||
| If nil, it only checks its own namespace. | |||
| properties: | |||
| matchExpressions: | |||
| description: matchExpressions is a list of label selector requirements. | |||
| The requirements are ANDed. | |||
| items: | |||
| description: A label selector requirement is a selector that | |||
| contains values, a key, and an operator that relates the key | |||
| and values. | |||
| properties: | |||
| key: | |||
| description: key is the label key that the selector applies | |||
| to. | |||
| type: string | |||
| operator: | |||
| description: operator represents a key's relationship to | |||
| a set of values. Valid operators are In, NotIn, Exists | |||
| and DoesNotExist. | |||
| type: string | |||
| values: | |||
| description: values is an array of string values. If the | |||
| operator is In or NotIn, the values array must be non-empty. | |||
| If the operator is Exists or DoesNotExist, the values | |||
| array must be empty. This array is replaced during a strategic | |||
| merge patch. | |||
| items: | |||
| type: string | |||
| type: array | |||
| required: | |||
| - key | |||
| - operator | |||
| type: object | |||
| type: array | |||
| matchLabels: | |||
| additionalProperties: | |||
| type: string | |||
| description: matchLabels is a map of {key,value} pairs. A single | |||
| {key,value} in the matchLabels map is equivalent to an element | |||
| of matchExpressions, whose key field is "key", the operator | |||
| is "In", and the values array contains only "value". The requirements | |||
| are ANDed. | |||
| type: object | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| serviceMonitorSelector: | |||
| description: ServiceMonitorSelector determines which ServiceMonitors | |||
| to select for target discovery. | |||
| properties: | |||
| matchExpressions: | |||
| description: matchExpressions is a list of label selector requirements. | |||
| The requirements are ANDed. | |||
| items: | |||
| description: A label selector requirement is a selector that | |||
| contains values, a key, and an operator that relates the key | |||
| and values. | |||
| properties: | |||
| key: | |||
| description: key is the label key that the selector applies | |||
| to. | |||
| type: string | |||
| operator: | |||
| description: operator represents a key's relationship to | |||
| a set of values. Valid operators are In, NotIn, Exists | |||
| and DoesNotExist. | |||
| type: string | |||
| values: | |||
| description: values is an array of string values. If the | |||
| operator is In or NotIn, the values array must be non-empty. | |||
| If the operator is Exists or DoesNotExist, the values | |||
| array must be empty. This array is replaced during a strategic | |||
| merge patch. | |||
| items: | |||
| type: string | |||
| type: array | |||
| required: | |||
| - key | |||
| - operator | |||
| type: object | |||
| type: array | |||
| matchLabels: | |||
| additionalProperties: | |||
| type: string | |||
| description: matchLabels is a map of {key,value} pairs. A single | |||
| {key,value} in the matchLabels map is equivalent to an element | |||
| of matchExpressions, whose key field is "key", the operator | |||
| is "In", and the values array contains only "value". The requirements | |||
| are ANDed. | |||
| type: object | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| walTruncateFrequency: | |||
| description: WALTruncateFrequency specifies how frequently to run | |||
| the WAL truncation process. Higher values cause the WAL to increase | |||
| and for old series to stay in the WAL longer, but reduces the chance | |||
| of data loss when remote_write fails for longer than the given frequency. | |||
| type: string | |||
| writeStaleOnShutdown: | |||
| description: WriteStaleOnShutdown writes staleness markers on shutdown | |||
| for all series. | |||
| type: boolean | |||
| type: object | |||
| type: object | |||
| served: true | |||
| storage: true | |||
| @@ -0,0 +1,588 @@ | |||
| --- | |||
| apiVersion: apiextensions.k8s.io/v1 | |||
| kind: CustomResourceDefinition | |||
| metadata: | |||
| annotations: | |||
| controller-gen.kubebuilder.io/version: v0.9.2 | |||
| creationTimestamp: null | |||
| name: podlogs.monitoring.grafana.com | |||
| spec: | |||
| group: monitoring.grafana.com | |||
| names: | |||
| categories: | |||
| - agent-operator | |||
| kind: PodLogs | |||
| listKind: PodLogsList | |||
| plural: podlogs | |||
| singular: podlogs | |||
| scope: Namespaced | |||
| versions: | |||
| - name: v1alpha1 | |||
| schema: | |||
| openAPIV3Schema: | |||
| description: PodLogs defines how to collect logs for a pod. | |||
| properties: | |||
| apiVersion: | |||
| description: 'APIVersion defines the versioned schema of this representation | |||
| of an object. Servers should convert recognized schemas to the latest | |||
| internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | |||
| type: string | |||
| kind: | |||
| description: 'Kind is a string value representing the REST resource this | |||
| object represents. Servers may infer this from the endpoint the client | |||
| submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | |||
| type: string | |||
| metadata: | |||
| type: object | |||
| spec: | |||
| description: Spec holds the specification of the desired behavior for | |||
| the PodLogs. | |||
| properties: | |||
| jobLabel: | |||
| description: The label to use to retrieve the job name from. | |||
| type: string | |||
| namespaceSelector: | |||
| description: Selector to select which namespaces the Pod objects are | |||
| discovered from. | |||
| properties: | |||
| any: | |||
| description: Boolean describing whether all namespaces are selected | |||
| in contrast to a list restricting them. | |||
| type: boolean | |||
| matchNames: | |||
| description: List of namespace names to select from. | |||
| items: | |||
| type: string | |||
| type: array | |||
| type: object | |||
| pipelineStages: | |||
| description: Pipeline stages for this pod. Pipeline stages support | |||
| transforming and filtering log lines. | |||
| items: | |||
| description: "PipelineStageSpec defines an individual pipeline stage. | |||
| Each stage type is mutually exclusive and no more than one may | |||
| be set per stage. \n More information on pipelines can be found | |||
| in the Promtail documentation: https://grafana.com/docs/loki/latest/clients/promtail/pipelines/" | |||
| properties: | |||
| cri: | |||
| description: 'CRI is a parsing stage that reads log lines using | |||
| the standard CRI logging format. Supply cri: {} to enable.' | |||
| type: object | |||
| docker: | |||
| description: 'Docker is a parsing stage that reads log lines | |||
| using the standard Docker logging format. Supply docker: {} | |||
| to enable.' | |||
| type: object | |||
| drop: | |||
| description: Drop is a filtering stage that lets you drop certain | |||
| logs. | |||
| properties: | |||
| dropCounterReason: | |||
| description: Every time a log line is dropped, the metric | |||
| logentry_dropped_lines_total is incremented. A "reason" | |||
| label is added, and can be customized by providing a custom | |||
| value here. Defaults to "drop_stage". | |||
| type: string | |||
| expression: | |||
| description: "RE2 regular expression. \n If source is provided, | |||
| the regex attempts to match the source. \n If no source | |||
| is provided, then the regex attempts to attach the log | |||
| line. \n If the provided regex matches the log line or | |||
| a provided source, the line is dropped." | |||
| type: string | |||
| longerThan: | |||
| description: LongerThan will drop a log line if it its content | |||
| is longer than this value (in bytes). Can be expressed | |||
| as an integer (8192) or a number with a suffix (8kb). | |||
| type: string | |||
| olderThan: | |||
| description: OlderThan will be parsed as a Go duration. | |||
| If the log line's timestamp is older than the current | |||
| time minus the provided duration, it will be dropped. | |||
| type: string | |||
| source: | |||
| description: Name from the extract data to parse. If empty, | |||
| uses the log message. | |||
| type: string | |||
| value: | |||
| description: "Value can only be specified when source is | |||
| specified. If the value provided is an exact match for | |||
| the given source then the line will be dropped. \n Mutually | |||
| exclusive with expression." | |||
| type: string | |||
| type: object | |||
| json: | |||
| description: "JSON is a parsing stage that reads the log line | |||
| as JSON and accepts JMESPath expressions to extract data. | |||
| \n Information on JMESPath: http://jmespath.org/" | |||
| properties: | |||
| expressions: | |||
| additionalProperties: | |||
| type: string | |||
| description: "Set of the key/value pairs of JMESPath expressions. | |||
| The key will be the key in the extracted data while the | |||
| expression will be the value, evaluated as a JMESPath | |||
| from the source data. \n Literal JMESPath expressions | |||
| can be used by wrapping a key in double quotes, which | |||
| then must be wrapped again in single quotes in YAML so | |||
| they get passed to the JMESPath parser." | |||
| type: object | |||
| source: | |||
| description: Name from the extracted data to parse as JSON. | |||
| If empty, uses entire log message. | |||
| type: string | |||
| type: object | |||
| labelAllow: | |||
| description: LabelAllow is an action stage that only allows | |||
| the provided labels to be included in the label set that is | |||
| sent to Loki with the log entry. | |||
| items: | |||
| type: string | |||
| type: array | |||
| labelDrop: | |||
| description: LabelDrop is an action stage that drops labels | |||
| from the label set that is sent to Loki with the log entry. | |||
| items: | |||
| type: string | |||
| type: array | |||
| labels: | |||
| additionalProperties: | |||
| type: string | |||
| description: "Labels is an action stage that takes data from | |||
| the extracted map and modifies the label set that is sent | |||
| to Loki with the log entry. \n The key is REQUIRED and represents | |||
| the name for the label that will be created. Value is optional | |||
| and will be the name from extracted data to use for the value | |||
| of the label. If the value is not provided, it defaults to | |||
| match the key." | |||
| type: object | |||
| limit: | |||
| description: Limit is a rate-limiting stage that throttles logs | |||
| based on several options. | |||
| properties: | |||
| burst: | |||
| description: The cap in the quantity of burst lines that | |||
| Promtail will push to Loki. | |||
| type: integer | |||
| drop: | |||
| description: "When drop is true, log lines that exceed the | |||
| current rate limit are discarded. When drop is false, | |||
| log lines that exceed the current rate limit wait to enter | |||
| the back pressure mode. \n Defaults to false." | |||
| type: boolean | |||
| rate: | |||
| description: The rate limit in lines per second that Promtail | |||
| will push to Loki. | |||
| type: integer | |||
| type: object | |||
| match: | |||
| description: Match is a filtering stage that conditionally applies | |||
| a set of stages or drop entries when a log entry matches a | |||
| configurable LogQL stream selector and filter expressions. | |||
| properties: | |||
| action: | |||
| description: Determines what action is taken when the selector | |||
| matches the log line. Can be keep or drop. Defaults to | |||
| keep. When set to drop, entries are dropped and no later | |||
| metrics are recorded. Stages must be empty when dropping | |||
| metrics. | |||
| type: string | |||
| dropCounterReason: | |||
| description: Every time a log line is dropped, the metric | |||
| logentry_dropped_lines_total is incremented. A "reason" | |||
| label is added, and can be customized by providing a custom | |||
| value here. Defaults to "match_stage." | |||
| type: string | |||
| pipelineName: | |||
| description: Names the pipeline. When defined, creates an | |||
| additional label in the pipeline_duration_seconds histogram, | |||
| where the value is concatenated with job_name using an | |||
| underscore. | |||
| type: string | |||
| selector: | |||
| description: LogQL stream selector and filter expressions. | |||
| Required. | |||
| type: string | |||
| stages: | |||
| description: "Nested set of pipeline stages to execute when | |||
| action is keep and the log line matches selector. \n An | |||
| example value for stages may be: \n stages: | - json: | |||
| {} - labelAllow: [foo, bar] \n Note that stages is a string | |||
| because SIG API Machinery does not support recursive types, | |||
| and so it cannot be validated for correctness. Be careful | |||
| not to mistype anything." | |||
| type: string | |||
| required: | |||
| - selector | |||
| type: object | |||
| metrics: | |||
| additionalProperties: | |||
| description: MetricsStageSpec is an action stage that allows | |||
| for defining and updating metrics based on data from the | |||
| extracted map. Created metrics are not pushed to Loki or | |||
| Prometheus and are instead exposed via the /metrics endpoint | |||
| of the Grafana Agent pod. The Grafana Agent Operator should | |||
| be configured with a MetricsInstance that discovers the | |||
| logging DaemonSet to collect metrics created by this stage. | |||
| properties: | |||
| action: | |||
| description: "The action to take against the metric. Required. | |||
| \n Must be either \"inc\" or \"add\" for type: counter | |||
| or type: histogram. When type: gauge, must be one of | |||
| \"set\", \"inc\", \"dec\", \"add\", or \"sub\". \n \"add\", | |||
| \"set\", or \"sub\" requires the extracted value to | |||
| be convertible to a positive float." | |||
| type: string | |||
| buckets: | |||
| description: 'Buckets to create. Bucket values must be | |||
| convertible to float64s. Extremely large or small numbers | |||
| are subject to some loss of precision. Only valid for | |||
| type: histogram.' | |||
| items: | |||
| type: string | |||
| type: array | |||
| countEntryBytes: | |||
| description: "If true all log line bytes are counted. | |||
| Can only be set with matchAll: true and action: add. | |||
| \n Only valid for type: counter." | |||
| type: boolean | |||
| description: | |||
| description: Sets the description for the created metric. | |||
| type: string | |||
| matchAll: | |||
| description: "If true, all log lines are counted without | |||
| attempting to match the source to the extracted map. | |||
| Mutually exclusive with value. \n Only valid for type: | |||
| counter." | |||
| type: boolean | |||
| maxIdleDuration: | |||
| description: "Label values on metrics are dynamic which | |||
| can cause exported metrics to go stale. To prevent unbounded | |||
| cardinality, any metrics not updated within MaxIdleDuration | |||
| are removed. \n Must be greater or equal to 1s. Defaults | |||
| to 5m." | |||
| type: string | |||
| prefix: | |||
| description: Sets the custom prefix name for the metric. | |||
| Defaults to "promtail_custom_". | |||
| type: string | |||
| source: | |||
| description: Key from the extracted data map to use for | |||
| the metric. Defaults to the metrics name if not present. | |||
| type: string | |||
| type: | |||
| description: The metric type to create. Must be one of | |||
| counter, gauge, histogram. Required. | |||
| type: string | |||
| value: | |||
| description: Filters down source data and only changes | |||
| the metric if the targeted value matches the provided | |||
| string exactly. If not present, all data matches. | |||
| type: string | |||
| required: | |||
| - action | |||
| - type | |||
| type: object | |||
| description: Metrics is an action stage that supports defining | |||
| and updating metrics based on data from the extracted map. | |||
| Created metrics are not pushed to Loki or Prometheus and are | |||
| instead exposed via the /metrics endpoint of the Grafana Agent | |||
| pod. The Grafana Agent Operator should be configured with | |||
| a MetricsInstance that discovers the logging DaemonSet to | |||
| collect metrics created by this stage. | |||
| type: object | |||
| multiline: | |||
| description: Multiline stage merges multiple lines into a multiline | |||
| block before passing it on to the next stage in the pipeline. | |||
| properties: | |||
| firstLine: | |||
| description: RE2 regular expression. Creates a new multiline | |||
| block when matched. Required. | |||
| type: string | |||
| maxLines: | |||
| description: Maximum number of lines a block can have. A | |||
| new block is started if the number of lines surpasses | |||
| this value. Defaults to 128. | |||
| type: integer | |||
| maxWaitTime: | |||
| description: Maximum time to wait before passing on the | |||
| multiline block to the next stage if no new lines are | |||
| received. Defaults to 3s. | |||
| type: string | |||
| required: | |||
| - firstLine | |||
| type: object | |||
| output: | |||
| description: Output stage is an action stage that takes data | |||
| from the extracted map and changes the log line that will | |||
| be sent to Loki. | |||
| properties: | |||
| source: | |||
| description: Name from extract data to use for the log entry. | |||
| Required. | |||
| type: string | |||
| required: | |||
| - source | |||
| type: object | |||
| pack: | |||
| description: Pack is a transform stage that lets you embed extracted | |||
| values and labels into the log line by packing the log line | |||
| and labels inside of a JSON object. | |||
| properties: | |||
| ingestTimestamp: | |||
| description: If the resulting log line should use any existing | |||
| timestamp or use time.Now() when the line was created. | |||
| Set to true when combining several log streams from different | |||
| containers to avoid out of order errors. | |||
| type: boolean | |||
| labels: | |||
| description: Name from extracted data or line labels. Required. | |||
| Labels provided here are automatically removed from output | |||
| labels. | |||
| items: | |||
| type: string | |||
| type: array | |||
| required: | |||
| - labels | |||
| type: object | |||
| regex: | |||
| description: Regex is a parsing stage that parses a log line | |||
| using a regular expression. Named capture groups in the regex | |||
| allows for adding data into the extracted map. | |||
| properties: | |||
| expression: | |||
| description: RE2 regular expression. Each capture group | |||
| MUST be named. Required. | |||
| type: string | |||
| source: | |||
| description: Name from extracted data to parse. If empty, | |||
| defaults to using the log message. | |||
| type: string | |||
| required: | |||
| - expression | |||
| type: object | |||
| replace: | |||
| description: Replace is a parsing stage that parses a log line | |||
| using a regular expression and replaces the log line. Named | |||
| capture groups in the regex allows for adding data into the | |||
| extracted map. | |||
| properties: | |||
| expression: | |||
| description: RE2 regular expression. Each capture group | |||
| MUST be named. Required. | |||
| type: string | |||
| replace: | |||
| description: Value to replace the captured group with. | |||
| type: string | |||
| source: | |||
| description: Name from extracted data to parse. If empty, | |||
| defaults to using the log message. | |||
| type: string | |||
| required: | |||
| - expression | |||
| type: object | |||
| template: | |||
| description: Template is a transform stage that manipulates | |||
| the values in the extracted map using Go's template syntax. | |||
| properties: | |||
| source: | |||
| description: Name from extracted data to parse. Required. | |||
| If empty, defaults to using the log message. | |||
| type: string | |||
| template: | |||
| description: Go template string to use. Required. In addition | |||
| to normal template functions, ToLower, ToUpper, Replace, | |||
| Trim, TrimLeft, TrimRight, TrimPrefix, and TrimSpace are | |||
| also available. | |||
| type: string | |||
| required: | |||
| - source | |||
| - template | |||
| type: object | |||
| tenant: | |||
| description: Tenant is an action stage that sets the tenant | |||
| ID for the log entry picking it from a field in the extracted | |||
| data map. If the field is missing, the default LogsClientSpec.tenantId | |||
| will be used. | |||
| properties: | |||
| label: | |||
| description: Name from labels whose value should be set | |||
| as tenant ID. Mutually exclusive with source and value. | |||
| type: string | |||
| source: | |||
| description: Name from extracted data to use as the tenant | |||
| ID. Mutually exclusive with label and value. | |||
| type: string | |||
| value: | |||
| description: Value to use for the template ID. Useful when | |||
| this stage is used within a conditional pipeline such | |||
| as match. Mutually exclusive with label and source. | |||
| type: string | |||
| type: object | |||
| timestamp: | |||
| description: Timestamp is an action stage that can change the | |||
| timestamp of a log line before it is sent to Loki. If not | |||
| present, the timestamp of a log line defaults to the time | |||
| when the log line was read. | |||
| properties: | |||
| actionOnFailure: | |||
| description: Action to take when the timestamp can't be | |||
| extracted or parsed. Can be skip or fudge. Defaults to | |||
| fudge. | |||
| type: string | |||
| fallbackFormats: | |||
| description: Fallback formats to try if format fails. | |||
| items: | |||
| type: string | |||
| type: array | |||
| format: | |||
| description: 'Determines format of the time string. Required. | |||
| Can be one of: ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, | |||
| RFC850, RFC1123, RFC1123Z, RFC3339, RFC3339Nano, Unix, | |||
| UnixMs, UnixUs, UnixNs.' | |||
| type: string | |||
| location: | |||
| description: IANA Timezone Database string. | |||
| type: string | |||
| source: | |||
| description: Name from extracted data to use as the timestamp. | |||
| Required. | |||
| type: string | |||
| required: | |||
| - format | |||
| - source | |||
| type: object | |||
| type: object | |||
| type: array | |||
| podTargetLabels: | |||
| description: PodTargetLabels transfers labels on the Kubernetes Pod | |||
| onto the target. | |||
| items: | |||
| type: string | |||
| type: array | |||
| relabelings: | |||
| description: "RelabelConfigs to apply to logs before delivering. Grafana | |||
| Agent Operator automatically adds relabelings for a few standard | |||
| Kubernetes fields and replaces original scrape job name with __tmp_logs_job_name. | |||
| \n More info: https://grafana.com/docs/loki/latest/clients/promtail/configuration/#relabel_configs" | |||
| items: | |||
| description: 'RelabelConfig allows dynamic rewriting of the label | |||
| set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section | |||
| of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' | |||
| properties: | |||
| action: | |||
| default: replace | |||
| description: Action to perform based on regex matching. Default | |||
| is 'replace'. uppercase and lowercase actions require Prometheus | |||
| >= 2.36. | |||
| enum: | |||
| - replace | |||
| - Replace | |||
| - keep | |||
| - Keep | |||
| - drop | |||
| - Drop | |||
| - hashmod | |||
| - HashMod | |||
| - labelmap | |||
| - LabelMap | |||
| - labeldrop | |||
| - LabelDrop | |||
| - labelkeep | |||
| - LabelKeep | |||
| - lowercase | |||
| - Lowercase | |||
| - uppercase | |||
| - Uppercase | |||
| - keepequal | |||
| - KeepEqual | |||
| - dropequal | |||
| - DropEqual | |||
| type: string | |||
| modulus: | |||
| description: Modulus to take of the hash of the source label | |||
| values. | |||
| format: int64 | |||
| type: integer | |||
| regex: | |||
| description: Regular expression against which the extracted | |||
| value is matched. Default is '(.*)' | |||
| type: string | |||
| replacement: | |||
| description: Replacement value against which a regex replace | |||
| is performed if the regular expression matches. Regex capture | |||
| groups are available. Default is '$1' | |||
| type: string | |||
| separator: | |||
| description: Separator placed between concatenated source label | |||
| values. default is ';'. | |||
| type: string | |||
| sourceLabels: | |||
| description: The source labels select values from existing labels. | |||
| Their content is concatenated using the configured separator | |||
| and matched against the configured regular expression for | |||
| the replace, keep, and drop actions. | |||
| items: | |||
| description: LabelName is a valid Prometheus label name which | |||
| may only contain ASCII letters, numbers, as well as underscores. | |||
| pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ | |||
| type: string | |||
| type: array | |||
| targetLabel: | |||
| description: Label to which the resulting value is written in | |||
| a replace action. It is mandatory for replace actions. Regex | |||
| capture groups are available. | |||
| type: string | |||
| type: object | |||
| type: array | |||
| selector: | |||
| description: Selector to select Pod objects. Required. | |||
| properties: | |||
| matchExpressions: | |||
| description: matchExpressions is a list of label selector requirements. | |||
| The requirements are ANDed. | |||
| items: | |||
| description: A label selector requirement is a selector that | |||
| contains values, a key, and an operator that relates the key | |||
| and values. | |||
| properties: | |||
| key: | |||
| description: key is the label key that the selector applies | |||
| to. | |||
| type: string | |||
| operator: | |||
| description: operator represents a key's relationship to | |||
| a set of values. Valid operators are In, NotIn, Exists | |||
| and DoesNotExist. | |||
| type: string | |||
| values: | |||
| description: values is an array of string values. If the | |||
| operator is In or NotIn, the values array must be non-empty. | |||
| If the operator is Exists or DoesNotExist, the values | |||
| array must be empty. This array is replaced during a strategic | |||
| merge patch. | |||
| items: | |||
| type: string | |||
| type: array | |||
| required: | |||
| - key | |||
| - operator | |||
| type: object | |||
| type: array | |||
| matchLabels: | |||
| additionalProperties: | |||
| type: string | |||
| description: matchLabels is a map of {key,value} pairs. A single | |||
| {key,value} in the matchLabels map is equivalent to an element | |||
| of matchExpressions, whose key field is "key", the operator | |||
| is "In", and the values array contains only "value". The requirements | |||
| are ANDed. | |||
| type: object | |||
| type: object | |||
| x-kubernetes-map-type: atomic | |||
| required: | |||
| - selector | |||
| type: object | |||
| type: object | |||
| served: true | |||
| storage: true | |||
| @@ -0,0 +1,67 @@ | |||
| {{/* | |||
| Expand the name of the chart. | |||
| */}} | |||
| {{- define "ga-operator.name" -}} | |||
| {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | |||
| {{- end }} | |||
| {{/* | |||
| Create a default fully qualified app name. | |||
| We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | |||
| If release name contains chart name it will be used as a full name. | |||
| */}} | |||
| {{- define "ga-operator.fullname" -}} | |||
| {{- if .Values.fullnameOverride }} | |||
| {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | |||
| {{- else }} | |||
| {{- $name := default .Chart.Name .Values.nameOverride }} | |||
| {{- if contains $name .Release.Name }} | |||
| {{- .Release.Name | trunc 63 | trimSuffix "-" }} | |||
| {{- else }} | |||
| {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{/* | |||
| Create chart name and version as used by the chart label. | |||
| */}} | |||
| {{- define "ga-operator.chart" -}} | |||
| {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | |||
| {{- end }} | |||
| {{/* | |||
| Common labels | |||
| */}} | |||
| {{- define "ga-operator.labels" -}} | |||
| {{ include "ga-operator.selectorLabels" . }} | |||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | |||
| app.kubernetes.io/component: operator | |||
| helm.sh/chart: {{ include "ga-operator.chart" . }} | |||
| {{- if .Chart.AppVersion }} | |||
| app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | |||
| {{- end }} | |||
| {{- if .Values.customLabels }} | |||
| {{ toYaml .Values.customLabels }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{/* | |||
| Selector labels | |||
| */}} | |||
| {{- define "ga-operator.selectorLabels" -}} | |||
| app.kubernetes.io/name: {{ include "ga-operator.name" . }} | |||
| app.kubernetes.io/instance: {{ .Release.Name }} | |||
| {{- end }} | |||
| {{/* | |||
| Create the name of the service account to use | |||
| */}} | |||
| {{- define "ga-operator.serviceAccountName" -}} | |||
| {{- if .Values.serviceAccount.create }} | |||
| {{- default (include "ga-operator.fullname" .) .Values.serviceAccount.name }} | |||
| {{- else }} | |||
| {{- default "default" .Values.serviceAccount.name }} | |||
| {{- end }} | |||
| {{- end }} | |||
| @@ -0,0 +1,62 @@ | |||
| {{- if .Values.rbac.create -}} | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| kind: ClusterRole | |||
| metadata: | |||
| name: {{ include "ga-operator.fullname" . }} | |||
| labels: | |||
| {{ include "ga-operator.labels" . | indent 4 }} | |||
| rules: | |||
| - apiGroups: [monitoring.grafana.com] | |||
| resources: | |||
| - grafanaagents | |||
| - metricsinstances | |||
| - logsinstances | |||
| - podlogs | |||
| - integrations | |||
| verbs: [get, list, watch] | |||
| - apiGroups: [monitoring.grafana.com] | |||
| resources: | |||
| - grafanaagents/finalizers | |||
| - metricsinstances/finalizers | |||
| - logsinstances/finalizers | |||
| - podlogs/finalizers | |||
| - integrations/finalizers | |||
| verbs: [get, list, watch, update] | |||
| - apiGroups: [monitoring.coreos.com] | |||
| resources: | |||
| - podmonitors | |||
| - probes | |||
| - servicemonitors | |||
| verbs: [get, list, watch] | |||
| - apiGroups: [monitoring.coreos.com] | |||
| resources: | |||
| - podmonitors/finalizers | |||
| - probes/finalizers | |||
| - servicemonitors/finalizers | |||
| verbs: [get, list, watch, update] | |||
| - apiGroups: [""] | |||
| resources: | |||
| - namespaces | |||
| - nodes | |||
| verbs: [get, list, watch] | |||
| - apiGroups: [""] | |||
| resources: | |||
| - secrets | |||
| - services | |||
| - configmaps | |||
| - endpoints | |||
| verbs: [get, list, watch, create, update, patch, delete] | |||
| - apiGroups: ["apps"] | |||
| resources: | |||
| - statefulsets | |||
| - daemonsets | |||
| - deployments | |||
| verbs: [get, list, watch, create, update, patch, delete] | |||
| {{- with .Values.rbac.podSecurityPolicyName }} | |||
| - apiGroups: [policy] | |||
| resources: | |||
| - podsecuritypolicies | |||
| verbs: [use] | |||
| resourceNames: [ {{ . }} ] | |||
| {{- end -}} | |||
| {{- end -}} | |||
| @@ -0,0 +1,17 @@ | |||
| {{- if .Values.rbac.create -}} | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| kind: ClusterRoleBinding | |||
| metadata: | |||
| name: {{ include "ga-operator.fullname" . }} | |||
| labels: | |||
| {{ include "ga-operator.labels" . | indent 4 }} | |||
| roleRef: | |||
| apiGroup: rbac.authorization.k8s.io | |||
| kind: ClusterRole | |||
| name: {{ include "ga-operator.fullname" . }} | |||
| subjects: | |||
| - kind: ServiceAccount | |||
| name: {{ template "ga-operator.serviceAccountName" . }} | |||
| namespace: {{ .Release.Namespace }} | |||
| {{- end -}} | |||
| @@ -0,0 +1,78 @@ | |||
| apiVersion: apps/v1 | |||
| kind: Deployment | |||
| metadata: | |||
| name: {{ include "ga-operator.fullname" . }} | |||
| labels: | |||
| {{ include "ga-operator.labels" . | indent 4 }} | |||
| {{- with .Values.annotations }} | |||
| annotations: | |||
| {{- toYaml . | nindent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| replicas: 1 | |||
| selector: | |||
| matchLabels: | |||
| {{ include "ga-operator.selectorLabels" . | indent 6 }} | |||
| template: | |||
| metadata: | |||
| labels: | |||
| {{ include "ga-operator.selectorLabels" . | indent 8 }} | |||
| {{- with .Values.podLabels }} | |||
| {{- toYaml . | nindent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.podAnnotations }} | |||
| annotations: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| spec: | |||
| {{- with .Values.priorityClassName }} | |||
| priorityClassName: {{ . }} | |||
| {{- end }} | |||
| serviceAccountName: {{ template "ga-operator.serviceAccountName" . }} | |||
| {{- with .Values.podSecurityContext }} | |||
| securityContext: | |||
| {{- toYaml . | nindent 8 }} | |||
| {{- end }} | |||
| containers: | |||
| - name: {{ include "ga-operator.name" . }} | |||
| image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" | |||
| imagePullPolicy: {{ .Values.image.pullPolicy }} | |||
| {{- with .Values.containerSecurityContext }} | |||
| securityContext: | |||
| {{- toYaml . | nindent 10 }} | |||
| {{- end }} | |||
| {{- with .Values.resources }} | |||
| resources: | |||
| {{- toYaml . | nindent 10 }} | |||
| {{- end }} | |||
| {{- if or (and .Values.kubeletService.namespace .Values.kubeletService.serviceName) (.Values.extraArgs) }} | |||
| args: | |||
| {{- if and .Values.kubeletService.namespace .Values.kubeletService.serviceName }} | |||
| - --kubelet-service={{ .Values.kubeletService.namespace }}/{{ .Values.kubeletService.serviceName }} | |||
| {{- end }} | |||
| {{- if .Values.extraArgs }} | |||
| {{- range .Values.extraArgs }} | |||
| - {{ . }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- with .Values.image.pullSecrets }} | |||
| imagePullSecrets: | |||
| {{- toYaml . | nindent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.hostAliases }} | |||
| hostAliases: | |||
| {{- toYaml . | nindent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.nodeSelector }} | |||
| nodeSelector: | |||
| {{- toYaml . | nindent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.tolerations }} | |||
| tolerations: | |||
| {{- toYaml . | nindent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.affinity }} | |||
| affinity: | |||
| {{- toYaml . | nindent 8 }} | |||
| {{- end }} | |||
| @@ -0,0 +1,10 @@ | |||
| {{- if .Values.serviceAccount.create -}} | |||
| apiVersion: v1 | |||
| kind: ServiceAccount | |||
| metadata: | |||
| name: {{ template "ga-operator.serviceAccountName" . }} | |||
| namespace: {{ .Release.Namespace }} | |||
| labels: | |||
| {{ include "ga-operator.labels" . | indent 4 }} | |||
| {{- end -}} | |||
| @@ -0,0 +1,118 @@ | |||
| apiVersion: monitoring.grafana.com/v1alpha1 | |||
| kind: GrafanaAgent | |||
| metadata: | |||
| name: grafana-agent-test | |||
| labels: | |||
| app: grafana-agent-test | |||
| annotations: | |||
| "helm.sh/hook": test | |||
| "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed | |||
| spec: | |||
| image: "{{ .Values.image.registry }}/grafana/agent:{{ .Values.image.tag }}" | |||
| logLevel: info | |||
| serviceAccountName: grafana-agent-test-sa | |||
| metrics: | |||
| instanceSelector: | |||
| matchLabels: | |||
| agent: grafana-agent-test | |||
| --- | |||
| apiVersion: v1 | |||
| kind: ServiceAccount | |||
| metadata: | |||
| name: grafana-agent-test-sa | |||
| annotations: | |||
| "helm.sh/hook": test | |||
| "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed | |||
| --- | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| kind: ClusterRole | |||
| metadata: | |||
| name: grafana-agent-test-cr | |||
| annotations: | |||
| "helm.sh/hook": test | |||
| "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed | |||
| rules: | |||
| - apiGroups: | |||
| - "" | |||
| resources: | |||
| - nodes | |||
| - nodes/proxy | |||
| - nodes/metrics | |||
| - services | |||
| - endpoints | |||
| - pods | |||
| verbs: | |||
| - get | |||
| - list | |||
| - watch | |||
| - apiGroups: | |||
| - networking.k8s.io | |||
| resources: | |||
| - ingresses | |||
| verbs: | |||
| - get | |||
| - list | |||
| - watch | |||
| - nonResourceURLs: | |||
| - /metrics | |||
| - /metrics/cadvisor | |||
| verbs: | |||
| - get | |||
| --- | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
| kind: ClusterRoleBinding | |||
| metadata: | |||
| name: grafana-agent-test-crb | |||
| annotations: | |||
| "helm.sh/hook": test | |||
| "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed | |||
| roleRef: | |||
| apiGroup: rbac.authorization.k8s.io | |||
| kind: ClusterRole | |||
| name: grafana-agent-test-cr | |||
| subjects: | |||
| - kind: ServiceAccount | |||
| name: grafana-agent-test-sa | |||
| namespace: {{ .Release.Namespace }} | |||
| --- | |||
| apiVersion: monitoring.grafana.com/v1alpha1 | |||
| kind: MetricsInstance | |||
| metadata: | |||
| name: primary-test | |||
| annotations: | |||
| "helm.sh/hook": test | |||
| "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed | |||
| labels: | |||
| agent: grafana-agent-test | |||
| spec: {} | |||
| --- | |||
| apiVersion: v1 | |||
| kind: Pod | |||
| metadata: | |||
| name: grafana-agent-test-probe | |||
| annotations: | |||
| "helm.sh/hook": test | |||
| "helm.sh/hook-weight": "1" | |||
| "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed | |||
| spec: | |||
| containers: | |||
| - name: busybox | |||
| image: busybox | |||
| command: ['wget'] | |||
| args: ['grafana-agent-test-operated:8080/-/healthy'] | |||
| # Wait for GrafanaAgent CR | |||
| initContainers: | |||
| - name: sleep | |||
| image: busybox | |||
| command: ['sleep', '60'] | |||
| restartPolicy: Never | |||
| @@ -0,0 +1,71 @@ | |||
| # -- Overrides the chart's name | |||
| nameOverride: "" | |||
| # -- Overrides the chart's computed fullname | |||
| fullnameOverride: "" | |||
| # -- Annotations for the Deployment | |||
| annotations: {} | |||
| # -- Annotations for the Deployment Pods | |||
| podAnnotations: {} | |||
| # -- Annotations for the Deployment Pods | |||
| podLabels: {} | |||
| # -- Pod security context (runAsUser, etc.) | |||
| podSecurityContext: {} | |||
| # -- Container security context (allowPrivilegeEscalation, etc.) | |||
| containerSecurityContext: {} | |||
| rbac: | |||
| # -- Toggle to create ClusterRole and ClusterRoleBinding | |||
| create: true | |||
| # -- Name of a PodSecurityPolicy to use in the ClusterRole. If unset, no PodSecurityPolicy is used. | |||
| podSecurityPolicyName: '' | |||
| serviceAccount: | |||
| # -- Toggle to create ServiceAccount | |||
| create: true | |||
| # -- Service account name | |||
| name: | |||
| image: | |||
| # -- Image registry | |||
| registry: docker.io | |||
| # -- Image repo | |||
| repository: grafana/agent-operator | |||
| # -- Image tag | |||
| tag: v0.39.1 | |||
| # -- Image pull policy | |||
| pullPolicy: IfNotPresent | |||
| # -- Image pull secrets | |||
| pullSecrets: [] | |||
| # -- hostAliases to add | |||
| hostAliases: [] | |||
| # - ip: 1.2.3.4 | |||
| # hostnames: | |||
| # - domain.tld | |||
| # -- If both are set, Agent Operator will create and maintain a service for scraping kubelets | |||
| # https://grafana.com/docs/agent/latest/operator/getting-started/#monitor-kubelets | |||
| kubeletService: | |||
| namespace: default | |||
| serviceName: kubelet | |||
| # -- List of additional cli arguments to configure agent-operator (example: `--log.level`) | |||
| extraArgs: [] | |||
| # -- Resource limits and requests config | |||
| resources: {} | |||
| # -- nodeSelector configuration | |||
| nodeSelector: {} | |||
| # -- Tolerations applied to Pods | |||
| tolerations: [] | |||
| # -- Pod affinity configuration | |||
| affinity: {} | |||
| @@ -0,0 +1,23 @@ | |||
| # Patterns to ignore when building packages. | |||
| # This supports shell glob matching, relative path matching, and | |||
| # negation (prefixed with !). Only one pattern per line. | |||
| .DS_Store | |||
| # Common VCS dirs | |||
| .git/ | |||
| .gitignore | |||
| .bzr/ | |||
| .bzrignore | |||
| .hg/ | |||
| .hgignore | |||
| .svn/ | |||
| # Common backup files | |||
| *.swp | |||
| *.bak | |||
| *.tmp | |||
| *~ | |||
| # Various IDEs | |||
| .project | |||
| .idea/ | |||
| *.tmproj | |||
| # OWNERS file for Kubernetes | |||
| OWNERS | |||
| @@ -0,0 +1,18 @@ | |||
| apiVersion: v1 | |||
| appVersion: RELEASE.2022-09-17T00-09-45Z | |||
| description: Multi-Cloud Object Storage | |||
| home: https://min.io | |||
| icon: https://min.io/resources/img/logo/MINIO_wordmark.png | |||
| keywords: | |||
| - minio | |||
| - storage | |||
| - object-storage | |||
| - s3 | |||
| - cluster | |||
| maintainers: | |||
| - email: dev@minio.io | |||
| name: MinIO, Inc | |||
| name: minio | |||
| sources: | |||
| - https://github.com/minio/minio | |||
| version: 4.0.15 | |||
| @@ -0,0 +1,236 @@ | |||
| # MinIO Helm Chart | |||
| [](https://slack.min.io) [](https://github.com/minio/minio/blob/master/LICENSE) | |||
| MinIO is a High Performance Object Storage released under GNU Affero General Public License v3.0. It is API compatible with Amazon S3 cloud storage service. Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads. | |||
| For more detailed documentation please visit [here](https://docs.minio.io/) | |||
| ## Introduction | |||
| This chart bootstraps MinIO Cluster on [Kubernetes](http://kubernetes.io) using the [Helm](https://helm.sh) package manager. | |||
| ## Prerequisites | |||
| - Helm cli with Kubernetes cluster configured. | |||
| - PV provisioner support in the underlying infrastructure. (We recommend using <https://github.com/minio/direct-csi>) | |||
| - Use Kubernetes version v1.19 and later for best experience. | |||
| ## Configure MinIO Helm repo | |||
| ```bash | |||
| helm repo add minio https://charts.min.io/ | |||
| ``` | |||
| ### Installing the Chart | |||
| Install this chart using: | |||
| ```bash | |||
| helm install --namespace minio --set rootUser=rootuser,rootPassword=rootpass123 --generate-name minio/minio | |||
| ``` | |||
| The command deploys MinIO on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. | |||
| ### Upgrading the Chart | |||
| You can use Helm to update MinIO version in a live release. Assuming your release is named as `my-release`, get the values using the command: | |||
| ```bash | |||
| helm get values my-release > old_values.yaml | |||
| ``` | |||
| Then change the field `image.tag` in `old_values.yaml` file with MinIO image tag you want to use. Now update the chart using | |||
| ```bash | |||
| helm upgrade -f old_values.yaml my-release minio/minio | |||
| ``` | |||
| Default upgrade strategies are specified in the `values.yaml` file. Update these fields if you'd like to use a different strategy. | |||
| ### Configuration | |||
| Refer the [Values file](./values.yaml) for all the possible config fields. | |||
| You can specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, | |||
| ```bash | |||
| helm install --name my-release --set persistence.size=1Ti minio/minio | |||
| ``` | |||
| The above command deploys MinIO server with a 1Ti backing persistent volume. | |||
| Alternately, you can provide a YAML file that specifies parameter values while installing the chart. For example, | |||
| ```bash | |||
| helm install --name my-release -f values.yaml minio/minio | |||
| ``` | |||
| ### Persistence | |||
| This chart provisions a PersistentVolumeClaim and mounts corresponding persistent volume to default location `/export`. You'll need physical storage available in the Kubernetes cluster for this to work. If you'd rather use `emptyDir`, disable PersistentVolumeClaim by: | |||
| ```bash | |||
| helm install --set persistence.enabled=false minio/minio | |||
| ``` | |||
| > *"An emptyDir volume is first created when a Pod is assigned to a Node, and exists as long as that Pod is running on that node. When a Pod is removed from a node for any reason, the data in the emptyDir is deleted forever."* | |||
| ### Existing PersistentVolumeClaim | |||
| If a Persistent Volume Claim already exists, specify it during installation. | |||
| 1. Create the PersistentVolume | |||
| 2. Create the PersistentVolumeClaim | |||
| 3. Install the chart | |||
| ```bash | |||
| helm install --set persistence.existingClaim=PVC_NAME minio/minio | |||
| ``` | |||
| ### NetworkPolicy | |||
| To enable network policy for MinIO, | |||
| install [a networking plugin that implements the Kubernetes | |||
| NetworkPolicy spec](https://kubernetes.io/docs/tasks/administer-cluster/declare-network-policy#before-you-begin), | |||
| and set `networkPolicy.enabled` to `true`. | |||
| For Kubernetes v1.5 & v1.6, you must also turn on NetworkPolicy by setting | |||
| the DefaultDeny namespace annotation. Note: this will enforce policy for *all* pods in the namespace: | |||
| ``` | |||
| kubectl annotate namespace default "net.beta.kubernetes.io/network-policy={\"ingress\":{\"isolation\":\"DefaultDeny\"}}" | |||
| ``` | |||
| With NetworkPolicy enabled, traffic will be limited to just port 9000. | |||
| For more precise policy, set `networkPolicy.allowExternal=true`. This will | |||
| only allow pods with the generated client label to connect to MinIO. | |||
| This label will be displayed in the output of a successful install. | |||
| ### Existing secret | |||
| Instead of having this chart create the secret for you, you can supply a preexisting secret, much | |||
| like an existing PersistentVolumeClaim. | |||
| First, create the secret: | |||
| ```bash | |||
| kubectl create secret generic my-minio-secret --from-literal=rootUser=foobarbaz --from-literal=rootPassword=foobarbazqux | |||
| ``` | |||
| Then install the chart, specifying that you want to use an existing secret: | |||
| ```bash | |||
| helm install --set existingSecret=my-minio-secret minio/minio | |||
| ``` | |||
| The following fields are expected in the secret: | |||
| | .data.\<key\> in Secret | Corresponding variable | Description | Required | | |||
| |:------------------------|:-----------------------|:---------------|:---------| | |||
| | `rootUser` | `rootUser` | Root user. | yes | | |||
| | `rootPassword` | `rootPassword` | Root password. | yes | | |||
| All corresponding variables will be ignored in values file. | |||
| ### Configure TLS | |||
| To enable TLS for MinIO containers, acquire TLS certificates from a CA or create self-signed certificates. While creating / acquiring certificates ensure the corresponding domain names are set as per the standard [DNS naming conventions](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-identity) in a Kubernetes StatefulSet (for a distributed MinIO setup). Then create a secret using | |||
| ```bash | |||
| kubectl create secret generic tls-ssl-minio --from-file=path/to/private.key --from-file=path/to/public.crt | |||
| ``` | |||
| Then install the chart, specifying that you want to use the TLS secret: | |||
| ```bash | |||
| helm install --set tls.enabled=true,tls.certSecret=tls-ssl-minio minio/minio | |||
| ``` | |||
| ### Installing certificates from third party CAs | |||
| MinIO can connect to other servers, including MinIO nodes or other server types such as NATs and Redis. If these servers use certificates that were not registered with a known CA, add trust for these certificates to MinIO Server by bundling these certificates into a Kubernetes secret and providing it to Helm via the `trustedCertsSecret` value. If `.Values.tls.enabled` is `true` and you're installing certificates for third party CAs, remember to include MinIO's own certificate with key `public.crt`, if it also needs to be trusted. | |||
| For instance, given that TLS is enabled and you need to add trust for MinIO's own CA and for the CA of a Keycloak server, a Kubernetes secret can be created from the certificate files using `kubectl`: | |||
| ``` | |||
| kubectl -n minio create secret generic minio-trusted-certs --from-file=public.crt --from-file=keycloak.crt | |||
| ``` | |||
| If TLS is not enabled, you would need only the third party CA: | |||
| ``` | |||
| kubectl -n minio create secret generic minio-trusted-certs --from-file=keycloak.crt | |||
| ``` | |||
| The name of the generated secret can then be passed to Helm using a values file or the `--set` parameter: | |||
| ``` | |||
| trustedCertsSecret: "minio-trusted-certs" | |||
| or | |||
| --set trustedCertsSecret=minio-trusted-certs | |||
| ``` | |||
| ### Create buckets after install | |||
| Install the chart, specifying the buckets you want to create after install: | |||
| ```bash | |||
| helm install --set buckets[0].name=bucket1,buckets[0].policy=none,buckets[0].purge=false minio/minio | |||
| ``` | |||
| Description of the configuration parameters used above - | |||
| - `buckets[].name` - name of the bucket to create, must be a string with length > 0 | |||
| - `buckets[].policy` - can be one of none|download|upload|public | |||
| - `buckets[].purge` - purge if bucket exists already | |||
| ### Create policies after install | |||
| Install the chart, specifying the policies you want to create after install: | |||
| ```bash | |||
| helm install --set policies[0].name=mypolicy,policies[0].statements[0].resources[0]='arn:aws:s3:::bucket1',policies[0].statements[0].actions[0]='s3:ListBucket',policies[0].statements[0].actions[1]='s3:GetObject' minio/minio | |||
| ``` | |||
| Description of the configuration parameters used above - | |||
| - `policies[].name` - name of the policy to create, must be a string with length > 0 | |||
| - `policies[].statements[]` - list of statements, includes actions and resources | |||
| - `policies[].statements[].resources[]` - list of resources that applies the statement | |||
| - `policies[].statements[].actions[]` - list of actions granted | |||
| ### Create user after install | |||
| Install the chart, specifying the users you want to create after install: | |||
| ```bash | |||
| helm install --set users[0].accessKey=accessKey,users[0].secretKey=secretKey,users[0].policy=none,users[1].accessKey=accessKey2,users[1].secretRef=existingSecret,users[1].secretKey=password,users[1].policy=none minio/minio | |||
| ``` | |||
| Description of the configuration parameters used above - | |||
| - `users[].accessKey` - accessKey of user | |||
| - `users[].secretKey` - secretKey of usersecretRef | |||
| - `users[].existingSecret` - secret name that contains the secretKey of user | |||
| - `users[].existingSecretKey` - data key in existingSecret secret containing the secretKey | |||
| - `users[].policy` - name of the policy to assign to user | |||
| ## Uninstalling the Chart | |||
| Assuming your release is named as `my-release`, delete it using the command: | |||
| ```bash | |||
| helm delete my-release | |||
| ``` | |||
| or | |||
| ```bash | |||
| helm uninstall my-release | |||
| ``` | |||
| The command removes all the Kubernetes components associated with the chart and deletes the release. | |||
| @@ -0,0 +1,43 @@ | |||
| {{- if eq .Values.service.type "ClusterIP" "NodePort" }} | |||
| MinIO can be accessed via port {{ .Values.service.port }} on the following DNS name from within your cluster: | |||
| {{ template "minio.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local | |||
| To access MinIO from localhost, run the below commands: | |||
| 1. export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | |||
| 2. kubectl port-forward $POD_NAME 9000 --namespace {{ .Release.Namespace }} | |||
| Read more about port forwarding here: http://kubernetes.io/docs/user-guide/kubectl/kubectl_port-forward/ | |||
| You can now access MinIO server on http://localhost:9000. Follow the below steps to connect to MinIO server with mc client: | |||
| 1. Download the MinIO mc client - https://docs.minio.io/docs/minio-client-quickstart-guide | |||
| 2. export MC_HOST_{{ template "minio.fullname" . }}-local=http://$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "minio.secretName" . }} -o jsonpath="{.data.rootUser}" | base64 --decode):$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "minio.secretName" . }} -o jsonpath="{.data.rootPassword}" | base64 --decode)@localhost:{{ .Values.service.port }} | |||
| 3. mc ls {{ template "minio.fullname" . }}-local | |||
| {{- end }} | |||
| {{- if eq .Values.service.type "LoadBalancer" }} | |||
| MinIO can be accessed via port {{ .Values.service.port }} on an external IP address. Get the service external IP address by: | |||
| kubectl get svc --namespace {{ .Release.Namespace }} -l app={{ template "minio.fullname" . }} | |||
| Note that the public IP may take a couple of minutes to be available. | |||
| You can now access MinIO server on http://<External-IP>:9000. Follow the below steps to connect to MinIO server with mc client: | |||
| 1. Download the MinIO mc client - https://docs.minio.io/docs/minio-client-quickstart-guide | |||
| 2. export MC_HOST_{{ template "minio.fullname" . }}-local=http://$(kubectl get secret {{ template "minio.secretName" . }} --namespace {{ .Release.Namespace }} -o jsonpath="{.data.rootUser}" | base64 --decode):$(kubectl get secret {{ template "minio.secretName" . }} -o jsonpath="{.data.rootPassword}" | base64 --decode)@<External-IP>:{{ .Values.service.port }} | |||
| 3. mc ls {{ template "minio.fullname" . }} | |||
| Alternately, you can use your browser or the MinIO SDK to access the server - https://docs.minio.io/categories/17 | |||
| {{- end }} | |||
| {{ if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }} | |||
| Note: Since NetworkPolicy is enabled, only pods with label | |||
| {{ template "minio.fullname" . }}-client=true" | |||
| will be able to connect to this minio cluster. | |||
| {{- end }} | |||
| @@ -0,0 +1,123 @@ | |||
| #!/bin/sh | |||
| set -e ; # Have script exit in the event of a failed command. | |||
| {{- if .Values.configPathmc }} | |||
| MC_CONFIG_DIR="{{ .Values.configPathmc }}" | |||
| MC="/usr/bin/mc --insecure --config-dir ${MC_CONFIG_DIR}" | |||
| {{- else }} | |||
| MC="/usr/bin/mc --insecure" | |||
| {{- end }} | |||
| # connectToMinio | |||
| # Use a check-sleep-check loop to wait for MinIO service to be available | |||
| connectToMinio() { | |||
| SCHEME=$1 | |||
| ATTEMPTS=0 ; LIMIT=29 ; # Allow 30 attempts | |||
| set -e ; # fail if we can't read the keys. | |||
| ACCESS=$(cat /config/rootUser) ; SECRET=$(cat /config/rootPassword) ; | |||
| set +e ; # The connections to minio are allowed to fail. | |||
| echo "Connecting to MinIO server: $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT" ; | |||
| MC_COMMAND="${MC} alias set myminio $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT $ACCESS $SECRET" ; | |||
| $MC_COMMAND ; | |||
| STATUS=$? ; | |||
| until [ $STATUS = 0 ] | |||
| do | |||
| ATTEMPTS=`expr $ATTEMPTS + 1` ; | |||
| echo \"Failed attempts: $ATTEMPTS\" ; | |||
| if [ $ATTEMPTS -gt $LIMIT ]; then | |||
| exit 1 ; | |||
| fi ; | |||
| sleep 2 ; # 1 second intervals between attempts | |||
| $MC_COMMAND ; | |||
| STATUS=$? ; | |||
| done ; | |||
| set -e ; # reset `e` as active | |||
| return 0 | |||
| } | |||
| # checkBucketExists ($bucket) | |||
| # Check if the bucket exists, by using the exit code of `mc ls` | |||
| checkBucketExists() { | |||
| BUCKET=$1 | |||
| CMD=$(${MC} ls myminio/$BUCKET > /dev/null 2>&1) | |||
| return $? | |||
| } | |||
| # createBucket ($bucket, $policy, $purge) | |||
| # Ensure bucket exists, purging if asked to | |||
| createBucket() { | |||
| BUCKET=$1 | |||
| POLICY=$2 | |||
| PURGE=$3 | |||
| VERSIONING=$4 | |||
| OBJECTLOCKING=$5 | |||
| # Purge the bucket, if set & exists | |||
| # Since PURGE is user input, check explicitly for `true` | |||
| if [ $PURGE = true ]; then | |||
| if checkBucketExists $BUCKET ; then | |||
| echo "Purging bucket '$BUCKET'." | |||
| set +e ; # don't exit if this fails | |||
| ${MC} rm -r --force myminio/$BUCKET | |||
| set -e ; # reset `e` as active | |||
| else | |||
| echo "Bucket '$BUCKET' does not exist, skipping purge." | |||
| fi | |||
| fi | |||
| # Create the bucket if it does not exist and set objectlocking if enabled (NOTE: versioning will be not changed if OBJECTLOCKING is set because it enables versioning to the Buckets created) | |||
| if ! checkBucketExists $BUCKET ; then | |||
| if [ ! -z $OBJECTLOCKING ] ; then | |||
| if [ $OBJECTLOCKING = true ] ; then | |||
| echo "Creating bucket with OBJECTLOCKING '$BUCKET'" | |||
| ${MC} mb --with-lock myminio/$BUCKET | |||
| elif [ $OBJECTLOCKING = false ] ; then | |||
| echo "Creating bucket '$BUCKET'" | |||
| ${MC} mb myminio/$BUCKET | |||
| fi | |||
| elif [ -z $OBJECTLOCKING ] ; then | |||
| echo "Creating bucket '$BUCKET'" | |||
| ${MC} mb myminio/$BUCKET | |||
| else | |||
| echo "Bucket '$BUCKET' already exists." | |||
| fi | |||
| fi | |||
| # set versioning for bucket if objectlocking is disabled or not set | |||
| if [ -z $OBJECTLOCKING ] ; then | |||
| if [ ! -z $VERSIONING ] ; then | |||
| if [ $VERSIONING = true ] ; then | |||
| echo "Enabling versioning for '$BUCKET'" | |||
| ${MC} version enable myminio/$BUCKET | |||
| elif [ $VERSIONING = false ] ; then | |||
| echo "Suspending versioning for '$BUCKET'" | |||
| ${MC} version suspend myminio/$BUCKET | |||
| fi | |||
| fi | |||
| else | |||
| echo "Bucket '$BUCKET' versioning unchanged." | |||
| fi | |||
| # At this point, the bucket should exist, skip checking for existence | |||
| # Set policy on the bucket | |||
| echo "Setting policy of bucket '$BUCKET' to '$POLICY'." | |||
| ${MC} policy set $POLICY myminio/$BUCKET | |||
| } | |||
| # Try connecting to MinIO instance | |||
| {{- if .Values.tls.enabled }} | |||
| scheme=https | |||
| {{- else }} | |||
| scheme=http | |||
| {{- end }} | |||
| connectToMinio $scheme | |||
| {{ if .Values.buckets }} | |||
| {{ $global := . }} | |||
| # Create the buckets | |||
| {{- range .Values.buckets }} | |||
| createBucket {{ tpl .name $global }} {{ .policy }} {{ .purge }} {{ .versioning }} {{ .objectlocking }} | |||
| {{- end }} | |||
| {{- end }} | |||
| @@ -0,0 +1,75 @@ | |||
| #!/bin/sh | |||
| set -e ; # Have script exit in the event of a failed command. | |||
| {{- if .Values.configPathmc }} | |||
| MC_CONFIG_DIR="{{ .Values.configPathmc }}" | |||
| MC="/usr/bin/mc --insecure --config-dir ${MC_CONFIG_DIR}" | |||
| {{- else }} | |||
| MC="/usr/bin/mc --insecure" | |||
| {{- end }} | |||
| # connectToMinio | |||
| # Use a check-sleep-check loop to wait for MinIO service to be available | |||
| connectToMinio() { | |||
| SCHEME=$1 | |||
| ATTEMPTS=0 ; LIMIT=29 ; # Allow 30 attempts | |||
| set -e ; # fail if we can't read the keys. | |||
| ACCESS=$(cat /config/rootUser) ; SECRET=$(cat /config/rootPassword) ; | |||
| set +e ; # The connections to minio are allowed to fail. | |||
| echo "Connecting to MinIO server: $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT" ; | |||
| MC_COMMAND="${MC} alias set myminio $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT $ACCESS $SECRET" ; | |||
| $MC_COMMAND ; | |||
| STATUS=$? ; | |||
| until [ $STATUS = 0 ] | |||
| do | |||
| ATTEMPTS=`expr $ATTEMPTS + 1` ; | |||
| echo \"Failed attempts: $ATTEMPTS\" ; | |||
| if [ $ATTEMPTS -gt $LIMIT ]; then | |||
| exit 1 ; | |||
| fi ; | |||
| sleep 2 ; # 1 second intervals between attempts | |||
| $MC_COMMAND ; | |||
| STATUS=$? ; | |||
| done ; | |||
| set -e ; # reset `e` as active | |||
| return 0 | |||
| } | |||
| # checkPolicyExists ($policy) | |||
| # Check if the policy exists, by using the exit code of `mc admin policy info` | |||
| checkPolicyExists() { | |||
| POLICY=$1 | |||
| CMD=$(${MC} admin policy info myminio $POLICY > /dev/null 2>&1) | |||
| return $? | |||
| } | |||
| # createPolicy($name, $filename) | |||
| createPolicy () { | |||
| NAME=$1 | |||
| FILENAME=$2 | |||
| # Create the name if it does not exist | |||
| echo "Checking policy: $NAME (in /config/$FILENAME.json)" | |||
| if ! checkPolicyExists $NAME ; then | |||
| echo "Creating policy '$NAME'" | |||
| else | |||
| echo "Policy '$NAME' already exists." | |||
| fi | |||
| ${MC} admin policy add myminio $NAME /config/$FILENAME.json | |||
| } | |||
| # Try connecting to MinIO instance | |||
| {{- if .Values.tls.enabled }} | |||
| scheme=https | |||
| {{- else }} | |||
| scheme=http | |||
| {{- end }} | |||
| connectToMinio $scheme | |||
| {{ if .Values.policies }} | |||
| # Create the policies | |||
| {{- range $idx, $policy := .Values.policies }} | |||
| createPolicy {{ $policy.name }} policy_{{ $idx }} | |||
| {{- end }} | |||
| {{- end }} | |||
| @@ -0,0 +1,105 @@ | |||
| #!/bin/sh | |||
| set -e ; # Have script exit in the event of a failed command. | |||
| {{- if .Values.configPathmc }} | |||
| MC_CONFIG_DIR="{{ .Values.configPathmc }}" | |||
| MC="/usr/bin/mc --insecure --config-dir ${MC_CONFIG_DIR}" | |||
| {{- else }} | |||
| MC="/usr/bin/mc --insecure" | |||
| {{- end }} | |||
| # AccessKey and secretkey credentials file are added to prevent shell execution errors caused by special characters. | |||
| # Special characters for example : ',",<,>,{,} | |||
| MINIO_ACCESSKEY_SECRETKEY_TMP="/tmp/accessKey_and_secretKey_tmp" | |||
| # connectToMinio | |||
| # Use a check-sleep-check loop to wait for MinIO service to be available | |||
| connectToMinio() { | |||
| SCHEME=$1 | |||
| ATTEMPTS=0 ; LIMIT=29 ; # Allow 30 attempts | |||
| set -e ; # fail if we can't read the keys. | |||
| ACCESS=$(cat /config/rootUser) ; SECRET=$(cat /config/rootPassword) ; | |||
| set +e ; # The connections to minio are allowed to fail. | |||
| echo "Connecting to MinIO server: $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT" ; | |||
| MC_COMMAND="${MC} alias set myminio $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT $ACCESS $SECRET" ; | |||
| $MC_COMMAND ; | |||
| STATUS=$? ; | |||
| until [ $STATUS = 0 ] | |||
| do | |||
| ATTEMPTS=`expr $ATTEMPTS + 1` ; | |||
| echo \"Failed attempts: $ATTEMPTS\" ; | |||
| if [ $ATTEMPTS -gt $LIMIT ]; then | |||
| exit 1 ; | |||
| fi ; | |||
| sleep 2 ; # 1 second intervals between attempts | |||
| $MC_COMMAND ; | |||
| STATUS=$? ; | |||
| done ; | |||
| set -e ; # reset `e` as active | |||
| return 0 | |||
| } | |||
| # checkUserExists () | |||
| # Check if the user exists, by using the exit code of `mc admin user info` | |||
| checkUserExists() { | |||
| CMD=$(${MC} admin user info myminio $(head -1 $MINIO_ACCESSKEY_SECRETKEY_TMP) > /dev/null 2>&1) | |||
| return $? | |||
| } | |||
| # createUser ($policy) | |||
| createUser() { | |||
| POLICY=$1 | |||
| #check accessKey_and_secretKey_tmp file | |||
| if [[ ! -f $MINIO_ACCESSKEY_SECRETKEY_TMP ]];then | |||
| echo "credentials file does not exist" | |||
| return 1 | |||
| fi | |||
| if [[ $(cat $MINIO_ACCESSKEY_SECRETKEY_TMP|wc -l) -ne 2 ]];then | |||
| echo "credentials file is invalid" | |||
| rm -f $MINIO_ACCESSKEY_SECRETKEY_TMP | |||
| return 1 | |||
| fi | |||
| USER=$(head -1 $MINIO_ACCESSKEY_SECRETKEY_TMP) | |||
| # Create the user if it does not exist | |||
| if ! checkUserExists ; then | |||
| echo "Creating user '$USER'" | |||
| cat $MINIO_ACCESSKEY_SECRETKEY_TMP | ${MC} admin user add myminio | |||
| else | |||
| echo "User '$USER' already exists." | |||
| fi | |||
| #clean up credentials files. | |||
| rm -f $MINIO_ACCESSKEY_SECRETKEY_TMP | |||
| # set policy for user | |||
| if [ ! -z $POLICY -a $POLICY != " " ] ; then | |||
| echo "Adding policy '$POLICY' for '$USER'" | |||
| ${MC} admin policy set myminio $POLICY user=$USER | |||
| else | |||
| echo "User '$USER' has no policy attached." | |||
| fi | |||
| } | |||
| # Try connecting to MinIO instance | |||
| {{- if .Values.tls.enabled }} | |||
| scheme=https | |||
| {{- else }} | |||
| scheme=http | |||
| {{- end }} | |||
| connectToMinio $scheme | |||
| {{ if .Values.users }} | |||
| {{ $global := . }} | |||
| # Create the users | |||
| {{- range .Values.users }} | |||
| echo {{ tpl .accessKey $global }} > $MINIO_ACCESSKEY_SECRETKEY_TMP | |||
| {{- if .existingSecret }} | |||
| cat /config/secrets/{{ tpl .existingSecretKey $global }} >> $MINIO_ACCESSKEY_SECRETKEY_TMP | |||
| # Add a new line if it doesn't exist | |||
| sed -i '$a\' $MINIO_ACCESSKEY_SECRETKEY_TMP | |||
| createUser {{ .policy }} | |||
| {{ else }} | |||
| echo {{ .secretKey }} >> $MINIO_ACCESSKEY_SECRETKEY_TMP | |||
| createUser {{ .policy }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- end }} | |||
| @@ -0,0 +1,58 @@ | |||
| #!/bin/sh | |||
| set -e ; # Have script exit in the event of a failed command. | |||
| {{- if .Values.configPathmc }} | |||
| MC_CONFIG_DIR="{{ .Values.configPathmc }}" | |||
| MC="/usr/bin/mc --insecure --config-dir ${MC_CONFIG_DIR}" | |||
| {{- else }} | |||
| MC="/usr/bin/mc --insecure" | |||
| {{- end }} | |||
| # connectToMinio | |||
| # Use a check-sleep-check loop to wait for MinIO service to be available | |||
| connectToMinio() { | |||
| SCHEME=$1 | |||
| ATTEMPTS=0 ; LIMIT=29 ; # Allow 30 attempts | |||
| set -e ; # fail if we can't read the keys. | |||
| ACCESS=$(cat /config/rootUser) ; SECRET=$(cat /config/rootPassword) ; | |||
| set +e ; # The connections to minio are allowed to fail. | |||
| echo "Connecting to MinIO server: $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT" ; | |||
| MC_COMMAND="${MC} alias set myminio $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT $ACCESS $SECRET" ; | |||
| $MC_COMMAND ; | |||
| STATUS=$? ; | |||
| until [ $STATUS = 0 ] | |||
| do | |||
| ATTEMPTS=`expr $ATTEMPTS + 1` ; | |||
| echo \"Failed attempts: $ATTEMPTS\" ; | |||
| if [ $ATTEMPTS -gt $LIMIT ]; then | |||
| exit 1 ; | |||
| fi ; | |||
| sleep 2 ; # 1 second intervals between attempts | |||
| $MC_COMMAND ; | |||
| STATUS=$? ; | |||
| done ; | |||
| set -e ; # reset `e` as active | |||
| return 0 | |||
| } | |||
| # runCommand ($@) | |||
| # Run custom mc command | |||
| runCommand() { | |||
| ${MC} "$@" | |||
| return $? | |||
| } | |||
| # Try connecting to MinIO instance | |||
| {{- if .Values.tls.enabled }} | |||
| scheme=https | |||
| {{- else }} | |||
| scheme=http | |||
| {{- end }} | |||
| connectToMinio $scheme | |||
| {{ if .Values.customCommands }} | |||
| # Run custom commands | |||
| {{- range .Values.customCommands }} | |||
| runCommand {{ .command }} | |||
| {{- end }} | |||
| {{- end }} | |||
| @@ -0,0 +1,28 @@ | |||
| {{- $statements_length := len .statements -}} | |||
| {{- $statements_length := sub $statements_length 1 -}} | |||
| { | |||
| "Version": "2012-10-17", | |||
| "Statement": [ | |||
| {{- range $i, $statement := .statements }} | |||
| { | |||
| "Effect": "Allow", | |||
| "Action": [ | |||
| "{{ $statement.actions | join "\",\n\"" }}" | |||
| ]{{ if $statement.resources }}, | |||
| "Resource": [ | |||
| "{{ $statement.resources | join "\",\n\"" }}" | |||
| ]{{ end }} | |||
| {{- if $statement.conditions }} | |||
| {{- $condition_len := len $statement.conditions }} | |||
| {{- $condition_len := sub $condition_len 1 }} | |||
| , | |||
| "Condition": { | |||
| {{- range $k,$v := $statement.conditions }} | |||
| {{- range $operator,$object := $v }} | |||
| "{{ $operator }}": { {{ $object }} }{{- if lt $k $condition_len }},{{- end }} | |||
| {{- end }}{{- end }} | |||
| }{{- end }} | |||
| }{{ if lt $i $statements_length }},{{end }} | |||
| {{- end }} | |||
| ] | |||
| } | |||
| @@ -0,0 +1,218 @@ | |||
| {{/* vim: set filetype=mustache: */}} | |||
| {{/* | |||
| Expand the name of the chart. | |||
| */}} | |||
| {{- define "minio.name" -}} | |||
| {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | |||
| {{- end -}} | |||
| {{/* | |||
| Create a default fully qualified app name. | |||
| We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | |||
| If release name contains chart name it will be used as a full name. | |||
| */}} | |||
| {{- define "minio.fullname" -}} | |||
| {{- if .Values.fullnameOverride -}} | |||
| {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | |||
| {{- else -}} | |||
| {{- $name := default .Chart.Name .Values.nameOverride -}} | |||
| {{- if contains $name .Release.Name -}} | |||
| {{- .Release.Name | trunc 63 | trimSuffix "-" -}} | |||
| {{- else -}} | |||
| {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | |||
| {{- end -}} | |||
| {{- end -}} | |||
| {{- end -}} | |||
| {{/* | |||
| Create chart name and version as used by the chart label. | |||
| */}} | |||
| {{- define "minio.chart" -}} | |||
| {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | |||
| {{- end -}} | |||
| {{/* | |||
| Return the appropriate apiVersion for networkpolicy. | |||
| */}} | |||
| {{- define "minio.networkPolicy.apiVersion" -}} | |||
| {{- if semverCompare ">=1.4-0, <1.7-0" .Capabilities.KubeVersion.Version -}} | |||
| {{- print "extensions/v1beta1" -}} | |||
| {{- else if semverCompare ">=1.7-0, <1.16-0" .Capabilities.KubeVersion.Version -}} | |||
| {{- print "networking.k8s.io/v1beta1" -}} | |||
| {{- else if semverCompare "^1.16-0" .Capabilities.KubeVersion.Version -}} | |||
| {{- print "networking.k8s.io/v1" -}} | |||
| {{- end -}} | |||
| {{- end -}} | |||
| {{/* | |||
| Return the appropriate apiVersion for deployment. | |||
| */}} | |||
| {{- define "minio.deployment.apiVersion" -}} | |||
| {{- if semverCompare "<1.9-0" .Capabilities.KubeVersion.Version -}} | |||
| {{- print "apps/v1beta2" -}} | |||
| {{- else -}} | |||
| {{- print "apps/v1" -}} | |||
| {{- end -}} | |||
| {{- end -}} | |||
| {{/* | |||
| Return the appropriate apiVersion for statefulset. | |||
| */}} | |||
| {{- define "minio.statefulset.apiVersion" -}} | |||
| {{- if semverCompare "<1.16-0" .Capabilities.KubeVersion.Version -}} | |||
| {{- print "apps/v1beta2" -}} | |||
| {{- else -}} | |||
| {{- print "apps/v1" -}} | |||
| {{- end -}} | |||
| {{- end -}} | |||
| {{/* | |||
| Return the appropriate apiVersion for ingress. | |||
| */}} | |||
| {{- define "minio.ingress.apiVersion" -}} | |||
| {{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} | |||
| {{- print "extensions/v1beta1" -}} | |||
| {{- else if semverCompare "<1.19-0" .Capabilities.KubeVersion.GitVersion -}} | |||
| {{- print "networking.k8s.io/v1beta1" -}} | |||
| {{- else -}} | |||
| {{- print "networking.k8s.io/v1" -}} | |||
| {{- end -}} | |||
| {{- end -}} | |||
| {{/* | |||
| Return the appropriate apiVersion for console ingress. | |||
| */}} | |||
| {{- define "minio.consoleIngress.apiVersion" -}} | |||
| {{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} | |||
| {{- print "extensions/v1beta1" -}} | |||
| {{- else if semverCompare "<1.19-0" .Capabilities.KubeVersion.GitVersion -}} | |||
| {{- print "networking.k8s.io/v1beta1" -}} | |||
| {{- else -}} | |||
| {{- print "networking.k8s.io/v1" -}} | |||
| {{- end -}} | |||
| {{- end -}} | |||
| {{/* | |||
| Determine secret name. | |||
| */}} | |||
| {{- define "minio.secretName" -}} | |||
| {{- if .Values.existingSecret -}} | |||
| {{- .Values.existingSecret }} | |||
| {{- else -}} | |||
| {{- include "minio.fullname" . -}} | |||
| {{- end -}} | |||
| {{- end -}} | |||
| {{/* | |||
| Determine name for scc role and rolebinding | |||
| */}} | |||
| {{- define "minio.sccRoleName" -}} | |||
| {{- printf "%s-%s" "scc" (include "minio.fullname" .) | trunc 63 | trimSuffix "-" -}} | |||
| {{- end -}} | |||
| {{/* | |||
| Properly format optional additional arguments to MinIO binary | |||
| */}} | |||
| {{- define "minio.extraArgs" -}} | |||
| {{- range .Values.extraArgs -}} | |||
| {{ " " }}{{ . }} | |||
| {{- end -}} | |||
| {{- end -}} | |||
| {{/* | |||
| Return the proper Docker Image Registry Secret Names | |||
| */}} | |||
| {{- define "minio.imagePullSecrets" -}} | |||
| {{/* | |||
| Helm 2.11 supports the assignment of a value to a variable defined in a different scope, | |||
| but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic. | |||
| Also, we can not use a single if because lazy evaluation is not an option | |||
| */}} | |||
| {{- if .Values.global }} | |||
| {{- if .Values.global.imagePullSecrets }} | |||
| imagePullSecrets: | |||
| {{- range .Values.global.imagePullSecrets }} | |||
| - name: {{ . }} | |||
| {{- end }} | |||
| {{- else if .Values.imagePullSecrets }} | |||
| imagePullSecrets: | |||
| {{ toYaml .Values.imagePullSecrets }} | |||
| {{- end -}} | |||
| {{- else if .Values.imagePullSecrets }} | |||
| imagePullSecrets: | |||
| {{ toYaml .Values.imagePullSecrets }} | |||
| {{- end -}} | |||
| {{- end -}} | |||
| {{/* | |||
| Formats volumeMount for MinIO TLS keys and trusted certs | |||
| */}} | |||
| {{- define "minio.tlsKeysVolumeMount" -}} | |||
| {{- if .Values.tls.enabled }} | |||
| - name: cert-secret-volume | |||
| mountPath: {{ .Values.certsPath }} | |||
| {{- end }} | |||
| {{- if or .Values.tls.enabled (ne .Values.trustedCertsSecret "") }} | |||
| {{- $casPath := printf "%s/CAs" .Values.certsPath | clean }} | |||
| - name: trusted-cert-secret-volume | |||
| mountPath: {{ $casPath }} | |||
| {{- end }} | |||
| {{- end -}} | |||
| {{/* | |||
| Formats volume for MinIO TLS keys and trusted certs | |||
| */}} | |||
| {{- define "minio.tlsKeysVolume" -}} | |||
| {{- if .Values.tls.enabled }} | |||
| - name: cert-secret-volume | |||
| secret: | |||
| secretName: {{ .Values.tls.certSecret }} | |||
| items: | |||
| - key: {{ .Values.tls.publicCrt }} | |||
| path: public.crt | |||
| - key: {{ .Values.tls.privateKey }} | |||
| path: private.key | |||
| {{- end }} | |||
| {{- if or .Values.tls.enabled (ne .Values.trustedCertsSecret "") }} | |||
| {{- $certSecret := eq .Values.trustedCertsSecret "" | ternary .Values.tls.certSecret .Values.trustedCertsSecret }} | |||
| {{- $publicCrt := eq .Values.trustedCertsSecret "" | ternary .Values.tls.publicCrt "" }} | |||
| - name: trusted-cert-secret-volume | |||
| secret: | |||
| secretName: {{ $certSecret }} | |||
| {{- if ne $publicCrt "" }} | |||
| items: | |||
| - key: {{ $publicCrt }} | |||
| path: public.crt | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- end -}} | |||
| {{/* | |||
| Returns the available value for certain key in an existing secret (if it exists), | |||
| otherwise it generates a random value. | |||
| */}} | |||
| {{- define "minio.getValueFromSecret" }} | |||
| {{- $len := (default 16 .Length) | int -}} | |||
| {{- $obj := (lookup "v1" "Secret" .Namespace .Name).data -}} | |||
| {{- if $obj }} | |||
| {{- index $obj .Key | b64dec -}} | |||
| {{- else -}} | |||
| {{- randAlphaNum $len -}} | |||
| {{- end -}} | |||
| {{- end }} | |||
| {{- define "minio.root.username" -}} | |||
| {{- if .Values.rootUser }} | |||
| {{- .Values.rootUser | toString }} | |||
| {{- else }} | |||
| {{- include "minio.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "minio.fullname" .) "Length" 20 "Key" "rootUser") }} | |||
| {{- end }} | |||
| {{- end -}} | |||
| {{- define "minio.root.password" -}} | |||
| {{- if .Values.rootPassword }} | |||
| {{- .Values.rootPassword | toString }} | |||
| {{- else }} | |||
| {{- include "minio.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "minio.fullname" .) "Length" 40 "Key" "rootPassword") }} | |||
| {{- end }} | |||
| {{- end -}} | |||
| @@ -0,0 +1,24 @@ | |||
| apiVersion: v1 | |||
| kind: ConfigMap | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }} | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| data: | |||
| initialize: |- | |||
| {{ include (print $.Template.BasePath "/_helper_create_bucket.txt") . | indent 4 }} | |||
| add-user: |- | |||
| {{ include (print $.Template.BasePath "/_helper_create_user.txt") . | indent 4 }} | |||
| add-policy: |- | |||
| {{ include (print $.Template.BasePath "/_helper_create_policy.txt") . | indent 4 }} | |||
| {{- range $idx, $policy := .Values.policies }} | |||
| # {{ $policy.name }} | |||
| policy_{{ $idx }}.json: |- | |||
| {{ include (print $.Template.BasePath "/_helper_policy.tpl") . | indent 4 }} | |||
| {{ end }} | |||
| custom-command: |- | |||
| {{ include (print $.Template.BasePath "/_helper_custom_command.txt") . | indent 4 }} | |||
| @@ -0,0 +1,58 @@ | |||
| {{- if .Values.consoleIngress.enabled -}} | |||
| {{- $fullName := printf "%s-console" (include "minio.fullname" .) -}} | |||
| {{- $servicePort := .Values.consoleService.port -}} | |||
| {{- $ingressPath := .Values.consoleIngress.path -}} | |||
| apiVersion: {{ template "minio.consoleIngress.apiVersion" . }} | |||
| kind: Ingress | |||
| metadata: | |||
| name: {{ $fullName }} | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| {{- with .Values.consoleIngress.labels }} | |||
| {{ toYaml . | indent 4 }} | |||
| {{- end }} | |||
| {{- with .Values.consoleIngress.annotations }} | |||
| annotations: | |||
| {{ toYaml . | indent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| {{- if .Values.consoleIngress.ingressClassName }} | |||
| ingressClassName: {{ .Values.consoleIngress.ingressClassName }} | |||
| {{- end }} | |||
| {{- if .Values.consoleIngress.tls }} | |||
| tls: | |||
| {{- range .Values.consoleIngress.tls }} | |||
| - hosts: | |||
| {{- range .hosts }} | |||
| - {{ . | quote }} | |||
| {{- end }} | |||
| secretName: {{ .secretName }} | |||
| {{- end }} | |||
| {{- end }} | |||
| rules: | |||
| {{- range .Values.consoleIngress.hosts }} | |||
| - http: | |||
| paths: | |||
| - path: {{ $ingressPath }} | |||
| {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} | |||
| pathType: Prefix | |||
| backend: | |||
| service: | |||
| name: {{ $fullName }} | |||
| port: | |||
| number: {{ $servicePort }} | |||
| {{- else }} | |||
| backend: | |||
| serviceName: {{ $fullName }} | |||
| servicePort: {{ $servicePort }} | |||
| {{- end }} | |||
| {{- if . }} | |||
| host: {{ . | quote }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- end }} | |||
| @@ -0,0 +1,48 @@ | |||
| {{ $scheme := "http" }} | |||
| {{- if .Values.tls.enabled }} | |||
| {{ $scheme = "https" }} | |||
| {{ end }} | |||
| apiVersion: v1 | |||
| kind: Service | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }}-console | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| {{- if .Values.consoleService.annotations }} | |||
| annotations: | |||
| {{ toYaml .Values.consoleService.annotations | indent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| {{- if (or (eq .Values.consoleService.type "ClusterIP" "") (empty .Values.consoleService.type)) }} | |||
| type: ClusterIP | |||
| {{- if not (empty .Values.consoleService.clusterIP) }} | |||
| clusterIP: {{ .Values.consoleService.clusterIP }} | |||
| {{end}} | |||
| {{- else if eq .Values.consoleService.type "LoadBalancer" }} | |||
| type: {{ .Values.consoleService.type }} | |||
| loadBalancerIP: {{ default "" .Values.consoleService.loadBalancerIP }} | |||
| {{- else }} | |||
| type: {{ .Values.consoleService.type }} | |||
| {{- end }} | |||
| ports: | |||
| - name: {{ $scheme }} | |||
| port: {{ .Values.consoleService.port }} | |||
| protocol: TCP | |||
| {{- if (and (eq .Values.consoleService.type "NodePort") ( .Values.consoleService.nodePort)) }} | |||
| nodePort: {{ .Values.consoleService.nodePort }} | |||
| {{- else }} | |||
| targetPort: {{ .Values.minioConsolePort }} | |||
| {{- end}} | |||
| {{- if .Values.consoleService.externalIPs }} | |||
| externalIPs: | |||
| {{- range $i , $ip := .Values.consoleService.externalIPs }} | |||
| - {{ $ip }} | |||
| {{- end }} | |||
| {{- end }} | |||
| selector: | |||
| app: {{ template "minio.name" . }} | |||
| release: {{ .Release.Name }} | |||
| @@ -0,0 +1,199 @@ | |||
| {{- if eq .Values.mode "standalone" }} | |||
| {{ $scheme := "http" }} | |||
| {{- if .Values.tls.enabled }} | |||
| {{ $scheme = "https" }} | |||
| {{ end }} | |||
| {{ $bucketRoot := or ($.Values.bucketRoot) ($.Values.mountPath) }} | |||
| apiVersion: {{ template "minio.deployment.apiVersion" . }} | |||
| kind: Deployment | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }} | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| {{- if .Values.additionalLabels }} | |||
| {{ toYaml .Values.additionalLabels | trimSuffix "\n" | indent 4 }} | |||
| {{- end }} | |||
| {{- if .Values.additionalAnnotations }} | |||
| annotations: | |||
| {{ toYaml .Values.additionalAnnotations | trimSuffix "\n" | indent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| strategy: | |||
| type: {{ .Values.DeploymentUpdate.type }} | |||
| {{- if eq .Values.DeploymentUpdate.type "RollingUpdate" }} | |||
| rollingUpdate: | |||
| maxSurge: {{ .Values.DeploymentUpdate.maxSurge }} | |||
| maxUnavailable: {{ .Values.DeploymentUpdate.maxUnavailable }} | |||
| {{- end}} | |||
| replicas: 1 | |||
| selector: | |||
| matchLabels: | |||
| app: {{ template "minio.name" . }} | |||
| release: {{ .Release.Name }} | |||
| template: | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| release: {{ .Release.Name }} | |||
| {{- if .Values.podLabels }} | |||
| {{ toYaml .Values.podLabels | indent 8 }} | |||
| {{- end }} | |||
| annotations: | |||
| {{- if not .Values.ignoreChartChecksums }} | |||
| checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} | |||
| checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} | |||
| {{- end }} | |||
| {{- if .Values.podAnnotations }} | |||
| {{ toYaml .Values.podAnnotations | trimSuffix "\n" | indent 8 }} | |||
| {{- end }} | |||
| spec: | |||
| {{- if .Values.priorityClassName }} | |||
| priorityClassName: "{{ .Values.priorityClassName }}" | |||
| {{- end }} | |||
| {{- if .Values.runtimeClassName }} | |||
| runtimeClassName: "{{ .Values.runtimeClassName }}" | |||
| {{- end }} | |||
| {{- if and .Values.securityContext.enabled .Values.persistence.enabled }} | |||
| securityContext: | |||
| runAsUser: {{ .Values.securityContext.runAsUser }} | |||
| runAsGroup: {{ .Values.securityContext.runAsGroup }} | |||
| fsGroup: {{ .Values.securityContext.fsGroup }} | |||
| {{- if and (ge .Capabilities.KubeVersion.Major "1") (ge .Capabilities.KubeVersion.Minor "20") }} | |||
| fsGroupChangePolicy: {{ .Values.securityContext.fsGroupChangePolicy }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{ if .Values.serviceAccount.create }} | |||
| serviceAccountName: {{ .Values.serviceAccount.name }} | |||
| {{- end }} | |||
| containers: | |||
| - name: {{ .Chart.Name }} | |||
| image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | |||
| imagePullPolicy: {{ .Values.image.pullPolicy }} | |||
| command: | |||
| - "/bin/sh" | |||
| - "-ce" | |||
| - "/usr/bin/docker-entrypoint.sh minio server {{ $bucketRoot }} -S {{ .Values.certsPath }} --address :{{ .Values.minioAPIPort }} --console-address :{{ .Values.minioConsolePort }} {{- template "minio.extraArgs" . }}" | |||
| volumeMounts: | |||
| - name: minio-user | |||
| mountPath: "/tmp/credentials" | |||
| readOnly: true | |||
| - name: export | |||
| mountPath: {{ .Values.mountPath }} | |||
| {{- if and .Values.persistence.enabled .Values.persistence.subPath }} | |||
| subPath: "{{ .Values.persistence.subPath }}" | |||
| {{- end }} | |||
| {{- if .Values.extraSecret }} | |||
| - name: extra-secret | |||
| mountPath: "/tmp/minio-config-env" | |||
| {{- end }} | |||
| {{- include "minio.tlsKeysVolumeMount" . | indent 12 }} | |||
| {{- if .Values.extraVolumeMounts }} | |||
| {{- toYaml .Values.extraVolumeMounts | nindent 12 }} | |||
| {{- end }} | |||
| ports: | |||
| - name: {{ $scheme }} | |||
| containerPort: {{ .Values.minioAPIPort }} | |||
| - name: {{ $scheme }}-console | |||
| containerPort: {{ .Values.minioConsolePort }} | |||
| env: | |||
| - name: MINIO_ROOT_USER | |||
| valueFrom: | |||
| secretKeyRef: | |||
| name: {{ template "minio.secretName" . }} | |||
| key: rootUser | |||
| - name: MINIO_ROOT_PASSWORD | |||
| valueFrom: | |||
| secretKeyRef: | |||
| name: {{ template "minio.secretName" . }} | |||
| key: rootPassword | |||
| {{- if .Values.extraSecret }} | |||
| - name: MINIO_CONFIG_ENV_FILE | |||
| value: "/tmp/minio-config-env/config.env" | |||
| {{- end}} | |||
| {{- if .Values.metrics.serviceMonitor.public }} | |||
| - name: MINIO_PROMETHEUS_AUTH_TYPE | |||
| value: "public" | |||
| {{- end}} | |||
| {{- if .Values.oidc.enabled }} | |||
| - name: MINIO_IDENTITY_OPENID_CONFIG_URL | |||
| value: {{ .Values.oidc.configUrl }} | |||
| - name: MINIO_IDENTITY_OPENID_CLIENT_ID | |||
| value: {{ .Values.oidc.clientId }} | |||
| - name: MINIO_IDENTITY_OPENID_CLIENT_SECRET | |||
| value: {{ .Values.oidc.clientSecret }} | |||
| - name: MINIO_IDENTITY_OPENID_CLAIM_NAME | |||
| value: {{ .Values.oidc.claimName }} | |||
| - name: MINIO_IDENTITY_OPENID_CLAIM_PREFIX | |||
| value: {{ .Values.oidc.claimPrefix }} | |||
| - name: MINIO_IDENTITY_OPENID_SCOPES | |||
| value: {{ .Values.oidc.scopes }} | |||
| - name: MINIO_IDENTITY_OPENID_REDIRECT_URI | |||
| value: {{ .Values.oidc.redirectUri }} | |||
| - name: MINIO_IDENTITY_OPENID_COMMENT | |||
| value: {{ .Values.oidc.comment }} | |||
| {{- end}} | |||
| {{- if .Values.etcd.endpoints }} | |||
| - name: MINIO_ETCD_ENDPOINTS | |||
| value: {{ join "," .Values.etcd.endpoints | quote }} | |||
| {{- if .Values.etcd.clientCert }} | |||
| - name: MINIO_ETCD_CLIENT_CERT | |||
| value: "/tmp/credentials/etcd_client_cert.pem" | |||
| {{- end }} | |||
| {{- if .Values.etcd.clientCertKey }} | |||
| - name: MINIO_ETCD_CLIENT_CERT_KEY | |||
| value: "/tmp/credentials/etcd_client_cert_key.pem" | |||
| {{- end }} | |||
| {{- if .Values.etcd.pathPrefix }} | |||
| - name: MINIO_ETCD_PATH_PREFIX | |||
| value: {{ .Values.etcd.pathPrefix }} | |||
| {{- end }} | |||
| {{- if .Values.etcd.corednsPathPrefix }} | |||
| - name: MINIO_ETCD_COREDNS_PATH | |||
| value: {{ .Values.etcd.corednsPathPrefix }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- range $key, $val := .Values.environment }} | |||
| - name: {{ $key }} | |||
| value: {{ $val | quote }} | |||
| {{- end}} | |||
| resources: | |||
| {{ toYaml .Values.resources | indent 12 }} | |||
| {{- with .Values.nodeSelector }} | |||
| nodeSelector: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- include "minio.imagePullSecrets" . | indent 6 }} | |||
| {{- with .Values.affinity }} | |||
| affinity: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.tolerations }} | |||
| tolerations: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| volumes: | |||
| - name: export | |||
| {{- if .Values.persistence.enabled }} | |||
| persistentVolumeClaim: | |||
| claimName: {{ .Values.persistence.existingClaim | default (include "minio.fullname" .) }} | |||
| {{- else }} | |||
| emptyDir: {} | |||
| {{- end }} | |||
| {{- if .Values.extraSecret }} | |||
| - name: extra-secret | |||
| secret: | |||
| secretName: {{ .Values.extraSecret }} | |||
| {{- end }} | |||
| - name: minio-user | |||
| secret: | |||
| secretName: {{ template "minio.secretName" . }} | |||
| {{- include "minio.tlsKeysVolume" . | indent 8 }} | |||
| {{- if .Values.extraVolumes }} | |||
| {{ toYaml .Values.extraVolumes | nindent 8 }} | |||
| {{- end }} | |||
| {{- end }} | |||
| @@ -0,0 +1,173 @@ | |||
| {{- if eq .Values.mode "gateway" }} | |||
| {{ $scheme := "http" }} | |||
| {{- if .Values.tls.enabled }} | |||
| {{ $scheme = "https" }} | |||
| {{ end }} | |||
| {{ $bucketRoot := or ($.Values.bucketRoot) ($.Values.mountPath) }} | |||
| apiVersion: {{ template "minio.deployment.apiVersion" . }} | |||
| kind: Deployment | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }} | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| {{- if .Values.additionalLabels }} | |||
| {{ toYaml .Values.additionalLabels | trimSuffix "\n" | indent 4 }} | |||
| {{- end }} | |||
| {{- if .Values.additionalAnnotations }} | |||
| annotations: | |||
| {{ toYaml .Values.additionalAnnotations | trimSuffix "\n" | indent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| strategy: | |||
| type: {{ .Values.DeploymentUpdate.type }} | |||
| {{- if eq .Values.DeploymentUpdate.type "RollingUpdate" }} | |||
| rollingUpdate: | |||
| maxSurge: {{ .Values.DeploymentUpdate.maxSurge }} | |||
| maxUnavailable: {{ .Values.DeploymentUpdate.maxUnavailable }} | |||
| {{- end}} | |||
| replicas: {{ .Values.gateway.replicas }} | |||
| selector: | |||
| matchLabels: | |||
| app: {{ template "minio.name" . }} | |||
| release: {{ .Release.Name }} | |||
| template: | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| release: {{ .Release.Name }} | |||
| {{- if .Values.podLabels }} | |||
| {{ toYaml .Values.podLabels | indent 8 }} | |||
| {{- end }} | |||
| annotations: | |||
| {{- if not .Values.ignoreChartChecksums }} | |||
| checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} | |||
| checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} | |||
| {{- end }} | |||
| {{- if .Values.podAnnotations }} | |||
| {{ toYaml .Values.podAnnotations | trimSuffix "\n" | indent 8 }} | |||
| {{- end }} | |||
| spec: | |||
| {{- if .Values.priorityClassName }} | |||
| priorityClassName: "{{ .Values.priorityClassName }}" | |||
| {{- end }} | |||
| {{- if and .Values.securityContext.enabled .Values.persistence.enabled }} | |||
| securityContext: | |||
| runAsUser: {{ .Values.securityContext.runAsUser }} | |||
| runAsGroup: {{ .Values.securityContext.runAsGroup }} | |||
| fsGroup: {{ .Values.securityContext.fsGroup }} | |||
| {{- end }} | |||
| {{ if .Values.serviceAccount.create }} | |||
| serviceAccountName: {{ .Values.serviceAccount.name }} | |||
| {{- end }} | |||
| containers: | |||
| - name: {{ .Chart.Name }} | |||
| image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | |||
| imagePullPolicy: {{ .Values.image.pullPolicy }} | |||
| command: | |||
| - "/bin/sh" | |||
| - "-ce" | |||
| {{- if eq .Values.gateway.type "nas" }} | |||
| - "/usr/bin/docker-entrypoint.sh minio gateway nas {{ $bucketRoot }} -S {{ .Values.certsPath }} --address :{{ .Values.minioAPIPort }} --console-address :{{ .Values.minioConsolePort }} {{- template "minio.extraArgs" . }} " | |||
| {{- end }} | |||
| volumeMounts: | |||
| - name: minio-user | |||
| mountPath: "/tmp/credentials" | |||
| readOnly: true | |||
| {{- if .Values.persistence.enabled }} | |||
| - name: export | |||
| mountPath: {{ .Values.mountPath }} | |||
| {{- if .Values.persistence.subPath }} | |||
| subPath: "{{ .Values.persistence.subPath }}" | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- if .Values.extraSecret }} | |||
| - name: extra-secret | |||
| mountPath: "/tmp/minio-config-env" | |||
| {{- end }} | |||
| {{- include "minio.tlsKeysVolumeMount" . | indent 12 }} | |||
| ports: | |||
| - name: {{ $scheme }} | |||
| containerPort: {{ .Values.minioAPIPort }} | |||
| - name: {{ $scheme }}-console | |||
| containerPort: {{ .Values.minioConsolePort }} | |||
| env: | |||
| - name: MINIO_ROOT_USER | |||
| valueFrom: | |||
| secretKeyRef: | |||
| name: {{ template "minio.secretName" . }} | |||
| key: rootUser | |||
| - name: MINIO_ROOT_PASSWORD | |||
| valueFrom: | |||
| secretKeyRef: | |||
| name: {{ template "minio.secretName" . }} | |||
| key: rootPassword | |||
| {{- if .Values.extraSecret }} | |||
| - name: MINIO_CONFIG_ENV_FILE | |||
| value: "/tmp/minio-config-env/config.env" | |||
| {{- end}} | |||
| {{- if .Values.metrics.serviceMonitor.public }} | |||
| - name: MINIO_PROMETHEUS_AUTH_TYPE | |||
| value: "public" | |||
| {{- end}} | |||
| {{- if .Values.etcd.endpoints }} | |||
| - name: MINIO_ETCD_ENDPOINTS | |||
| value: {{ join "," .Values.etcd.endpoints | quote }} | |||
| {{- if .Values.etcd.clientCert }} | |||
| - name: MINIO_ETCD_CLIENT_CERT | |||
| value: "/tmp/credentials/etcd_client.crt" | |||
| {{- end }} | |||
| {{- if .Values.etcd.clientCertKey }} | |||
| - name: MINIO_ETCD_CLIENT_CERT_KEY | |||
| value: "/tmp/credentials/etcd_client.key" | |||
| {{- end }} | |||
| {{- if .Values.etcd.pathPrefix }} | |||
| - name: MINIO_ETCD_PATH_PREFIX | |||
| value: {{ .Values.etcd.pathPrefix }} | |||
| {{- end }} | |||
| {{- if .Values.etcd.corednsPathPrefix }} | |||
| - name: MINIO_ETCD_COREDNS_PATH | |||
| value: {{ .Values.etcd.corednsPathPrefix }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- range $key, $val := .Values.environment }} | |||
| - name: {{ $key }} | |||
| value: {{ $val | quote }} | |||
| {{- end}} | |||
| resources: | |||
| {{ toYaml .Values.resources | indent 12 }} | |||
| {{- with .Values.nodeSelector }} | |||
| nodeSelector: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- include "minio.imagePullSecrets" . | indent 6 }} | |||
| {{- with .Values.affinity }} | |||
| affinity: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.tolerations }} | |||
| tolerations: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| volumes: | |||
| - name: export | |||
| {{- if .Values.persistence.enabled }} | |||
| persistentVolumeClaim: | |||
| claimName: {{ .Values.persistence.existingClaim | default (include "minio.fullname" .) }} | |||
| {{- else }} | |||
| emptyDir: {} | |||
| {{- end }} | |||
| - name: minio-user | |||
| secret: | |||
| secretName: {{ template "minio.secretName" . }} | |||
| {{- if .Values.extraSecret }} | |||
| - name: extra-secret | |||
| secret: | |||
| secretName: {{ .Values.extraSecret }} | |||
| {{- end }} | |||
| {{- include "minio.tlsKeysVolume" . | indent 8 }} | |||
| {{- end }} | |||
| @@ -0,0 +1,58 @@ | |||
| {{- if .Values.ingress.enabled -}} | |||
| {{- $fullName := include "minio.fullname" . -}} | |||
| {{- $servicePort := .Values.service.port -}} | |||
| {{- $ingressPath := .Values.ingress.path -}} | |||
| apiVersion: {{ template "minio.ingress.apiVersion" . }} | |||
| kind: Ingress | |||
| metadata: | |||
| name: {{ $fullName }} | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| {{- with .Values.ingress.labels }} | |||
| {{ toYaml . | indent 4 }} | |||
| {{- end }} | |||
| {{- with .Values.ingress.annotations }} | |||
| annotations: | |||
| {{ toYaml . | indent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| {{- if .Values.ingress.ingressClassName }} | |||
| ingressClassName: {{ .Values.ingress.ingressClassName }} | |||
| {{- end }} | |||
| {{- if .Values.ingress.tls }} | |||
| tls: | |||
| {{- range .Values.ingress.tls }} | |||
| - hosts: | |||
| {{- range .hosts }} | |||
| - {{ . | quote }} | |||
| {{- end }} | |||
| secretName: {{ .secretName }} | |||
| {{- end }} | |||
| {{- end }} | |||
| rules: | |||
| {{- range .Values.ingress.hosts }} | |||
| - http: | |||
| paths: | |||
| - path: {{ $ingressPath }} | |||
| {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} | |||
| pathType: Prefix | |||
| backend: | |||
| service: | |||
| name: {{ $fullName }} | |||
| port: | |||
| number: {{ $servicePort }} | |||
| {{- else }} | |||
| backend: | |||
| serviceName: {{ $fullName }} | |||
| servicePort: {{ $servicePort }} | |||
| {{- end }} | |||
| {{- if . }} | |||
| host: {{ . | quote }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- end }} | |||
| @@ -0,0 +1,27 @@ | |||
| {{- if .Values.networkPolicy.enabled }} | |||
| kind: NetworkPolicy | |||
| apiVersion: {{ template "minio.networkPolicy.apiVersion" . }} | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }} | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| spec: | |||
| podSelector: | |||
| matchLabels: | |||
| app: {{ template "minio.name" . }} | |||
| release: {{ .Release.Name }} | |||
| ingress: | |||
| - ports: | |||
| - port: {{ .Values.minioAPIPort }} | |||
| - port: {{ .Values.minioConsolePort }} | |||
| {{- if not .Values.networkPolicy.allowExternal }} | |||
| from: | |||
| - podSelector: | |||
| matchLabels: | |||
| {{ template "minio.name" . }}-client: "true" | |||
| {{- end }} | |||
| {{- end }} | |||
| @@ -0,0 +1,14 @@ | |||
| {{- if .Values.podDisruptionBudget.enabled }} | |||
| apiVersion: policy/v1beta1 | |||
| kind: PodDisruptionBudget | |||
| metadata: | |||
| name: minio | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| spec: | |||
| maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} | |||
| selector: | |||
| matchLabels: | |||
| app: {{ template "minio.name" . }} | |||
| {{- end }} | |||
| @@ -0,0 +1,101 @@ | |||
| {{- if .Values.buckets }} | |||
| apiVersion: batch/v1 | |||
| kind: Job | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }}-make-bucket-job | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }}-make-bucket-job | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| annotations: | |||
| "helm.sh/hook": post-install,post-upgrade | |||
| "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | |||
| {{- with .Values.makeBucketJob.annotations }} | |||
| {{ toYaml . | indent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| template: | |||
| metadata: | |||
| labels: | |||
| app: {{ template "minio.name" . }}-job | |||
| release: {{ .Release.Name }} | |||
| {{- if .Values.podLabels }} | |||
| {{ toYaml .Values.podLabels | indent 8 }} | |||
| {{- end }} | |||
| {{- if .Values.makeBucketJob.podAnnotations }} | |||
| annotations: | |||
| {{ toYaml .Values.makeBucketJob.podAnnotations | indent 8 }} | |||
| {{- end }} | |||
| spec: | |||
| restartPolicy: OnFailure | |||
| {{- include "minio.imagePullSecrets" . | indent 6 }} | |||
| {{- if .Values.nodeSelector }} | |||
| nodeSelector: | |||
| {{ toYaml .Values.makeBucketJob.nodeSelector | indent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.makeBucketJob.affinity }} | |||
| affinity: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.makeBucketJob.tolerations }} | |||
| tolerations: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- if .Values.makeBucketJob.securityContext.enabled }} | |||
| securityContext: | |||
| runAsUser: {{ .Values.makeBucketJob.securityContext.runAsUser }} | |||
| runAsGroup: {{ .Values.makeBucketJob.securityContext.runAsGroup }} | |||
| fsGroup: {{ .Values.makeBucketJob.securityContext.fsGroup }} | |||
| {{- end }} | |||
| volumes: | |||
| - name: minio-configuration | |||
| projected: | |||
| sources: | |||
| - configMap: | |||
| name: {{ template "minio.fullname" . }} | |||
| - secret: | |||
| name: {{ template "minio.secretName" . }} | |||
| {{- if .Values.tls.enabled }} | |||
| - name: cert-secret-volume-mc | |||
| secret: | |||
| secretName: {{ .Values.tls.certSecret }} | |||
| items: | |||
| - key: {{ .Values.tls.publicCrt }} | |||
| path: CAs/public.crt | |||
| {{ end }} | |||
| {{- if .Values.makeBucketJob.extraVolumes }} | |||
| {{- toYaml .Values.makeBucketJob.extraVolumes | nindent 8 }} | |||
| {{- end }} | |||
| {{ if .Values.serviceAccount.create }} | |||
| serviceAccountName: {{ .Values.serviceAccount.name }} | |||
| {{- end }} | |||
| containers: | |||
| - name: minio-mc | |||
| image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" | |||
| imagePullPolicy: {{ .Values.mcImage.pullPolicy }} | |||
| {{- if .Values.makeBucketJob.exitCommand }} | |||
| command: ["/bin/sh", "-c"] | |||
| args: ["/bin/sh /config/initialize; x=$(echo $?); {{ .Values.makeBucketJob.exitCommand }} && exit $x" ] | |||
| {{- else }} | |||
| command: ["/bin/sh", "/config/initialize"] | |||
| {{- end }} | |||
| env: | |||
| - name: MINIO_ENDPOINT | |||
| value: {{ template "minio.fullname" . }} | |||
| - name: MINIO_PORT | |||
| value: {{ .Values.service.port | quote }} | |||
| volumeMounts: | |||
| - name: minio-configuration | |||
| mountPath: /config | |||
| {{- if .Values.tls.enabled }} | |||
| - name: cert-secret-volume-mc | |||
| mountPath: {{ .Values.configPathmc }}certs | |||
| {{ end }} | |||
| {{- if .Values.makeBucketJob.extraVolumeMounts }} | |||
| {{- toYaml .Values.makeBucketJob.extraVolumeMounts | nindent 10 }} | |||
| {{- end }} | |||
| resources: | |||
| {{ toYaml .Values.makeBucketJob.resources | indent 10 }} | |||
| {{- end }} | |||
| @@ -0,0 +1,101 @@ | |||
| {{- if .Values.policies }} | |||
| apiVersion: batch/v1 | |||
| kind: Job | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }}-make-policies-job | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }}-make-policies-job | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| annotations: | |||
| "helm.sh/hook": post-install,post-upgrade | |||
| "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | |||
| {{- with .Values.makePolicyJob.annotations }} | |||
| {{ toYaml . | indent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| template: | |||
| metadata: | |||
| labels: | |||
| app: {{ template "minio.name" . }}-job | |||
| release: {{ .Release.Name }} | |||
| {{- if .Values.podLabels }} | |||
| {{ toYaml .Values.podLabels | indent 8 }} | |||
| {{- end }} | |||
| {{- if .Values.makePolicyJob.podAnnotations }} | |||
| annotations: | |||
| {{ toYaml .Values.makePolicyJob.podAnnotations | indent 8 }} | |||
| {{- end }} | |||
| spec: | |||
| restartPolicy: OnFailure | |||
| {{- include "minio.imagePullSecrets" . | indent 6 }} | |||
| {{- if .Values.nodeSelector }} | |||
| nodeSelector: | |||
| {{ toYaml .Values.makePolicyJob.nodeSelector | indent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.makePolicyJob.affinity }} | |||
| affinity: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.makePolicyJob.tolerations }} | |||
| tolerations: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- if .Values.makePolicyJob.securityContext.enabled }} | |||
| securityContext: | |||
| runAsUser: {{ .Values.makePolicyJob.securityContext.runAsUser }} | |||
| runAsGroup: {{ .Values.makePolicyJob.securityContext.runAsGroup }} | |||
| fsGroup: {{ .Values.makePolicyJob.securityContext.fsGroup }} | |||
| {{- end }} | |||
| volumes: | |||
| - name: minio-configuration | |||
| projected: | |||
| sources: | |||
| - configMap: | |||
| name: {{ template "minio.fullname" . }} | |||
| - secret: | |||
| name: {{ template "minio.secretName" . }} | |||
| {{- if .Values.tls.enabled }} | |||
| - name: cert-secret-volume-mc | |||
| secret: | |||
| secretName: {{ .Values.tls.certSecret }} | |||
| items: | |||
| - key: {{ .Values.tls.publicCrt }} | |||
| path: CAs/public.crt | |||
| {{ end }} | |||
| {{- if .Values.makePolicyJob.extraVolumes }} | |||
| {{- toYaml .Values.makePolicyJob.extraVolumes | nindent 8 }} | |||
| {{- end }} | |||
| {{ if .Values.serviceAccount.create }} | |||
| serviceAccountName: {{ .Values.serviceAccount.name }} | |||
| {{- end }} | |||
| containers: | |||
| - name: minio-mc | |||
| image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" | |||
| imagePullPolicy: {{ .Values.mcImage.pullPolicy }} | |||
| {{- if .Values.makePolicyJob.exitCommand }} | |||
| command: ["/bin/sh", "-c"] | |||
| args: ["/bin/sh /config/add-policy; x=$(echo $?); {{ .Values.makePolicyJob.exitCommand }} && exit $x" ] | |||
| {{- else }} | |||
| command: ["/bin/sh", "/config/add-policy"] | |||
| {{- end }} | |||
| env: | |||
| - name: MINIO_ENDPOINT | |||
| value: {{ template "minio.fullname" . }} | |||
| - name: MINIO_PORT | |||
| value: {{ .Values.service.port | quote }} | |||
| volumeMounts: | |||
| - name: minio-configuration | |||
| mountPath: /config | |||
| {{- if .Values.tls.enabled }} | |||
| - name: cert-secret-volume-mc | |||
| mountPath: {{ .Values.configPathmc }}certs | |||
| {{ end }} | |||
| {{- if .Values.makePolicyJob.extraVolumeMounts }} | |||
| {{- toYaml .Values.makePolicyJob.extraVolumeMounts | nindent 10 }} | |||
| {{- end }} | |||
| resources: | |||
| {{ toYaml .Values.makePolicyJob.resources | indent 10 }} | |||
| {{- end }} | |||
| @@ -0,0 +1,111 @@ | |||
| {{- $global := . -}} | |||
| {{- if .Values.users }} | |||
| apiVersion: batch/v1 | |||
| kind: Job | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }}-make-user-job | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }}-make-user-job | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| annotations: | |||
| "helm.sh/hook": post-install,post-upgrade | |||
| "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | |||
| {{- with .Values.makeUserJob.annotations }} | |||
| {{ toYaml . | indent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| template: | |||
| metadata: | |||
| labels: | |||
| app: {{ template "minio.name" . }}-job | |||
| release: {{ .Release.Name }} | |||
| {{- if .Values.podLabels }} | |||
| {{ toYaml .Values.podLabels | indent 8 }} | |||
| {{- end }} | |||
| {{- if .Values.makeUserJob.podAnnotations }} | |||
| annotations: | |||
| {{ toYaml .Values.makeUserJob.podAnnotations | indent 8 }} | |||
| {{- end }} | |||
| spec: | |||
| restartPolicy: OnFailure | |||
| {{- include "minio.imagePullSecrets" . | indent 6 }} | |||
| {{- if .Values.nodeSelector }} | |||
| nodeSelector: | |||
| {{ toYaml .Values.makeUserJob.nodeSelector | indent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.makeUserJob.affinity }} | |||
| affinity: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.makeUserJob.tolerations }} | |||
| tolerations: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- if .Values.makeUserJob.securityContext.enabled }} | |||
| securityContext: | |||
| runAsUser: {{ .Values.makeUserJob.securityContext.runAsUser }} | |||
| runAsGroup: {{ .Values.makeUserJob.securityContext.runAsGroup }} | |||
| fsGroup: {{ .Values.makeUserJob.securityContext.fsGroup }} | |||
| {{- end }} | |||
| volumes: | |||
| - name: minio-configuration | |||
| projected: | |||
| sources: | |||
| - configMap: | |||
| name: {{ template "minio.fullname" . }} | |||
| - secret: | |||
| name: {{ template "minio.secretName" . }} | |||
| {{- range .Values.users }} | |||
| {{- if .existingSecret }} | |||
| - secret: | |||
| name: {{ tpl .existingSecret $global }} | |||
| items: | |||
| - key: {{ .existingSecretKey }} | |||
| path: secrets/{{ tpl .existingSecretKey $global }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- if .Values.tls.enabled }} | |||
| - name: cert-secret-volume-mc | |||
| secret: | |||
| secretName: {{ .Values.tls.certSecret }} | |||
| items: | |||
| - key: {{ .Values.tls.publicCrt }} | |||
| path: CAs/public.crt | |||
| {{ end }} | |||
| {{- if .Values.makeUserJob.extraVolumes }} | |||
| {{- toYaml .Values.makeUserJob.extraVolumes | nindent 8 }} | |||
| {{- end }} | |||
| {{ if .Values.serviceAccount.create }} | |||
| serviceAccountName: {{ .Values.serviceAccount.name }} | |||
| {{- end }} | |||
| containers: | |||
| - name: minio-mc | |||
| image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" | |||
| imagePullPolicy: {{ .Values.mcImage.pullPolicy }} | |||
| {{- if .Values.makeUserJob.exitCommand }} | |||
| command: ["/bin/sh", "-c"] | |||
| args: ["/bin/sh /config/add-user; x=$(echo $?); {{ .Values.makeUserJob.exitCommand }} && exit $x" ] | |||
| {{- else }} | |||
| command: ["/bin/sh", "/config/add-user"] | |||
| {{- end }} | |||
| env: | |||
| - name: MINIO_ENDPOINT | |||
| value: {{ template "minio.fullname" . }} | |||
| - name: MINIO_PORT | |||
| value: {{ .Values.service.port | quote }} | |||
| volumeMounts: | |||
| - name: minio-configuration | |||
| mountPath: /config | |||
| {{- if .Values.tls.enabled }} | |||
| - name: cert-secret-volume-mc | |||
| mountPath: {{ .Values.configPathmc }}certs | |||
| {{ end }} | |||
| {{- if .Values.makeUserJob.extraVolumeMounts }} | |||
| {{- toYaml .Values.makeUserJob.extraVolumeMounts | nindent 10 }} | |||
| {{- end }} | |||
| resources: | |||
| {{ toYaml .Values.makeUserJob.resources | indent 10 }} | |||
| {{- end }} | |||
| @@ -0,0 +1,92 @@ | |||
| {{- if .Values.customCommands }} | |||
| apiVersion: batch/v1 | |||
| kind: Job | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }}-custom-command-job | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }}-custom-command-job | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| annotations: | |||
| "helm.sh/hook": post-install,post-upgrade | |||
| "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | |||
| {{- with .Values.customCommandJob.annotations }} | |||
| {{ toYaml . | indent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| template: | |||
| metadata: | |||
| labels: | |||
| app: {{ template "minio.name" . }}-job | |||
| release: {{ .Release.Name }} | |||
| {{- if .Values.podLabels }} | |||
| {{ toYaml .Values.podLabels | indent 8 }} | |||
| {{- end }} | |||
| {{- if .Values.customCommandJob.podAnnotations }} | |||
| annotations: | |||
| {{ toYaml .Values.customCommandJob.podAnnotations | indent 8 }} | |||
| {{- end }} | |||
| spec: | |||
| restartPolicy: OnFailure | |||
| {{- include "minio.imagePullSecrets" . | indent 6 }} | |||
| {{- if .Values.nodeSelector }} | |||
| nodeSelector: | |||
| {{ toYaml .Values.customCommandJob.nodeSelector | indent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.customCommandJob.affinity }} | |||
| affinity: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.customCommandJob.tolerations }} | |||
| tolerations: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- if .Values.customCommandJob.securityContext.enabled }} | |||
| securityContext: | |||
| runAsUser: {{ .Values.customCommandJob.securityContext.runAsUser }} | |||
| runAsGroup: {{ .Values.customCommandJob.securityContext.runAsGroup }} | |||
| fsGroup: {{ .Values.customCommandJob.securityContext.fsGroup }} | |||
| {{- end }} | |||
| volumes: | |||
| - name: minio-configuration | |||
| projected: | |||
| sources: | |||
| - configMap: | |||
| name: {{ template "minio.fullname" . }} | |||
| - secret: | |||
| name: {{ template "minio.secretName" . }} | |||
| {{- if .Values.tls.enabled }} | |||
| - name: cert-secret-volume-mc | |||
| secret: | |||
| secretName: {{ .Values.tls.certSecret }} | |||
| items: | |||
| - key: {{ .Values.tls.publicCrt }} | |||
| path: CAs/public.crt | |||
| {{ end }} | |||
| containers: | |||
| - name: minio-mc | |||
| image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" | |||
| imagePullPolicy: {{ .Values.mcImage.pullPolicy }} | |||
| {{- if .Values.customCommandJob.exitCommand }} | |||
| command: ["/bin/sh", "-c"] | |||
| args: ["/bin/sh /config/custom-command; x=$(echo $?); {{ .Values.customCommandJob.exitCommand }} && exit $x" ] | |||
| {{- else }} | |||
| command: ["/bin/sh", "/config/custom-command"] | |||
| {{- end }} | |||
| env: | |||
| - name: MINIO_ENDPOINT | |||
| value: {{ template "minio.fullname" . }} | |||
| - name: MINIO_PORT | |||
| value: {{ .Values.service.port | quote }} | |||
| volumeMounts: | |||
| - name: minio-configuration | |||
| mountPath: /config | |||
| {{- if .Values.tls.enabled }} | |||
| - name: cert-secret-volume-mc | |||
| mountPath: {{ .Values.configPathmc }}certs | |||
| {{ end }} | |||
| resources: | |||
| {{ toYaml .Values.customCommandJob.resources | indent 10 }} | |||
| {{- end }} | |||
| @@ -0,0 +1,35 @@ | |||
| {{- if eq .Values.mode "standalone" }} | |||
| {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} | |||
| apiVersion: v1 | |||
| kind: PersistentVolumeClaim | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }} | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| {{- if .Values.persistence.annotations }} | |||
| annotations: | |||
| {{ toYaml .Values.persistence.annotations | trimSuffix "\n" | indent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| accessModes: | |||
| - {{ .Values.persistence.accessMode | quote }} | |||
| resources: | |||
| requests: | |||
| storage: {{ .Values.persistence.size | quote }} | |||
| {{- if .Values.persistence.storageClass }} | |||
| {{- if (eq "-" .Values.persistence.storageClass) }} | |||
| storageClassName: "" | |||
| {{- else }} | |||
| storageClassName: "{{ .Values.persistence.storageClass }}" | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- if .Values.persistence.VolumeName }} | |||
| volumeName: "{{ .Values.persistence.VolumeName }}" | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- end }} | |||
| @@ -0,0 +1,22 @@ | |||
| {{- if not .Values.existingSecret }} | |||
| apiVersion: v1 | |||
| kind: Secret | |||
| metadata: | |||
| name: {{ template "minio.secretName" . }} | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| type: Opaque | |||
| data: | |||
| rootUser: {{ include "minio.root.username" . | b64enc | quote }} | |||
| rootPassword: {{ include "minio.root.password" . | b64enc | quote }} | |||
| {{- if .Values.etcd.clientCert }} | |||
| etcd_client.crt: {{ .Values.etcd.clientCert | toString | b64enc | quote }} | |||
| {{- end }} | |||
| {{- if .Values.etcd.clientCertKey }} | |||
| etcd_client.key: {{ .Values.etcd.clientCertKey | toString | b64enc | quote }} | |||
| {{- end }} | |||
| {{- end }} | |||
| @@ -0,0 +1,45 @@ | |||
| {{- if and .Values.securityContext.enabled .Values.persistence.enabled (.Capabilities.APIVersions.Has "security.openshift.io/v1") }} | |||
| apiVersion: security.openshift.io/v1 | |||
| kind: SecurityContextConstraints | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| allowHostDirVolumePlugin: false | |||
| allowHostIPC: false | |||
| allowHostNetwork: false | |||
| allowHostPID: false | |||
| allowHostPorts: false | |||
| allowPrivilegeEscalation: true | |||
| allowPrivilegedContainer: false | |||
| allowedCapabilities: [] | |||
| readOnlyRootFilesystem: false | |||
| defaultAddCapabilities: [] | |||
| requiredDropCapabilities: | |||
| - KILL | |||
| - MKNOD | |||
| - SETUID | |||
| - SETGID | |||
| fsGroup: | |||
| type: MustRunAs | |||
| ranges: | |||
| - max: {{ .Values.securityContext.fsGroup }} | |||
| min: {{ .Values.securityContext.fsGroup }} | |||
| runAsUser: | |||
| type: MustRunAs | |||
| uid: {{ .Values.securityContext.runAsUser }} | |||
| seLinuxContext: | |||
| type: MustRunAs | |||
| supplementalGroups: | |||
| type: RunAsAny | |||
| volumes: | |||
| - configMap | |||
| - downwardAPI | |||
| - emptyDir | |||
| - persistentVolumeClaim | |||
| - projected | |||
| - secret | |||
| {{- end }} | |||
| @@ -0,0 +1,49 @@ | |||
| {{ $scheme := "http" }} | |||
| {{- if .Values.tls.enabled }} | |||
| {{ $scheme = "https" }} | |||
| {{ end }} | |||
| apiVersion: v1 | |||
| kind: Service | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }} | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| monitoring: "true" | |||
| {{- if .Values.service.annotations }} | |||
| annotations: | |||
| {{ toYaml .Values.service.annotations | indent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| {{- if (or (eq .Values.service.type "ClusterIP" "") (empty .Values.service.type)) }} | |||
| type: ClusterIP | |||
| {{- if not (empty .Values.service.clusterIP) }} | |||
| clusterIP: {{ .Values.service.clusterIP }} | |||
| {{end}} | |||
| {{- else if eq .Values.service.type "LoadBalancer" }} | |||
| type: {{ .Values.service.type }} | |||
| loadBalancerIP: {{ default "" .Values.service.loadBalancerIP }} | |||
| {{- else }} | |||
| type: {{ .Values.service.type }} | |||
| {{- end }} | |||
| ports: | |||
| - name: {{ $scheme }} | |||
| port: {{ .Values.service.port }} | |||
| protocol: TCP | |||
| {{- if (and (eq .Values.service.type "NodePort") ( .Values.service.nodePort)) }} | |||
| nodePort: {{ .Values.service.nodePort }} | |||
| {{- else }} | |||
| targetPort: {{ .Values.minioAPIPort }} | |||
| {{- end}} | |||
| {{- if .Values.service.externalIPs }} | |||
| externalIPs: | |||
| {{- range $i , $ip := .Values.service.externalIPs }} | |||
| - {{ $ip }} | |||
| {{- end }} | |||
| {{- end }} | |||
| selector: | |||
| app: {{ template "minio.name" . }} | |||
| release: {{ .Release.Name }} | |||
| @@ -0,0 +1,7 @@ | |||
| {{- if .Values.serviceAccount.create -}} | |||
| apiVersion: v1 | |||
| kind: ServiceAccount | |||
| metadata: | |||
| name: {{ .Values.serviceAccount.name | quote }} | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| {{- end -}} | |||
| @@ -0,0 +1,115 @@ | |||
| {{- if and .Values.metrics.serviceMonitor.enabled .Values.metrics.serviceMonitor.includeNode}} | |||
| apiVersion: monitoring.coreos.com/v1 | |||
| kind: ServiceMonitor | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }} | |||
| {{- if .Values.metrics.serviceMonitor.namespace }} | |||
| namespace: {{ .Values.metrics.serviceMonitor.namespace }} | |||
| {{ else }} | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| {{- end }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| {{- if .Values.metrics.serviceMonitor.additionalLabels }} | |||
| {{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }} | |||
| {{- end }} | |||
| {{- if .Values.metrics.serviceMonitor.annotations }} | |||
| annotations: | |||
| {{ toYaml .Values.metrics.serviceMonitor.annotations | trimSuffix "\n" | indent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| endpoints: | |||
| {{- if .Values.tls.enabled }} | |||
| - port: https | |||
| scheme: https | |||
| tlsConfig: | |||
| ca: | |||
| secret: | |||
| name: {{ .Values.tls.certSecret }} | |||
| key: {{ .Values.tls.publicCrt }} | |||
| serverName: {{ template "minio.fullname" . }} | |||
| {{ else }} | |||
| - port: http | |||
| scheme: http | |||
| {{- end }} | |||
| path: /minio/v2/metrics/node | |||
| {{- if .Values.metrics.serviceMonitor.interval }} | |||
| interval: {{ .Values.metrics.serviceMonitor.interval }} | |||
| {{- end }} | |||
| {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} | |||
| scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} | |||
| {{- end }} | |||
| {{- if .Values.metrics.serviceMonitor.relabelConfigs }} | |||
| {{ toYaml .Values.metrics.serviceMonitor.relabelConfigs | indent 6 }} | |||
| {{- end }} | |||
| {{- if not .Values.metrics.serviceMonitor.public }} | |||
| bearerTokenSecret: | |||
| name: {{ template "minio.fullname" . }}-prometheus | |||
| key: token | |||
| {{- end }} | |||
| namespaceSelector: | |||
| matchNames: | |||
| - {{ .Release.Namespace | quote }} | |||
| selector: | |||
| matchLabels: | |||
| app: {{ include "minio.name" . }} | |||
| release: {{ .Release.Name }} | |||
| monitoring: "true" | |||
| {{- end }} | |||
| {{- if .Values.metrics.serviceMonitor.enabled }} | |||
| --- | |||
| apiVersion: monitoring.coreos.com/v1 | |||
| kind: Probe | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }}-cluster | |||
| {{- if .Values.metrics.serviceMonitor.namespace }} | |||
| namespace: {{ .Values.metrics.serviceMonitor.namespace }} | |||
| {{ else }} | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| {{- end }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| {{- if .Values.metrics.serviceMonitor.additionalLabels }} | |||
| {{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| jobName: {{ template "minio.fullname" . }} | |||
| prober: | |||
| url: {{ template "minio.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.port }} | |||
| path: /minio/v2/metrics/cluster | |||
| {{- if .Values.tls.enabled }} | |||
| scheme: https | |||
| tlsConfig: | |||
| ca: | |||
| secret: | |||
| name: {{ .Values.tls.certSecret }} | |||
| key: {{ .Values.tls.publicCrt }} | |||
| serverName: {{ template "minio.fullname" . }} | |||
| {{ else }} | |||
| scheme: http | |||
| {{- end }} | |||
| {{- if .Values.metrics.serviceMonitor.relabelConfigsCluster }} | |||
| {{ toYaml .Values.metrics.serviceMonitor.relabelConfigsCluster | indent 2 }} | |||
| {{- end }} | |||
| targets: | |||
| staticConfig: | |||
| static: | |||
| - {{ template "minio.fullname" . }}.{{ .Release.Namespace }} | |||
| {{- if not .Values.metrics.serviceMonitor.public }} | |||
| {{- if .Values.metrics.serviceMonitor.interval }} | |||
| interval: {{ .Values.metrics.serviceMonitor.interval }} | |||
| {{- end }} | |||
| {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} | |||
| scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} | |||
| {{- end }} | |||
| bearerTokenSecret: | |||
| name: {{ template "minio.fullname" . }}-prometheus | |||
| key: token | |||
| {{- end }} | |||
| {{- end }} | |||
| @@ -0,0 +1,252 @@ | |||
| {{- if eq .Values.mode "distributed" }} | |||
| {{ $poolCount := .Values.pools | int }} | |||
| {{ $nodeCount := .Values.replicas | int }} | |||
| {{ $replicas := mul $poolCount $nodeCount }} | |||
| {{ $drivesPerNode := .Values.drivesPerNode | int }} | |||
| {{ $scheme := "http" }} | |||
| {{- if .Values.tls.enabled }} | |||
| {{ $scheme = "https" }} | |||
| {{ end }} | |||
| {{ $mountPath := .Values.mountPath }} | |||
| {{ $bucketRoot := or ($.Values.bucketRoot) ($.Values.mountPath) }} | |||
| {{ $subPath := .Values.persistence.subPath }} | |||
| {{ $penabled := .Values.persistence.enabled }} | |||
| {{ $accessMode := .Values.persistence.accessMode }} | |||
| {{ $storageClass := .Values.persistence.storageClass }} | |||
| {{ $psize := .Values.persistence.size }} | |||
| apiVersion: v1 | |||
| kind: Service | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }}-svc | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: "{{ .Release.Name }}" | |||
| heritage: "{{ .Release.Service }}" | |||
| spec: | |||
| publishNotReadyAddresses: true | |||
| clusterIP: None | |||
| ports: | |||
| - name: {{ $scheme }} | |||
| port: {{ .Values.service.port }} | |||
| protocol: TCP | |||
| targetPort: {{ .Values.minioAPIPort }} | |||
| selector: | |||
| app: {{ template "minio.name" . }} | |||
| release: {{ .Release.Name }} | |||
| --- | |||
| apiVersion: {{ template "minio.statefulset.apiVersion" . }} | |||
| kind: StatefulSet | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }} | |||
| namespace: {{ .Release.Namespace | quote }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| chart: {{ template "minio.chart" . }} | |||
| release: {{ .Release.Name }} | |||
| heritage: {{ .Release.Service }} | |||
| {{- if .Values.additionalLabels }} | |||
| {{ toYaml .Values.additionalLabels | trimSuffix "\n" | indent 4 }} | |||
| {{- end }} | |||
| {{- if .Values.additionalAnnotations }} | |||
| annotations: | |||
| {{ toYaml .Values.additionalAnnotations | trimSuffix "\n" | indent 4 }} | |||
| {{- end }} | |||
| spec: | |||
| updateStrategy: | |||
| type: {{ .Values.StatefulSetUpdate.updateStrategy }} | |||
| podManagementPolicy: "Parallel" | |||
| serviceName: {{ template "minio.fullname" . }}-svc | |||
| replicas: {{ $replicas }} | |||
| selector: | |||
| matchLabels: | |||
| app: {{ template "minio.name" . }} | |||
| release: {{ .Release.Name }} | |||
| template: | |||
| metadata: | |||
| name: {{ template "minio.fullname" . }} | |||
| labels: | |||
| app: {{ template "minio.name" . }} | |||
| release: {{ .Release.Name }} | |||
| {{- if .Values.podLabels }} | |||
| {{ toYaml .Values.podLabels | indent 8 }} | |||
| {{- end }} | |||
| annotations: | |||
| {{- if not .Values.ignoreChartChecksums }} | |||
| checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} | |||
| checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} | |||
| {{- end }} | |||
| {{- if .Values.podAnnotations }} | |||
| {{ toYaml .Values.podAnnotations | trimSuffix "\n" | indent 8 }} | |||
| {{- end }} | |||
| spec: | |||
| {{- if .Values.priorityClassName }} | |||
| priorityClassName: "{{ .Values.priorityClassName }}" | |||
| {{- end }} | |||
| {{- if .Values.runtimeClassName }} | |||
| runtimeClassName: "{{ .Values.runtimeClassName }}" | |||
| {{- end }} | |||
| {{- if and .Values.securityContext.enabled .Values.persistence.enabled }} | |||
| securityContext: | |||
| runAsUser: {{ .Values.securityContext.runAsUser }} | |||
| runAsGroup: {{ .Values.securityContext.runAsGroup }} | |||
| fsGroup: {{ .Values.securityContext.fsGroup }} | |||
| {{- if and (ge .Capabilities.KubeVersion.Major "1") (ge .Capabilities.KubeVersion.Minor "20") }} | |||
| fsGroupChangePolicy: {{ .Values.securityContext.fsGroupChangePolicy }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{ if .Values.serviceAccount.create }} | |||
| serviceAccountName: {{ .Values.serviceAccount.name }} | |||
| {{- end }} | |||
| containers: | |||
| - name: {{ .Chart.Name }} | |||
| image: {{ .Values.image.repository }}:{{ .Values.image.tag }} | |||
| imagePullPolicy: {{ .Values.image.pullPolicy }} | |||
| command: [ "/bin/sh", | |||
| "-ce", | |||
| "/usr/bin/docker-entrypoint.sh minio server {{- range $i := until $poolCount }}{{ $factor := mul $i $nodeCount }}{{ $endIndex := add $factor $nodeCount }}{{ $beginIndex := mul $i $nodeCount }} {{ $scheme }}://{{ template `minio.fullname` $ }}-{{ `{` }}{{ $beginIndex }}...{{ sub $endIndex 1 }}{{ `}`}}.{{ template `minio.fullname` $ }}-svc.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}{{if (gt $drivesPerNode 1)}}{{ $bucketRoot }}-{{ `{` }}0...{{ sub $drivesPerNode 1 }}{{ `}` }}{{else}}{{ $bucketRoot }}{{end}}{{- end}} -S {{ .Values.certsPath }} --address :{{ .Values.minioAPIPort }} --console-address :{{ .Values.minioConsolePort }} {{- template `minio.extraArgs` . }}" ] | |||
| volumeMounts: | |||
| {{- if $penabled }} | |||
| {{- if (gt $drivesPerNode 1) }} | |||
| {{- range $i := until $drivesPerNode }} | |||
| - name: export-{{ $i }} | |||
| mountPath: {{ $mountPath }}-{{ $i }} | |||
| {{- if and $penabled $subPath }} | |||
| subPath: {{ $subPath }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- else }} | |||
| - name: export | |||
| mountPath: {{ $mountPath }} | |||
| {{- if and $penabled $subPath }} | |||
| subPath: {{ $subPath }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- if .Values.extraSecret }} | |||
| - name: extra-secret | |||
| mountPath: "/tmp/minio-config-env" | |||
| {{- end }} | |||
| {{- include "minio.tlsKeysVolumeMount" . | indent 12 }} | |||
| {{- if .Values.extraVolumeMounts }} | |||
| {{- toYaml .Values.extraVolumeMounts | nindent 12 }} | |||
| {{- end }} | |||
| ports: | |||
| - name: {{ $scheme }} | |||
| containerPort: {{ .Values.minioAPIPort }} | |||
| - name: {{ $scheme }}-console | |||
| containerPort: {{ .Values.minioConsolePort }} | |||
| env: | |||
| - name: MINIO_ROOT_USER | |||
| valueFrom: | |||
| secretKeyRef: | |||
| name: {{ template "minio.secretName" . }} | |||
| key: rootUser | |||
| - name: MINIO_ROOT_PASSWORD | |||
| valueFrom: | |||
| secretKeyRef: | |||
| name: {{ template "minio.secretName" . }} | |||
| key: rootPassword | |||
| {{- if .Values.extraSecret }} | |||
| - name: MINIO_CONFIG_ENV_FILE | |||
| value: "/tmp/minio-config-env/config.env" | |||
| {{- end}} | |||
| {{- if .Values.metrics.serviceMonitor.public }} | |||
| - name: MINIO_PROMETHEUS_AUTH_TYPE | |||
| value: "public" | |||
| {{- end}} | |||
| {{- if .Values.oidc.enabled }} | |||
| - name: MINIO_IDENTITY_OPENID_CONFIG_URL | |||
| value: {{ .Values.oidc.configUrl }} | |||
| - name: MINIO_IDENTITY_OPENID_CLIENT_ID | |||
| value: {{ .Values.oidc.clientId }} | |||
| - name: MINIO_IDENTITY_OPENID_CLIENT_SECRET | |||
| value: {{ .Values.oidc.clientSecret }} | |||
| - name: MINIO_IDENTITY_OPENID_CLAIM_NAME | |||
| value: {{ .Values.oidc.claimName }} | |||
| - name: MINIO_IDENTITY_OPENID_CLAIM_PREFIX | |||
| value: {{ .Values.oidc.claimPrefix }} | |||
| - name: MINIO_IDENTITY_OPENID_SCOPES | |||
| value: {{ .Values.oidc.scopes }} | |||
| - name: MINIO_IDENTITY_OPENID_REDIRECT_URI | |||
| value: {{ .Values.oidc.redirectUri }} | |||
| - name: MINIO_IDENTITY_OPENID_COMMENT | |||
| value: {{ .Values.oidc.comment }} | |||
| {{- end}} | |||
| {{- range $key, $val := .Values.environment }} | |||
| - name: {{ $key }} | |||
| value: {{ $val | quote }} | |||
| {{- end}} | |||
| resources: | |||
| {{ toYaml .Values.resources | indent 12 }} | |||
| {{- with .Values.nodeSelector }} | |||
| nodeSelector: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- include "minio.imagePullSecrets" . | indent 6 }} | |||
| {{- with .Values.affinity }} | |||
| affinity: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- with .Values.tolerations }} | |||
| tolerations: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- if and (gt $replicas 1) (ge .Capabilities.KubeVersion.Major "1") (ge .Capabilities.KubeVersion.Minor "19") }} | |||
| {{- with .Values.topologySpreadConstraints }} | |||
| topologySpreadConstraints: | |||
| {{ toYaml . | indent 8 }} | |||
| {{- end }} | |||
| {{- end }} | |||
| volumes: | |||
| - name: minio-user | |||
| secret: | |||
| secretName: {{ template "minio.secretName" . }} | |||
| {{- if .Values.extraSecret }} | |||
| - name: extra-secret | |||
| secret: | |||
| secretName: {{ .Values.extraSecret }} | |||
| {{- end }} | |||
| {{- include "minio.tlsKeysVolume" . | indent 8 }} | |||
| {{- if .Values.extraVolumes }} | |||
| {{ toYaml .Values.extraVolumes | nindent 8 }} | |||
| {{- end }} | |||
| {{- if .Values.persistence.enabled }} | |||
| volumeClaimTemplates: | |||
| {{- if gt $drivesPerNode 1 }} | |||
| {{- range $diskId := until $drivesPerNode}} | |||
| - metadata: | |||
| name: export-{{ $diskId }} | |||
| {{- if $.Values.persistence.annotations }} | |||
| annotations: | |||
| {{ toYaml $.Values.persistence.annotations | trimSuffix "\n" | indent 10 }} | |||
| {{- end }} | |||
| spec: | |||
| accessModes: [ {{ $accessMode | quote }} ] | |||
| {{- if $storageClass }} | |||
| storageClassName: {{ $storageClass }} | |||
| {{- end }} | |||
| resources: | |||
| requests: | |||
| storage: {{ $psize }} | |||
| {{- end }} | |||
| {{- else }} | |||
| - metadata: | |||
| name: export | |||
| {{- if $.Values.persistence.annotations }} | |||
| annotations: | |||
| {{ toYaml $.Values.persistence.annotations | trimSuffix "\n" | indent 10 }} | |||
| {{- end }} | |||
| spec: | |||
| accessModes: [ {{ $accessMode | quote }} ] | |||
| {{- if $storageClass }} | |||
| storageClassName: {{ $storageClass }} | |||
| {{- end }} | |||
| resources: | |||
| requests: | |||
| storage: {{ $psize }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- end }} | |||
| @@ -0,0 +1,516 @@ | |||
| ## Provide a name in place of minio for `app:` labels | |||
| ## | |||
| nameOverride: "" | |||
| ## Provide a name to substitute for the full names of resources | |||
| ## | |||
| fullnameOverride: "" | |||
| ## set kubernetes cluster domain where minio is running | |||
| ## | |||
| clusterDomain: cluster.local | |||
| ## Set default image, imageTag, and imagePullPolicy. mode is used to indicate the | |||
| ## | |||
| image: | |||
| repository: quay.io/minio/minio | |||
| tag: RELEASE.2022-09-17T00-09-45Z | |||
| pullPolicy: IfNotPresent | |||
| imagePullSecrets: [] | |||
| # - name: "image-pull-secret" | |||
| ## Set default image, imageTag, and imagePullPolicy for the `mc` (the minio | |||
| ## client used to create a default bucket). | |||
| ## | |||
| mcImage: | |||
| repository: quay.io/minio/mc | |||
| tag: RELEASE.2022-09-16T09-16-47Z | |||
| pullPolicy: IfNotPresent | |||
| ## minio mode, i.e. standalone or distributed or gateway. | |||
| mode: distributed ## other supported values are "standalone", "gateway" | |||
| ## Additional labels to include with deployment or statefulset | |||
| additionalLabels: {} | |||
| ## Additional annotations to include with deployment or statefulset | |||
| additionalAnnotations: {} | |||
| ## Typically the deployment/statefulset includes checksums of secrets/config, | |||
| ## So that when these change on a subsequent helm install, the deployment/statefulset | |||
| ## is restarted. This can result in unnecessary restarts under GitOps tooling such as | |||
| ## flux, so set to "true" to disable this behaviour. | |||
| ignoreChartChecksums: false | |||
| ## Additional arguments to pass to minio binary | |||
| extraArgs: [] | |||
| ## Additional volumes to minio container | |||
| extraVolumes: [] | |||
| ## Additional volumeMounts to minio container | |||
| extraVolumeMounts: [] | |||
| ## Internal port number for MinIO S3 API container | |||
| ## Change service.port to change external port number | |||
| minioAPIPort: "9000" | |||
| ## Internal port number for MinIO Browser Console container | |||
| ## Change consoleService.port to change external port number | |||
| minioConsolePort: "9001" | |||
| ## Update strategy for Deployments | |||
| DeploymentUpdate: | |||
| type: RollingUpdate | |||
| maxUnavailable: 0 | |||
| maxSurge: 100% | |||
| ## Update strategy for StatefulSets | |||
| StatefulSetUpdate: | |||
| updateStrategy: RollingUpdate | |||
| ## Pod priority settings | |||
| ## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ | |||
| ## | |||
| priorityClassName: "" | |||
| ## Pod runtime class name | |||
| ## ref https://kubernetes.io/docs/concepts/containers/runtime-class/ | |||
| ## | |||
| runtimeClassName: "" | |||
| ## Set default rootUser, rootPassword | |||
| ## AccessKey and secretKey is generated when not set | |||
| ## Distributed MinIO ref: https://docs.minio.io/docs/distributed-minio-quickstart-guide | |||
| ## | |||
| rootUser: "" | |||
| rootPassword: "" | |||
| ## Use existing Secret that store following variables: | |||
| ## | |||
| ## | Chart var | .data.<key> in Secret | | |||
| ## |:----------------------|:-------------------------| | |||
| ## | rootUser | rootUser | | |||
| ## | rootPassword | rootPassword | | |||
| ## | |||
| ## All mentioned variables will be ignored in values file. | |||
| ## .data.rootUser and .data.rootPassword are mandatory, | |||
| ## others depend on enabled status of corresponding sections. | |||
| existingSecret: "" | |||
| ## Directory on the MinIO pof | |||
| certsPath: "/etc/minio/certs/" | |||
| configPathmc: "/etc/minio/mc/" | |||
| ## Path where PV would be mounted on the MinIO Pod | |||
| mountPath: "/export" | |||
| ## Override the root directory which the minio server should serve from. | |||
| ## If left empty, it defaults to the value of {{ .Values.mountPath }} | |||
| ## If defined, it must be a sub-directory of the path specified in {{ .Values.mountPath }} | |||
| ## | |||
| bucketRoot: "" | |||
| # Number of drives attached to a node | |||
| drivesPerNode: 1 | |||
| # Number of MinIO containers running | |||
| replicas: 16 | |||
| # Number of expanded MinIO clusters | |||
| pools: 1 | |||
| # Deploy if 'mode == gateway' - 4 replicas. | |||
| gateway: | |||
| type: "nas" # currently only "nas" are supported. | |||
| replicas: 4 | |||
| ## TLS Settings for MinIO | |||
| tls: | |||
| enabled: false | |||
| ## Create a secret with private.key and public.crt files and pass that here. Ref: https://github.com/minio/minio/tree/master/docs/tls/kubernetes#2-create-kubernetes-secret | |||
| certSecret: "" | |||
| publicCrt: public.crt | |||
| privateKey: private.key | |||
| ## Trusted Certificates Settings for MinIO. Ref: https://docs.minio.io/docs/how-to-secure-access-to-minio-server-with-tls#install-certificates-from-third-party-cas | |||
| ## Bundle multiple trusted certificates into one secret and pass that here. Ref: https://github.com/minio/minio/tree/master/docs/tls/kubernetes#2-create-kubernetes-secret | |||
| ## When using self-signed certificates, remember to include MinIO's own certificate in the bundle with key public.crt. | |||
| ## If certSecret is left empty and tls is enabled, this chart installs the public certificate from .Values.tls.certSecret. | |||
| trustedCertsSecret: "" | |||
| ## Enable persistence using Persistent Volume Claims | |||
| ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ | |||
| ## | |||
| persistence: | |||
| enabled: true | |||
| annotations: {} | |||
| ## A manually managed Persistent Volume and Claim | |||
| ## Requires persistence.enabled: true | |||
| ## If defined, PVC must be created manually before volume will be bound | |||
| existingClaim: "" | |||
| ## minio data Persistent Volume Storage Class | |||
| ## If defined, storageClassName: <storageClass> | |||
| ## If set to "-", storageClassName: "", which disables dynamic provisioning | |||
| ## If undefined (the default) or set to null, no storageClassName spec is | |||
| ## set, choosing the default provisioner. (gp2 on AWS, standard on | |||
| ## GKE, AWS & OpenStack) | |||
| ## | |||
| ## Storage class of PV to bind. By default it looks for standard storage class. | |||
| ## If the PV uses a different storage class, specify that here. | |||
| storageClass: "" | |||
| VolumeName: "" | |||
| accessMode: ReadWriteOnce | |||
| size: 500Gi | |||
| ## If subPath is set mount a sub folder of a volume instead of the root of the volume. | |||
| ## This is especially handy for volume plugins that don't natively support sub mounting (like glusterfs). | |||
| ## | |||
| subPath: "" | |||
| ## Expose the MinIO service to be accessed from outside the cluster (LoadBalancer service). | |||
| ## or access it from within the cluster (ClusterIP service). Set the service type and the port to serve it. | |||
| ## ref: http://kubernetes.io/docs/user-guide/services/ | |||
| ## | |||
| service: | |||
| type: ClusterIP | |||
| clusterIP: ~ | |||
| port: "9000" | |||
| nodePort: 32000 | |||
| ## Configure Ingress based on the documentation here: https://kubernetes.io/docs/concepts/services-networking/ingress/ | |||
| ## | |||
| ingress: | |||
| enabled: false | |||
| # ingressClassName: "" | |||
| labels: {} | |||
| # node-role.kubernetes.io/ingress: platform | |||
| annotations: {} | |||
| # kubernetes.io/ingress.class: nginx | |||
| # kubernetes.io/tls-acme: "true" | |||
| # kubernetes.io/ingress.allow-http: "false" | |||
| # kubernetes.io/ingress.global-static-ip-name: "" | |||
| # nginx.ingress.kubernetes.io/secure-backends: "true" | |||
| # nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" | |||
| # nginx.ingress.kubernetes.io/whitelist-source-range: 0.0.0.0/0 | |||
| path: / | |||
| hosts: | |||
| - minio-example.local | |||
| tls: [] | |||
| # - secretName: chart-example-tls | |||
| # hosts: | |||
| # - chart-example.local | |||
| consoleService: | |||
| type: ClusterIP | |||
| clusterIP: ~ | |||
| port: "9001" | |||
| nodePort: 32001 | |||
| consoleIngress: | |||
| enabled: false | |||
| # ingressClassName: "" | |||
| labels: {} | |||
| # node-role.kubernetes.io/ingress: platform | |||
| annotations: {} | |||
| # kubernetes.io/ingress.class: nginx | |||
| # kubernetes.io/tls-acme: "true" | |||
| # kubernetes.io/ingress.allow-http: "false" | |||
| # kubernetes.io/ingress.global-static-ip-name: "" | |||
| # nginx.ingress.kubernetes.io/secure-backends: "true" | |||
| # nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" | |||
| # nginx.ingress.kubernetes.io/whitelist-source-range: 0.0.0.0/0 | |||
| path: / | |||
| hosts: | |||
| - console.minio-example.local | |||
| tls: [] | |||
| # - secretName: chart-example-tls | |||
| # hosts: | |||
| # - chart-example.local | |||
| ## Node labels for pod assignment | |||
| ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ | |||
| ## | |||
| nodeSelector: {} | |||
| tolerations: [] | |||
| affinity: {} | |||
| topologySpreadConstraints: [] | |||
| ## Add stateful containers to have security context, if enabled MinIO will run as this | |||
| ## user and group NOTE: securityContext is only enabled if persistence.enabled=true | |||
| securityContext: | |||
| enabled: true | |||
| runAsUser: 1000 | |||
| runAsGroup: 1000 | |||
| fsGroup: 1000 | |||
| fsGroupChangePolicy: "OnRootMismatch" | |||
| # Additational pod annotations | |||
| podAnnotations: {} | |||
| # Additional pod labels | |||
| podLabels: {} | |||
| ## Configure resource requests and limits | |||
| ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ | |||
| ## | |||
| resources: | |||
| requests: | |||
| memory: 16Gi | |||
| ## List of policies to be created after minio install | |||
| ## | |||
| ## In addition to default policies [readonly|readwrite|writeonly|consoleAdmin|diagnostics] | |||
| ## you can define additional policies with custom supported actions and resources | |||
| policies: [] | |||
| ## writeexamplepolicy policy grants creation or deletion of buckets with name | |||
| ## starting with example. In addition, grants objects write permissions on buckets starting with | |||
| ## example. | |||
| # - name: writeexamplepolicy | |||
| # statements: | |||
| # - resources: | |||
| # - 'arn:aws:s3:::example*/*' | |||
| # actions: | |||
| # - "s3:AbortMultipartUpload" | |||
| # - "s3:GetObject" | |||
| # - "s3:DeleteObject" | |||
| # - "s3:PutObject" | |||
| # - "s3:ListMultipartUploadParts" | |||
| # - resources: | |||
| # - 'arn:aws:s3:::example*' | |||
| # actions: | |||
| # - "s3:CreateBucket" | |||
| # - "s3:DeleteBucket" | |||
| # - "s3:GetBucketLocation" | |||
| # - "s3:ListBucket" | |||
| # - "s3:ListBucketMultipartUploads" | |||
| ## readonlyexamplepolicy policy grants access to buckets with name starting with example. | |||
| ## In addition, grants objects read permissions on buckets starting with example. | |||
| # - name: readonlyexamplepolicy | |||
| # statements: | |||
| # - resources: | |||
| # - 'arn:aws:s3:::example*/*' | |||
| # actions: | |||
| # - "s3:GetObject" | |||
| # - resources: | |||
| # - 'arn:aws:s3:::example*' | |||
| # actions: | |||
| # - "s3:GetBucketLocation" | |||
| # - "s3:ListBucket" | |||
| # - "s3:ListBucketMultipartUploads" | |||
| ## conditionsexample policy creates all access to example bucket with aws:username="johndoe" and source ip range 10.0.0.0/8 and 192.168.0.0/24 only | |||
| # - name: conditionsexample | |||
| # statements: | |||
| # - resources: | |||
| # - 'arn:aws:s3:::example/*' | |||
| # actions: | |||
| # - 's3:*' | |||
| # conditions: | |||
| # - StringEquals: '"aws:username": "johndoe"' | |||
| # - IpAddress: | | |||
| # "aws:SourceIp": [ | |||
| # "10.0.0.0/8", | |||
| # "192.168.0.0/24" | |||
| # ] | |||
| # | |||
| ## Additional Annotations for the Kubernetes Job makePolicyJob | |||
| makePolicyJob: | |||
| podAnnotations: {} | |||
| annotations: {} | |||
| securityContext: | |||
| enabled: false | |||
| runAsUser: 1000 | |||
| runAsGroup: 1000 | |||
| fsGroup: 1000 | |||
| resources: | |||
| requests: | |||
| memory: 128Mi | |||
| nodeSelector: {} | |||
| tolerations: [] | |||
| affinity: {} | |||
| extraVolumes: [] | |||
| extraVolumeMounts: [] | |||
| # Command to run after the main command on exit | |||
| exitCommand: "" | |||
| ## List of users to be created after minio install | |||
| ## | |||
| users: | |||
| ## Username, password and policy to be assigned to the user | |||
| ## Default policies are [readonly|readwrite|writeonly|consoleAdmin|diagnostics] | |||
| ## Add new policies as explained here https://docs.min.io/docs/minio-multi-user-quickstart-guide.html | |||
| ## NOTE: this will fail if LDAP is enabled in your MinIO deployment | |||
| ## make sure to disable this if you are using LDAP. | |||
| - accessKey: console | |||
| secretKey: console123 | |||
| policy: consoleAdmin | |||
| # Or you can refer to specific secret | |||
| #- accessKey: externalSecret | |||
| # existingSecret: my-secret | |||
| # existingSecretKey: password | |||
| # policy: readonly | |||
| ## Additional Annotations for the Kubernetes Job makeUserJob | |||
| makeUserJob: | |||
| podAnnotations: {} | |||
| annotations: {} | |||
| securityContext: | |||
| enabled: false | |||
| runAsUser: 1000 | |||
| runAsGroup: 1000 | |||
| fsGroup: 1000 | |||
| resources: | |||
| requests: | |||
| memory: 128Mi | |||
| nodeSelector: {} | |||
| tolerations: [] | |||
| affinity: {} | |||
| extraVolumes: [] | |||
| extraVolumeMounts: [] | |||
| # Command to run after the main command on exit | |||
| exitCommand: "" | |||
| ## List of buckets to be created after minio install | |||
| ## | |||
| buckets: | |||
| # # Name of the bucket | |||
| # - name: bucket1 | |||
| # # Policy to be set on the | |||
| # # bucket [none|download|upload|public] | |||
| # policy: none | |||
| # # Purge if bucket exists already | |||
| # purge: false | |||
| # # set versioning for | |||
| # # bucket [true|false] | |||
| # versioning: false | |||
| # # set objectlocking for | |||
| # # bucket [true|false] NOTE: versioning is enabled by default if you use locking | |||
| # objectlocking: false | |||
| # - name: bucket2 | |||
| # policy: none | |||
| # purge: false | |||
| # versioning: true | |||
| # # set objectlocking for | |||
| # # bucket [true|false] NOTE: versioning is enabled by default if you use locking | |||
| # objectlocking: false | |||
| ## Additional Annotations for the Kubernetes Job makeBucketJob | |||
| makeBucketJob: | |||
| podAnnotations: {} | |||
| annotations: {} | |||
| securityContext: | |||
| enabled: false | |||
| runAsUser: 1000 | |||
| runAsGroup: 1000 | |||
| fsGroup: 1000 | |||
| resources: | |||
| requests: | |||
| memory: 128Mi | |||
| nodeSelector: {} | |||
| tolerations: [] | |||
| affinity: {} | |||
| extraVolumes: [] | |||
| extraVolumeMounts: [] | |||
| # Command to run after the main command on exit | |||
| exitCommand: "" | |||
| ## List of command to run after minio install | |||
| ## NOTE: the mc command TARGET is always "myminio" | |||
| customCommands: | |||
| # - command: "admin policy set myminio consoleAdmin group='cn=ops,cn=groups,dc=example,dc=com'" | |||
| ## Additional Annotations for the Kubernetes Job customCommandJob | |||
| customCommandJob: | |||
| podAnnotations: {} | |||
| annotations: {} | |||
| securityContext: | |||
| enabled: false | |||
| runAsUser: 1000 | |||
| runAsGroup: 1000 | |||
| fsGroup: 1000 | |||
| resources: | |||
| requests: | |||
| memory: 128Mi | |||
| nodeSelector: {} | |||
| tolerations: [] | |||
| affinity: {} | |||
| # Command to run after the main command on exit | |||
| exitCommand: "" | |||
| ## Use this field to add environment variables relevant to MinIO server. These fields will be passed on to MinIO container(s) | |||
| ## when Chart is deployed | |||
| environment: | |||
| ## Please refer for comprehensive list https://docs.min.io/minio/baremetal/reference/minio-server/minio-server.html | |||
| ## MINIO_SUBNET_LICENSE: "License key obtained from https://subnet.min.io" | |||
| ## MINIO_BROWSER: "off" | |||
| ## The name of a secret in the same kubernetes namespace which contain secret values | |||
| ## This can be useful for LDAP password, etc | |||
| ## The key in the secret must be 'config.env' | |||
| ## | |||
| # extraSecret: minio-extraenv | |||
| ## OpenID Identity Management | |||
| ## The following section documents environment variables for enabling external identity management using an OpenID Connect (OIDC)-compatible provider. | |||
| ## See https://docs.min.io/minio/baremetal/security/openid-external-identity-management/external-authentication-with-openid-identity-provider.html#minio-external-identity-management-openid for a tutorial on using these variables. | |||
| oidc: | |||
| enabled: false | |||
| configUrl: "https://identity-provider-url/.well-known/openid-configuration" | |||
| clientId: "minio" | |||
| clientSecret: "" | |||
| claimName: "policy" | |||
| scopes: "openid,profile,email" | |||
| redirectUri: "https://console-endpoint-url/oauth_callback" | |||
| # Can leave empty | |||
| claimPrefix: "" | |||
| comment: "" | |||
| networkPolicy: | |||
| enabled: false | |||
| allowExternal: true | |||
| ## PodDisruptionBudget settings | |||
| ## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ | |||
| ## | |||
| podDisruptionBudget: | |||
| enabled: false | |||
| maxUnavailable: 1 | |||
| ## Specify the service account to use for the MinIO pods. If 'create' is set to 'false' | |||
| ## and 'name' is left unspecified, the account 'default' will be used. | |||
| serviceAccount: | |||
| create: true | |||
| ## The name of the service account to use. If 'create' is 'true', a service account with that name | |||
| ## will be created. | |||
| name: "minio-sa" | |||
| metrics: | |||
| serviceMonitor: | |||
| enabled: false | |||
| # scrape each node/pod individually for additional metrics | |||
| includeNode: false | |||
| public: true | |||
| additionalLabels: {} | |||
| # for node metrics | |||
| relabelConfigs: {} | |||
| # for cluster metrics | |||
| relabelConfigsCluster: {} | |||
| # metricRelabelings: | |||
| # - regex: (server|pod) | |||
| # action: labeldrop | |||
| # namespace: monitoring | |||
| # interval: 30s | |||
| # scrapeTimeout: 10s | |||
| ## ETCD settings: https://github.com/minio/minio/blob/master/docs/sts/etcd.md | |||
| ## Define endpoints to enable this section. | |||
| etcd: | |||
| endpoints: [] | |||
| pathPrefix: "" | |||
| corednsPathPrefix: "" | |||
| clientCert: "" | |||
| clientCertKey: "" | |||
| @@ -0,0 +1,4 @@ | |||
| ## Introduction | |||
| The Helm Charts found under the examples directory are getting started examples which you can use to deploy Loki using the Simple Scalable architecture quickly. Currently, the examples include: | |||
| - [Deploying Grafana Enterprise Logs (Loki in Enterprise mode)](https://github.com/grafana/loki/tree/main/production/helm/loki/docs/examples/enterprise) | |||
| - [Deploying Loki OSS](https://github.com/grafana/loki/tree/main/production/helm/loki/docs/examples/oss) | |||
| @@ -0,0 +1,28 @@ | |||
| ## Introduction | |||
| This example gives you an example or getting started overrides value file for deploying Loki (Enterprise Licensed) using the Simple Scalable architecture in GKE and using GCS. | |||
| ## Installation of Helm Chart | |||
| These instructions assume you already have access to a Kubernetes cluster, GCS Bucket and GCP Service Account which has read/write permissions to that GCS Bucket. | |||
| ### Populate Secret Values | |||
| Populate the [enterprise-secrets.yaml](./enterprise-secrets.yaml) so that: | |||
| - The `gcp_service_account.json` secret has the contents of your GCP Service Account JSON key. | |||
| - The `license.jwt` secret has the contents of your Grafana Enterprise Logs license key given to your by Grafana Labs. | |||
| Deploy the secrets file to your k8s cluster with the command: | |||
| `kubectl apply -f enterprise-secrets.yaml` | |||
| ### Configure the Helm Chart | |||
| Open [overrides-enterprise-gcs.yaml](./overrides-enterprise-gcs.yaml) and replace `{YOUR_GCS_BUCKET}` with the name of your GCS bucket. If there are other things you'd like to configure, view the core [Values.yaml file](https://github.com/grafana/helm-charts/blob/main/charts/loki-simple-scalable/values.yaml) and override anything else you need to within the overrides-enterprise-gcs.yaml file. | |||
| ### Install the Helm chart | |||
| `helm upgrade --install --values {PATH_TO_YOUR_OVERRIDES_YAML_FILE} {YOUR_RELEASE_NAME} grafana/loki-simple-scalable --namespace {KUBERNETES_NAMESPACE}` | |||
| ### Get the Token for Grafana to connect | |||
| `export POD_NAME=$(kubectl get pods --namespace {KUBERNETES_NAMESPACE} -l "job-name=enterprise-logs-tokengen" -o jsonpath="{.items[0].metadata.name}")` | |||
| `kubectl --namespace {KUBERNETES_NAMESPACE} logs $POD_NAME loki | grep Token` | |||
| Take note of this token, you will need it when connecting Grafana Enterprise Logs to Grafana. | |||
| @@ -0,0 +1,12 @@ | |||
| apiVersion: v1 | |||
| kind: Secret | |||
| metadata: | |||
| name: gel-secrets | |||
| type: Opaque | |||
| stringData: | |||
| gcp_service_account.json: | | |||
| { | |||
| GCP_SERVICE_ACCOUNT_JSON_HERE | |||
| } | |||
| license.jwt: LICENSE_HERE | |||
| @@ -0,0 +1,83 @@ | |||
| enterprise: | |||
| enabled: true | |||
| useExternalLicense: true | |||
| externalLicenseName: gel-secrets | |||
| tokengen: | |||
| env: | |||
| - name: GOOGLE_APPLICATION_CREDENTIALS | |||
| value: "/etc/gel_secrets/gcp_service_account.json" | |||
| extraVolumeMounts: | |||
| - name: gel-secrets | |||
| mountPath: "/etc/gel_secrets" | |||
| extraVolumes: | |||
| - name: gel-secrets | |||
| secret: | |||
| secretName: gel-secrets | |||
| items: | |||
| - key: license.jwt | |||
| path: license.jwt | |||
| - key: gcp_service_account.json | |||
| path: gcp_service_account.json | |||
| loki: | |||
| auth_enabled: true | |||
| storage: | |||
| type: gcs | |||
| bucketNames: | |||
| chunks: {YOUR_GCS_BUCKET} | |||
| ruler: {YOUR_GCS_BUCKET} | |||
| admin: {YOUR_GCS_BUCKET} | |||
| minio: | |||
| enabled: false | |||
| write: | |||
| extraEnv: | |||
| - name: GOOGLE_APPLICATION_CREDENTIALS | |||
| value: "/etc/gel_secrets/gcp_service_account.json" | |||
| extraVolumeMounts: | |||
| - name: gel-secrets | |||
| mountPath: "/etc/gel_secrets" | |||
| extraVolumes: | |||
| - name: gel-secrets | |||
| secret: | |||
| secretName: gel-secrets | |||
| items: | |||
| - key: license.jwt | |||
| path: license.jwt | |||
| - key: gcp_service_account.json | |||
| path: gcp_service_account.json | |||
| read: | |||
| extraEnv: | |||
| - name: GOOGLE_APPLICATION_CREDENTIALS | |||
| value: "/etc/gel_secrets/gcp_service_account.json" | |||
| extraVolumeMounts: | |||
| - name: gel-secrets | |||
| mountPath: "/etc/gel_secrets" | |||
| extraVolumes: | |||
| - name: gel-secrets | |||
| secret: | |||
| secretName: gel-secrets | |||
| items: | |||
| - key: license.jwt | |||
| path: license.jwt | |||
| - key: gcp_service_account.json | |||
| path: gcp_service_account.json | |||
| gateway: | |||
| extraEnv: | |||
| - name: GOOGLE_APPLICATION_CREDENTIALS | |||
| value: "/etc/gel_secrets/gcp_service_account.json" | |||
| extraVolumeMounts: | |||
| - name: gel-secrets | |||
| mountPath: "/etc/gel_secrets" | |||
| extraVolumes: | |||
| - name: gel-secrets | |||
| secret: | |||
| secretName: gel-secrets | |||
| items: | |||
| - key: license.jwt | |||
| path: license.jwt | |||
| - key: gcp_service_account.json | |||
| path: gcp_service_account.json | |||
| @@ -0,0 +1,20 @@ | |||
| ## Introduction | |||
| This example gives you an example or getting started overrides value file for deploying Loki (OSS) using the Simple Scalable architecture in GKE and using GCS | |||
| ## Installation of Helm Chart | |||
| These instructions assume you have already have access to a Kubernetes cluster, GCS Bucket and GCP Service Account which has read/write permissions to that GCS Bucket. | |||
| ### Populate Secret Values | |||
| Populate the examples/enterprise/enterprise-secrets.yaml so that: | |||
| - The gcp_service_account.json secret has the contents of your GCP Service Account JSON key | |||
| Deploy the secrets file to your k8s cluster. | |||
| `kubectl apply -f loki-secrets.yaml` | |||
| ### Configure the Helm Chart | |||
| Open examples/enterprise/overides-oss-gcs.yaml and replace `{YOUR_GCS_BUCKET}` with the name of your GCS bucket. If there are other things you'd like to configure, view the core [Values.yaml file](https://github.com/grafana/helm-charts/blob/main/charts/loki-simple-scalable/values.yaml) and override anything else you need to within the overrides-enterprise-gcs.yaml file. | |||
| ### Install the Helm chart | |||
| `helm upgrade --install --values {PATH_TO_YOUR_OVERRIDES_YAML_FILE} {YOUR_RELEASE_NAME} grafana/loki-simple-scalable --namespace {KUBERNETES_NAMESPACE}` | |||
| @@ -0,0 +1,10 @@ | |||
| apiVersion: v1 | |||
| kind: Secret | |||
| metadata: | |||
| name: loki-secrets | |||
| type: Opaque | |||
| stringData: | |||
| gcp_service_account.json: | | |||
| { | |||
| GCP_SERVICE_ACCOUNT_JSON_HERE | |||
| } | |||
| @@ -0,0 +1,77 @@ | |||
| enterprise: | |||
| enabled: false | |||
| adminApi: | |||
| enabled: false | |||
| useExternalLicense: false | |||
| config: | | |||
| admin_client: | |||
| storage: | |||
| gcs: | |||
| bucket_name: {YOUR_GCS_BUCKET} | |||
| auth: | |||
| type: trust | |||
| auth_enabled: false | |||
| cluster_name: loki-logs | |||
| loki: | |||
| auth_enabled: false | |||
| commonConfig: | |||
| path_prefix: /var/loki | |||
| replication_factor: 3 | |||
| storage: | |||
| type: gcs | |||
| bucketNames: | |||
| chunks: {YOUR_GCS_BUCKET} | |||
| ruler: {YOUR_GCS_BUCKET} | |||
| admin: {YOUR_GCS_BUCKET} | |||
| minio: | |||
| enabled: false | |||
| write: | |||
| extraEnv: | |||
| - name: GOOGLE_APPLICATION_CREDENTIALS | |||
| value: "/etc/loki_secrets/gcp_service_account.json" | |||
| extraVolumeMounts: | |||
| - name: loki-secrets | |||
| mountPath: "/etc/loki_secrets" | |||
| extraVolumes: | |||
| - name: loki-secrets | |||
| secret: | |||
| secretName: loki-secrets | |||
| items: | |||
| - key: gcp_service_account.json | |||
| path: gcp_service_account.json | |||
| read: | |||
| extraEnv: | |||
| - name: GOOGLE_APPLICATION_CREDENTIALS | |||
| value: "/etc/loki_secrets/gcp_service_account.json" | |||
| extraVolumeMounts: | |||
| - name: loki-secrets | |||
| mountPath: "/etc/loki_secrets" | |||
| extraVolumes: | |||
| - name: loki-secrets | |||
| secret: | |||
| secretName: loki-secrets | |||
| items: | |||
| - key: gcp_service_account.json | |||
| path: gcp_service_account.json | |||
| gateway: | |||
| extraEnv: | |||
| - name: GOOGLE_APPLICATION_CREDENTIALS | |||
| value: "/etc/loki_secrets/gcp_service_account.json" | |||
| extraVolumeMounts: | |||
| - name: loki-secrets | |||
| mountPath: "/etc/loki_secrets" | |||
| extraVolumes: | |||
| - name: loki-secrets | |||
| secret: | |||
| secretName: loki-secrets | |||
| items: | |||
| - key: gcp_service_account.json | |||
| path: gcp_service_account.json | |||
| @@ -0,0 +1,49 @@ | |||
| --- | |||
| title: Helm Chart Values | |||
| menuTitle: Helm chart values | |||
| description: Reference for Helm Chart values. | |||
| aliases: | |||
| - ../../../installation/helm/reference/ | |||
| weight: 500 | |||
| keywords: [] | |||
| --- | |||
| <!-- Autogenerated. Modify ../production/helm/loki/reference.md.gotmpl --> | |||
| # Helm Chart Values | |||
| <!-- vale Grafana.Quotes = NO --> | |||
| <!-- The reference title is required. Use a noun-based title. --> | |||
| <!-- vale Grafana.Quotes = YES --> | |||
| This is the generated reference for the Loki Helm Chart values. | |||
| > **Note:** This reference is for the Loki Helm chart version 3.0 or greater. | |||
| > If you are using the `grafana/loki-stack` Helm chart from the community repo, | |||
| > please refer to the `values.yaml` of the respective Github repository | |||
| > [grafana/helm-charts](https://github.com/grafana/helm-charts/tree/main/charts/loki-stack). | |||
| <!-- Override default values table from helm-docs. See https://github.com/norwoodj/helm-docs/tree/master#advanced-table-rendering --> | |||
| {{ define "chart.valuesTableHtml" }} | |||
| {{ `{{< responsive-table >}}` }} | |||
| <table> | |||
| <thead> | |||
| <th>Key</th> | |||
| <th>Type</th> | |||
| <th>Description</th> | |||
| <th>Default</th> | |||
| </thead> | |||
| <tbody> | |||
| {{- range .Values }} | |||
| <tr> | |||
| <td>{{ .Key }}</td> | |||
| <td>{{ .Type }}</td> | |||
| <td>{{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }}</td> | |||
| <td>{{ template "chart.valueDefaultColumnRender" . }}</td> | |||
| </tr> | |||
| {{- end }} | |||
| </tbody> | |||
| </table> | |||
| {{ `{{< /responsive-table >}}` }} | |||
| {{ end }} | |||
| {{ template "chart.valuesTableHtml" . }} | |||
| @@ -0,0 +1,4 @@ | |||
| --- | |||
| rules: | |||
| quoted-strings: | |||
| required: true | |||
| @@ -0,0 +1,78 @@ | |||
| --- | |||
| groups: | |||
| - name: "loki_alerts" | |||
| rules: | |||
| {{- if not (.Values.monitoring.rules.disabled.LokiRequestErrors | default false) }} | |||
| - alert: "LokiRequestErrors" | |||
| annotations: | |||
| message: | | |||
| {{`{{`}} $labels.job {{`}}`}} {{`{{`}} $labels.route {{`}}`}} is experiencing {{`{{`}} printf "%.2f" $value {{`}}`}}% errors. | |||
| expr: | | |||
| 100 * sum(rate(loki_request_duration_seconds_count{status_code=~"5.."}[2m])) by (namespace, job, route) | |||
| / | |||
| sum(rate(loki_request_duration_seconds_count[2m])) by (namespace, job, route) | |||
| > 10 | |||
| for: "15m" | |||
| labels: | |||
| severity: "critical" | |||
| {{- if .Values.monitoring.rules.additionalRuleLabels }} | |||
| {{ toYaml .Values.monitoring.rules.additionalRuleLabels | indent 10 }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- if not (.Values.monitoring.rules.disabled.LokiRequestPanics | default false) }} | |||
| - alert: "LokiRequestPanics" | |||
| annotations: | |||
| message: | | |||
| {{`{{`}} $labels.job {{`}}`}} is experiencing {{`{{`}} printf "%.2f" $value {{`}}`}}% increase of panics. | |||
| expr: | | |||
| sum(increase(loki_panic_total[10m])) by (namespace, job) > 0 | |||
| labels: | |||
| severity: "critical" | |||
| {{- if .Values.monitoring.rules.additionalRuleLabels }} | |||
| {{ toYaml .Values.monitoring.rules.additionalRuleLabels | indent 10 }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- if not (.Values.monitoring.rules.disabled.LokiRequestLatency | default false) }} | |||
| - alert: "LokiRequestLatency" | |||
| annotations: | |||
| message: | | |||
| {{`{{`}} $labels.job {{`}}`}} {{`{{`}} $labels.route {{`}}`}} is experiencing {{`{{`}} printf "%.2f" $value {{`}}`}}s 99th percentile latency. | |||
| expr: | | |||
| namespace_job_route:loki_request_duration_seconds:99quantile{route!~"(?i).*tail.*"} > 1 | |||
| for: "15m" | |||
| labels: | |||
| severity: "critical" | |||
| {{- if .Values.monitoring.rules.additionalRuleLabels }} | |||
| {{ toYaml .Values.monitoring.rules.additionalRuleLabels | indent 10 }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- if not (.Values.monitoring.rules.disabled.LokiTooManyCompactorsRunning | default false) }} | |||
| - alert: "LokiTooManyCompactorsRunning" | |||
| annotations: | |||
| message: | | |||
| {{`{{`}} $labels.cluster {{`}}`}} {{`{{`}} $labels.namespace {{`}}`}} has had {{`{{`}} printf "%.0f" $value {{`}}`}} compactors running for more than 5m. Only one compactor should run at a time. | |||
| expr: | | |||
| sum(loki_boltdb_shipper_compactor_running) by (namespace, cluster) > 1 | |||
| for: "5m" | |||
| labels: | |||
| severity: "warning" | |||
| {{- if .Values.monitoring.rules.additionalRuleLabels }} | |||
| {{ toYaml .Values.monitoring.rules.additionalRuleLabels | indent 10 }} | |||
| {{- end }} | |||
| {{- end }} | |||
| {{- if not (.Values.monitoring.rules.disabled.LokiCanaryLatency | default false) }} | |||
| - name: "loki_canaries_alerts" | |||
| rules: | |||
| - alert: "LokiCanaryLatency" | |||
| annotations: | |||
| message: | | |||
| {{`{{`}} $labels.job {{`}}`}} is experiencing {{`{{`}} printf "%.2f" $value {{`}}`}}s 99th percentile latency. | |||
| expr: | | |||
| histogram_quantile(0.99, sum(rate(loki_canary_response_latency_seconds_bucket[5m])) by (le, namespace, job)) > 5 | |||
| for: "15m" | |||
| labels: | |||
| severity: "warning" | |||
| {{- if .Values.monitoring.rules.additionalRuleLabels }} | |||
| {{ toYaml .Values.monitoring.rules.additionalRuleLabels | indent 10 }} | |||
| {{- end }} | |||
| {{- end }} | |||
| @@ -0,0 +1,632 @@ | |||
| { | |||
| "annotations": { | |||
| "list": [ ] | |||
| }, | |||
| "editable": true, | |||
| "gnetId": null, | |||
| "graphTooltip": 0, | |||
| "hideControls": false, | |||
| "links": [ | |||
| { | |||
| "asDropdown": true, | |||
| "icon": "external link", | |||
| "includeVars": true, | |||
| "keepTime": true, | |||
| "tags": [ | |||
| "loki" | |||
| ], | |||
| "targetBlank": false, | |||
| "title": "Loki Dashboards", | |||
| "type": "dashboards" | |||
| } | |||
| ], | |||
| "refresh": "10s", | |||
| "rows": [ | |||
| { | |||
| "collapse": false, | |||
| "height": "100px", | |||
| "panels": [ | |||
| { | |||
| "aliasColors": { }, | |||
| "bars": false, | |||
| "dashLength": 10, | |||
| "dashes": false, | |||
| "datasource": "$datasource", | |||
| "fill": 1, | |||
| "format": "none", | |||
| "id": 1, | |||
| "legend": { | |||
| "avg": false, | |||
| "current": false, | |||
| "max": false, | |||
| "min": false, | |||
| "show": true, | |||
| "total": false, | |||
| "values": false | |||
| }, | |||
| "lines": true, | |||
| "linewidth": 1, | |||
| "links": [ ], | |||
| "nullPointMode": "null as zero", | |||
| "percentage": false, | |||
| "pointradius": 5, | |||
| "points": false, | |||
| "renderer": "flot", | |||
| "seriesOverrides": [ ], | |||
| "spaceLength": 10, | |||
| "span": 6, | |||
| "stack": false, | |||
| "steppedLine": false, | |||
| "targets": [ | |||
| { | |||
| "expr": "sum(loki_compactor_pending_delete_requests_count{cluster=~\"$cluster\", namespace=~\"$namespace\"})", | |||
| "format": "time_series", | |||
| "instant": true, | |||
| "intervalFactor": 2, | |||
| "refId": "A" | |||
| } | |||
| ], | |||
| "thresholds": "70,80", | |||
| "timeFrom": null, | |||
| "timeShift": null, | |||
| "title": "Number of Pending Requests", | |||
| "tooltip": { | |||
| "shared": true, | |||
| "sort": 2, | |||
| "value_type": "individual" | |||
| }, | |||
| "type": "singlestat", | |||
| "xaxis": { | |||
| "buckets": null, | |||
| "mode": "time", | |||
| "name": null, | |||
| "show": true, | |||
| "values": [ ] | |||
| }, | |||
| "yaxes": [ | |||
| { | |||
| "format": "short", | |||
| "label": null, | |||
| "logBase": 1, | |||
| "max": null, | |||
| "min": 0, | |||
| "show": true | |||
| }, | |||
| { | |||
| "format": "short", | |||
| "label": null, | |||
| "logBase": 1, | |||
| "max": null, | |||
| "min": null, | |||
| "show": false | |||
| } | |||
| ] | |||
| }, | |||
| { | |||
| "aliasColors": { }, | |||
| "bars": false, | |||
| "dashLength": 10, | |||
| "dashes": false, | |||
| "datasource": "$datasource", | |||
| "fill": 1, | |||
| "format": "dtdurations", | |||
| "id": 2, | |||
| "legend": { | |||
| "avg": false, | |||
| "current": false, | |||
| "max": false, | |||
| "min": false, | |||
| "show": true, | |||
| "total": false, | |||
| "values": false | |||
| }, | |||
| "lines": true, | |||
| "linewidth": 1, | |||
| "links": [ ], | |||
| "nullPointMode": "null as zero", | |||
| "percentage": false, | |||
| "pointradius": 5, | |||
| "points": false, | |||
| "renderer": "flot", | |||
| "seriesOverrides": [ ], | |||
| "spaceLength": 10, | |||
| "span": 6, | |||
| "stack": false, | |||
| "steppedLine": false, | |||
| "targets": [ | |||
| { | |||
| "expr": "max(loki_compactor_oldest_pending_delete_request_age_seconds{cluster=~\"$cluster\", namespace=~\"$namespace\"})", | |||
| "format": "time_series", | |||
| "instant": true, | |||
| "intervalFactor": 2, | |||
| "refId": "A" | |||
| } | |||
| ], | |||
| "thresholds": "70,80", | |||
| "timeFrom": null, | |||
| "timeShift": null, | |||
| "title": "Oldest Pending Request Age", | |||
| "tooltip": { | |||
| "shared": true, | |||
| "sort": 2, | |||
| "value_type": "individual" | |||
| }, | |||
| "type": "singlestat", | |||
| "xaxis": { | |||
| "buckets": null, | |||
| "mode": "time", | |||
| "name": null, | |||
| "show": true, | |||
| "values": [ ] | |||
| }, | |||
| "yaxes": [ | |||
| { | |||
| "format": "short", | |||
| "label": null, | |||
| "logBase": 1, | |||
| "max": null, | |||
| "min": 0, | |||
| "show": true | |||
| }, | |||
| { | |||
| "format": "short", | |||
| "label": null, | |||
| "logBase": 1, | |||
| "max": null, | |||
| "min": null, | |||
| "show": false | |||
| } | |||
| ] | |||
| } | |||
| ], | |||
| "repeat": null, | |||
| "repeatIteration": null, | |||
| "repeatRowId": null, | |||
| "showTitle": false, | |||
| "title": "Headlines", | |||
| "titleSize": "h6" | |||
| }, | |||
| { | |||
| "collapse": false, | |||
| "height": "250px", | |||
| "panels": [ | |||
| { | |||
| "aliasColors": { }, | |||
| "bars": false, | |||
| "dashLength": 10, | |||
| "dashes": false, | |||
| "datasource": "$datasource", | |||
| "fill": 1, | |||
| "id": 3, | |||
| "legend": { | |||
| "avg": false, | |||
| "current": false, | |||
| "max": false, | |||
| "min": false, | |||
| "show": true, | |||
| "total": false, | |||
| "values": false | |||
| }, | |||
| "lines": true, | |||
| "linewidth": 1, | |||
| "links": [ ], | |||
| "nullPointMode": "null as zero", | |||
| "percentage": false, | |||
| "pointradius": 5, | |||
| "points": false, | |||
| "renderer": "flot", | |||
| "seriesOverrides": [ ], | |||
| "spaceLength": 10, | |||
| "span": 6, | |||
| "stack": false, | |||
| "steppedLine": false, | |||
| "targets": [ | |||
| { | |||
| "expr": "sum(increase(loki_compactor_delete_requests_received_total{cluster=~\"$cluster\", namespace=~\"$namespace\"}[1d]))", | |||
| "format": "time_series", | |||
| "intervalFactor": 2, | |||
| "legendFormat": "received", | |||
| "legendLink": null, | |||
| "step": 10 | |||
| } | |||
| ], | |||
| "thresholds": [ ], | |||
| "timeFrom": null, | |||
| "timeShift": null, | |||
| "title": "Delete Requests Received / Day", | |||
| "tooltip": { | |||
| "shared": true, | |||
| "sort": 2, | |||
| "value_type": "individual" | |||
| }, | |||
| "type": "graph", | |||
| "xaxis": { | |||
| "buckets": null, | |||
| "mode": "time", | |||
| "name": null, | |||
| "show": true, | |||
| "values": [ ] | |||
| }, | |||
| "yaxes": [ | |||
| { | |||
| "format": "short", | |||
| "label": null, | |||
| "logBase": 1, | |||
| "max": null, | |||
| "min": 0, | |||
| "show": true | |||
| }, | |||
| { | |||
| "format": "short", | |||
| "label": null, | |||
| "logBase": 1, | |||
| "max": null, | |||
| "min": null, | |||
| "show": false | |||
| } | |||
| ] | |||
| }, | |||
| { | |||
| "aliasColors": { }, | |||
| "bars": false, | |||
| "dashLength": 10, | |||
| "dashes": false, | |||
| "datasource": "$datasource", | |||
| "fill": 1, | |||
| "id": 4, | |||
| "legend": { | |||
| "avg": false, | |||
| "current": false, | |||
| "max": false, | |||
| "min": false, | |||
| "show": true, | |||
| "total": false, | |||
| "values": false | |||
| }, | |||
| "lines": true, | |||
| "linewidth": 1, | |||
| "links": [ ], | |||
| "nullPointMode": "null as zero", | |||
| "percentage": false, | |||
| "pointradius": 5, | |||
| "points": false, | |||
| "renderer": "flot", | |||
| "seriesOverrides": [ ], | |||
| "spaceLength": 10, | |||
| "span": 6, | |||
| "stack": false, | |||
| "steppedLine": false, | |||
| "targets": [ | |||
| { | |||
| "expr": "sum(increase(loki_compactor_delete_requests_processed_total{cluster=~\"$cluster\", namespace=~\"$namespace\"}[1d]))", | |||
| "format": "time_series", | |||
| "intervalFactor": 2, | |||
| "legendFormat": "processed", | |||
| "legendLink": null, | |||
| "step": 10 | |||
| } | |||
| ], | |||
| "thresholds": [ ], | |||
| "timeFrom": null, | |||
| "timeShift": null, | |||
| "title": "Delete Requests Processed / Day", | |||
| "tooltip": { | |||
| "shared": true, | |||
| "sort": 2, | |||
| "value_type": "individual" | |||
| }, | |||
| "type": "graph", | |||
| "xaxis": { | |||
| "buckets": null, | |||
| "mode": "time", | |||
| "name": null, | |||
| "show": true, | |||
| "values": [ ] | |||
| }, | |||
| "yaxes": [ | |||
| { | |||
| "format": "short", | |||
| "label": null, | |||
| "logBase": 1, | |||
| "max": null, | |||
| "min": 0, | |||
| "show": true | |||
| }, | |||
| { | |||
| "format": "short", | |||
| "label": null, | |||
| "logBase": 1, | |||
| "max": null, | |||
| "min": null, | |||
| "show": false | |||
| } | |||
| ] | |||
| } | |||
| ], | |||
| "repeat": null, | |||
| "repeatIteration": null, | |||
| "repeatRowId": null, | |||
| "showTitle": true, | |||
| "title": "Churn", | |||
| "titleSize": "h6" | |||
| }, | |||
| { | |||
| "collapse": false, | |||
| "height": "250px", | |||
| "panels": [ | |||
| { | |||
| "aliasColors": { }, | |||
| "bars": false, | |||
| "dashLength": 10, | |||
| "dashes": false, | |||
| "datasource": "$datasource", | |||
| "fill": 1, | |||
| "id": 5, | |||
| "legend": { | |||
| "avg": false, | |||
| "current": false, | |||
| "max": false, | |||
| "min": false, | |||
| "show": true, | |||
| "total": false, | |||
| "values": false | |||
| }, | |||
| "lines": true, | |||
| "linewidth": 1, | |||
| "links": [ ], | |||
| "nullPointMode": "null as zero", | |||
| "percentage": false, | |||
| "pointradius": 5, | |||
| "points": false, | |||
| "renderer": "flot", | |||
| "seriesOverrides": [ ], | |||
| "spaceLength": 10, | |||
| "span": 12, | |||
| "stack": false, | |||
| "steppedLine": false, | |||
| "targets": [ | |||
| { | |||
| "expr": "sum(increase(loki_compactor_load_pending_requests_attempts_total{status=\"fail\", cluster=~\"$cluster\", namespace=~\"$namespace\"}[1h]))", | |||
| "format": "time_series", | |||
| "intervalFactor": 2, | |||
| "legendFormat": "failures", | |||
| "legendLink": null, | |||
| "step": 10 | |||
| } | |||
| ], | |||
| "thresholds": [ ], | |||
| "timeFrom": null, | |||
| "timeShift": null, | |||
| "title": "Failures in Loading Delete Requests / Hour", | |||
| "tooltip": { | |||
| "shared": true, | |||
| "sort": 2, | |||
| "value_type": "individual" | |||
| }, | |||
| "type": "graph", | |||
| "xaxis": { | |||
| "buckets": null, | |||
| "mode": "time", | |||
| "name": null, | |||
| "show": true, | |||
| "values": [ ] | |||
| }, | |||
| "yaxes": [ | |||
| { | |||
| "format": "short", | |||
| "label": null, | |||
| "logBase": 1, | |||
| "max": null, | |||
| "min": 0, | |||
| "show": true | |||
| }, | |||
| { | |||
| "format": "short", | |||
| "label": null, | |||
| "logBase": 1, | |||
| "max": null, | |||
| "min": null, | |||
| "show": false | |||
| } | |||
| ] | |||
| } | |||
| ], | |||
| "repeat": null, | |||
| "repeatIteration": null, | |||
| "repeatRowId": null, | |||
| "showTitle": true, | |||
| "title": "Failures", | |||
| "titleSize": "h6" | |||
| }, | |||
| { | |||
| "collapse": false, | |||
| "height": "250px", | |||
| "panels": [ | |||
| { | |||
| "aliasColors": { }, | |||
| "bars": false, | |||
| "dashLength": 10, | |||
| "dashes": false, | |||
| "datasource": "$datasource", | |||
| "fill": 1, | |||
| "id": 6, | |||
| "legend": { | |||
| "avg": false, | |||
| "current": false, | |||
| "max": false, | |||
| "min": false, | |||
| "show": true, | |||
| "total": false, | |||
| "values": false | |||
| }, | |||
| "lines": true, | |||
| "linewidth": 1, | |||
| "links": [ ], | |||
| "nullPointMode": "null as zero", | |||
| "percentage": false, | |||
| "pointradius": 5, | |||
| "points": false, | |||
| "renderer": "flot", | |||
| "seriesOverrides": [ ], | |||
| "spaceLength": 10, | |||
| "span": 12, | |||
| "stack": false, | |||
| "steppedLine": false, | |||
| "targets": [ | |||
| { | |||
| "expr": "sum(rate(loki_compactor_deleted_lines{cluster=~\"$cluster\",job=~\"$namespace/(loki|enterprise-logs)-read\"}[$__rate_interval])) by (user)", | |||
| "format": "time_series", | |||
| "intervalFactor": 2, | |||
| "legendFormat": "{{user}}", | |||
| "legendLink": null, | |||
| "step": 10 | |||
| } | |||
| ], | |||
| "thresholds": [ ], | |||
| "timeFrom": null, | |||
| "timeShift": null, | |||
| "title": "Lines Deleted / Sec", | |||
| "tooltip": { | |||
| "shared": true, | |||
| "sort": 2, | |||
| "value_type": "individual" | |||
| }, | |||
| "type": "graph", | |||
| "xaxis": { | |||
| "buckets": null, | |||
| "mode": "time", | |||
| "name": null, | |||
| "show": true, | |||
| "values": [ ] | |||
| }, | |||
| "yaxes": [ | |||
| { | |||
| "format": "short", | |||
| "label": null, | |||
| "logBase": 1, | |||
| "max": null, | |||
| "min": 0, | |||
| "show": true | |||
| }, | |||
| { | |||
| "format": "short", | |||
| "label": null, | |||
| "logBase": 1, | |||
| "max": null, | |||
| "min": null, | |||
| "show": false | |||
| } | |||
| ] | |||
| } | |||
| ], | |||
| "repeat": null, | |||
| "repeatIteration": null, | |||
| "repeatRowId": null, | |||
| "showTitle": true, | |||
| "title": "Deleted lines", | |||
| "titleSize": "h6" | |||
| } | |||
| ], | |||
| "schemaVersion": 14, | |||
| "style": "dark", | |||
| "tags": [ | |||
| "loki" | |||
| ], | |||
| "templating": { | |||
| "list": [ | |||
| { | |||
| "current": { | |||
| "text": "default", | |||
| "value": "default" | |||
| }, | |||
| "hide": 0, | |||
| "label": "Data Source", | |||
| "name": "datasource", | |||
| "options": [ ], | |||
| "query": "prometheus", | |||
| "refresh": 1, | |||
| "regex": "", | |||
| "type": "datasource" | |||
| }, | |||
| { | |||
| "allValue": null, | |||
| "current": { | |||
| "text": "prod", | |||
| "value": "prod" | |||
| }, | |||
| "datasource": "$datasource", | |||
| "hide": 0, | |||
| "includeAll": false, | |||
| "label": "cluster", | |||
| "multi": false, | |||
| "name": "cluster", | |||
| "options": [ ], | |||
| "query": "label_values(loki_build_info, cluster)", | |||
| "refresh": 1, | |||
| "regex": "", | |||
| "sort": 2, | |||
| "tagValuesQuery": "", | |||
| "tags": [ ], | |||
| "tagsQuery": "", | |||
| "type": "query", | |||
| "useTags": false | |||
| }, | |||
| { | |||
| "allValue": null, | |||
| "current": { | |||
| "text": "prod", | |||
| "value": "prod" | |||
| }, | |||
| "datasource": "$datasource", | |||
| "hide": 0, | |||
| "includeAll": false, | |||
| "label": "namespace", | |||
| "multi": false, | |||
| "name": "namespace", | |||
| "options": [ ], | |||
| "query": "label_values(loki_build_info{cluster=~\"$cluster\"}, namespace)", | |||
| "refresh": 1, | |||
| "regex": "", | |||
| "sort": 2, | |||
| "tagValuesQuery": "", | |||
| "tags": [ ], | |||
| "tagsQuery": "", | |||
| "type": "query", | |||
| "useTags": false | |||
| } | |||
| ] | |||
| }, | |||
| "time": { | |||
| "from": "now-1h", | |||
| "to": "now" | |||
| }, | |||
| "timepicker": { | |||
| "refresh_intervals": [ | |||
| "5s", | |||
| "10s", | |||
| "30s", | |||
| "1m", | |||
| "5m", | |||
| "15m", | |||
| "30m", | |||
| "1h", | |||
| "2h", | |||
| "1d" | |||
| ], | |||
| "time_options": [ | |||
| "5m", | |||
| "15m", | |||
| "1h", | |||
| "6h", | |||
| "12h", | |||
| "24h", | |||
| "2d", | |||
| "7d", | |||
| "30d" | |||
| ] | |||
| }, | |||
| "timezone": "utc", | |||
| "title": "Loki / Deletion", | |||
| "uid": "deletion", | |||
| "version": 0 | |||
| } | |||
| @@ -0,0 +1,657 @@ | |||
| { | |||
| "annotations": { | |||
| "list": [ | |||
| { | |||
| "builtIn": 1, | |||
| "datasource": "-- Grafana --", | |||
| "enable": true, | |||
| "hide": true, | |||
| "iconColor": "rgba(0, 211, 255, 1)", | |||
| "name": "Annotations & Alerts", | |||
| "target": { | |||
| "limit": 100, | |||
| "matchAny": false, | |||
| "tags": [ ], | |||
| "type": "dashboard" | |||
| }, | |||
| "type": "dashboard" | |||
| }, | |||
| { | |||
| "datasource": "${datasource}", | |||
| "enable": false, | |||
| "expr": "sum by (tenant) (changes(loki_ruler_wal_prometheus_tsdb_wal_truncations_total{tenant=~\"${tenant}\"}[$__rate_interval]))", | |||
| "iconColor": "red", | |||
| "name": "WAL Truncations", | |||
| "target": { | |||
| "queryType": "Azure Monitor", | |||
| "refId": "Anno" | |||
| }, | |||
| "titleFormat": "{{tenant}}" | |||
| } | |||
| ] | |||
| }, | |||
| "editable": true, | |||
| "fiscalYearStartMonth": 0, | |||
| "gnetId": null, | |||
| "graphTooltip": 0, | |||
| "iteration": 1635347545534, | |||
| "links": [ ], | |||
| "liveNow": false, | |||
| "panels": [ | |||
| { | |||
| "datasource": "${datasource}", | |||
| "fieldConfig": { | |||
| "defaults": { | |||
| "color": { | |||
| "mode": "thresholds" | |||
| }, | |||
| "mappings": [ ], | |||
| "noValue": "0", | |||
| "thresholds": { | |||
| "mode": "absolute", | |||
| "steps": [ | |||
| { | |||
| "color": "green", | |||
| "value": null | |||
| }, | |||
| { | |||
| "color": "red", | |||
| "value": 1 | |||
| } | |||
| ] | |||
| } | |||
| }, | |||
| "overrides": [ ] | |||
| }, | |||
| "gridPos": { | |||
| "h": 10, | |||
| "w": 2, | |||
| "x": 0, | |||
| "y": 0 | |||
| }, | |||
| "id": 2, | |||
| "options": { | |||
| "colorMode": "value", | |||
| "graphMode": "area", | |||
| "justifyMode": "auto", | |||
| "orientation": "auto", | |||
| "reduceOptions": { | |||
| "calcs": [ | |||
| "lastNotNull" | |||
| ], | |||
| "fields": "", | |||
| "values": false | |||
| }, | |||
| "textMode": "auto" | |||
| }, | |||
| "pluginVersion": "8.3.0-38205pre", | |||
| "targets": [ | |||
| { | |||
| "datasource": "${datasource}", | |||
| "exemplar": false, | |||
| "expr": "sum(loki_ruler_wal_appender_ready) by (pod, tenant) == 0", | |||
| "instant": true, | |||
| "interval": "", | |||
| "legendFormat": "", | |||
| "refId": "A" | |||
| } | |||
| ], | |||
| "title": "Appenders Not Ready", | |||
| "type": "stat" | |||
| }, | |||
| { | |||
| "datasource": "${datasource}", | |||
| "description": "", | |||
| "fieldConfig": { | |||
| "defaults": { | |||
| "color": { | |||
| "mode": "palette-classic" | |||
| }, | |||
| "custom": { | |||
| "axisLabel": "", | |||
| "axisPlacement": "auto", | |||
| "barAlignment": 0, | |||
| "drawStyle": "line", | |||
| "fillOpacity": 0, | |||
| "gradientMode": "none", | |||
| "hideFrom": { | |||
| "legend": false, | |||
| "tooltip": false, | |||
| "viz": false | |||
| }, | |||
| "lineInterpolation": "linear", | |||
| "lineWidth": 1, | |||
| "pointSize": 5, | |||
| "scaleDistribution": { | |||
| "type": "linear" | |||
| }, | |||
| "showPoints": "auto", | |||
| "spanNulls": false, | |||
| "stacking": { | |||
| "group": "A", | |||
| "mode": "none" | |||
| }, | |||
| "thresholdsStyle": { | |||
| "mode": "off" | |||
| } | |||
| }, | |||
| "mappings": [ ], | |||
| "thresholds": { | |||
| "mode": "absolute", | |||
| "steps": [ | |||
| { | |||
| "color": "green", | |||
| "value": null | |||
| }, | |||
| { | |||
| "color": "red", | |||
| "value": 80 | |||
| } | |||
| ] | |||
| } | |||
| }, | |||
| "overrides": [ ] | |||
| }, | |||
| "gridPos": { | |||
| "h": 10, | |||
| "w": 11, | |||
| "x": 2, | |||
| "y": 0 | |||
| }, | |||
| "id": 4, | |||
| "options": { | |||
| "legend": { | |||
| "calcs": [ ], | |||
| "displayMode": "list", | |||
| "placement": "bottom" | |||
| }, | |||
| "tooltip": { | |||
| "mode": "single" | |||
| } | |||
| }, | |||
| "targets": [ | |||
| { | |||
| "datasource": "${datasource}", | |||
| "exemplar": true, | |||
| "expr": "sum(rate(loki_ruler_wal_samples_appended_total{tenant=~\"${tenant}\"}[$__rate_interval])) by (tenant) > 0", | |||
| "interval": "", | |||
| "legendFormat": "{{tenant}}", | |||
| "refId": "A" | |||
| } | |||
| ], | |||
| "title": "Samples Appended to WAL per Second", | |||
| "type": "timeseries" | |||
| }, | |||
| { | |||
| "datasource": "${datasource}", | |||
| "description": "Series are unique combinations of labels", | |||
| "fieldConfig": { | |||
| "defaults": { | |||
| "color": { | |||
| "mode": "palette-classic" | |||
| }, | |||
| "custom": { | |||
| "axisLabel": "", | |||
| "axisPlacement": "auto", | |||
| "barAlignment": 0, | |||
| "drawStyle": "line", | |||
| "fillOpacity": 0, | |||
| "gradientMode": "none", | |||
| "hideFrom": { | |||
| "legend": false, | |||
| "tooltip": false, | |||
| "viz": false | |||
| }, | |||
| "lineInterpolation": "linear", | |||
| "lineWidth": 1, | |||
| "pointSize": 5, | |||
| "scaleDistribution": { | |||
| "type": "linear" | |||
| }, | |||
| "showPoints": "auto", | |||
| "spanNulls": false, | |||
| "stacking": { | |||
| "group": "A", | |||
| "mode": "none" | |||
| }, | |||
| "thresholdsStyle": { | |||
| "mode": "off" | |||
| } | |||
| }, | |||
| "mappings": [ ], | |||
| "thresholds": { | |||
| "mode": "absolute", | |||
| "steps": [ | |||
| { | |||
| "color": "green", | |||
| "value": null | |||
| }, | |||
| { | |||
| "color": "red", | |||
| "value": 80 | |||
| } | |||
| ] | |||
| } | |||
| }, | |||
| "overrides": [ ] | |||
| }, | |||
| "gridPos": { | |||
| "h": 10, | |||
| "w": 11, | |||
| "x": 13, | |||
| "y": 0 | |||
| }, | |||
| "id": 5, | |||
| "options": { | |||
| "legend": { | |||
| "calcs": [ ], | |||
| "displayMode": "list", | |||
| "placement": "bottom" | |||
| }, | |||
| "tooltip": { | |||
| "mode": "single" | |||
| } | |||
| }, | |||
| "targets": [ | |||
| { | |||
| "datasource": "${datasource}", | |||
| "exemplar": true, | |||
| "expr": "sum(rate(loki_ruler_wal_storage_created_series_total{tenant=~\"${tenant}\"}[$__rate_interval])) by (tenant) > 0", | |||
| "interval": "", | |||
| "legendFormat": "{{tenant}}", | |||
| "refId": "A" | |||
| } | |||
| ], | |||
| "title": "Series Created per Second", | |||
| "type": "timeseries" | |||
| }, | |||
| { | |||
| "datasource": "${datasource}", | |||
| "description": "Difference between highest timestamp appended to WAL and highest timestamp successfully written to remote storage", | |||
| "fieldConfig": { | |||
| "defaults": { | |||
| "color": { | |||
| "mode": "palette-classic" | |||
| }, | |||
| "custom": { | |||
| "axisLabel": "", | |||
| "axisPlacement": "auto", | |||
| "barAlignment": 0, | |||
| "drawStyle": "line", | |||
| "fillOpacity": 0, | |||
| "gradientMode": "none", | |||
| "hideFrom": { | |||
| "legend": false, | |||
| "tooltip": false, | |||
| "viz": false | |||
| }, | |||
| "lineInterpolation": "linear", | |||
| "lineWidth": 1, | |||
| "pointSize": 5, | |||
| "scaleDistribution": { | |||
| "type": "linear" | |||
| }, | |||
| "showPoints": "auto", | |||
| "spanNulls": false, | |||
| "stacking": { | |||
| "group": "A", | |||
| "mode": "none" | |||
| }, | |||
| "thresholdsStyle": { | |||
| "mode": "off" | |||
| } | |||
| }, | |||
| "mappings": [ ], | |||
| "thresholds": { | |||
| "mode": "absolute", | |||
| "steps": [ | |||
| { | |||
| "color": "green", | |||
| "value": null | |||
| }, | |||
| { | |||
| "color": "red", | |||
| "value": 80 | |||
| } | |||
| ] | |||
| } | |||
| }, | |||
| "overrides": [ ] | |||
| }, | |||
| "gridPos": { | |||
| "h": 10, | |||
| "w": 12, | |||
| "x": 0, | |||
| "y": 10 | |||
| }, | |||
| "id": 6, | |||
| "options": { | |||
| "legend": { | |||
| "calcs": [ ], | |||
| "displayMode": "list", | |||
| "placement": "bottom" | |||
| }, | |||
| "tooltip": { | |||
| "mode": "single" | |||
| } | |||
| }, | |||
| "targets": [ | |||
| { | |||
| "datasource": "${datasource}", | |||
| "exemplar": true, | |||
| "expr": "loki_ruler_wal_prometheus_remote_storage_highest_timestamp_in_seconds{tenant=~\"${tenant}\"}\n- on (tenant)\n (\n loki_ruler_wal_prometheus_remote_storage_queue_highest_sent_timestamp_seconds{tenant=~\"${tenant}\"}\n or vector(0)\n )", | |||
| "interval": "", | |||
| "legendFormat": "{{tenant}}", | |||
| "refId": "A" | |||
| } | |||
| ], | |||
| "title": "Write Behind", | |||
| "type": "timeseries" | |||
| }, | |||
| { | |||
| "datasource": "${datasource}", | |||
| "description": "", | |||
| "fieldConfig": { | |||
| "defaults": { | |||
| "color": { | |||
| "mode": "palette-classic" | |||
| }, | |||
| "custom": { | |||
| "axisLabel": "", | |||
| "axisPlacement": "auto", | |||
| "barAlignment": 0, | |||
| "drawStyle": "line", | |||
| "fillOpacity": 0, | |||
| "gradientMode": "none", | |||
| "hideFrom": { | |||
| "legend": false, | |||
| "tooltip": false, | |||
| "viz": false | |||
| }, | |||
| "lineInterpolation": "linear", | |||
| "lineWidth": 1, | |||
| "pointSize": 5, | |||
| "scaleDistribution": { | |||
| "type": "linear" | |||
| }, | |||
| "showPoints": "auto", | |||
| "spanNulls": false, | |||
| "stacking": { | |||
| "group": "A", | |||
| "mode": "none" | |||
| }, | |||
| "thresholdsStyle": { | |||
| "mode": "off" | |||
| } | |||
| }, | |||
| "mappings": [ ], | |||
| "thresholds": { | |||
| "mode": "absolute", | |||
| "steps": [ | |||
| { | |||
| "color": "green", | |||
| "value": null | |||
| }, | |||
| { | |||
| "color": "red", | |||
| "value": 80 | |||
| } | |||
| ] | |||
| } | |||
| }, | |||
| "overrides": [ ] | |||
| }, | |||
| "gridPos": { | |||
| "h": 10, | |||
| "w": 12, | |||
| "x": 12, | |||
| "y": 10 | |||
| }, | |||
| "id": 7, | |||
| "options": { | |||
| "legend": { | |||
| "calcs": [ ], | |||
| "displayMode": "list", | |||
| "placement": "bottom" | |||
| }, | |||
| "tooltip": { | |||
| "mode": "single" | |||
| } | |||
| }, | |||
| "targets": [ | |||
| { | |||
| "datasource": "${datasource}", | |||
| "exemplar": true, | |||
| "expr": "sum(rate(loki_ruler_wal_prometheus_remote_storage_samples_total{tenant=~\"${tenant}\"}[$__rate_interval])) by (tenant) > 0", | |||
| "interval": "", | |||
| "legendFormat": "{{tenant}}", | |||
| "refId": "A" | |||
| } | |||
| ], | |||
| "title": "Samples Sent per Second", | |||
| "type": "timeseries" | |||
| }, | |||
| { | |||
| "datasource": "${datasource}", | |||
| "description": "\n", | |||
| "fieldConfig": { | |||
| "defaults": { | |||
| "color": { | |||
| "mode": "palette-classic" | |||
| }, | |||
| "custom": { | |||
| "axisLabel": "", | |||
| "axisPlacement": "auto", | |||
| "barAlignment": 0, | |||
| "drawStyle": "line", | |||
| "fillOpacity": 0, | |||
| "gradientMode": "none", | |||
| "hideFrom": { | |||
| "legend": false, | |||
| "tooltip": false, | |||
| "viz": false | |||
| }, | |||
| "lineInterpolation": "linear", | |||
| "lineWidth": 1, | |||
| "pointSize": 5, | |||
| "scaleDistribution": { | |||
| "type": "linear" | |||
| }, | |||
| "showPoints": "auto", | |||
| "spanNulls": false, | |||
| "stacking": { | |||
| "group": "A", | |||
| "mode": "none" | |||
| }, | |||
| "thresholdsStyle": { | |||
| "mode": "off" | |||
| } | |||
| }, | |||
| "mappings": [ ], | |||
| "thresholds": { | |||
| "mode": "absolute", | |||
| "steps": [ | |||
| { | |||
| "color": "green", | |||
| "value": null | |||
| }, | |||
| { | |||
| "color": "red", | |||
| "value": 80 | |||
| } | |||
| ] | |||
| }, | |||
| "unit": "bytes" | |||
| }, | |||
| "overrides": [ ] | |||
| }, | |||
| "gridPos": { | |||
| "h": 10, | |||
| "w": 12, | |||
| "x": 0, | |||
| "y": 20 | |||
| }, | |||
| "id": 8, | |||
| "options": { | |||
| "legend": { | |||
| "calcs": [ ], | |||
| "displayMode": "list", | |||
| "placement": "bottom" | |||
| }, | |||
| "tooltip": { | |||
| "mode": "single" | |||
| } | |||
| }, | |||
| "targets": [ | |||
| { | |||
| "datasource": "${datasource}", | |||
| "exemplar": true, | |||
| "expr": "sum by (tenant) (loki_ruler_wal_disk_size{tenant=~\"${tenant}\"})", | |||
| "interval": "", | |||
| "legendFormat": "{{tenant}}", | |||
| "refId": "A" | |||
| } | |||
| ], | |||
| "title": "WAL Disk Size", | |||
| "type": "timeseries" | |||
| }, | |||
| { | |||
| "datasource": "${datasource}", | |||
| "description": "Some number of pending samples is expected, but if remote-write is failing this value will remain high", | |||
| "fieldConfig": { | |||
| "defaults": { | |||
| "color": { | |||
| "mode": "palette-classic" | |||
| }, | |||
| "custom": { | |||
| "axisLabel": "", | |||
| "axisPlacement": "auto", | |||
| "barAlignment": 0, | |||
| "drawStyle": "line", | |||
| "fillOpacity": 0, | |||
| "gradientMode": "none", | |||
| "hideFrom": { | |||
| "legend": false, | |||
| "tooltip": false, | |||
| "viz": false | |||
| }, | |||
| "lineInterpolation": "linear", | |||
| "lineWidth": 1, | |||
| "pointSize": 5, | |||
| "scaleDistribution": { | |||
| "type": "linear" | |||
| }, | |||
| "showPoints": "auto", | |||
| "spanNulls": false, | |||
| "stacking": { | |||
| "group": "A", | |||
| "mode": "none" | |||
| }, | |||
| "thresholdsStyle": { | |||
| "mode": "off" | |||
| } | |||
| }, | |||
| "mappings": [ ], | |||
| "thresholds": { | |||
| "mode": "absolute", | |||
| "steps": [ | |||
| { | |||
| "color": "green", | |||
| "value": null | |||
| }, | |||
| { | |||
| "color": "red", | |||
| "value": 80 | |||
| } | |||
| ] | |||
| } | |||
| }, | |||
| "overrides": [ ] | |||
| }, | |||
| "gridPos": { | |||
| "h": 10, | |||
| "w": 12, | |||
| "x": 12, | |||
| "y": 20 | |||
| }, | |||
| "id": 9, | |||
| "options": { | |||
| "legend": { | |||
| "calcs": [ ], | |||
| "displayMode": "list", | |||
| "placement": "bottom" | |||
| }, | |||
| "tooltip": { | |||
| "mode": "single" | |||
| } | |||
| }, | |||
| "targets": [ | |||
| { | |||
| "datasource": "${datasource}", | |||
| "exemplar": true, | |||
| "expr": "max(loki_ruler_wal_prometheus_remote_storage_samples_pending{tenant=~\"${tenant}\"}) by (tenant,pod) > 0", | |||
| "interval": "", | |||
| "legendFormat": "{{tenant}}", | |||
| "refId": "A" | |||
| } | |||
| ], | |||
| "title": "Pending Samples", | |||
| "type": "timeseries" | |||
| } | |||
| ], | |||
| "schemaVersion": 31, | |||
| "style": "dark", | |||
| "tags": [ ], | |||
| "templating": { | |||
| "list": [ | |||
| { | |||
| "description": null, | |||
| "error": null, | |||
| "hide": 0, | |||
| "includeAll": false, | |||
| "label": "Datasource", | |||
| "multi": false, | |||
| "name": "datasource", | |||
| "options": [ ], | |||
| "query": "prometheus", | |||
| "queryValue": "", | |||
| "refresh": 1, | |||
| "regex": "", | |||
| "skipUrlSync": false, | |||
| "type": "datasource" | |||
| }, | |||
| { | |||
| "allValue": null, | |||
| "datasource": "${datasource}", | |||
| "definition": "label_values(loki_ruler_wal_samples_appended_total, tenant)", | |||
| "description": null, | |||
| "error": null, | |||
| "hide": 0, | |||
| "includeAll": true, | |||
| "label": "Tenant", | |||
| "multi": true, | |||
| "name": "tenant", | |||
| "options": [ ], | |||
| "query": { | |||
| "query": "label_values(loki_ruler_wal_samples_appended_total, tenant)", | |||
| "refId": "StandardVariableQuery" | |||
| }, | |||
| "refresh": 2, | |||
| "regex": "", | |||
| "skipUrlSync": false, | |||
| "sort": 0, | |||
| "type": "query" | |||
| } | |||
| ] | |||
| }, | |||
| "time": { | |||
| "from": "now-6h", | |||
| "to": "now" | |||
| }, | |||
| "timepicker": { }, | |||
| "timezone": "", | |||
| "title": "Recording Rules", | |||
| "uid": "2xKA_ZK7k", | |||
| "version": 9, | |||
| "weekStart": "" | |||
| } | |||