Skip to content

Commit

Permalink
Merge pull request #15609 from johngmyers/automated-cherry-pick-of-#1…
Browse files Browse the repository at this point in the history
…5605-upstream-release-1.27

Automated cherry pick of #15605: Fix Karpenter failure to start on IPv6 clusters
  • Loading branch information
k8s-ci-robot authored Jul 13, 2023
2 parents ab83f8a + 22ac54c commit d9cfdf7
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 5 deletions.
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 @@ -1242,7 +1242,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 @@ -395,6 +395,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

0 comments on commit d9cfdf7

Please sign in to comment.