aboutsummaryrefslogtreecommitdiff
path: root/grumpy/gitolite/templates/gitolite-deployment.yaml
blob: 14aceaae8810d87d33fa507761cf84176e6c0ab2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "gitolite.fullname" . }}
  labels:
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    component: "{{ .Release.Name }}-{{ .Values.Name }}"
spec:
  replicas: 1
  strategy:
    type: RollingUpdate
  selector:
    matchLabels:
      component: "{{ .Release.Name }}-{{ .Values.Component }}"
  template:
    metadata:
      labels:
        app: {{ template "gitolite.fullname" . }}
        heritage: {{ .Release.Service | quote }}
        release: {{ .Release.Name | quote }}
        chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
        component: "{{ .Release.Name }}-{{ .Values.Component }}"
    spec:
		{{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
    {{- end }}
      {{- if .Values.NodeSelector }}
      nodeSelector:
{{ toYaml .Values.NodeSelector | indent 8 }}
      {{- end }}
      {{- if .Values.Tolerations }}
      tolerations:
{{ toYaml .Values.Tolerations | indent 8 }}
      {{- end }}
      containers:
        - name: {{ template "gitolite.fullname" . }}
          image: "{{ .Values.Image }}:{{ .Values.ImageTag }}"
          #command:
          #  - tail
          #  - -f
          #  - /dev/null

          imagePullPolicy: "{{ .Values.ImagePullPolicy }}"
          env:
            - name: SSH_KEY
              value: "{{ default "" .Values.SSH_KEY}}"
            - name: SSH_KEY_NAME
              value: "{{ default "admin" .Values.SSH_KEY_NAME}}"
            - name: UMASK
              value: "0027"
          ports:
            - containerPort: {{ .Values.ContainerPort }}
              name: ssh
          resources:
            requests:
              cpu: "{{ .Values.Cpu }}"
              memory: "{{ .Values.Memory }}"
          volumeMounts:
{{- if .Values.Persistence.mounts }}
{{ toYaml .Values.Persistence.mounts | indent 12 }}
{{- end }}
            -
              mountPath: /etc/ssh/keys
              name: gitolite-ssh-keys
              readOnly: false
            -
              mountPath: /var/lib/git
              name: gitolite-git
              readOnly: false
      initContainers:
        - name: setup
          image: busybox
          command:
            - "chmod"
            - "755"
            - "/var/lib/git"
          volumeMounts:
            -
              mountPath: /var/lib/git
              name: gitolite-git
              readOnly: false
      volumes:
      - name: gitolite-ssh-keys
        persistentVolumeClaim:
          claimName: {{ .Values.Persistence.SshKeys.ExistingClaim | default (include "gitolite.claimname.ssh-keys" .) }}
      - name: gitolite-git
      {{- if .Values.Persistence.Git.ExistingClaim  }}
        persistentVolumeClaim:
          claimName: {{ .Values.Persistence.Git.ExistingClaim | default (include "gitolite.claimname.git" .) }}
      {{- else }}
        emptyDir: {}
      {{- end -}}