mirror of https://github.com/k3s-io/k3s
Merge pull request #56015 from luxas/kubeadm_fix_selfhosting_bug
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. kubeadm: Fix a small bug in the self-hosting code **What this PR does / why we need it**: `apps/v1beta2` requires that `DaemonSet.spec.selector.matchLabels` equals `DaemonSet.spec.template.metadata.labels`. Without this change, the API server rejects the DaemonSet in the validation stage. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ``` @kubernetes/sig-cluster-lifecycle-pr-reviews @xiangpengzhaopull/6/head
commit
0291bd35fb
|
@ -141,6 +141,9 @@ func BuildDaemonSet(name string, podSpec *v1.PodSpec, mutators map[string][]PodS
|
|||
Labels: BuildSelfhostedComponentLabels(name),
|
||||
},
|
||||
Spec: apps.DaemonSetSpec{
|
||||
Selector: &metav1.LabelSelector{
|
||||
MatchLabels: BuildSelfhostedComponentLabels(name),
|
||||
},
|
||||
Template: v1.PodTemplateSpec{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Labels: BuildSelfhostedComponentLabels(name),
|
||||
|
|
|
@ -113,6 +113,9 @@ metadata:
|
|||
name: self-hosted-kube-apiserver
|
||||
namespace: kube-system
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: self-hosted-kube-apiserver
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
|
@ -271,6 +274,9 @@ metadata:
|
|||
name: self-hosted-kube-controller-manager
|
||||
namespace: kube-system
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: self-hosted-kube-controller-manager
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
|
@ -398,6 +404,9 @@ metadata:
|
|||
name: self-hosted-kube-scheduler
|
||||
namespace: kube-system
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: self-hosted-kube-scheduler
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
|
|
Loading…
Reference in New Issue