Skip to content
This repository was archived by the owner on Jul 13, 2026. It is now read-only.
Open
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
4 changes: 4 additions & 0 deletions charts/bctlquickstart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ helm.sh/chart: {{ include "bctlquickstartchart.chart" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/part-of: {{ include "bctlquickstartchart.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.additionalLabels }}
{{ toYaml .Values.additionalLabels }}
{{- end }}
{{- end }}

{{/*
Expand Down
19 changes: 10 additions & 9 deletions charts/bctlquickstart/templates/agent/bctl-agent-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ metadata:
name: {{ include "bctlquickstartchart.agentClusterRoleName" . }}
labels:
{{- include "bctlquickstartchart.labels" . | nindent 4 }}
app.kubernetes.io/component: agent
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
namespace: {{ .Release.Namespace }}
rules:
- apiGroups: [""]
resources: ["users", "groups", "serviceaccounts"]
verbs: ["impersonate"]
- apiGroups: [""]
resources: ["serviceaccounts"]
verbs: ["create", "delete", "list", "get"]
- apiGroups: ["rbac.authorization.k8s.io"]
resources: ["clusterrolebindings", "rolebindings"]
verbs: ["list"]
- apiGroups: [""]
resources: ["users", "groups", "serviceaccounts"]
verbs: ["impersonate"]
- apiGroups: [""]
resources: ["serviceaccounts"]
verbs: ["create", "delete", "list", "get"]
- apiGroups: ["rbac.authorization.k8s.io"]
resources: ["clusterrolebindings", "rolebindings"]
verbs: ["list"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ metadata:
name: {{ include "bctlquickstartchart.agentClusterRoleBindingName" . }}
labels:
{{- include "bctlquickstartchart.labels" . | nindent 4 }}
app.kubernetes.io/component: agent
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
namespace: {{ .Release.Namespace }}
subjects:
- kind: ServiceAccount
namespace: {{ .Release.Namespace }}
name: {{ include "bctlquickstartchart.agentServiceAccountName" . }}
- kind: ServiceAccount
namespace: {{ .Release.Namespace }}
name: {{ include "bctlquickstartchart.agentServiceAccountName" . }}
roleRef:
kind: ClusterRole
name: {{ include "bctlquickstartchart.agentClusterRoleName" . }}
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "bctlquickstartchart.agentClusterRoleName" . }}
apiGroup: rbac.authorization.k8s.io
168 changes: 88 additions & 80 deletions charts/bctlquickstart/templates/agent/bctl-agent-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,89 +4,97 @@ metadata:
name: {{ include "bctlquickstartchart.agentDeploymentName" . }}
labels:
{{- include "bctlquickstartchart.labels" . | nindent 4 }}
app.kubernetes.io/component: agent
app: {{ include "bctlquickstartchart.agentDeploymentName" . }}
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ include "bctlquickstartchart.agentDeploymentName" . }}
template:
metadata:
labels:
app: {{ include "bctlquickstartchart.agentDeploymentName" . }}
spec:
serviceAccountName: {{ include "bctlquickstartchart.agentServiceAccountName" . }}
{{- if .Values.image.agentImagePullSecrets }}
imagePullSecrets:
{{- range .Values.image.agentImagePullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
{{- if .Values.priorityClass }}
priorityClassName: {{ .Values.priorityClass }}
{{- end }}
containers:
- name: bctl-agent
image: "{{ required "A valid .Values.image.agentImageName entry required!" .Values.image.agentImageName}}:{{ required "A valid .Values.image.agentImageTag entry required!" .Values.image.agentImageTag }}"
resources:
{{- toYaml .Values.agentResources | nindent 16 }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 6001
name: bctl-port
env:
- name: SERVICE_URL
value: "{{ required "A valid .Values.serviceUrl entry required!" .Values.serviceUrl }}"
- name: TARGET_NAME
value: "{{ required "A valid .Values.clusterName entry required!" .Values.clusterName }}"
- name: API_KEY
{{ if .Values.apiKey }}
value: "{{- include "bctlquickstartchart.apiKeyOrRef" . -}}"
{{ else if .Values.apiKeyExistingSecret }}
valueFrom:
secretKeyRef:
name: "{{- include "bctlquickstartchart.apiKeyOrRef" . -}}"
key: "api-key"
{{ end }}
- name: NAMESPACE
value: {{ .Release.Namespace }}
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: DEV
value: {{ printf "'%t'" .Values.isDev }}
- name: LOG_LEVEL
value: {{ .Values.logLevel }}
{{ if .Values.environmentId }}
- name: ENVIRONMENT
value: {{ .Values.environmentId }}
{{ end }}
{{ if .Values.idp.expectedProvider }}
- name: IDP_PROVIDER
value: {{ .Values.idp.expectedProvider }}
{{ end }}
{{ if .Values.idp.expectedOrgId }}
- name: IDP_ORG_ID
value: {{ .Values.idp.expectedOrgId }}
{{ end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 16 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 16 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 16 }}
{{- end }}
{{- with .Values.agent.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 16 }}
{{- end }}
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "bctlquickstartchart.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: agent
app: {{ include "bctlquickstartchart.agentDeploymentName" . }}
template:
metadata:
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "bctlquickstartchart.labels" . | nindent 8 }}
app.kubernetes.io/component: agent
app: {{ include "bctlquickstartchart.agentDeploymentName" . }}
spec:
serviceAccountName: {{ include "bctlquickstartchart.agentServiceAccountName" . }}
{{- if .Values.image.agentImagePullSecrets }}
imagePullSecrets:
{{- range .Values.image.agentImagePullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
{{- if .Values.priorityClass }}
priorityClassName: {{ .Values.priorityClass }}
{{- end }}
containers:
- name: bctl-agent
image: "{{ required "A valid .Values.image.agentImageName entry required!" .Values.image.agentImageName}}:{{ required "A valid .Values.image.agentImageTag entry required!" .Values.image.agentImageTag }}"
{{- with .Values.agentResources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 6001
name: bctl-port
env:
- name: SERVICE_URL
value: "{{ required "A valid .Values.serviceUrl entry required!" .Values.serviceUrl }}"
- name: TARGET_NAME
value: "{{ required "A valid .Values.clusterName entry required!" .Values.clusterName }}"
- name: API_KEY
{{ if .Values.apiKey }}
value: "{{- include "bctlquickstartchart.apiKeyOrRef" . -}}"
{{ else if .Values.apiKeyExistingSecret }}
valueFrom:
secretKeyRef:
name: "{{- include "bctlquickstartchart.apiKeyOrRef" . -}}"
key: "api-key"
{{ end }}
- name: NAMESPACE
value: {{ .Release.Namespace }}
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: DEV
value: {{ printf "'%t'" .Values.isDev }}
- name: LOG_LEVEL
value: {{ .Values.logLevel }}
{{ if .Values.environmentId }}
- name: ENVIRONMENT
value: {{ .Values.environmentId }}
{{ end }}
{{ if .Values.idp.expectedProvider }}
- name: IDP_PROVIDER
value: {{ .Values.idp.expectedProvider }}
{{ end }}
{{ if .Values.idp.expectedOrgId }}
- name: IDP_ORG_ID
value: {{ .Values.idp.expectedOrgId }}
{{ end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
13 changes: 7 additions & 6 deletions charts/bctlquickstart/templates/agent/bctl-agent-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ metadata:
name: {{ include "bctlquickstartchart.agentRoleName" . }}
labels:
{{- include "bctlquickstartchart.labels" . | nindent 4 }}
app.kubernetes.io/component: agent
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
namespace: {{ .Release.Namespace }}
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "update", "create"]
- apiGroups: [""]
resources: ["pods/log", "events"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "update", "create"]
- apiGroups: [""]
resources: ["pods/log", "events"]
verbs: ["get", "list"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ metadata:
name: {{ include "bctlquickstartchart.agentRoleBindingName" . }}
labels:
{{- include "bctlquickstartchart.labels" . | nindent 4 }}
app.kubernetes.io/component: agent
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
namespace: {{ .Release.Namespace }}
subjects:
- kind: ServiceAccount
namespace: {{ .Release.Namespace }}
name: {{ include "bctlquickstartchart.agentServiceAccountName" . }}
- kind: ServiceAccount
namespace: {{ .Release.Namespace }}
name: {{ include "bctlquickstartchart.agentServiceAccountName" . }}
roleRef:
kind: Role
name: {{ include "bctlquickstartchart.agentRoleName" . }}
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "bctlquickstartchart.agentRoleName" . }}
apiGroup: rbac.authorization.k8s.io
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: {{ include "bctlquickstartchart.agentServiceAccountName" . }}
labels:
{{- include "bctlquickstartchart.labels" . | nindent 4 }}
app.kubernetes.io/component: agent
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
{{- include "bctlquickstartchart.labels" . | nindent 4 }}
app.kubernetes.io/component: cleanup
spec:
ttlSecondsAfterFinished: 300 # Leave job for 5 minutes if failed/success
template:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ metadata:
name: {{ include "bctlquickstartchart.cleanupRoleName" . }}
labels:
{{- include "bctlquickstartchart.labels" . | nindent 4 }}
app.kubernetes.io/component: cleanup
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
namespace: {{ .Release.Namespace }}
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["delete"]
resourceNames: [{{ include "bctlquickstartchart.agentSecretName" . }}]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["delete"]
resourceNames: [{{ include "bctlquickstartchart.agentSecretName" . }}]
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ metadata:
name: {{ include "bctlquickstartchart.cleanupRoleBindingName" . }}
labels:
{{- include "bctlquickstartchart.labels" . | nindent 4 }}
app.kubernetes.io/component: cleanup
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
namespace: {{ .Release.Namespace }}
subjects:
- kind: ServiceAccount
namespace: {{ .Release.Namespace }}
name: {{ include "bctlquickstartchart.cleanupServiceAccountName" . }}
- kind: ServiceAccount
namespace: {{ .Release.Namespace }}
name: {{ include "bctlquickstartchart.cleanupServiceAccountName" . }}
roleRef:
kind: Role
name: {{ include "bctlquickstartchart.cleanupRoleName" . }}
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "bctlquickstartchart.cleanupRoleName" . }}
apiGroup: rbac.authorization.k8s.io
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: {{ include "bctlquickstartchart.cleanupServiceAccountName" . }}
labels:
{{- include "bctlquickstartchart.labels" . | nindent 4 }}
app.kubernetes.io/component: cleanup
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
Loading