Skip to content

Commit

Permalink
NodeSelector should specify string explicitly
Browse files Browse the repository at this point in the history
Kubernetes doesn't accept any other value but string in nodeSelector,
but if we specified ambiguous value like true, it's treated as a
non-string like bool and then failed to create resource because of type
mis-match, that's why we should make value of nodeSelector enclosed by
double quotations to ensure value is always string
  • Loading branch information
ukinau authored and Alena Prokharchyk committed Jul 2, 2019
1 parent 5ff184b commit d41abc7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion templates/coredns.go
Expand Up @@ -122,7 +122,7 @@ spec:
nodeSelector:
beta.kubernetes.io/os: linux
{{ range $k, $v := .NodeSelector }}
{{ $k }}: {{ $v }}
{{ $k }}: "{{ $v }}"
{{ end }}
containers:
- name: coredns
Expand Down
2 changes: 1 addition & 1 deletion templates/kubedns.go
Expand Up @@ -124,7 +124,7 @@ spec:
spec:
nodeSelector:
{{ range $k, $v := .NodeSelector }}
{{ $k }}: {{ $v }}
{{ $k }}: "{{ $v }}"
{{ end }}
affinity:
podAntiAffinity:
Expand Down
2 changes: 1 addition & 1 deletion templates/nginx-ingress.go
Expand Up @@ -188,7 +188,7 @@ spec:
hostNetwork: true
nodeSelector:
{{ range $k, $v := .NodeSelector }}
{{ $k }}: {{ $v }}
{{ $k }}: "{{ $v }}"
{{ end }}
{{if eq .RBACConfig "rbac"}}
serviceAccountName: nginx-ingress-serviceaccount
Expand Down

0 comments on commit d41abc7

Please sign in to comment.