Skip to content

Commit

Permalink
chore(charts): ensure env and envFrom can be set, move env to deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
stevepentland committed Feb 29, 2024
1 parent db466db commit 1a9462d
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 19 deletions.
2 changes: 1 addition & 1 deletion charts/nx-agents/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: nx-agents
description: Nx Cloud Agents Helm Chart
type: application
version: 1.0.0-rc.3
version: 1.0.0-rc.4
maintainers:
- name: nx
url: "https://nx.app/"
Expand Down
71 changes: 71 additions & 0 deletions charts/nx-agents/ci/basic-moreenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
global:
imageRegistry: 'us-east1-docker.pkg.dev/nxcloudoperations'
imageTag: ''
imageRepository: 'nx-cloud-enterprise-public'
namespace: 'nx-cloud-workflows'

naming:
nameOverride: ''
fullNameOverride: ''

serviceAccounts:
controller:
annotations: {}
runner:
annotations: {}

controller:
deployment:
port: 9000
annotations: {}
env:
- name: value-one
value: nx-cloud-workflows
- name: value-two
value: nx-cloud-workflows2
envFrom:
- configMapRef:
name: configmap
- secretRef:
name: secret
service:
port: 9000
type: ClusterIP
loadBalancerIP: ''
loadBalancerSourceRanges: []
annotations: {}
image:
registry: ''
imageName: nx-cloud-workflow-controller
repository: ''
tag: test.0219162846
pullPolicy: Always
resources:
limits:
memory: '1Gi'
cpu: '1.0'
requests:
memory: '0.5Gi'
cpu: '0.5'

executor:
env: {}

daemonset:
enabled: true
script: |
#!/bin/bash
set -e
# change the file-watcher max-count on each node to 1048576
# insert the new value into the system config
sysctl -w fs.inotify.max_user_watches=1048576
# check that the new value was applied
cat /proc/sys/fs/inotify/max_user_watches
secret:
name: 'cloudsecret'
awsS3AccessKeyId: 'ABC123556'
awsS3SecretAccessKey: 'BBBAAA1234'
2 changes: 1 addition & 1 deletion charts/nx-agents/ci/basic-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ controller:
deployment:
port: 9000
annotations: {}
env: {}
service:
port: 9000
type: ClusterIP
loadBalancerIP: ''
loadBalancerSourceRanges: []
annotations: {}
env: {}
image:
registry: ''
imageName: nx-cloud-workflow-controller
Expand Down
38 changes: 22 additions & 16 deletions charts/nx-agents/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ spec:
matchLabels:
app: nx-cloud-workflow-controller
replicas: 1
{{- if .Values.controller.deployment.strategy }}
strategy:
{{- toYaml .Values.controller.deployment.strategy | nindent 4 }}
{{- end }}
template:
metadata:
labels:
Expand Down Expand Up @@ -69,6 +73,7 @@ spec:
periodSeconds: 20
successThreshold: 1
timeoutSeconds: 1
failureThreshold: 10
readinessProbe:
httpGet:
path: /readyz
Expand All @@ -78,26 +83,27 @@ spec:
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
{{- if gt (len .Values.controller.env) 0 }}
env:
{{- range $key, $value := .Values.controller.env }}
- name: {{ $key | quote }}
value: {{ $value | quote }}
{{- if gt (len .Values.controller.deployment.envFrom) 0 }}
envFrom:
{{- toYaml .Values.controller.deployment.envFrom | nindent 12}}
{{- end }}
env:
{{- if gt (len .Values.controller.deployment.env) 0 }}
{{- toYaml .Values.controller.deployment.env | nindent 12 }}
{{- end }}
{{- with .Values.secret }}
{{- if .awsS3AccessKeyId }}
{{- if .name }}
- name: AWS_S3_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ .name }}
key: {{ .awsS3AccessKeyId }}
- name: AWS_S3_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ .name }}
key: {{ .awsS3SecretAccessKey }}
{{- end }}
- name: AWS_S3_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ .name }}
key: {{ .awsS3AccessKeyId }}
- name: AWS_S3_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ .name }}
key: {{ .awsS3SecretAccessKey }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
8 changes: 7 additions & 1 deletion charts/nx-agents/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ controller:
tolerations: {}
nodeSelector: {}
args: {}
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
envFrom: []
env: {}
service:
port: 9000
type: ClusterIP
loadBalancerIP: ''
loadBalancerSourceRanges: []
annotations: {}
env: {}
image:
registry: ''
imageName: nx-cloud-workflow-controller
Expand Down

0 comments on commit 1a9462d

Please sign in to comment.