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

Fix Karpenter failure to start on IPv6 clusters #15605

Merged
merged 1 commit into from
Jul 9, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
version: 9.99.0
- id: k8s-1.12
manifest: coredns.addons.k8s.io/k8s-1.12.yaml
manifestHash: d2bbb7cbee5835c3891fe80fbacf8963508359ef9159f8480325ce9a7174f14a
manifestHash: 8834e41010ae2fb8a533107c4a32cf068ac161359956e7a52921b2a07ad8ebf5
name: coredns.addons.k8s.io
selector:
k8s-addon: coredns.addons.k8s.io
Expand Down Expand Up @@ -69,7 +69,7 @@ spec:
version: 9.99.0
- id: k8s-1.19
manifest: karpenter.sh/k8s-1.19.yaml
manifestHash: f59d4c21751b3fc33c84e664fb41199b8efb58cc5976ade6e937abc109cb612b
manifestHash: aab89cad4f4a52b8620f581548694a6fc096bdbd1a297310beda01b57d3550ae
name: karpenter.sh
prune:
kinds:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ spec:
tolerations:
- key: CriticalAddonsOnly
operator: Exists
- key: node-role.kubernetes.io/master
operator: Exists
- key: node-role.kubernetes.io/control-plane
operator: Exists
topologySpreadConstraints:
- labelSelector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ spec:
- mountPath: /var/run/secrets/amazonaws.com/
name: token-amazonaws-com
readOnly: true
dnsPolicy: Default
dnsPolicy: ClusterFirst
priorityClassName: system-cluster-critical
securityContext:
fsGroup: 1000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ spec:
- key: "CriticalAddonsOnly"
operator: "Exists"
{{- end }}
{{- if KarpenterEnabled }}
- key: node-role.kubernetes.io/master
operator: Exists
- key: node-role.kubernetes.io/control-plane
operator: Exists
{{- end }}
nodeSelector:
kubernetes.io/os: linux
{{- if .KubeDNS.Affinity }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,8 @@ spec:
securityContext:
fsGroup: 1000
priorityClassName: "system-cluster-critical"
dnsPolicy: Default
# Must use ClusterFirst on IPv6 clusters in order to get DNS64
dnsPolicy: ClusterFirst
containers:
- name: controller
image: public.ecr.aws/karpenter/controller:v0.28.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ func (b *BootstrapChannelBuilder) buildAddons(c *fi.CloudupModelBuilderContext)
})
}
}
if b.Cluster.Spec.Karpenter != nil && fi.ValueOf(&b.Cluster.Spec.Karpenter.Enabled) {
if b.Cluster.Spec.Karpenter != nil && b.Cluster.Spec.Karpenter.Enabled {
key := "karpenter.sh"

{
Expand Down
3 changes: 3 additions & 0 deletions upup/pkg/fi/cloudup/template_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS
return nodeup.UsesInstanceIDForNodeName(tf.Cluster)
}

dest["KarpenterEnabled"] = func() bool {
return cluster.Spec.Karpenter != nil && cluster.Spec.Karpenter.Enabled
}
dest["KarpenterInstanceTypes"] = func(ig kops.InstanceGroupSpec) ([]string, error) {
return karpenterInstanceTypes(tf.cloud.(awsup.AWSCloud), ig)
}
Expand Down