Vijay Venkatesh Kumar | 8c46517 | 2021-06-03 16:51:33 -0400 | [diff] [blame] | 1 | {{/* |
| 2 | #============LICENSE_START======================================================== |
| 3 | # ================================================================================ |
| 4 | # Copyright (c) 2021 AT&T. All rights reserved. |
| 5 | # ================================================================================ |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # ============LICENSE_END========================================================= |
| 18 | */}} |
| 19 | |
| 20 | apiVersion: apps/v1 |
| 21 | kind: Deployment |
| 22 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
| 23 | spec: |
| 24 | replicas: 1 |
| 25 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 26 | template: |
| 27 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
| 28 | spec: |
| 29 | {{ include "common.podSecurityContext" . | indent 7 | trim}} |
| 30 | initContainers: |
| 31 | - name: volume-permissions |
| 32 | image: {{ include "repositoryGenerator.image.busybox" . }} |
| 33 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 34 | command: |
| 35 | - sh |
| 36 | args: |
| 37 | - "-c" |
| 38 | - | |
| 39 | chown -R {{ .Values.securityContext.user_id }}:{{ .Values.securityContext.group_id }} //chartmuseum-persist |
| 40 | securityContext: |
| 41 | runAsUser: 0 |
| 42 | volumeMounts: |
| 43 | - name: chart-persistent |
| 44 | mountPath: "/chartmuseum-persist" |
| 45 | containers: |
| 46 | - name: {{ include "common.name" . }} |
| 47 | image: {{ include "repositoryGenerator.githubContainerRegistry" . }}/{{ .Values.image }} |
| 48 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 49 | {{ include "common.containerSecurityContext" . | indent 12 | trim }} |
| 50 | resources: {{ include "common.resources" . | nindent 12 }} |
| 51 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
| 52 | {{- if eq .Values.liveness.enabled true }} |
| 53 | livenessProbe: |
| 54 | httpGet: |
| 55 | path: {{ .Values.liveness.path }} |
| 56 | port: {{ .Values.liveness.port }} |
| 57 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 58 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 59 | {{ end }} |
| 60 | env: |
| 61 | - name: STORAGE |
| 62 | value: local |
| 63 | - name: STORAGE_LOCAL_ROOTDIR |
| 64 | value: "/chartmuseum-persist" |
| 65 | - name: BASIC_AUTH_USER |
| 66 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "registrycred" "key" "login") | indent 14 }} |
| 67 | - name: BASIC_AUTH_PASS |
| 68 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "registrycred" "key" "password") | indent 14 }} |
| 69 | volumeMounts: |
| 70 | - mountPath: /chartmuseum-persist |
| 71 | name: chart-persistent |
| 72 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
| 73 | volumes: |
| 74 | - name: chart-persistent |
| 75 | {{- if .Values.persistence.enabled }} |
| 76 | persistentVolumeClaim: |
| 77 | claimName: {{ include "common.fullname" . }} |
| 78 | {{- else }} |
| 79 | emptyDir: {} |
| 80 | {{- end }} |
| 81 | |
| 82 | imagePullSecrets: |
| 83 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |