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
110 changes: 103 additions & 7 deletions docs/pages/includes/helm-reference/zz_generated.tbot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This must contain the port number, usually 443 or 3080 for Proxy Service.
Connecting to the Proxy Service is the most common and recommended way to connect to Teleport.
This is mandatory to connect to Teleport Enterprise (Cloud)

This setting is mutually exclusive with teleportProxyAddress and is ignored if `customConfig` is set.
This setting is mutually exclusive with teleportProxyAddress and is ignored if `tbotConfig` is set.

For example:
```yaml
Expand All @@ -54,7 +54,7 @@ should be used when you are deploying the bot in the same Kubernetes cluster tha
Helm release and have direct access to the Auth Service.
Else, you should prefer connecting via the Proxy Service.

This setting is mutually exclusive with teleportProxyAddress and is ignored if `customConfig` is set.
This setting is mutually exclusive with teleportProxyAddress and is ignored if `tbotConfig` is set.

For example:
```yaml
Expand All @@ -64,7 +64,7 @@ teleportAuthAddress: "teleport-auth.teleport-namespace.svc.cluster.local:3025"
## `defaultOutput`

`defaultOutput` controls the default output configured for the tbot agent.
Ignored if `customConfig` is set.
Ignored if `tbotConfig` is set.

### `defaultOutput.enabled`

Expand All @@ -74,6 +74,102 @@ Ignored if `customConfig` is set.

`defaultOutput.enabled` controls whether the default output is enabled.

## `argocd`

`argocd` configures tbot to synchronize Teleport-managed Kubernetes clusters
to Argo CD.
Ignored if `tbotConfig` is set.

### `argocd.enabled`

| Type | Default |
|------|---------|
| `bool` | `false` |

`argocd.enabled` controls whether the Argo CD output is enabled.

### `argocd.clusterSelectors`

| Type | Default |
|------|---------|
| `list` | `[]` |

`argocd.clusterSelectors` determines which Kubernetes clusters will
be synchronized to Argo CD.

For example:
```yaml
clusterSelectors:
- name: my-cluster-1
- labels:
environment: production
```

### `argocd.secretNamespace`

| Type | Default |
|------|---------|
| `string` | `""` |

`argocd.secretNamespace` determines to which Kubernetes namespace
cluster secrets will be written (it must be the namespace in which Argo CD
is running). Defaults to the current namespace.

### `argocd.secretNamePrefix`

| Type | Default |
|------|---------|
| `string` | `""` |

`argocd.secretNamePrefix` overrides the string that cluster secret
names will be prefixed with. Defaults to "teleport.argocd-cluster".

### `argocd.secretLabels`

| Type | Default |
|------|---------|
| `object` | `{}` |

`argocd.secretLabels` provides a set of labels that will be applied
to cluster secrets.

### `argocd.secretAnnotations`

| Type | Default |
|------|---------|
| `object` | `{}` |

`argocd.secretAnnotations` provides a set of annotations that will
be applied to cluster secrets.

### `argocd.project`

| Type | Default |
|------|---------|
| `string` | `""` |

`argocd.project` sets the Argo CD project with which the Kubernetes
clusters will be associated.

### `argocd.namespaces`

| Type | Default |
|------|---------|
| `list` | `[]` |

`argocd.namespaces` controls which Kubernetes namespaces the Argo CD
clusters will be allowed to operate on.

### `argocd.clusterResources`

| Type | Default |
|------|---------|
| `bool` | `false` |

`argocd.clusterResources` determines whether the Argo CD cluster is
allowed to operate on cluster-scoped resources (only when `argocd.namespaces`
is non-empty).

## `persistence`

`persistence` controls how the tbot agent stores its data.
Expand Down Expand Up @@ -102,7 +198,7 @@ use the more specific configuration values throughout this chart.

`outputs` contains additional outputs to configure for the tbot agent.
These should be in the same format as the `outputs` field in the tbot.yaml.
Ignored if `customConfig` is set.
Ignored if `tbotConfig` is set.

## `services`

Expand All @@ -112,7 +208,7 @@ Ignored if `customConfig` is set.

`services` contains additional services to configure for the tbot agent.
These should be in the same format as the `services` field in the tbot.yaml.
Ignored if `customConfig` is set.
Ignored if `tbotConfig` is set.

## `joinMethod`

Expand All @@ -122,7 +218,7 @@ Ignored if `customConfig` is set.

`joinMethod` describes how tbot joins the Teleport cluster.
See [the join method reference](../../reference/join-methods.mdx) for a list fo supported values and detailed explanations.
Ignored if `customConfig` is set.
Ignored if `tbotConfig` is set.

## `token`

Expand All @@ -132,7 +228,7 @@ Ignored if `customConfig` is set.

`token` is the name of the token used by tbot to join the Teleport cluster.
This value is not sensitive unless the `joinMethod` is set to `"token"`.
Ignored if `customConfig` is set.
Ignored if `tbotConfig` is set.

## `teleportVersionOverride`

Expand Down
21 changes: 21 additions & 0 deletions examples/chart/tbot/.lint/argocd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
clusterName: "test.teleport.sh"
teleportProxyAddress: "test.teleport.sh:443"
token: "my-token"
defaultOutput:
enabled: false
argocd:
enabled: true
clusterSelectors:
- name: foo
- labels:
foo: bar
secretNamespace: my-namespace
secretLabels:
baz: qux
secretAnnotations:
chunky: bacon
project: my-argo-project
namespaces:
- dev
- prod
clusterResources: true
32 changes: 31 additions & 1 deletion examples/chart/tbot/templates/_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,44 @@ storage:
{{- else }}
{{- required "'persistence' must be 'secret' or 'disabled'" "" }}
{{- end }}
{{- if or (.Values.defaultOutput.enabled) (.Values.outputs) }}
{{- if or (.Values.defaultOutput.enabled) (.Values.argocd.enabled) (.Values.outputs) }}
outputs:
{{- if .Values.defaultOutput.enabled }}
- type: identity
destination:
type: kubernetes_secret
name: {{ include "tbot.defaultOutputName" . }}
{{- end }}
{{- if .Values.argocd.enabled }}
- type: kubernetes/argo-cd
{{- if .Values.argocd.clusterSelectors }}
selectors:
{{- toYaml .Values.argocd.clusterSelectors | nindent 8 }}
{{- else }}
{{- required "'argocd.clusterSelectors' must be provided if `argocd.enabled' is true" "" }}
{{- end }}
{{- if .Values.argocd.secretNamespace }}
secret_namespace: {{ .Values.argocd.secretNamespace }}
{{- end }}
{{- if .Values.argocd.secretLabels }}
secret_labels:
{{- toYaml .Values.argocd.secretLabels | nindent 8 }}
{{- end }}
{{- if .Values.argocd.secretAnnotations }}
secret_annotations:
{{- toYaml .Values.argocd.secretAnnotations | nindent 8 }}
{{- end }}
{{- if .Values.argocd.project }}
project: {{ .Values.argocd.project }}
{{- end }}
{{- if .Values.argocd.namespaces }}
namespaces:
{{- toYaml .Values.argocd.namespaces | nindent 8 }}
{{- end }}
{{- if .Values.argocd.clusterResources }}
cluster_resources: {{ .Values.argocd.clusterResources }}
{{- end }}
{{- end }}
{{- if .Values.outputs }}
{{- toYaml .Values.outputs | nindent 2}}
{{- end }}
Expand Down
33 changes: 33 additions & 0 deletions examples/chart/tbot/tests/__snapshot__/config_test.yaml.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,39 @@ it should match the snapshot (custom):
metadata:
name: RELEASE-NAME-tbot
namespace: NAMESPACE
should match the snapshot (argocd):
1: |
apiVersion: v1
data:
tbot.yaml: |-
onboarding:
join_method: kubernetes
token: my-token
outputs:
- cluster_resources: true
namespaces:
- dev
- prod
project: my-argo-project
secret_annotations:
chunky: bacon
secret_labels:
baz: qux
secret_namespace: my-namespace
selectors:
- name: foo
- labels:
foo: bar
type: kubernetes/argo-cd
proxy_server: test.teleport.sh:443
storage:
name: RELEASE-NAME-tbot
type: kubernetes_secret
version: v2
kind: ConfigMap
metadata:
name: RELEASE-NAME-tbot
namespace: NAMESPACE
should match the snapshot (full):
1: |
apiVersion: v1
Expand Down
5 changes: 5 additions & 0 deletions examples/chart/tbot/tests/config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ tests:
path: /buzz
asserts:
- matchSnapshot: {}
- it: should match the snapshot (argocd)
values:
- ../.lint/argocd.yaml
asserts:
- matchSnapshot: {}
55 changes: 48 additions & 7 deletions examples/chart/tbot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fullnameOverride: ""
# Connecting to the Proxy Service is the most common and recommended way to connect to Teleport.
# This is mandatory to connect to Teleport Enterprise (Cloud)
#
# This setting is mutually exclusive with teleportProxyAddress and is ignored if `customConfig` is set.
# This setting is mutually exclusive with teleportProxyAddress and is ignored if `tbotConfig` is set.
#
# For example:
# ```yaml
Expand All @@ -31,7 +31,7 @@ teleportProxyAddress: ""
# Helm release and have direct access to the Auth Service.
# Else, you should prefer connecting via the Proxy Service.
#
# This setting is mutually exclusive with teleportProxyAddress and is ignored if `customConfig` is set.
# This setting is mutually exclusive with teleportProxyAddress and is ignored if `tbotConfig` is set.
#
# For example:
# ```yaml
Expand All @@ -40,11 +40,52 @@ teleportProxyAddress: ""
teleportAuthAddress: ""

