diff --git a/templates/deployment.yaml b/templates/deployment.yaml index e235838..d3e54a1 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -27,15 +27,26 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - - name: http - containerPort: 80 - protocol: TCP + - name: http + containerPort: 80 + protocol: TCP + - name: https + containerPort: 443 + protocol: TCP resources: {{- toYaml .Values.resources | nindent 12 }} {{- if .Values.config.DRONE_DATABASE_DRIVER | default "sqlite3" | eq "sqlite3" }} volumeMounts: - name: data mountPath: {{ default "/data/database.sqlite" .Values.config.DRONE_DATABASE_DATASOURCE | dir }} + {{- with .Values.extraVolumeMounts }} + {{- toYaml . | nindent 10 }} + {{- end }} + {{- else }} + {{- with .Values.extraVolumeMounts }} + volumeMounts: + {{- toYaml . | nindent 10 }} + {{- end }} {{- end }} {{- with .Values.affinity }} affinity: @@ -66,9 +77,20 @@ spec: {{- with .Values.persistence.existingClaim }} claimName: {{ tpl . $ }} {{- end }} + {{- with .Values.extraVolumes }} + {{- toYaml . | nindent 6 }} + {{- end }} {{- else if and (.Values.config.DRONE_DATABASE_DRIVER | default "sqlite3" | eq "sqlite3") (not .Values.persistence.existingClaim) }} volumes: - name: data persistentVolumeClaim: claimName: {{ include "drone.fullname" . }} + {{- with .Values.extraVolumes }} + {{- toYaml . | nindent 6 }} + {{- end }} + {{- else }} + {{- with .Values.extraVolumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/templates/service.yaml b/templates/service.yaml index 1c8d971..49c29b5 100644 --- a/templates/service.yaml +++ b/templates/service.yaml @@ -12,8 +12,8 @@ spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} - targetPort: http + targetPort: {{ .Values.config.DRONE_SERVER_PROTO | default "http" }} protocol: TCP - name: http + name: {{ .Values.config.DRONE_SERVER_PROTO | default "http" }} selector: {{- include "drone.selectorLabels" . | nindent 4 }} diff --git a/values.yaml b/values.yaml index 3b270df..1257377 100644 --- a/values.yaml +++ b/values.yaml @@ -574,4 +574,36 @@ persistence: - ReadWriteOnce labels: {} annotation: {} - # storageClass: \ No newline at end of file + # storageClass: + +# extra volumes for the pod +extraVolumes: {} +# The following example mount the same secret, which contains tls certificates +# under different names. Each volume mount contains only selected items of the +# secret. This make it easier to place the items on different locations inside the +# container filesystem via extraVolumeMounts. +# - name: custom-ca-anchor +# secret: +# secretName: drone-custom-tls-certificates +# items: +# - key: ca.crt +# path: ca.crt +# mode: 0444 +# - name: custom-tls-certificates +# secret: +# secretName: drone-custom-tls-certificates +# items: +# - key: tls.key +# path: tls.key +# mode: 0400 +# - key: tls.crt +# path: tls.crt +# mode: 0444 + +extraVolumeMounts: {} +# The following example follows the example of extraVolumes and mounts the +# volumes to the corresponding paths in the container filesystem. +# - name: custom-ca-anchor +# mountPath: /usr/local/share/ca-certificates +# - name: custom-tls-certificates +# mountPath: /etc/drone/tls \ No newline at end of file