Skip to content
Merged
23 changes: 23 additions & 0 deletions docs/pages/kubernetes-access/helm/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,29 @@ A list of `initContainers` which will be run before the main Teleport container
</TabItem>
</Tabs>

## `postStart`
Comment thread
webvictim marked this conversation as resolved.

[Kubernetes reference](https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/)

A `postStart` lifecycle handler to be configured on the main Teleport container.

<Tabs>
<TabItem label="values.yaml">
```yaml
postStart:
command:
- echo
- foo
```
</TabItem>
<TabItem label="--set">
```shell
--set "postStart.command[0]=echo" \
--set "postStart.command[1]=foo"
```
</TabItem>
</Tabs>

## `resources`

| Type | Default value | Can be used in `custom` mode? |
Expand Down
6 changes: 6 additions & 0 deletions examples/chart/teleport-cluster/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ spec:
initialDelaySeconds: 5 # wait 5s for agent to register
periodSeconds: 5 # poll health every 5s
failureThreshold: 12 # consider agent unhealthy after 60s (12 * 5s)
{{- if .Values.postStart.command }}
lifecycle:
postStart:
exec:
command: {{ toYaml .Values.postStart.command | nindent 14 }}
{{- end }}
{{- if .Values.resources }}
resources:
{{- toYaml .Values.resources | nindent 10 }}
Expand Down
14 changes: 14 additions & 0 deletions examples/chart/teleport-cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,20 @@
"type": "array",
"default": []
},
"postStart": {
"$id": "#/properties/postStart",
"type": "object",
"required": [
"command"
],
"properties": {
"command": {
"$id": "#properties/postStart/command",
"type": "array",
"default": []
}
}
},
"kubeClusterName": {
"$id": "#/properties/kubeClusterName",
"type": "string",
Expand Down
5 changes: 5 additions & 0 deletions examples/chart/teleport-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ initContainers: []
# image: "alpine"
# args: ["echo test"]

# If set, will run the command as a postStart handler
# https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/
postStart:
command: []

# Resources to request for each pod in the deployment
# https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
resources: {}
Expand Down