Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to disable creation of ClusteRole and ClusterRoleBinding #17570

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 3 additions & 1 deletion examples/chart/teleport-cluster/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -60,4 +61,5 @@ rules:
- events
verbs:
- create
{{ end }}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand All @@ -10,3 +11,4 @@ subjects:
- kind: ServiceAccount
name: {{ template "teleport.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end -}}
14 changes: 13 additions & 1 deletion examples/chart/teleport-cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,19 @@
"create": {
"$id": "#properties/service/create",
"type": "boolean",
"default": true
"default": true
}
}
},
"rbac": {
"$id": "#/properties/rbac",
"type": "object",
"required": [],
"properties": {
"create": {
"$id": "#properties/rbac/create",
"type": "boolean",
"default": true
}
}
},
Expand Down
6 changes: 6 additions & 0 deletions examples/chart/teleport-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,12 @@ serviceAccount:
name: ""
# To set annotations on the service account, use the annotations.serviceAccount value.

# Set to true (default) to create Kubernetes ClusterRole and ClusterRoleBinding.
rbac:
# Specifies whether a ClusterRole and ClusterRoleBinding should be created.
# Set to false if your cluster level resources are managed separately.
create: true

# Options for the Teleport service
service:
type: LoadBalancer
Expand Down
2 changes: 2 additions & 0 deletions examples/chart/teleport-kube-agent/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -27,3 +28,4 @@ rules:
- selfsubjectaccessreviews
verbs:
- create
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand All @@ -14,3 +15,4 @@ subjects:
- kind: ServiceAccount
name: {{ template "teleport.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end -}}
29 changes: 29 additions & 0 deletions examples/chart/teleport-kube-agent/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,35 @@
}
}
},
"serviceAccount": {
"$id": "#/properties/serviceAccount",
"type": "object",
"required": [],
"properties": {
"name": {
"$id": "#properties/serviceAccount/name",
"type": "string",
"default": ""
},
"create": {
"$id": "#properties/serviceAccount/create",
"type": "boolean",
"default": true
}
}
},
"rbac": {
"$id": "#/properties/rbac",
"type": "object",
"required": [],
"properties": {
"create": {
"$id": "#properties/rbac/create",
"type": "boolean",
"default": true
}
}
},
"extraArgs": {
"$id": "#/properties/extraArgs",
"type": "array",
Expand Down
12 changes: 9 additions & 3 deletions examples/chart/teleport-kube-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ highAvailability:
################################################################
# Values that must be provided if using persistent storage for Teleport.
#
# Assigning a persistent volume to Teleport agent allows the agent to keep session recordings when the pod is restarted if `session_recording` is set to `node` or `proxy`.
# The security association between the agent and the Teleport is no longer stored in PV, instead it is stored in a Kubernetes Secret so that the agent does not require PV
# Assigning a persistent volume to Teleport agent allows the agent to keep session recordings when the pod is restarted if `session_recording` is set to `node` or `proxy`.
# The security association between the agent and the Teleport is no longer stored in PV, instead it is stored in a Kubernetes Secret so that the agent does not require PV
# to survive restarts and rotations while using short-lived joining tokens.
#
# Fields:
Expand Down Expand Up @@ -201,12 +201,18 @@ serviceAccountName: ""
# (optional) Kubernetes service account to create/use.
serviceAccount:
# Specifies whether a ServiceAccount should be created
create: true
create: true
# The name of the ServiceAccount to use.
# If not set and serviceAccount.create is true, the name is generated using the release name.
# If create is false, the name will be used to reference an existing service account.
name: ""

# Set to true (default) to create Kubernetes ClusterRole and ClusterRoleBinding.
rbac:
# Specifies whether a ClusterRole and ClusterRoleBinding should be created.
# Set to false if your cluster level resources are managed separately.
create: true

# Name of the Secret to store the teleport join token.
secretName: teleport-kube-agent-join-token

Expand Down