mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 13:07:07 +00:00
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 @xiangpengzhao
This commit is contained in:
commit
0291bd35fb
@ -141,6 +141,9 @@ func BuildDaemonSet(name string, podSpec *v1.PodSpec, mutators map[string][]PodS
|
|||||||
Labels: BuildSelfhostedComponentLabels(name),
|
Labels: BuildSelfhostedComponentLabels(name),
|
||||||
},
|
},
|
||||||
Spec: apps.DaemonSetSpec{
|
Spec: apps.DaemonSetSpec{
|
||||||
|
Selector: &metav1.LabelSelector{
|
||||||
|
MatchLabels: BuildSelfhostedComponentLabels(name),
|
||||||
|
},
|
||||||
Template: v1.PodTemplateSpec{
|
Template: v1.PodTemplateSpec{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Labels: BuildSelfhostedComponentLabels(name),
|
Labels: BuildSelfhostedComponentLabels(name),
|
||||||
|
@ -113,6 +113,9 @@ metadata:
|
|||||||
name: self-hosted-kube-apiserver
|
name: self-hosted-kube-apiserver
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
spec:
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
k8s-app: self-hosted-kube-apiserver
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
@ -271,6 +274,9 @@ metadata:
|
|||||||
name: self-hosted-kube-controller-manager
|
name: self-hosted-kube-controller-manager
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
spec:
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
k8s-app: self-hosted-kube-controller-manager
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
@ -398,6 +404,9 @@ metadata:
|
|||||||
name: self-hosted-kube-scheduler
|
name: self-hosted-kube-scheduler
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
spec:
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
k8s-app: self-hosted-kube-scheduler
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
|
Loading…
Reference in New Issue
Block a user