Skip to content

Commit

Permalink
fix: helm chart secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarschulte committed Aug 23, 2023
1 parent e1553c5 commit c6e8700
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 10 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Learn about the capabilities of this extension in our [Reliability Hub](https://
| `AZURE_TENANT_ID` | azure.tenantID | Azure Tenant ID | true | |
| `AZURE_CLIENT_SECRET` | azure.clientSecret | Azure Client Secret | false | |
| `AZURE_SUBSCRIPTION_ID` | azure.subscriptionID | Azure Subscription ID | false | |
| `STEADYBIT_EXTENSION_AZURE_CERTIFICATE_PATH` | azure.certificatePath | Location of a certificate used to authenticate to azure | false | |
| `STEADYBIT_EXTENSION_AZURE_CERTIFICATE_PATH` | azure.certificatePath | Location of a certificate used to authenticate to azure | false | |
| `STEADYBIT_EXTENSION_AZURE_CERTIFICATE_PASSWORD` | azure.certificatePassword | Passphrase for the certificate used to authenticate to azure | false | |


Expand Down Expand Up @@ -46,6 +46,9 @@ helm upgrade steadybit-extension-azure \
--timeout 5m0s \
--create-namespace \
--namespace steadybit-extension \
--set azure.clientID=YOUR_CLIENT_ID \
--set azure.clientSecret=YOUR_CLIENT_SECRET \
--set azure.tenantID=YOUR_TENANT_ID \
steadybit-extension-azure/steadybit-extension-azure
```

Expand Down
2 changes: 1 addition & 1 deletion charts/steadybit-extension-azure/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: steadybit-extension-azure
description: Steadybit scaffold extension Helm chart for Kubernetes.
version: 1.0.2
version: 1.0.3
appVersion: latest
home: https://www.steadybit.com/
icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png
Expand Down
20 changes: 20 additions & 0 deletions charts/steadybit-extension-azure/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if not .Values.azure.existingSecret -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "azure.secret.name" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- range $key, $value := .Values.extraLabels }}
{{ $key }}: {{ $value }}
{{- end }}
type: Opaque
data:
clientID: {{ .Values.azure.clientID | b64enc | quote }}
clientSecret: {{ .Values.azure.clientSecret | b64enc | quote }}
tenantID: {{ .Values.azure.tenantID | b64enc | quote }}
subscriptionID: {{ .Values.azure.subscriptionID | b64enc | quote }}
certificatePath: {{ .Values.azure.certificatePath | b64enc | quote }}
certificatePassword: {{ .Values.azure.certificatePassword | b64enc | quote }}
userAssertionString: {{ .Values.azure.userAssertionString | b64enc | quote }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/steadybit-extension-azure/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ tests:
- it: manifest should match snapshot with azure certificates vars
set:
azure:
clientID: "clientId"
tenantID: "tenantId"
certificatePath: "/tmp/certificatePath"
certificatePassword: "certificatePassword"
asserts:
Expand Down
14 changes: 7 additions & 7 deletions charts/steadybit-extension-azure/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ extraEnv: []
extraEnvFrom: []

azure:
clientID: null
clientSecret: null
tenantID: null
subscriptionID: null
certificatePath: null
certificatePassword: null
userAssertionString: null
clientID: ""
clientSecret: ""
tenantID: ""
subscriptionID: ""
certificatePath: ""
certificatePassword: ""
userAssertionString: ""
# azure.existingSecret -- If defined, will skip secret creation and instead assume that the referenced secret contains the keys clientID, clientSecret, tenantID, subscriptionID, certificatePath, certificatePassword, userAssertionString
existingSecret: null
5 changes: 4 additions & 1 deletion e2e/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ func TestWithMinikube(t *testing.T) {
Name: "extension-azure",
Port: 8092,
ExtraArgs: func(m *e2e.Minikube) []string {
return []string{"--set", "logging.level=debug"}
return []string{
"--set", "logging.level=debug",
"--set", "azure.level=debug",
}
},
}

Expand Down

0 comments on commit c6e8700

Please sign in to comment.