Skip to content

Commit

Permalink
feat(chart): allow built-in kubernetes cloud profile support
Browse files Browse the repository at this point in the history
  • Loading branch information
nefelim4ag committed Dec 18, 2023
1 parent b22545e commit 6841c23
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/teamcity-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: teamcity-server
description: A Helm chart for deploy HA teamcity server
type: application
version: 3.0.0
version: 3.1.0
appVersion: "2023.11"
30 changes: 30 additions & 0 deletions charts/teamcity-server/templates/teamcity/rbac.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{- if $.Values.serviceAccount.enabled }}
{{- if $.Values.serviceAccount.agentRBAC.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ $.Release.Name }}-agent-ctrl
rules:
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["list", "get"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "create", "list", "delete"]
- apiGroups: ["extensions", "apps"]
resources: ["deployments"]
verbs: ["list", "get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ $.Release.Name }}-agent-ctrl
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ $.Release.Name }}-agent-ctrl
subjects:
- kind: ServiceAccount
name: {{ $.Release.Name }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{- if $.Values.serviceAccount.enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ $.Release.Name }}
annotations: {{ $.Values.serviceAccount.annotations | toJson }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/teamcity-server/templates/teamcity/teamcity.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ spec:
app: {{ $.Release.Name }}
component: server
spec:
{{- if $.Values.serviceAccount.enabled }}
serviceAccountName: {{ $.Release.Name }}
{{- end }}
containers:
- name: {{ $.Release.Name }}
image: {{ $.Values.image.repository }}:{{ $.Values.image.tag }}
Expand Down
6 changes: 6 additions & 0 deletions charts/teamcity-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ teamcity:
- CAN_CHECK_FOR_CHANGES
- CAN_PROCESS_BUILD_MESSAGES

serviceAccount:
enabled: false
annotations: {}
agentRBAC:
enabled: false

pdb:
enabled: true
minAvailable: 1
Expand Down

0 comments on commit 6841c23

Please sign in to comment.