Skip to content

Commit 30b9147

Browse files
Enhance Workload API documentation with file configurations and examples
1 parent 962c7dd commit 30b9147

File tree

4 files changed

+128
-14
lines changed

4 files changed

+128
-14
lines changed

docs/reference/api/application/workload.md

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,31 @@ metadata:
5252
| `command` | []string | No | [] | Container entrypoint |
5353
| `args` | []string | No | [] | Arguments for the entrypoint |
5454
| `env` | [[EnvVar](#envvar)] | No | [] | Environment variables |
55+
| `files` | [[File](#file)] | No | [] | File configurations and secrets |
5556

5657
### EnvVar
5758

58-
| Field | Type | Required | Default | Description |
59-
|---------|--------|----------|---------|----------------------------|
60-
| `key` | string | Yes | - | Environment variable name |
61-
| `value` | string | Yes | - | Environment variable value |
59+
| Field | Type | Required | Default | Description |
60+
|----------------|---------------------------------|----------|---------|---------------------------------------------------------|
61+
| `key` | string | Yes | - | Environment variable name |
62+
| `value` | string | No | - | Environment variable value (required if secretKeyRef is not set) |
63+
| `secretKeyRef` | [SecretKeyRef](#secretkeyref) | No | - | Reference to a secret key (required if value is not set) |
64+
65+
### File
66+
67+
| Field | Type | Required | Default | Description |
68+
|----------------|---------------------------------|----------|---------|---------------------------------------------------------|
69+
| `key` | string | Yes | - | File name |
70+
| `mountPath` | string | Yes | - | Path where the file should be mounted |
71+
| `value` | string | No | - | File content (required if secretKeyRef is not set) |
72+
| `secretKeyRef` | [SecretKeyRef](#secretkeyref) | No | - | Reference to a secret key (required if value is not set) |
73+
74+
### SecretKeyRef
75+
76+
| Field | Type | Required | Default | Description |
77+
|---------|--------|----------|---------|------------------------|
78+
| `name` | string | Yes | - | Name of the secret |
79+
| `key` | string | Yes | - | Key within the secret |
6280

6381
### WorkloadEndpoint
6482

@@ -136,6 +154,45 @@ spec:
136154
port: 9090
137155
```
138156

157+
### Workload with Environment Variables and Files
158+
159+
```yaml
160+
apiVersion: openchoreo.dev/v1alpha1
161+
kind: Workload
162+
metadata:
163+
name: secure-service-workload
164+
namespace: default
165+
spec:
166+
owner:
167+
projectName: my-project
168+
componentName: secure-service
169+
containers:
170+
main:
171+
image: myregistry/secure-service:v1.0.0
172+
env:
173+
- key: LOG_LEVEL
174+
value: info
175+
- key: GIT_PAT
176+
secretKeyRef:
177+
name: git-secrets
178+
key: pat
179+
files:
180+
- key: ssl.pem
181+
mountPath: /tmp
182+
secretKeyRef:
183+
name: certificates
184+
key: privateKey
185+
- key: application.toml
186+
mountPath: /tmp
187+
value: |
188+
schema_generation:
189+
enable: true
190+
endpoints:
191+
api:
192+
type: REST
193+
port: 8080
194+
```
195+
139196
### Workload with Connections
140197

141198
```yaml

sidebars.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ const sidebars: SidebarsConfig = {
103103
type: 'category',
104104
label: 'Runtime Resources',
105105
items: [
106-
{type: 'doc', id: 'reference/api/runtime/servicebinding', label: 'ServiceBinding'},
107-
{type: 'doc', id: 'reference/api/runtime/webapplicationbinding', label: 'WebApplicationBinding'},
108-
{type: 'doc', id: 'reference/api/runtime/scheduledtaskbinding', label: 'ScheduledTaskBinding'},
106+
{type: 'doc', id: 'reference/api/runtime/servicebinding', label: 'ServiceBinding (Deprecated)'},
107+
{type: 'doc', id: 'reference/api/runtime/webapplicationbinding', label: 'WebApplicationBinding (Deprecated)'},
108+
{type: 'doc', id: 'reference/api/runtime/scheduledtaskbinding', label: 'ScheduledTaskBinding (Deprecated)'},
109109
{type: 'doc', id: 'reference/api/runtime/release', label: 'Release'}
110110
]
111111
}

versioned_docs/version-v0.4.x/reference/api/application/workload.md

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,31 @@ metadata:
5252
| `command` | []string | No | [] | Container entrypoint |
5353
| `args` | []string | No | [] | Arguments for the entrypoint |
5454
| `env` | [[EnvVar](#envvar)] | No | [] | Environment variables |
55+
| `files` | [[File](#file)] | No | [] | File configurations and secrets |
5556

5657
### EnvVar
5758

58-
| Field | Type | Required | Default | Description |
59-
|---------|--------|----------|---------|----------------------------|
60-
| `key` | string | Yes | - | Environment variable name |
61-
| `value` | string | Yes | - | Environment variable value |
59+
| Field | Type | Required | Default | Description |
60+
|----------------|---------------------------------|----------|---------|---------------------------------------------------------|
61+
| `key` | string | Yes | - | Environment variable name |
62+
| `value` | string | No | - | Environment variable value (required if secretKeyRef is not set) |
63+
| `secretKeyRef` | [SecretKeyRef](#secretkeyref) | No | - | Reference to a secret key (required if value is not set) |
64+
65+
### File
66+
67+
| Field | Type | Required | Default | Description |
68+
|----------------|---------------------------------|----------|---------|---------------------------------------------------------|
69+
| `key` | string | Yes | - | File name |
70+
| `mountPath` | string | Yes | - | Path where the file should be mounted |
71+
| `value` | string | No | - | File content (required if secretKeyRef is not set) |
72+
| `secretKeyRef` | [SecretKeyRef](#secretkeyref) | No | - | Reference to a secret key (required if value is not set) |
73+
74+
### SecretKeyRef
75+
76+
| Field | Type | Required | Default | Description |
77+
|---------|--------|----------|---------|------------------------|
78+
| `name` | string | Yes | - | Name of the secret |
79+
| `key` | string | Yes | - | Key within the secret |
6280

6381
### WorkloadEndpoint
6482

@@ -136,6 +154,45 @@ spec:
136154
port: 9090
137155
```
138156

157+
### Workload with Environment Variables and Files
158+
159+
```yaml
160+
apiVersion: openchoreo.dev/v1alpha1
161+
kind: Workload
162+
metadata:
163+
name: secure-service-workload
164+
namespace: default
165+
spec:
166+
owner:
167+
projectName: my-project
168+
componentName: secure-service
169+
containers:
170+
main:
171+
image: myregistry/secure-service:v1.0.0
172+
env:
173+
- key: LOG_LEVEL
174+
value: info
175+
- key: GIT_PAT
176+
secretKeyRef:
177+
name: git-secrets
178+
key: pat
179+
files:
180+
- key: ssl.pem
181+
mountPath: /tmp
182+
secretKeyRef:
183+
name: certificates
184+
key: privateKey
185+
- key: application.toml
186+
mountPath: /tmp
187+
value: |
188+
schema_generation:
189+
enable: true
190+
endpoints:
191+
api:
192+
type: REST
193+
port: 8080
194+
```
195+
139196
### Workload with Connections
140197

141198
```yaml

versioned_sidebars/version-v0.4.x-sidebars.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,17 @@
164164
{
165165
"type": "doc",
166166
"id": "reference/api/runtime/servicebinding",
167-
"label": "ServiceBinding"
167+
"label": "ServiceBinding (Deprecated)"
168168
},
169169
{
170170
"type": "doc",
171171
"id": "reference/api/runtime/webapplicationbinding",
172-
"label": "WebApplicationBinding"
172+
"label": "WebApplicationBinding (Deprecated)"
173173
},
174174
{
175175
"type": "doc",
176176
"id": "reference/api/runtime/scheduledtaskbinding",
177-
"label": "ScheduledTaskBinding"
177+
"label": "ScheduledTaskBinding (Deprecated)"
178178
},
179179
{
180180
"type": "doc",

0 commit comments

Comments
 (0)