Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding support for Self signed cert in Devtron #4542

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions charts/devtron/templates/configmap-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -273,3 +273,16 @@ data:
{{- end }}
{{- end }}
type: Opaque

{{- if $.Values.selfSignedCert.enabled }}
---
# Source: devtron-operator/templates/self-signed-cert.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: self-signed-cert
namespace: devtroncd
data:
myCA.pem: |
{{ $.Values.selfSignedCert.myCA | nindent 8 }}
{{- end }}
27 changes: 27 additions & 0 deletions charts/devtron/templates/devtron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,22 @@ spec:
securityContext:
{{- toYaml $.Values.global.podSecurityContext | nindent 8 }}
{{- end }}
{{- if $.Values.selfSignedCert.enabled }}
initcontainers:
- name: self-signed-container
image: quay.io/devtron/ubuntu-k8s-utils:latest
command:
- /bin/bash
- -c
- echo "Starting the init-container"
- cp ~/tmp/self-signed-config/myCA.pem /usr/local/share/ca-certificates/myCA.crt
- sudo update-ca-certificates
volumeMounts:
- name: cert-volume
mountPath: /etc/ssl/certs
- name: config
mountPath: tmp/self-signed-config
{{- end }}
containers:
- name: devtron
{{- if $.Values.installer.modules }}
Expand Down Expand Up @@ -154,6 +170,17 @@ spec:
resources:
{{- toYaml .resources | nindent 12 }}
{{- end }}
{{- if $.Values.selfSignedCert.enabled }}
volumeMounts:
- mountPath: /etc/ssl/certs
name: cert-volume
volumes:
- name: cert-config
configMap:
name: self-signed-cert
- name: cert-volume
emptyDir: {}
{{- end }}
revisionHistoryLimit: 3
---
{{- if .serviceMonitor.enabled }}
Expand Down
26 changes: 26 additions & 0 deletions charts/devtron/templates/gitsensor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,21 @@ spec:
volumeMounts:
- mountPath: /git-base/
name: git-volume
{{- if $.Values.selfSignedCert.enabled }}
- name: self-signed-container
image: quay.io/devtron/ubuntu-k8s-utils:latest
command:
- /bin/bash
- -c
- echo "Starting the init-container"
- cp ~/tmp/self-signed-config/myCA.pem /usr/local/share/ca-certificates/myCA.crt
- sudo update-ca-certificates
volumeMounts:
- name: cert-volume
mountPath: /etc/ssl/certs
- name: config
mountPath: tmp/self-signed-config
{{- end }}
containers:
- name: git-sensor
image: {{ .image }}
Expand Down Expand Up @@ -129,6 +144,17 @@ spec:
resources:
{{- toYaml .resources | nindent 12 }}
{{- end }}
{{- if $.Values.selfSignedCert.enabled }}
volumeMounts:
- mountPath: /etc/ssl/certs
name: cert-volume
volumes:
- name: cert-config
configMap:
name: self-signed-cert
- name: cert-volume
emptyDir: {}
{{- end }}
volumeClaimTemplates:
- metadata:
name: git-volume
Expand Down
2 changes: 2 additions & 0 deletions charts/devtron/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,3 +381,5 @@ monitoring:
resources: {}
persistence:
storage: "2Gi"
selfSignedCert:
enabled: false
Loading