Skip to content

Commit

Permalink
chore(nx-cloud): Allow serviceAccountName to be defined for all nx-cl…
Browse files Browse the repository at this point in the history
…oud deployments
  • Loading branch information
pmariglia committed Oct 3, 2024
1 parent 699b2ca commit ce73e8b
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/nx-cloud/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: nx-cloud
description: Nx Cloud Helm Chart
type: application
version: 0.15.11
version: 0.15.12
maintainers:
- name: nx
url: "https://nx.app/"
Expand Down
11 changes: 11 additions & 0 deletions charts/nx-cloud/ci/basic-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ secret:
# When creating new values files for testing, bring over the lines below. The generated environment is quite resource
# constrained and with the default settings from values.yaml some of the pods will fail to schedule.
frontend:
serviceAccountName: 'nx-cloud-sa'
deployment:
env:
- name: TEST_VARIABLE
Expand All @@ -24,6 +25,7 @@ frontend:
cpu: '0.1'

nxApi:
serviceAccountName: 'nx-cloud-sa'
deployment:
env:
- name: TEST_VARIABLE
Expand All @@ -37,6 +39,7 @@ nxApi:
cpu: '0.1'

fileServer:
serviceAccountName: 'nx-cloud-sa'
deployment:
env:
- name: TEST_VARIABLE
Expand All @@ -52,6 +55,7 @@ fileServer:
cpu: '0.1'

aggregator:
serviceAccountName: 'nx-cloud-sa'
schedule: "*/10 * * * *"
env:
- name: TEST_VARIABLE
Expand All @@ -62,12 +66,19 @@ aggregator:
cpu: '0.1'

messagequeue:
serviceAccountName: 'nx-cloud-sa'
deployment:
port: 61616
service:
port: 61616

extraManifests:
serviceAccount:
apiVersion: v1
kind: ServiceAccount
metadata:
name: nx-cloud-sa
namespace: default
secret:
apiVersion: v1
kind: Secret
Expand Down
3 changes: 3 additions & 0 deletions charts/nx-cloud/templates/nx-cloud-aggregator-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
spec:
template:
spec:
{{- if .Values.aggregator.serviceAccountName }}
serviceAccountName: {{ .Values.aggregator.serviceAccountName }}
{{- end }}
{{- if .Values.selfSignedCertConfigMap }}
initContainers:
- command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ spec:
labels:
app: nx-cloud-file-server
spec:
{{- if .Values.fileServer.serviceAccountName }}
serviceAccountName: {{ .Values.fileServer.serviceAccountName }}
{{- end }}
volumes:
- name: data
persistentVolumeClaim:
Expand Down
3 changes: 3 additions & 0 deletions charts/nx-cloud/templates/nx-cloud-frontend-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ spec:
labels:
app: nx-cloud-frontend
spec:
{{- if .Values.frontend.serviceAccountName }}
serviceAccountName: {{ .Values.frontend.serviceAccountName }}
{{- end }}
containers:
- name: nx-cloud-frontend
image: {{ include "nxCloud.images.frontend.image" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ spec:
labels:
app: nx-cloud-messagequeue
spec:
{{- if .Values.messagequeue.serviceAccountName }}
serviceAccountName: {{ .Values.messagequeue.serviceAccountName }}
{{- end }}
containers:
- name: nx-cloud-messagequeue
image: {{ include "nxCloud.images.messagequeue.image" . }}
Expand Down
6 changes: 5 additions & 1 deletion charts/nx-cloud/templates/nx-cloud-nx-api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ spec:
app: nx-cloud-nx-api
spec:
terminationGracePeriodSeconds: 60
{{- if .Values.awsS3.serviceAccountName }}
{{- if and .Values.nxApi.serviceAccountName .Values.awsS3.serviceAccountName }}
serviceAccountName: {{ .Values.nxApi.serviceAccountName }}
{{- else if .Values.nxApi.serviceAccountName }}
serviceAccountName: {{ .Values.nxApi.serviceAccountName }}
{{- else if .Values.awsS3.serviceAccountName }}
serviceAccountName: {{ .Values.awsS3.serviceAccountName }}
{{- end }}
{{- if .Values.selfSignedCertConfigMap }}
Expand Down
5 changes: 5 additions & 0 deletions charts/nx-cloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ verboseMongoLogging: false
enableMessageQueue: true

frontend:
serviceAccountName: ''
image:
registry: ''
imageName: nx-cloud-frontend
Expand All @@ -42,6 +43,7 @@ frontend:
cpu: '0.5'

nxApi:
serviceAccountName: ''
image:
registry: ''
imageName: nx-cloud-nx-api
Expand All @@ -66,6 +68,7 @@ nxApi:
cpu: '1.0'

fileServer:
serviceAccountName: ''
image:
registry: ''
imageName: nx-cloud-file-server
Expand Down Expand Up @@ -94,6 +97,7 @@ fileServer:
fsGroupChangePolicy: "OnRootMismatch"

aggregator:
serviceAccountName: ''
schedule: '*/10 * * * *'
image:
registry: ''
Expand All @@ -110,6 +114,7 @@ aggregator:
cpu: '0.5'

messagequeue:
serviceAccountName: ''
image:
registry: ''
imageName: nx-cloud-messagequeue
Expand Down

0 comments on commit ce73e8b

Please sign in to comment.