Skip to content

Commit

Permalink
Add appName to all resources so they can be deployed with other resou…
Browse files Browse the repository at this point in the history
…rces in the same namespace (#114)
  • Loading branch information
lvarin authored Jul 12, 2024
1 parent c65300a commit 09fcee6
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
14 changes: 7 additions & 7 deletions deployment/templates/mongo-deploy.yaml
Original file line number Diff line number Diff line change
@@ -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%
Expand All @@ -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
Expand All @@ -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:
2 changes: 1 addition & 1 deletion deployment/templates/mongo-pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mongodb
name: mongodb-{{ .Values.trs_filer.appName }}
spec:
accessModes:
- ReadWriteOnce
Expand Down
8 changes: 4 additions & 4 deletions deployment/templates/mongo-service.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 2 additions & 2 deletions deployment/templates/trs-filer-configmap-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion deployment/templates/trs-filer-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
2 changes: 1 addition & 1 deletion deployment/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 09fcee6

Please sign in to comment.