Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add nodeselector in stack deployment and make nodeselector global con… #140

Merged
merged 3 commits into from
Nov 5, 2024
Merged
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
10 changes: 6 additions & 4 deletions tinkerbell/hegel/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{{- if .Values.deploy }}
{{- $trustedProxies := .Values.trustedProxies }}
{{- $roleType := .Values.rbac.type }}
{{- $nodeSelector := .Values.nodeSelector }}
{{- if .Values.global }}
{{- $trustedProxies = coalesce .Values.trustedProxies .Values.global.trustedProxies }}
{{- $nodeSelector = coalesce .Values.nodeSelector .Values.global.nodeSelector }}
{{- $roleType = coalesce .Values.global.rbac.type .Values.rbac.type }}
{{- end }}
apiVersion: apps/v1
Expand Down Expand Up @@ -30,10 +32,6 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- args:
- --backend=kubernetes
Expand Down Expand Up @@ -65,6 +63,10 @@ spec:
cpu: {{ .Values.resources.requests.cpu }}
memory: {{ .Values.resources.requests.memory }}
serviceAccountName: {{ .Values.name }}
{{- with $nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.singleNodeClusterConfig.controlPlaneTolerationsEnabled }}
tolerations:
{{- include "singleNodeClusterConfig" . | indent 6 }}
Expand Down
10 changes: 6 additions & 4 deletions tinkerbell/rufio/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{- if .Values.deploy }}
{{- $roleType := .Values.rbac.type }}
{{- $nodeSelector := .Values.nodeSelector }}
{{- if .Values.global }}
{{- $roleType = coalesce .Values.global.rbac.type .Values.rbac.type }}
{{- $nodeSelector = coalesce .Values.nodeSelector .Values.global.nodeSelector }}
{{- end }}
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -31,10 +33,6 @@ spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
runAsNonRoot: true
containers:
Expand Down Expand Up @@ -74,6 +72,10 @@ spec:
memory: {{ .Values.resources.requests.memory }}
serviceAccountName: {{ .Values.serviceAccountName }}
terminationGracePeriodSeconds: 10
{{- with $nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.singleNodeClusterConfig.controlPlaneTolerationsEnabled }}
tolerations:
{{- include "singleNodeClusterConfig" . | indent 6 }}
Expand Down
10 changes: 6 additions & 4 deletions tinkerbell/smee/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
{{- $publicIP := .Values.publicIP }}
{{- $trustedProxies := .Values.trustedProxies }}
{{- $roleType := .Values.rbac.type }}
{{- $nodeSelector := .Values.nodeSelector }}
{{- if .Values.global }}
{{- $publicIP = coalesce .Values.publicIP .Values.global.publicIP }}
{{- $trustedProxies = coalesce .Values.trustedProxies .Values.global.trustedProxies }}
{{- $roleType = coalesce .Values.global.rbac.type .Values.rbac.type }}
{{- $nodeSelector = coalesce .Values.nodeSelector .Values.global.nodeSelector }}
{{- end }}
{{- $_ := set .Values.dhcp "syslogIp" (default $publicIP .Values.dhcp.syslogIp) }}
{{- $_ := set .Values.dhcp "ipForPacket" (default $publicIP .Values.dhcp.ipForPacket) }}
Expand Down Expand Up @@ -41,10 +43,6 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- image: {{ .Values.image }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
Expand Down Expand Up @@ -118,6 +116,10 @@ spec:
{{- if .Values.hostNetwork }}
hostNetwork: true
{{- end }}
{{- with $nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if or .Values.deployment.tolerations .Values.singleNodeClusterConfig.controlPlaneTolerationsEnabled }}
tolerations:
{{- .Values.deployment.tolerations | toYaml | nindent 8 }}
Expand Down
8 changes: 8 additions & 0 deletions tinkerbell/stack/templates/nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{{- $sourceInterface := .Values.stack.relay.sourceInterface -}}
{{- $ifaceModes := dict "ipvlan" "" "macvlan" "" -}}
{{- $dhcpInterfaceType := .Values.stack.relay.interfaceMode -}}
{{- $nodeSelector := .Values.stack.nodeSelector }}
{{- if not (hasKey $ifaceModes $dhcpInterfaceType) -}}
{{- fail "invalid value at .stack.relay.interfaceMode: valid modes include ipvlan and macvlan" -}}
{{- end -}}
Expand All @@ -13,6 +14,9 @@
{{- if not $listenBroadcast -}}
{{- $dhcpInterfaceName = "eth0" -}}
{{- end -}}
{{- if .Values.global }}
{{- $nodeSelector = coalesce .Values.stack.nodeSelector .Values.global.nodeSelector }}
{{- end -}}
{{- $claimName := coalesce .Values.stack.hook.persistence.existingClaim .Values.stack.hook.persistence.localPersistentVolume.name }}
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -153,6 +157,10 @@ spec:
securityContext:
privileged: true
{{- end }}
{{- with $nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.stack.singleNodeClusterConfig.controlPlaneTolerationsEnabled }}
tolerations:
{{- include "singleNodeClusterConfig" . | indent 6 }}
Expand Down
1 change: 1 addition & 0 deletions tinkerbell/stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,4 @@ global:
trustedProxies: []
rbac:
type: Role
nodeSelector: {}
10 changes: 6 additions & 4 deletions tinkerbell/tink/templates/tink-controller/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{- if .Values.controller.deploy }}
{{- $roleType := .Values.controller.rbac.type }}
{{- $nodeSelector := .Values.controller.nodeSelector }}
{{- if .Values.global }}
{{- $roleType = coalesce .Values.global.rbac.type .Values.controller.rbac.type }}
{{- $nodeSelector = coalesce .Values.controller.nodeSelector .Values.global.nodeSelector }}
{{- end }}
apiVersion: apps/v1
kind: Deployment
Expand All @@ -20,10 +22,6 @@ spec:
labels:
app: {{ .Values.controller.name }}
spec:
{{- with .Values.controller.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- image: {{ .Values.controller.image }}
imagePullPolicy: {{ .Values.controller.imagePullPolicy }}
Expand All @@ -43,6 +41,10 @@ spec:
cpu: {{ .Values.controller.resources.requests.cpu }}
memory: {{ .Values.controller.resources.requests.memory }}
serviceAccountName: {{ .Values.controller.name }}
{{- with $nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.controller.singleNodeClusterConfig.controlPlaneTolerationsEnabled }}
tolerations:
{{- include "singleNodeClusterConfig" . | indent 6 }}
Expand Down
10 changes: 6 additions & 4 deletions tinkerbell/tink/templates/tink-server/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{- if .Values.server.deploy }}
{{- $roleType := .Values.server.rbac.type }}
{{- $nodeSelector := .Values.server.nodeSelector }}
{{- if .Values.global }}
{{- $roleType = coalesce .Values.global.rbac.type .Values.server.rbac.type }}
{{- $nodeSelector = coalesce .Values.server.nodeSelector .Values.global.nodeSelector }}
{{- end }}
apiVersion: apps/v1
kind: Deployment
Expand All @@ -28,10 +30,6 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.server.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- args:
- --backend=kubernetes
Expand All @@ -55,6 +53,10 @@ spec:
cpu: {{ .Values.server.resources.requests.cpu }}
memory: {{ .Values.server.resources.requests.memory }}
serviceAccountName: {{ .Values.server.name }}
{{- with $nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.server.singleNodeClusterConfig.controlPlaneTolerationsEnabled }}
tolerations:
{{- include "singleNodeClusterConfig" . | indent 6 }}
Expand Down
Loading