From dfc278d1a1c9a0a5210b3e01b24faa08af765d47 Mon Sep 17 00:00:00 2001 From: Vibhu Prashar Date: Tue, 27 Jun 2023 15:39:39 +0530 Subject: [PATCH] Add support for missing objectstorage secret for thanos store (#307) * Add support for missing objectstorage secret for thanos store Signed-off-by: Vibhu Prashar * Add review comments Signed-off-by: Vibhu Prashar --------- Signed-off-by: Vibhu Prashar --- Makefile | 15 +++ README.md | 12 +- build.sh | 5 + example.jsonnet | 2 +- ...{deployment.yaml => minio-deployment.yaml} | 24 ++-- .../{pvc.yaml => minio-pvc.yaml} | 7 +- .../{secret.yaml => minio-secret-thanos.yaml} | 7 +- .../{service.yaml => minio-service.yaml} | 9 +- jsonnet/minio/minio.libsonnet | 107 ++++++++++++++++++ manifests/thanos-query-deployment.yaml | 6 +- manifests/thanos-query-service.yaml | 2 +- manifests/thanos-query-serviceAccount.yaml | 2 +- manifests/thanos-query-serviceMonitor.yaml | 2 +- ...anos-receive-ingestor-default-service.yaml | 2 +- ...-receive-ingestor-default-statefulSet.yaml | 6 +- ...hanos-receive-ingestor-serviceAccount.yaml | 2 +- ...hanos-receive-ingestor-serviceMonitor.yaml | 2 +- .../thanos-receive-router-deployment.yaml | 8 +- manifests/thanos-receive-router-service.yaml | 4 +- .../thanos-receive-router-serviceAccount.yaml | 2 +- manifests/thanos-store-service.yaml | 2 +- manifests/thanos-store-serviceAccount.yaml | 2 +- manifests/thanos-store-serviceMonitor.yaml | 2 +- manifests/thanos-store-statefulSet.yaml | 6 +- minio.jsonnet | 32 ++++++ 25 files changed, 220 insertions(+), 50 deletions(-) rename examples/development-minio/{deployment.yaml => minio-deployment.yaml} (52%) rename examples/development-minio/{pvc.yaml => minio-pvc.yaml} (73%) rename examples/development-minio/{secret.yaml => minio-secret-thanos.yaml} (70%) rename examples/development-minio/{service.yaml => minio-service.yaml} (64%) create mode 100644 jsonnet/minio/minio.libsonnet create mode 100644 minio.jsonnet diff --git a/Makefile b/Makefile index 3494fabf..0e59913b 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,21 @@ lint: $(JSONNET_LINT) vendor vendor: | $(JB) jsonnetfile.json jsonnetfile.lock.json $(JB) install +.PHONY: deploy +deploy: + kubectl create ns thanos + kubectl create ns minio + kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v$(PROM_OPERATOR_VERSION)/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml + kubectl create -f examples/development-minio/ + kubectl create -f manifests/ + +.PHONY: teardown +teardown: + kubectl delete -f examples/development-minio/ + kubectl delete -f manifests/ + kubectl delete ns thanos + kubectl delete ns minio + .PHONY: clean clean: -rm -rf tmp/bin diff --git a/README.md b/README.md index 24569fec..8bafcd38 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,12 @@ This project is intended to be used as a library (i.e. the intent is not for you Though for a quickstart a compiled version of the Kubernetes [manifests](manifests) generated with this library (specifically with `example.jsonnet`) is checked into this repository in order to try the content out quickly. To try out the stack un-customized run: * Simply create the stack: ```shell -$ kubectl create ns thanos -$ kubectl create -f manifests/ +$ make deploy ``` * And to teardown the stack: ```shell -$ kubectl delete -f manifests/ +$ make teardown ``` ## Customizing kube-thanos @@ -77,7 +76,7 @@ local commonConfig = { config+:: { local cfg = self, namespace: 'thanos', - version: 'v0.29.0', + version: 'v0.31.0', image: 'quay.io/thanos/thanos:' + cfg.version, imagePullPolicy: 'IfNotPresent', objectStorageConfig: { @@ -167,10 +166,15 @@ find manifests -type f ! -name '*.yaml' -delete # The following script generates all components, mostly used for testing rm -rf examples/all/manifests +rm -rf examples/development-minio mkdir examples/all/manifests +mkdir examples/development-minio ${JSONNET} -J vendor -m examples/all/manifests "${1-all.jsonnet}" | xargs -I{} sh -c "cat {} | ${GOJSONTOYAML} > {}.yaml; rm -f {}" -- {} find examples/all/manifests -type f ! -name '*.yaml' -delete + +${JSONNET} -J vendor -m examples/development-minio "${1-minio.jsonnet}" | xargs -I{} sh -c "cat {} | ${GOJSONTOYAML} > {}.yaml; rm -f {}" -- {} +find examples/development-minio -type f ! -name '*.yaml' -delete ``` > Note you need `jsonnet` (`go get github.com/google/go-jsonnet/cmd/jsonnet`) and `gojsontoyaml` (`go get github.com/brancz/gojsontoyaml`) installed to run `build.sh`. If you just want json output, not yaml, then you can skip the pipe and everything afterwards. diff --git a/build.sh b/build.sh index 82b6d03b..66c50ee5 100755 --- a/build.sh +++ b/build.sh @@ -21,7 +21,12 @@ find manifests -type f ! -name '*.yaml' -delete # The following script generates all components, mostly used for testing rm -rf examples/all/manifests +rm -rf examples/development-minio mkdir examples/all/manifests +mkdir examples/development-minio ${JSONNET} -J vendor -m examples/all/manifests "${1-all.jsonnet}" | xargs -I{} sh -c "cat {} | ${GOJSONTOYAML} > {}.yaml; rm -f {}" -- {} find examples/all/manifests -type f ! -name '*.yaml' -delete + +${JSONNET} -J vendor -m examples/development-minio "${1-minio.jsonnet}" | xargs -I{} sh -c "cat {} | ${GOJSONTOYAML} > {}.yaml; rm -f {}" -- {} +find examples/development-minio -type f ! -name '*.yaml' -delete diff --git a/example.jsonnet b/example.jsonnet index 3883c123..9091261d 100644 --- a/example.jsonnet +++ b/example.jsonnet @@ -6,7 +6,7 @@ local commonConfig = { config+:: { local cfg = self, namespace: 'thanos', - version: 'v0.29.0', + version: 'v0.31.0', image: 'quay.io/thanos/thanos:' + cfg.version, imagePullPolicy: 'IfNotPresent', objectStorageConfig: { diff --git a/examples/development-minio/deployment.yaml b/examples/development-minio/minio-deployment.yaml similarity index 52% rename from examples/development-minio/deployment.yaml rename to examples/development-minio/minio-deployment.yaml index e4dd299f..effb79f6 100644 --- a/examples/development-minio/deployment.yaml +++ b/examples/development-minio/minio-deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: minio + namespace: thanos spec: selector: matchLabels: @@ -14,22 +15,25 @@ spec: app.kubernetes.io/name: minio spec: containers: - - name: minio - image: minio/minio - command: + - command: - /bin/sh - -c - - "mkdir -p /storage/thanos && /opt/bin/minio server /storage" + - | + mkdir -p /storage/thanos && \ + /usr/bin/docker-entrypoint.sh minio server /storage env: - - name: MINIO_ACCESS_KEY - value: "minio" - - name: MINIO_SECRET_KEY - value: "minio123" + - name: MINIO_ROOT_USER + value: minio + - name: MINIO_ROOT_PASSWORD + value: minio123 + image: minio/minio:RELEASE.2023-05-27T05-56-19Z + imagePullPolicy: IfNotPresent + name: minio ports: - containerPort: 9000 volumeMounts: - - name: storage - mountPath: "/storage" + - mountPath: /storage + name: storage volumes: - name: storage persistentVolumeClaim: diff --git a/examples/development-minio/pvc.yaml b/examples/development-minio/minio-pvc.yaml similarity index 73% rename from examples/development-minio/pvc.yaml rename to examples/development-minio/minio-pvc.yaml index 27f8d0b1..da9f3c11 100644 --- a/examples/development-minio/pvc.yaml +++ b/examples/development-minio/minio-pvc.yaml @@ -1,12 +1,13 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: minio labels: app.kubernetes.io/name: minio + name: minio + namespace: thanos spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce resources: requests: - storage: 10Gi + storage: 5Gi diff --git a/examples/development-minio/secret.yaml b/examples/development-minio/minio-secret-thanos.yaml similarity index 70% rename from examples/development-minio/secret.yaml rename to examples/development-minio/minio-secret-thanos.yaml index 68e841c6..e295ecd7 100644 --- a/examples/development-minio/secret.yaml +++ b/examples/development-minio/minio-secret-thanos.yaml @@ -2,13 +2,14 @@ apiVersion: v1 kind: Secret metadata: name: thanos-objectstorage -type: Opaque + namespace: thanos stringData: - thanos.yaml: |- + thanos.yaml: | type: s3 config: bucket: thanos - endpoint: minio:9000 + endpoint: minio.thanos.svc.cluster.local:9000 insecure: true access_key: minio secret_key: minio123 +type: Opaque diff --git a/examples/development-minio/service.yaml b/examples/development-minio/minio-service.yaml similarity index 64% rename from examples/development-minio/service.yaml rename to examples/development-minio/minio-service.yaml index a6cf645d..12e2c16f 100644 --- a/examples/development-minio/service.yaml +++ b/examples/development-minio/minio-service.yaml @@ -2,11 +2,12 @@ apiVersion: v1 kind: Service metadata: name: minio + namespace: thanos spec: - type: ClusterIP ports: - - port: 9000 - targetPort: 9000 - protocol: TCP + - port: 9000 + protocol: TCP + targetPort: 9000 selector: app.kubernetes.io/name: minio + type: ClusterIP diff --git a/jsonnet/minio/minio.libsonnet b/jsonnet/minio/minio.libsonnet new file mode 100644 index 00000000..a5bdd838 --- /dev/null +++ b/jsonnet/minio/minio.libsonnet @@ -0,0 +1,107 @@ +// These are the defaults for this components configuration. +// When calling the function to generate the component's manifest, +// you can pass an object structured like the default to overwrite default values. +local defaults = { + namespace: error 'must provide namespace', + buckets: error 'must provide buckets', + accessKey: error 'must provide accessKey', + secretKey: error 'must provide secretKey', + + commonLabels:: { 'app.kubernetes.io/name': 'minio' }, +}; + +function(params) { + local minio = self, + + // Combine the defaults and the passed params to make the component's config. + config:: defaults + params, + + deployment: { + apiVersion: 'apps/v1', + kind: 'Deployment', + metadata: { + name: 'minio', + namespace: minio.config.namespace, + }, + spec: { + selector: { + matchLabels: minio.config.commonLabels, + }, + strategy: { type: 'Recreate' }, + template: { + metadata: { + labels: minio.config.commonLabels, + }, + spec: { + containers: [ + { + command: [ + '/bin/sh', + '-c', + ||| + mkdir -p %s && \ + /usr/bin/docker-entrypoint.sh minio server /storage + ||| % std.join(' ', ['/storage/%s' % bucket for bucket in minio.config.buckets]), + ], + env: [ + { + name: 'MINIO_ROOT_USER', + value: minio.config.accessKey, + }, + { + name: 'MINIO_ROOT_PASSWORD', + value: minio.config.secretKey, + }, + ], + image: 'minio/minio:RELEASE.2023-05-27T05-56-19Z', + imagePullPolicy: 'IfNotPresent', + name: 'minio', + ports: [ + { containerPort: 9000 }, + ], + volumeMounts: [ + { mountPath: '/storage', name: 'storage' }, + ], + }, + ], + volumes: [{ + name: 'storage', + persistentVolumeClaim: { claimName: 'minio' }, + }], + }, + }, + }, + }, + + pvc: { + apiVersion: 'v1', + kind: 'PersistentVolumeClaim', + metadata: { + labels: minio.config.commonLabels, + name: 'minio', + namespace: minio.config.namespace, + }, + spec: { + accessModes: ['ReadWriteOnce'], + resources: { + requests: { storage: '5Gi' }, + }, + }, + }, + + service: { + apiVersion: 'v1', + kind: 'Service', + metadata: { + name: 'minio', + namespace: minio.config.namespace, + }, + spec: { + ports: [ + { port: 9000, protocol: 'TCP', targetPort: 9000 }, + ], + selector: minio.config.commonLabels, + type: 'ClusterIP', + }, + }, +} diff --git a/manifests/thanos-query-deployment.yaml b/manifests/thanos-query-deployment.yaml index 4451fbb5..fae19571 100644 --- a/manifests/thanos-query-deployment.yaml +++ b/manifests/thanos-query-deployment.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: query-layer app.kubernetes.io/instance: thanos-query app.kubernetes.io/name: thanos-query - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 name: thanos-query namespace: thanos spec: @@ -21,7 +21,7 @@ spec: app.kubernetes.io/component: query-layer app.kubernetes.io/instance: thanos-query app.kubernetes.io/name: thanos-query - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 spec: affinity: podAntiAffinity: @@ -54,7 +54,7 @@ spec: valueFrom: fieldRef: fieldPath: status.hostIP - image: quay.io/thanos/thanos:v0.29.0 + image: quay.io/thanos/thanos:v0.31.0 imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 4 diff --git a/manifests/thanos-query-service.yaml b/manifests/thanos-query-service.yaml index 90db29af..0dc4a480 100644 --- a/manifests/thanos-query-service.yaml +++ b/manifests/thanos-query-service.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: query-layer app.kubernetes.io/instance: thanos-query app.kubernetes.io/name: thanos-query - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 name: thanos-query namespace: thanos spec: diff --git a/manifests/thanos-query-serviceAccount.yaml b/manifests/thanos-query-serviceAccount.yaml index 6ff4b1e9..9a6d7018 100644 --- a/manifests/thanos-query-serviceAccount.yaml +++ b/manifests/thanos-query-serviceAccount.yaml @@ -6,6 +6,6 @@ metadata: app.kubernetes.io/component: query-layer app.kubernetes.io/instance: thanos-query app.kubernetes.io/name: thanos-query - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 name: thanos-query namespace: thanos diff --git a/manifests/thanos-query-serviceMonitor.yaml b/manifests/thanos-query-serviceMonitor.yaml index 20f62c0b..4cffad75 100644 --- a/manifests/thanos-query-serviceMonitor.yaml +++ b/manifests/thanos-query-serviceMonitor.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: query-layer app.kubernetes.io/instance: thanos-query app.kubernetes.io/name: thanos-query - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 name: thanos-query namespace: thanos spec: diff --git a/manifests/thanos-receive-ingestor-default-service.yaml b/manifests/thanos-receive-ingestor-default-service.yaml index dc83f245..7cd8acac 100644 --- a/manifests/thanos-receive-ingestor-default-service.yaml +++ b/manifests/thanos-receive-ingestor-default-service.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: database-write-hashring app.kubernetes.io/instance: thanos-receive-ingestor-default app.kubernetes.io/name: thanos-receive - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 controller.receive.thanos.io/hashring: default name: thanos-receive-ingestor-default namespace: thanos diff --git a/manifests/thanos-receive-ingestor-default-statefulSet.yaml b/manifests/thanos-receive-ingestor-default-statefulSet.yaml index 75f7773f..868cb571 100644 --- a/manifests/thanos-receive-ingestor-default-statefulSet.yaml +++ b/manifests/thanos-receive-ingestor-default-statefulSet.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: database-write-hashring app.kubernetes.io/instance: thanos-receive-ingestor-default app.kubernetes.io/name: thanos-receive - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 controller.receive.thanos.io: thanos-receive-controller controller.receive.thanos.io/hashring: default name: thanos-receive-ingestor-default @@ -26,7 +26,7 @@ spec: app.kubernetes.io/component: database-write-hashring app.kubernetes.io/instance: thanos-receive-ingestor-default app.kubernetes.io/name: thanos-receive - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 controller.receive.thanos.io/hashring: default spec: affinity: @@ -90,7 +90,7 @@ spec: valueFrom: fieldRef: fieldPath: status.hostIP - image: quay.io/thanos/thanos:v0.29.0 + image: quay.io/thanos/thanos:v0.31.0 imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 8 diff --git a/manifests/thanos-receive-ingestor-serviceAccount.yaml b/manifests/thanos-receive-ingestor-serviceAccount.yaml index 54764ce9..d1589c5b 100644 --- a/manifests/thanos-receive-ingestor-serviceAccount.yaml +++ b/manifests/thanos-receive-ingestor-serviceAccount.yaml @@ -6,6 +6,6 @@ metadata: app.kubernetes.io/component: database-write-hashring app.kubernetes.io/instance: thanos-receive-ingestor app.kubernetes.io/name: thanos-receive - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 name: thanos-receive-ingestor namespace: thanos diff --git a/manifests/thanos-receive-ingestor-serviceMonitor.yaml b/manifests/thanos-receive-ingestor-serviceMonitor.yaml index ee1401ba..f5d72973 100644 --- a/manifests/thanos-receive-ingestor-serviceMonitor.yaml +++ b/manifests/thanos-receive-ingestor-serviceMonitor.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: database-write-hashring app.kubernetes.io/instance: thanos-receive-ingestor app.kubernetes.io/name: thanos-receive - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 name: thanos-receive-ingestor namespace: thanos spec: diff --git a/manifests/thanos-receive-router-deployment.yaml b/manifests/thanos-receive-router-deployment.yaml index 9a50ddbb..7a9875d0 100644 --- a/manifests/thanos-receive-router-deployment.yaml +++ b/manifests/thanos-receive-router-deployment.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: thanos-receive-router app.kubernetes.io/instance: thanos-receive app.kubernetes.io/name: thanos-receive - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 name: thanos-receive-router namespace: thanos spec: @@ -15,14 +15,14 @@ spec: app.kubernetes.io/component: thanos-receive-router app.kubernetes.io/instance: thanos-receive app.kubernetes.io/name: thanos-receive - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 template: metadata: labels: app.kubernetes.io/component: thanos-receive-router app.kubernetes.io/instance: thanos-receive app.kubernetes.io/name: thanos-receive - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 spec: containers: - args: @@ -49,7 +49,7 @@ spec: valueFrom: fieldRef: fieldPath: status.hostIP - image: quay.io/thanos/thanos:v0.29.0 + image: quay.io/thanos/thanos:v0.31.0 imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 8 diff --git a/manifests/thanos-receive-router-service.yaml b/manifests/thanos-receive-router-service.yaml index fdb4bc65..46eb1ba4 100644 --- a/manifests/thanos-receive-router-service.yaml +++ b/manifests/thanos-receive-router-service.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: thanos-receive-router app.kubernetes.io/instance: thanos-receive app.kubernetes.io/name: thanos-receive - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 name: thanos-receive-router namespace: thanos spec: @@ -23,4 +23,4 @@ spec: app.kubernetes.io/component: thanos-receive-router app.kubernetes.io/instance: thanos-receive app.kubernetes.io/name: thanos-receive - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 diff --git a/manifests/thanos-receive-router-serviceAccount.yaml b/manifests/thanos-receive-router-serviceAccount.yaml index dff40d15..f9ad6efd 100644 --- a/manifests/thanos-receive-router-serviceAccount.yaml +++ b/manifests/thanos-receive-router-serviceAccount.yaml @@ -6,6 +6,6 @@ metadata: app.kubernetes.io/component: thanos-receive-router app.kubernetes.io/instance: thanos-receive app.kubernetes.io/name: thanos-receive - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 name: thanos-receive-router namespace: thanos diff --git a/manifests/thanos-store-service.yaml b/manifests/thanos-store-service.yaml index b45ab0fd..2e17fb27 100644 --- a/manifests/thanos-store-service.yaml +++ b/manifests/thanos-store-service.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: object-store-gateway app.kubernetes.io/instance: thanos-store app.kubernetes.io/name: thanos-store - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 name: thanos-store namespace: thanos spec: diff --git a/manifests/thanos-store-serviceAccount.yaml b/manifests/thanos-store-serviceAccount.yaml index 83b1d71f..e0b60cbc 100644 --- a/manifests/thanos-store-serviceAccount.yaml +++ b/manifests/thanos-store-serviceAccount.yaml @@ -6,6 +6,6 @@ metadata: app.kubernetes.io/component: object-store-gateway app.kubernetes.io/instance: thanos-store app.kubernetes.io/name: thanos-store - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 name: thanos-store namespace: thanos diff --git a/manifests/thanos-store-serviceMonitor.yaml b/manifests/thanos-store-serviceMonitor.yaml index 5726928e..3c55f9ec 100644 --- a/manifests/thanos-store-serviceMonitor.yaml +++ b/manifests/thanos-store-serviceMonitor.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: object-store-gateway app.kubernetes.io/instance: thanos-store app.kubernetes.io/name: thanos-store - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 name: thanos-store namespace: thanos spec: diff --git a/manifests/thanos-store-statefulSet.yaml b/manifests/thanos-store-statefulSet.yaml index 75baf5bc..49fe6c35 100644 --- a/manifests/thanos-store-statefulSet.yaml +++ b/manifests/thanos-store-statefulSet.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: object-store-gateway app.kubernetes.io/instance: thanos-store app.kubernetes.io/name: thanos-store - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 name: thanos-store namespace: thanos spec: @@ -22,7 +22,7 @@ spec: app.kubernetes.io/component: object-store-gateway app.kubernetes.io/instance: thanos-store app.kubernetes.io/name: thanos-store - app.kubernetes.io/version: v0.29.0 + app.kubernetes.io/version: v0.31.0 spec: affinity: podAntiAffinity: @@ -62,7 +62,7 @@ spec: valueFrom: fieldRef: fieldPath: status.hostIP - image: quay.io/thanos/thanos:v0.29.0 + image: quay.io/thanos/thanos:v0.31.0 imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 8 diff --git a/minio.jsonnet b/minio.jsonnet new file mode 100644 index 00000000..f783db26 --- /dev/null +++ b/minio.jsonnet @@ -0,0 +1,32 @@ +local minio = (import 'jsonnet/minio/minio.libsonnet')({ + namespace: 'thanos', + buckets: ['thanos'], + accessKey: 'minio', + secretKey: 'minio123', +}); + +{ + 'minio-deployment': minio.deployment, + 'minio-pvc': minio.pvc, + 'minio-service': minio.service, + 'minio-secret-thanos': { + apiVersion: 'v1', + kind: 'Secret', + metadata: { + name: 'thanos-objectstorage', + namespace: minio.config.namespace, + }, + stringData: { + 'thanos.yaml': ||| + type: s3 + config: + bucket: thanos + endpoint: %s.%s.svc.cluster.local:9000 + insecure: true + access_key: minio + secret_key: minio123 + ||| % [minio.service.metadata.name, minio.config.namespace], + }, + type: 'Opaque', + }, +}