You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/deploy-with-configurations.mdx
+27-13Lines changed: 27 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
---
2
-
title: Deploy a Service with Configurations and Secrets
3
-
description: Learn how to inject environment variables, config files, and secrets into your OpenChoreo service deployments.
2
+
title: Deploy a Worker with Configurations and Secrets
3
+
description: Learn how to inject environment variables, config files, and secrets into your OpenChoreo worker deployments.
4
4
sidebar_position: 6
5
5
---
6
6
7
7
importCodeBlockfrom"@theme/CodeBlock";
8
8
import { versions } from"../_constants.mdx";
9
9
10
-
# Deploy a Service with Configurations and Secrets
10
+
# Deploy a Worker with Configurations and Secrets
11
11
12
-
This guide walks you through deploying a service that uses environment variables, configuration files, and secrets. OpenChoreo lets you inject all of these into your workload without baking them into your container image.
12
+
This guide walks you through deploying a worker that uses environment variables, configuration files, and secrets. OpenChoreo lets you inject all of these into your workload without baking them into your container image.
13
13
14
14
## Overview
15
15
@@ -89,7 +89,7 @@ Each `SecretReference` maps a key from the external store to a Kubernetes secret
89
89
90
90
## Step 3 — Deploy the Component and Workload
91
91
92
-
Create a `Component` using the `service-with-configs` ComponentType, and a `Workload` that injects environment variables, a configuration file, and the secrets defined above.
92
+
Create a `Component` using the `deployment/worker` ComponentType, and a `Workload` that injects environment variables, a configuration file, and the secrets defined above. The container echoes all injected values and then sleeps indefinitely so you can inspect the output.
93
93
94
94
```bash
95
95
kubectl apply -f - <<EOF
@@ -104,7 +104,7 @@ spec:
104
104
projectName: default
105
105
componentType:
106
106
kind: ClusterComponentType
107
-
name: deployment/service
107
+
name: deployment/worker
108
108
autoDeploy: true
109
109
---
110
110
apiVersion: openchoreo.dev/v1alpha1
@@ -116,13 +116,21 @@ spec:
116
116
owner:
117
117
projectName: default
118
118
componentName: config-tutorial-app
119
-
endpoints:
120
-
http:
121
-
type: HTTP
122
-
port: 80
123
-
visibility: [external]
124
119
container:
125
-
image: "nginx:1.25-alpine"
120
+
image: "alpine:3.19"
121
+
command:
122
+
- sh
123
+
- -c
124
+
- |
125
+
echo "=== Environment Variables ==="
126
+
echo "LOG_LEVEL=$LOG_LEVEL"
127
+
echo "DATABASE_PASSWORD=$DATABASE_PASSWORD"
128
+
echo "=== Config File ==="
129
+
cat /conf/application.toml
130
+
echo "=== Secret File ==="
131
+
cat /conf/gitPAT
132
+
echo "=== Done. Sleeping... ==="
133
+
sleep infinity
126
134
env:
127
135
- key: LOG_LEVEL
128
136
value: info
@@ -214,6 +222,12 @@ Check that the pods are running:
214
222
kubectl get pods -A | grep config-tutorial-app
215
223
```
216
224
225
+
Once the pod is running, inspect the container output to verify the injected values:
Verify the ConfigMaps, ExternalSecrets, and Secrets were created for the configurations:
218
232
219
233
```bash
@@ -224,7 +238,7 @@ kubectl get secrets -A | grep config-tutorial-app
224
238
225
239
## Summary
226
240
227
-
You've learned how to deploy a service with environment variables, configuration files, and secrets using OpenChoreo's `Workload` and `SecretReference` resources, and how to override configurations per environment using `ReleaseBinding`.
241
+
You've learned how to deploy a worker with environment variables, configuration files, and secrets using OpenChoreo's `Workload` and `SecretReference` resources, and how to override configurations per environment using `ReleaseBinding`.
0 commit comments