-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Key Vault secrets instead of cert-manager secret in AKS cluster (#…
…185) * Update deployment script and add nginx-values.yaml * Update Dockerfile, values.yaml, variables.tf, and lib script * Update to satisfy pydantic and mypy * More mypy induced changes * More mypy changes
- Loading branch information
Showing
26 changed files
with
179 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
controller: | ||
podLabels: | ||
azure.workload.identity/use: "true" | ||
extraVolumes: | ||
- name: secrets-store-inline | ||
csi: | ||
driver: secrets-store.csi.k8s.io | ||
readOnly: true | ||
volumeAttributes: | ||
secretProviderClass: "keyvault" | ||
extraVolumeMounts: | ||
- name: secrets-store-inline | ||
mountPath: "/mnt/secrets-store" | ||
readOnly: true | ||
extraArgs: | ||
default-ssl-certificate: pc/planetarycomputer-test-certificate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,8 +73,8 @@ tiler: | |
|
||
stac_api_url: http://planetary-computer-stac.pc.svc.cluster.local | ||
stac_api_href: stac/ | ||
# PCT sas needs to be accessed through api management | ||
pc_sdk_sas_url: https://pct-sas-westeurope-staging-apim.azure-api.net/sas/token | ||
# PCT sas needs to be accessed through Azure Front Door | ||
pc_sdk_sas_url: https://planetarycomputer-test.microsoft.com/sas/token | ||
pc_sdk_subscription_key: "{{ tf.pc_sdk_subscription_key }}" | ||
vectortile_sa_base_url: https://pcvectortiles.blob.core.windows.net | ||
|
||
|
@@ -111,21 +111,19 @@ pcingress: | |
secretName: "pqe-tls-secret" | ||
|
||
certIssuer: | ||
enabled: true | ||
enabled: false | ||
privateKeySecretRef: "{{ tf.cluster_cert_issuer }}" | ||
server: "{{ tf.cluster_cert_server }}" | ||
issuerEmail: "[email protected]" | ||
secretName: "pqe-tls-secret" | ||
|
||
ingress: | ||
enabled: true | ||
tlsHost: "{{ tf.dns_label }}.{{ tf.location }}.cloudapp.azure.com" | ||
tlsHost: "planetarycomputer-test.microsoft.com" | ||
hosts: | ||
- "{{ tf.dns_label }}.{{ tf.location }}.cloudapp.azure.com" | ||
- "planetarycomputer-test.microsoft.com" | ||
annotations: | ||
kubernetes.io/ingress.class: nginx | ||
cert-manager.io/cluster-issuer: "{{ tf.cluster_cert_issuer }}-pcingress" | ||
nginx.ingress.kubernetes.io/rewrite-target: /$2 | ||
nginx.ingress.kubernetes.io/use-regex: "true" | ||
nginx.ingress.kubernetes.io/proxy-buffer-size: "16k" | ||
|
@@ -146,3 +144,12 @@ postgres: | |
user: "{{ tf.pg_user }}" | ||
password: "{{ tf.pg_password }}" | ||
dbName: "{{ tf.pg_database }}" | ||
|
||
secretProvider: | ||
create: true | ||
providerName: "keyvault" | ||
userAssignedIdentityID: "{{ env.SECRET_PROVIDER_MANAGED_IDENTITY_ID }}" | ||
tenantId: "{{ env.AZURE_TENANT }}" | ||
keyvaultName: "{{ env.KEYVAULT_NAME }}" | ||
keyvaultCertificateName: "{{ env.SECRET_PROVIDER_KEYVAULT_SECRET }}" | ||
kubernetesCertificateSecretName: "{{ env.SECRET_PROVIDER_KEYVAULT_SECRET }}" |
20 changes: 0 additions & 20 deletions
20
deployment/helm/pc-apis-ingress/templates/cluster_issuer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +0,0 @@ | ||
{{- if .Values.pcingress.certIssuer.enabled -}} | ||
apiVersion: cert-manager.io/v1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: {{ .Values.pcingress.certIssuer.privateKeySecretRef }}-pcingress | ||
spec: | ||
acme: | ||
server: {{ .Values.pcingress.certIssuer.server }} | ||
email: {{ .Values.pcingress.certIssuer.issuerEmail }} | ||
privateKeySecretRef: | ||
name: {{ .Values.pcingress.certIssuer.privateKeySecretRef }} | ||
solvers: | ||
- http01: | ||
ingress: | ||
class: nginx | ||
podTemplate: | ||
spec: | ||
nodeSelector: | ||
"kubernetes.io/os": linux | ||
{{- end }} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
deployment/helm/pc-apis-ingress/templates/secret-provider.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{- if .Values.secretProvider.create -}} | ||
apiVersion: secrets-store.csi.x-k8s.io/v1 | ||
kind: SecretProviderClass | ||
metadata: | ||
name: {{ .Values.secretProvider.providerName }} | ||
namespace: {{ .Values.namespace }} | ||
spec: | ||
provider: azure | ||
secretObjects: | ||
- secretName: {{ .Values.secretProvider.kubernetesCertificateSecretName }} | ||
type: kubernetes.io/tls | ||
data: | ||
- objectName: {{ .Values.secretProvider.keyvaultCertificateName }} | ||
key: tls.crt | ||
- objectName: {{ .Values.secretProvider.keyvaultCertificateName }} | ||
key: tls.key | ||
parameters: | ||
usePodIdentity: "false" | ||
clientID: "{{ .Values.secretProvider.userAssignedIdentityID }}" | ||
keyvaultName: "{{ .Values.secretProvider.keyvaultName }}" | ||
tenantId: "{{ .Values.secretProvider.tenantId }}" | ||
cloudName: "" | ||
objects: | | ||
array: | ||
- | | ||
objectName: {{ .Values.secretProvider.keyvaultCertificateName }} | ||
objectType: secret | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,5 @@ terraform { | |
} | ||
} | ||
} | ||
|
||
data "azurerm_client_config" "current" {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.