From 29ba0d92d00d8ea9c2dc9c6aaf9187a1d1ee094b Mon Sep 17 00:00:00 2001 From: dannc Date: Mon, 27 Mar 2023 10:32:33 +0700 Subject: [PATCH] [stage-3] fix values for simple-app and atlantis --- k8s/helm/atlantis/templates/deployment.yaml | 10 +++--- k8s/helm/atlantis/templates/secret.yaml | 4 +-- k8s/helm/atlantis/values.yaml | 32 +++++++++---------- k8s/helm/simple-app/templates/NOTES.txt | 4 +-- k8s/helm/simple-app/templates/deployment.yaml | 6 ++-- k8s/helm/simple-app/values.yaml | 18 +++++------ readme.md | 2 +- 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/k8s/helm/atlantis/templates/deployment.yaml b/k8s/helm/atlantis/templates/deployment.yaml index c801903..e5bc4f6 100644 --- a/k8s/helm/atlantis/templates/deployment.yaml +++ b/k8s/helm/atlantis/templates/deployment.yaml @@ -7,7 +7,7 @@ metadata: service: atlantis name: {{ .Chart.Name }}-{{ .Values.environment }} spec: - replicas: {{ .Values.atlantis.replicasCount }} + replicas: {{ .Values.replicasCount }} selector: matchLabels: app: {{ .Chart.Name }}-{{ .Values.environment }} @@ -27,7 +27,7 @@ spec: containerPort: 4141 env: - name: ATLANTIS_GH_USER - value: {{ .Values.atlantis.config.github.user }} + value: {{ .Values.config.github.user }} - name: ATLANTIS_GH_TOKEN valueFrom: secretKeyRef: @@ -39,11 +39,11 @@ spec: name: {{ .Chart.Name }}-{{ .Values.environment }} key: github_secret - name: ATLANTIS_REPO_ALLOWLIST - value: {{ toYaml (.Values.atlantis.config.orgAllowlist) }} + value: {{ toYaml (.Values.config.orgAllowlist) }} - name: ATLANTIS_ALLOW_COMMANDS - value: {{ .Values.atlantis.config.allowCommands }} + value: {{ .Values.config.allowCommands }} resources: - {{- toYaml .Values.atlantis.resources | nindent 12 }} + {{- toYaml .Values.resources | nindent 12 }} livenessProbe: httpGet: path: /healthz diff --git a/k8s/helm/atlantis/templates/secret.yaml b/k8s/helm/atlantis/templates/secret.yaml index 84936d9..934170c 100644 --- a/k8s/helm/atlantis/templates/secret.yaml +++ b/k8s/helm/atlantis/templates/secret.yaml @@ -4,5 +4,5 @@ kind: Secret metadata: name: {{ .Chart.Name }}-{{ .Values.environment }} data: - github_token: {{ .Values.atlantis.config.github.token | b64enc }} - github_secret: {{ .Values.atlantis.config.github.secret | b64enc }} + github_token: {{ .Values.config.github.token | b64enc }} + github_secret: {{ .Values.config.github.secret | b64enc }} diff --git a/k8s/helm/atlantis/values.yaml b/k8s/helm/atlantis/values.yaml index f079297..7237ec0 100644 --- a/k8s/helm/atlantis/values.yaml +++ b/k8s/helm/atlantis/values.yaml @@ -3,20 +3,20 @@ environment: production image: name: ghcr.io/runatlantis/atlantis -atlantis: - config: - orgAllowlist: github.com/Dannecron/* - github: - user: personal-access-token-name - token: personal-access-token-secret - secret: webhook-secret - allowCommands: "version,plan,state" +replicasCount: 1 - replicasCount: 1 - resources: - requests: - memory: 512Mi - cpu: 100m - limits: - memory: 1Gi - cpu: 100m +resources: + requests: + memory: 512Mi + cpu: 100m + limits: + memory: 1Gi + cpu: 100m + +config: + orgAllowlist: github.com/Dannecron/* + github: + user: personal-access-token-name + token: personal-access-token-secret + secret: webhook-secret + allowCommands: "version,plan,state" diff --git a/k8s/helm/simple-app/templates/NOTES.txt b/k8s/helm/simple-app/templates/NOTES.txt index 2589bf1..19b6f7e 100644 --- a/k8s/helm/simple-app/templates/NOTES.txt +++ b/k8s/helm/simple-app/templates/NOTES.txt @@ -1,6 +1,6 @@ --------------------------------------------------------- -Content of NOTES.txt appears after deploy. -Deployed version {{ .Chart.AppVersion }}. +Test application. +Deployed version {{ .Values.image.tag | default .Chart.AppVersion }}. --------------------------------------------------------- diff --git a/k8s/helm/simple-app/templates/deployment.yaml b/k8s/helm/simple-app/templates/deployment.yaml index 435a7ac..4b73cc7 100644 --- a/k8s/helm/simple-app/templates/deployment.yaml +++ b/k8s/helm/simple-app/templates/deployment.yaml @@ -7,7 +7,7 @@ metadata: service: application name: {{ .Chart.Name }}-{{ .Values.environment }}-application spec: - replicas: {{ .Values.application.replicasCount }} + replicas: {{ .Values.replicasCount }} selector: matchLabels: app: {{ .Chart.Name }}-{{ .Values.environment }} @@ -19,12 +19,12 @@ spec: service: application spec: containers: - - image: {{ .Values.image.name }}:{{ .Chart.AppVersion }} + - image: {{ .Values.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }} imagePullPolicy: Always name: application ports: - name: web containerPort: 80 resources: - {{- toYaml .Values.application.resources | nindent 12 }} + {{- toYaml .Values.resources | nindent 12 }} terminationGracePeriodSeconds: 30 diff --git a/k8s/helm/simple-app/values.yaml b/k8s/helm/simple-app/values.yaml index c44d8a1..c48f03f 100644 --- a/k8s/helm/simple-app/values.yaml +++ b/k8s/helm/simple-app/values.yaml @@ -2,13 +2,13 @@ environment: production image: name: dannecron/parcel-example-neko + tag: -application: - replicasCount: 1 - resources: - limits: - cpu: 200m - memory: 256Mi - requests: - cpu: 100m - memory: 128Mi +replicasCount: 1 +resources: + limits: + cpu: 200m + memory: 256Mi + requests: + cpu: 100m + memory: 128Mi diff --git a/readme.md b/readme.md index 0422ddd..fb137de 100644 --- a/readme.md +++ b/readme.md @@ -84,7 +84,7 @@ ansible-playbook -i ansible/kubectl_init kubectl_init.yml * [atlantis](https://www.runatlantis.io) ```shell - helm upgrade --set "atlantis.config.github.user=" --set "atlantis.config.github.token=" --set "atlantis.config.github.secret=" atlantis k8s/helm/atlantis + helm install --set "atlantis.config.github.user=" --set "atlantis.config.github.token=" --set "atlantis.config.github.secret=" atlantis k8s/helm/atlantis ``` где ``, `` - это данные персонального access-токена, созданного на github,