From 04620128d3de09f88476dc8e8cb93f9e954f3084 Mon Sep 17 00:00:00 2001 From: David Riosalido Date: Tue, 14 May 2024 14:17:34 +0200 Subject: [PATCH 1/2] Allow SelfSignedCertificates already provisioned --- charts/port-ocean/Chart.yaml | 2 +- charts/port-ocean/templates/certificate_secret.yaml | 4 ++-- charts/port-ocean/templates/deployment.yaml | 12 ++++++++++-- charts/port-ocean/values.yaml | 5 ++++- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/charts/port-ocean/Chart.yaml b/charts/port-ocean/Chart.yaml index dfdba21..6d4598f 100644 --- a/charts/port-ocean/Chart.yaml +++ b/charts/port-ocean/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: port-ocean description: A Helm chart for Port Ocean integrations type: application -version: 0.1.20 +version: 0.1.21 appVersion: "0.1.0" home: https://getport.io/ sources: diff --git a/charts/port-ocean/templates/certificate_secret.yaml b/charts/port-ocean/templates/certificate_secret.yaml index 4d88909..d5f7f21 100644 --- a/charts/port-ocean/templates/certificate_secret.yaml +++ b/charts/port-ocean/templates/certificate_secret.yaml @@ -1,4 +1,4 @@ -{{- if .Values.selfSignedCertificate.enabled }} +{{- if and .Values.selfSignedCertificate.enabled (eq false .Values.selfSignedCertificate.useExistingSecret) }} apiVersion: v1 kind: Secret metadata: @@ -6,4 +6,4 @@ metadata: type: Opaque data: crt: {{ .Values.selfSignedCertificate.certificate | b64enc }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/port-ocean/templates/deployment.yaml b/charts/port-ocean/templates/deployment.yaml index 140d1df..e0557b8 100644 --- a/charts/port-ocean/templates/deployment.yaml +++ b/charts/port-ocean/templates/deployment.yaml @@ -64,7 +64,16 @@ spec: readOnly: true {{- end }} volumes: - {{- if .Values.selfSignedCertificate.enabled }} + {{- if and .Values.selfSignedCertificate.enabled .Values.selfSignedCertificate.useExistingSecret }} + - name: certificates + projected: + sources: + - secret: + name: {{ .Values.selfSignedCertificate.secret.name }} + items: + - key: {{ .Values.selfSignedCertificate.secret.key }} + path: cert.crt + {{- else if .Values.selfSignedCertificate.enabled }} - name: certificates projected: sources: @@ -86,4 +95,3 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} - diff --git a/charts/port-ocean/values.yaml b/charts/port-ocean/values.yaml index b024fb8..922f545 100644 --- a/charts/port-ocean/values.yaml +++ b/charts/port-ocean/values.yaml @@ -91,4 +91,7 @@ integration: selfSignedCertificate: enabled: false - certificate: "" \ No newline at end of file + certificate: "" + secret: "" + useExistingSecret: false + key: crt From feef299d1f836fbb72c805baeefdd874889d81c8 Mon Sep 17 00:00:00 2001 From: David Riosalido Date: Thu, 16 May 2024 10:52:33 +0200 Subject: [PATCH 2/2] Fix Values.yaml --- .../templates/certificate_secret.yaml | 2 +- charts/port-ocean/templates/deployment.yaml | 2 +- charts/port-ocean/values.yaml | 22 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/charts/port-ocean/templates/certificate_secret.yaml b/charts/port-ocean/templates/certificate_secret.yaml index d5f7f21..da327b9 100644 --- a/charts/port-ocean/templates/certificate_secret.yaml +++ b/charts/port-ocean/templates/certificate_secret.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.selfSignedCertificate.enabled (eq false .Values.selfSignedCertificate.useExistingSecret) }} +{{- if and .Values.selfSignedCertificate.enabled (not .Values.selfSignedCertificate.secret.useExistingSecret) }} apiVersion: v1 kind: Secret metadata: diff --git a/charts/port-ocean/templates/deployment.yaml b/charts/port-ocean/templates/deployment.yaml index e0557b8..fd2fa3b 100644 --- a/charts/port-ocean/templates/deployment.yaml +++ b/charts/port-ocean/templates/deployment.yaml @@ -64,7 +64,7 @@ spec: readOnly: true {{- end }} volumes: - {{- if and .Values.selfSignedCertificate.enabled .Values.selfSignedCertificate.useExistingSecret }} + {{- if and .Values.selfSignedCertificate.enabled .Values.selfSignedCertificate.secret.useExistingSecret }} - name: certificates projected: sources: diff --git a/charts/port-ocean/values.yaml b/charts/port-ocean/values.yaml index 922f545..29a92e0 100644 --- a/charts/port-ocean/values.yaml +++ b/charts/port-ocean/values.yaml @@ -15,15 +15,15 @@ extraEnv: podSecurityContext: {} # Example - # runAsGroup: 1001 - # runAsUser: 1001 - # fsGroup: 1001 - # fsGroupChangePolicy: "OnRootMismatch" +# runAsGroup: 1001 +# runAsUser: 1001 +# fsGroup: 1001 +# fsGroupChangePolicy: "OnRootMismatch" containerSecurityContext: {} # Example - # runAsGroup: 1001 - # runAsUser: 1001 - # allowPrivilegeEscalation: false +# runAsGroup: 1001 +# runAsUser: 1001 +# allowPrivilegeEscalation: false rolloutStrategy: "Recreate" @@ -35,7 +35,6 @@ resources: memory: "1024Mi" cpu: "500m" - nodeSelector: {} tolerations: [] @@ -92,6 +91,7 @@ integration: selfSignedCertificate: enabled: false certificate: "" - secret: "" - useExistingSecret: false - key: crt + secret: + name: "" + key: crt + useExistingSecret: false