Skip to content

Commit 80757b2

Browse files
feat(octopus-deploy): add nodeSelector/affinity/tolerations for mssql (#512)
1 parent bf5b93b commit 80757b2

File tree

4 files changed

+60
-39
lines changed

4 files changed

+60
-39
lines changed

.changeset/shy-seas-wonder.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"octopus-deploy": patch
3+
---
4+
5+
Add mssql pod constraints (nodeSelector/tolerations/affinity)

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.idea
22
myvalues.yaml
3+
dry-run.yaml
34
license.xml
45
octopus*.tgz
56
index.yaml
@@ -9,4 +10,4 @@ node_modules
910

1011
*.orig
1112

12-
.debug/
13+
.debug/

charts/octopus-deploy/charts/mssql/templates/statefulset.yaml

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ spec:
2121
spec:
2222
securityContext:
2323
{{- toYaml .Values.podSecurityContext | nindent 8 }}
24+
{{- with .Values.nodeSelector }}
25+
nodeSelector:
26+
{{- toYaml . | nindent 8 }}
27+
{{- end }}
28+
{{- with .Values.affinity }}
29+
affinity:
30+
{{- toYaml . | nindent 8 }}
31+
{{- end }}
32+
{{- with .Values.tolerations }}
33+
tolerations:
34+
{{- toYaml . | nindent 8 }}
35+
{{- end }}
2436
containers:
2537
- name: {{ .Chart.Name }}
2638
command:
@@ -30,28 +42,28 @@ spec:
3042
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
3143
imagePullPolicy: {{ .Values.image.pullPolicy }}
3244
ports:
33-
- containerPort: {{ .Values.containers.ports.containerPort}}
45+
- containerPort: {{ .Values.containers.ports.containerPort}}
3446
env:
35-
- name: MSSQL_PID
36-
value: "{{ .Values.MSSQL_PID}}"
37-
- name: ACCEPT_EULA
38-
value: "{{ .Values.ACCEPT_EULA | upper}}"
39-
- name: MSSQL_AGENT_ENABLED
40-
value: "{{ .Values.MSSQL_AGENT_ENABLED}}"
41-
- name: SA_PASSWORD
42-
valueFrom:
43-
secretKeyRef:
44-
name: {{ include "mssql.name" . }}
45-
key: sa_password
47+
- name: MSSQL_PID
48+
value: "{{ .Values.MSSQL_PID}}"
49+
- name: ACCEPT_EULA
50+
value: "{{ .Values.ACCEPT_EULA | upper}}"
51+
- name: MSSQL_AGENT_ENABLED
52+
value: "{{ .Values.MSSQL_AGENT_ENABLED}}"
53+
- name: SA_PASSWORD
54+
valueFrom:
55+
secretKeyRef:
56+
name: {{ include "mssql.name" . }}
57+
key: sa_password
4658
volumeMounts:
47-
- name: mssql
48-
mountPath: "/var/opt/mssql"
49-
- name: mssql-config-volume
50-
mountPath: /var/opt/config
51-
volumes:
59+
- name: mssql
60+
mountPath: "/var/opt/mssql"
61+
- name: mssql-config-volume
62+
mountPath: /var/opt/config
63+
volumes:
5264
- name: mssql-config-volume
5365
configMap:
54-
name: {{ include "mssql.name" . }}
66+
name: {{ include "mssql.name" . }}
5567
volumeClaimTemplates:
5668
- metadata:
5769
name: mssql
@@ -63,4 +75,4 @@ spec:
6375
{{- end }}
6476
resources:
6577
requests:
66-
storage: 8Gi
78+
storage: 8Gi

charts/octopus-deploy/values.yaml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ octopus:
2222
# The task cap to set for the new node. If blank the default of 5 is used.
2323
taskCap:
2424

25-
# The Octopus server image.
25+
# The Octopus server image.
2626
# Visit https://hub.docker.com/r/octopusdeploy/octopusdeploy for the available versions.
2727
image:
2828
# The repository defaults to DockerHub
2929
repository: octopusdeploy/octopusdeploy
3030
# The tag will default to using the chart appVersion
31-
tag:
31+
tag:
3232
# The port the website is exposed on
33-
webPort: 80
34-
# The port polling tentacles will connect via https://www.octopus.com/docs/infrastructure/deployment-targets/windows-targets/tentacle-communication#polling-tentacles
35-
tentaclePort: 10943
33+
webPort: 80
34+
# The port polling tentacles will connect via https://www.octopus.com/docs/infrastructure/deployment-targets/windows-targets/tentacle-communication#polling-tentacles
35+
tentaclePort: 10943
3636
# The port for gRPC communication
3737
grpcPort: 8443
38-
# The number of server nodes to maintain
38+
# The number of server nodes to maintain
3939
replicaCount: 1
4040

4141
# Resource requests and limits can be set
@@ -56,7 +56,7 @@ octopus:
5656
# Volume used for Octopus server logs: https://octopus.com/docs/support/log-files
5757
# Each Octopus node mounts its own server log volume (this volume is not shared across nodes)
5858
serverLogVolume:
59-
size: 200Mi
59+
size: 200Mi
6060
storageClassName: ""
6161

6262
# Extra volumes. Use this for arbitrary volume mounts when using readOnlyRootFilesystem. You will want mounts for:
@@ -82,17 +82,17 @@ octopus:
8282

8383
# The volume used for persisting packages pushed to the Octopus built-in package repository: https://octopus.com/docs/packaging-applications/package-repositories/built-in-repository
8484
packageRepositoryVolume:
85-
size: 1Gi
85+
size: 1Gi
8686
storageClassName: ""
8787
storageAccessMode: ReadWriteOnce
8888
# The volume used for persisting deployment artifacts: https://octopus.com/docs/projects/deployment-process/artifacts
8989
artifactVolume:
90-
size: 1Gi
90+
size: 1Gi
9191
storageClassName: ""
9292
storageAccessMode: ReadWriteOnce
9393
# Volume used for task logs: https://octopus.com/docs/support/get-the-raw-output-from-a-task
94-
taskLogVolume:
95-
size: 1Gi
94+
taskLogVolume:
95+
size: 1Gi
9696
storageClassName: ""
9797
storageAccessMode: ReadWriteOnce
9898
# Volume used for archived audit logs: https://octopus.com/docs/security/users-and-teams/auditing#archived-audit-events
@@ -102,8 +102,8 @@ octopus:
102102
storageAccessMode: ReadWriteOnce
103103

104104
service:
105-
type: NodePort
106-
105+
type: NodePort
106+
107107
ingress:
108108
enabled: false
109109
annotations: {}
@@ -141,17 +141,17 @@ octopus:
141141
all:
142142
# an array of hostnames that should be excluded from proxying
143143
excludedHostnames: []
144-
145-
# For minimum resource indications see https://octopus.com/docs/administration/managing-infrastructure/performance#minimum-requirements
146-
resources: {}
144+
145+
# For minimum resource indications see https://octopus.com/docs/administration/managing-infrastructure/performance#minimum-requirements
146+
resources: {}
147147
# requests:
148148
# memory: "400M"
149149
# cpu: "100m"
150150
# limits:
151151
# memory: "4G"
152152
# cpu: "1"
153153

154-
tolerations: []
154+
tolerations: []
155155
topologySpreadConstraints: []
156156

157157
serviceAccount:
@@ -211,15 +211,18 @@ octopus:
211211
dockerHub:
212212
# Set to true to create a secret containing the docker registry password
213213
login: false
214-
# The base 64 encoded Docker config JSON. This value can be created with the command:
214+
# The base 64 encoded Docker config JSON. This value can be created with the command:
215215
# kubectl create secret docker-registry regcred --docker-username=myusername --docker-password=mypassword --dry-run=client -o="jsonpath={.data.\.dockerconfigjson}"
216216
# See https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
217217
creds:
218218

219-
mssql:
219+
mssql:
220220
enabled: false
221221
ACCEPT_EULA: "Y"
222222
SA_PASSWORD: ""
223+
nodeSelector: {}
224+
tolerations: []
225+
affinity: {}
223226

224227
global:
225228
# Set the default storageClass to be used for all persistent volume claims

0 commit comments

Comments
 (0)