From 09fcee6d164fadf06211d8dd770fdbbc76395288 Mon Sep 17 00:00:00 2001 From: Alvaro Gonzalez Date: Fri, 12 Jul 2024 13:27:23 +0300 Subject: [PATCH] Add appName to all resources so they can be deployed with other resources in the same namespace (#114) --- deployment/templates/mongo-deploy.yaml | 14 +++++++------- deployment/templates/mongo-pvc.yaml | 2 +- deployment/templates/mongo-service.yaml | 8 ++++---- deployment/templates/trs-filer-configmap-job.yaml | 4 ++-- deployment/templates/trs-filer-deploy.yaml | 3 ++- deployment/values.yaml | 2 +- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/deployment/templates/mongo-deploy.yaml b/deployment/templates/mongo-deploy.yaml index a4afc80..36b6c7e 100644 --- a/deployment/templates/mongo-deploy.yaml +++ b/deployment/templates/mongo-deploy.yaml @@ -1,14 +1,14 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: mongodb + name: mongodb-{{ .Values.trs_filer.appName }} spec: progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 10 selector: matchLabels: - app: mongodb + app: mongodb-{{ .Values.trs_filer.appName }} strategy: rollingUpdate: maxSurge: 25% @@ -18,12 +18,12 @@ spec: metadata: creationTimestamp: null labels: - app: mongodb + app: mongodb-{{ .Values.trs_filer.appName }} spec: containers: - image: {{ .Values.mongodb.image }} imagePullPolicy: Always - name: mongodb + name: mongodb-{{ .Values.trs_filer.appName }} ports: - containerPort: 27017 protocol: TCP @@ -32,14 +32,14 @@ spec: terminationMessagePolicy: File volumeMounts: - mountPath: /data/db/ - name: mongodb + name: mongodb-{{ .Values.trs_filer.appName }} dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler securityContext: {} terminationGracePeriodSeconds: 30 volumes: - - name: mongodb + - name: mongodb-{{ .Values.trs_filer.appName }} persistentVolumeClaim: - claimName: mongodb + claimName: mongodb-{{ .Values.trs_filer.appName }} status: diff --git a/deployment/templates/mongo-pvc.yaml b/deployment/templates/mongo-pvc.yaml index ef8989d..d702e9b 100644 --- a/deployment/templates/mongo-pvc.yaml +++ b/deployment/templates/mongo-pvc.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: mongodb + name: mongodb-{{ .Values.trs_filer.appName }} spec: accessModes: - ReadWriteOnce diff --git a/deployment/templates/mongo-service.yaml b/deployment/templates/mongo-service.yaml index 22959a9..33ebe3d 100644 --- a/deployment/templates/mongo-service.yaml +++ b/deployment/templates/mongo-service.yaml @@ -1,17 +1,17 @@ apiVersion: v1 kind: Service metadata: - name: mongodb + name: mongodb-{{ .Values.trs_filer.appName }} labels: - app: mongodb + app: mongodb-{{ .Values.trs_filer.appName }} spec: ports: - - name: mongodb + - name: mongodb-{{ .Values.trs_filer.appName }} port: 27017 protocol: TCP targetPort: 27017 selector: - app: mongodb + app: mongodb-{{ .Values.trs_filer.appName }} sessionAffinity: None type: ClusterIP status: diff --git a/deployment/templates/trs-filer-configmap-job.yaml b/deployment/templates/trs-filer-configmap-job.yaml index c4fef61..95751cd 100644 --- a/deployment/templates/trs-filer-configmap-job.yaml +++ b/deployment/templates/trs-filer-configmap-job.yaml @@ -3,7 +3,7 @@ data: config.yaml: '# Empty, this configMap will be filled by Job (configmap-job-{{ .Values.trs_filer.appName }})' kind: ConfigMap metadata: - name: app-config + name: app-config-{{ .Values.trs_filer.appName }} --- apiVersion: batch/v1 kind: Job @@ -21,7 +21,7 @@ spec: - name: APISERVER value: {{ .Values.apiServer }} - name: CONFIG_MAP_NAME - value: app-config + value: app-config-{{ .Values.trs_filer.appName }} - name: APP_CONFIG_PATH value: /app/trs_filer/config.yaml - name: APP_NAME diff --git a/deployment/templates/trs-filer-deploy.yaml b/deployment/templates/trs-filer-deploy.yaml index 5dcf361..2acdd74 100644 --- a/deployment/templates/trs-filer-deploy.yaml +++ b/deployment/templates/trs-filer-deploy.yaml @@ -45,6 +45,7 @@ spec: items: - key: config.yaml path: config.yaml - name: app-config + name: app-config-{{ .Values.trs_filer.appName }} + name: config-yaml status: diff --git a/deployment/values.yaml b/deployment/values.yaml index 514e4e0..49e6208 100644 --- a/deployment/values.yaml +++ b/deployment/values.yaml @@ -5,7 +5,7 @@ host_name: trs-filer-test.2.rahtiapp.fi trs_filer: - image: elixircloud/trs-filer:0.1.0 + image: elixircloud/trs-filer:20211110 appName: trs-filer apiServer: kubernetes.default.svc:443 # address of k8s API server