diff --git a/quick-links-charts/Chart.yaml b/quick-links-charts/Chart.yaml index 0dcf90a..5ba5047 100644 --- a/quick-links-charts/Chart.yaml +++ b/quick-links-charts/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v2 -name: quick-links-chart +name: quick-links description: A Helm chart for deploying quick-links service version: 0.1.0 diff --git a/quick-links-charts/templates/deployment.yaml b/quick-links-charts/templates/deployment.yaml index 5633bd7..6bfa05f 100644 --- a/quick-links-charts/templates/deployment.yaml +++ b/quick-links-charts/templates/deployment.yaml @@ -1,33 +1,23 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ .Chart.Name }}-quick-links + name: {{ .Values.deployment.name }} spec: - replicas: {{ .Values.replicaCount }} + replicas: {{ .Values.deployment.replicaCount }} selector: matchLabels: - app: quick-links + app: {{.Values.app_name }} template: metadata: labels: - app: quick-links + app: {{.Values.app_name }} spec: containers: - - name: quick-links - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + - name: {{.Values.app_name }} + image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}" + imagePullPolicy: {{ .Values.deployment.image.pullPolicy }} env: - - name: DB_HOST - value: {{ .Values.env.DB_HOST }} - - name: DB_PORT - value: {{ .Values.env.DB_PORT }} - - name: DB_USER - value: {{ .Values.env.DB_USER }} - - name: DB_PASSWORD - value: {{ .Values.env.DB_PASSWORD }} - - name: DB_NAME - value: {{ .Values.env.DB_NAME }} - - name: REDIS_HOST - value: {{ .Values.env.REDIS_HOST }} - - name: REDIS_PASSWORD - value: {{ .Values.env.REDIS_PASSWORD }} + {{- range $key, $value := .Values.deployment.env }} + - name: {{ $key }} + value: {{ quote $value }} + {{- end }} \ No newline at end of file diff --git a/quick-links-charts/templates/service.yaml b/quick-links-charts/templates/service.yaml index 0c28f2e..48ef066 100644 --- a/quick-links-charts/templates/service.yaml +++ b/quick-links-charts/templates/service.yaml @@ -4,9 +4,9 @@ metadata: name: {{ .Values.service.name }} spec: selector: - app: quick-links + app: {{ .Values.app_name }} ports: - - name: quick-links + - name: {{ .Values.app_name }} protocol: TCP port: {{ .Values.service.port }} targetPort: {{ .Values.service.port }} diff --git a/quick-links-charts/values.yaml b/quick-links-charts/values.yaml index ce0d860..65a05cf 100644 --- a/quick-links-charts/values.yaml +++ b/quick-links-charts/values.yaml @@ -1,17 +1,20 @@ -replicaCount: 2 -image: - repository: quick-links - tag: dev - pullPolicy: Never -env: - DB_HOST: 'postgres-postgresql-ha-pgpool' - DB_USER: 'postgres' - DB_PASSWORD: 'password' - DB_NAME: 'quicklink' - REDIS_HOST: 'redis-master' - REDIS_PASSWORD: 'Mx765t6kQe' +app_name: quick-links + deployment: name: quick-links-deployment + replicaCount: 2 + image: + repository: quick-links + tag: prod + pullPolicy: Never + env: + DB_HOST: 'postgres-postgresql-ha-pgpool' + DB_USER: 'postgres' + DB_PASSWORD: 'password' + DB_NAME: 'quicklink' + REDIS_HOST: 'redis-master' + REDIS_PASSWORD: 'Mx765t6kQe' + service: name: quick-links-service type: ClusterIP