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

IDP-1416 Add support for workleap certificate store #60

Merged
merged 2 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion charts/aspnetcore/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: aspnetcore
description: A generic Helm chart for ASP.NET Core services
version: 1.0.4
version: 1.0.5
starcraft66 marked this conversation as resolved.
Show resolved Hide resolved
home: https://github.com/gsoft-inc/gsoft-helm-charts
sources:
- https://github.com/gsoft-inc/gsoft-helm-charts
Expand Down
21 changes: 16 additions & 5 deletions charts/aspnetcore/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ include "aspnetcore.serviceAccountName" . }}
{{- if .Values.volumes }}
starcraft66 marked this conversation as resolved.
Show resolved Hide resolved
{{- toYaml .Values.volumes | nindent 6 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}-container
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand Down Expand Up @@ -68,8 +65,14 @@ spec:
startupProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.extraVolumeMounts }}
volumeMounts:
{{- if .Values.certificateStore.enabled }}
- name: internal-certificates
mountPath: "/etc/ssl/certs/ca-certificates.crt"
subPath: "certificate-wildcard-platform-workleap-{{ .Values.environment }}-internal"
readOnly: true
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
{{- end }}
{{- with .Values.nodeSelector }}
Expand All @@ -84,7 +87,15 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.extraVolumes}}
volumes:
{{- if .Values.certificateStore.enabled }}
- name: internal-certificates
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: internal-dns-keyvault
{{- end }}
{{- if .Values.extraVolumes}}
{{- toYaml .Values.extraVolumes | nindent 8 }}
{{- end }}
18 changes: 18 additions & 0 deletions charts/aspnetcore/templates/secretproviderclass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.certificateStore.enabled }}
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: internal-dns-keyvault
spec:
provider: azure
parameters:
usePodIdentity: "false"
clientID: {{ .Values.azureWorkloadIdentity.clientId }}
keyvaultName: {{ .Values.certificateStore.keyvaultName }}
objects: |
array:
- |
objectName: INTERNAL_DNS_CERTIFICATE_NAME
objectType: cert
tenantId: {{ .Values.certificateStore.tenantId }}
{{- end }}
starcraft66 marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions charts/aspnetcore/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,12 @@ extraVolumes: []
## mountPath: /etc/config
##
extraVolumeMounts: []

## Replace the container's certificate store with Workleap's certificate store which is stored in an Azure Key Vault
## @param certificateStore.enabled Whether or not to replace the container's certificate store with Workleap's
## @param certificateStore.tenantId The id of the azure tenant the Key Vault containing the certificate store is located in
## @param certificateStore.keyvaultName The name of the Key Vault containing the certificate store
certificateStore:
enabled: false
tenantId: ""
keyvaultName: ""
starcraft66 marked this conversation as resolved.
Show resolved Hide resolved
Loading