Skip to content
Merged
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
20 changes: 16 additions & 4 deletions charts/todoblazor/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,27 @@ helm dependency update

## Validate on a test cluster

Create the secret with the connection string:

```bash
kubectl create ns demo
kubectl create secret generic todoblazor-database \
--from-literal=connectionstring='mongodb://root:admin@todoblazor-mongodb:27017/todolist?authSource=admin' \
--namespace demo
```

Create a `values.mine.yaml` file:

```yaml
dotnet:
environment: Development
enableOpenTelemetry: false
webapp:
tag: 1.0.21375563304
db:
connectionString: mongodb://root:admin@todoblazor-mongodb:27017/todolist?authSource=admin
# connectionString: mongodb://root:admin@todoblazor-mongodb:27017/todolist?authSource=admin
connectionStringSecretKeyRef:
name: todoblazor-database
key: connectionstring
databaseName: todolist
ingress:
enabled: true
Expand All @@ -52,7 +64,7 @@ Install or update the application:
helm upgrade --install todoblazor . \
-f values.yaml -f values.mine.yaml \
--set webapp.host=todoblazor.console.$SANDBOX_ID.instruqt.io \
--namespace demo --create-namespace
--namespace demo
```

Check everything is ok in the namespace:
Expand All @@ -64,7 +76,7 @@ kubectl get pod,svc,deploy,rs,ingress,secret,pvc -n demo
Open the web application in a browser:

```bash
echo https://todoblazor.console.$SANDBOX_ID.instruqt.io/swagger
echo https://todoblazor.console.$SANDBOX_ID.instruqt.io
```

If needed, debug with:
Expand Down
12 changes: 12 additions & 0 deletions charts/todoblazor/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,21 @@ spec:
- name: OpenTelemetry__CollectorEndpoint
value: "http://$(HOST_IP):4317"
{{- end }}
{{- if $.Values.dotnet.enableHttpRedirect }}
- name: Features__IsHttpsRedirectionEnabled
value: "true"
{{- end }}
{{- if .db }}
{{- if .db.connectionStringSecretKeyRef }}
- name: DatabaseSettings__ConnectionString
valueFrom:
secretKeyRef:
name: {{ .db.connectionStringSecretKeyRef.name }}
key: {{ .db.connectionStringSecretKeyRef.key }}
{{- else }}
- name: DatabaseSettings__ConnectionString
value: {{ .db.connectionString }}
{{- end }}
- name: DatabaseSettings__DatabaseName
value: {{ .db.databaseName }}
{{- end }}
Expand Down
6 changes: 5 additions & 1 deletion charts/todoblazor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
containerPort: 8080
healthEndpoint: /health
db:
connectionString: "someconnstring"
# connectionString: "someconnstring"
# connectionStringSecretKeyRef:
# name: todoblazor-secret
# key: db-connectionstring
databaseName: "somedb"
extraEnv: []
# - name: xxx
Expand All @@ -33,6 +36,7 @@ dotnet:
framework: Information
application: Information
enableOpenTelemetry: false
enableHttpRedirect: true

ingress:
enabled: false
Expand Down
Loading