# defaultOutput -- controls the default output configured for the tbot agent.
# Ignored if `customConfig` is set.
# Ignored if `tbotConfig` is set.
defaultOutput:
# defaultOutput.enabled(bool) -- controls whether the default output is enabled.
enabled: true

# argocd -- configures tbot to synchronize Teleport-managed Kubernetes clusters
# to Argo CD.
# Ignored if `tbotConfig` is set.
argocd:
# argocd.enabled(bool) -- controls whether the Argo CD output is enabled.
enabled: false
# argocd.clusterSelectors(list) -- determines which Kubernetes clusters will
# be synchronized to Argo CD.
#
# For example:
# ```yaml
# clusterSelectors:
# - name: my-cluster-1
# - labels:
# environment: production
# ```
clusterSelectors: []
# argocd.secretNamespace(string) -- determines to which Kubernetes namespace
# cluster secrets will be written (it must be the namespace in which Argo CD
# is running). Defaults to the current namespace.
secretNamespace: ""
# argocd.secretNamePrefix(string) -- overrides the string that cluster secret
# names will be prefixed with. Defaults to "teleport.argocd-cluster".
secretNamePrefix: ""
# argocd.secretLabels(object) -- provides a set of labels that will be applied
# to cluster secrets.
secretLabels: {}
# argocd.secretAnnotations(object) -- provides a set of annotations that will
# be applied to cluster secrets.
secretAnnotations: {}
# argocd.project(string) -- sets the Argo CD project with which the Kubernetes
# clusters will be associated.
project: ""
# argocd.namespaces(list) -- controls which Kubernetes namespaces the Argo CD
# clusters will be allowed to operate on.
namespaces: []
# argocd.clusterResources(bool) -- determines whether the Argo CD cluster is
# allowed to operate on cluster-scoped resources (only when `argocd.namespaces`
# is non-empty).
clusterResources: false

# persistence -- controls how the tbot agent stores its data.
#
# Options:
Expand All @@ -61,22 +102,22 @@ tbotConfig: {}

# outputs(list) -- contains additional outputs to configure for the tbot agent.
# These should be in the same format as the `outputs` field in the tbot.yaml.
# Ignored if `customConfig` is set.
# Ignored if `tbotConfig` is set.
outputs: []

# services(list) -- contains additional services to configure for the tbot agent.
# These should be in the same format as the `services` field in the tbot.yaml.
# Ignored if `customConfig` is set.
# Ignored if `tbotConfig` is set.
services: []

# joinMethod(string) -- describes how tbot joins the Teleport cluster.
# See [the join method reference](../../reference/join-methods.mdx) for a list fo supported values and detailed explanations.
# Ignored if `customConfig` is set.
# Ignored if `tbotConfig` is set.
joinMethod: "kubernetes"

# token(string) -- is the name of the token used by tbot to join the Teleport cluster.
# This value is not sensitive unless the `joinMethod` is set to `"token"`.
# Ignored if `customConfig` is set.
# Ignored if `tbotConfig` is set.
token: ""

# teleportVersionOverride(string) -- controls the tbot image version deployed by
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ func (d *KubernetesDataSource) Read(
},
DisableExecPlugin: true,
},
bot.DefaultCredentialLifetime,
),
}
if err := botCfg.CheckAndSetDefaults(); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ func (r *KubernetesEphemeralResource) Open(
},
DisableExecPlugin: true,
},
bot.DefaultCredentialLifetime,
),
}
if err := botCfg.CheckAndSetDefaults(); err != nil {
Expand Down
Loading
Loading