From 31575e407a7390e992642c2176978e16d22b9c88 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Tue, 3 Nov 2020 11:07:32 -0800 Subject: [PATCH] Add Cluster ID support to k3s stub cloud controller Resolves warning 2 from #2471. As per https://github.com/kubernetes/cloud-provider/issues/12 the ClusterID requirement was never really followed through on, so the flag is probably going to be removed in the future. One side-effect of this is that the core k8s cloud-controller-manager also wants to watch nodes, and needs RBAC to do so. Signed-off-by: Brad Davidson --- manifests/ccm.yaml | 3 +++ pkg/cloudprovider/cloudprovider.go | 2 +- pkg/daemons/control/server.go | 1 - pkg/deploy/zz_generated_bindata.go | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/manifests/ccm.yaml b/manifests/ccm.yaml index b0e9049c29..d39ff84dae 100644 --- a/manifests/ccm.yaml +++ b/manifests/ccm.yaml @@ -78,3 +78,6 @@ subjects: - kind: User name: cloud-controller-manager namespace: kube-system +- kind: ServiceAccount + name: cloud-controller-manager + namespace: kube-system diff --git a/pkg/cloudprovider/cloudprovider.go b/pkg/cloudprovider/cloudprovider.go index 83f255161f..fd2dd80db0 100644 --- a/pkg/cloudprovider/cloudprovider.go +++ b/pkg/cloudprovider/cloudprovider.go @@ -58,5 +58,5 @@ func (k *k3s) ProviderName() string { } func (k *k3s) HasClusterID() bool { - return false + return true } diff --git a/pkg/daemons/control/server.go b/pkg/daemons/control/server.go index 6f8f221d00..41907e245d 100644 --- a/pkg/daemons/control/server.go +++ b/pkg/daemons/control/server.go @@ -913,7 +913,6 @@ func cloudControllerManager(ctx context.Context, cfg *config.Control, runtime *c "bind-address": localhostIP.String(), "secure-port": "0", "cloud-provider": version.Program, - "allow-untagged-cloud": "true", "node-status-update-frequency": "1m", "profiling": "false", } diff --git a/pkg/deploy/zz_generated_bindata.go b/pkg/deploy/zz_generated_bindata.go index f84dd3a24c..b52ebba1ac 100644 --- a/pkg/deploy/zz_generated_bindata.go +++ b/pkg/deploy/zz_generated_bindata.go @@ -90,7 +90,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _ccmYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x93\x3f\x6f\xe3\x30\x0c\xc5\x77\x7d\x0a\x21\x4b\x80\x03\x9c\xe0\xb6\x83\xc7\xeb\xd0\x3d\x40\xbb\xd3\x12\x9b\xa8\x91\x45\x81\xa4\x1c\xb4\x9f\xbe\x70\x9c\x16\x81\xdd\xfc\x71\x36\xc2\x20\x7f\xef\xd1\xd4\x83\x1c\x5e\x91\x25\x50\xaa\x2d\x37\xe0\x56\x50\x74\x47\x1c\x3e\x41\x03\xa5\xd5\xfe\x9f\xac\x02\xad\xbb\xbf\x66\x1f\x92\xaf\xed\x53\x2c\xa2\xc8\x1b\x8a\x68\x5a\x54\xf0\xa0\x50\x1b\x6b\x13\xb4\x58\x5b\x17\xa9\xf8\xca\x51\x52\xa6\x18\x91\xab\x16\x12\x6c\x91\x0d\x97\x88\x52\x9b\xca\x42\x0e\xcf\x4c\x25\x4b\x3f\x54\x59\x47\xc4\x3e\xa4\x73\x2d\x63\x2d\xa3\x50\x61\x87\xa7\xa6\x88\x20\x28\xc6\xda\x0e\xb9\x39\x7d\xdb\xa2\x0e\x00\x46\x50\x3c\x96\x25\xfb\xbe\x9c\x68\x2c\x16\x53\x24\x76\x98\x74\x84\x3c\x43\x65\x50\xb7\x9b\x0d\x4d\xe4\xc7\x36\x97\x7f\x96\x33\x66\xd7\xa2\xa0\x65\x84\x18\xbc\xdc\x05\x11\xe4\x2e\xb8\xb1\x87\x18\x44\x7f\xdf\xaa\x2f\x0f\xb3\xf1\xe0\x1c\x95\x4b\x7f\xef\x2e\x50\xee\x1f\x9c\x28\x26\xed\x28\x96\xf6\xd2\x6d\x7f\x8c\x3f\x66\x17\x93\xcf\x14\xae\x9d\x79\x22\x74\x98\xdc\xbd\xaa\xcc\xe3\x09\xf9\x1f\x92\x0f\x69\x3b\x2b\x28\x14\x71\x83\x6f\x7d\xe7\xf7\x8a\x57\x54\x8d\xb5\xd3\x58\xde\xd4\x90\xd2\xbc\xa3\xd3\x63\x1e\x87\xf1\x17\x41\xbe\x3d\x37\x34\x48\x06\x87\xb5\xdd\x97\x06\x2b\xf9\x10\xc5\xd6\x7c\x05\x00\x00\xff\xff\xff\xea\xf1\x4c\x44\x04\x00\x00") +var _ccmYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x93\x3f\x8f\xdb\x30\x0c\xc5\x77\x7d\x0a\x21\x4b\x80\x02\x4e\xd0\xad\xf0\xd6\x76\xe8\x9e\xa2\xdd\x69\x89\x4d\xd4\xc8\xa2\x40\x52\x0e\xee\x3e\xfd\xc1\x71\x2e\x08\xec\xcb\x1f\xe7\x36\xc2\x20\x7f\xef\xc9\xe4\x83\x1c\xfe\x22\x4b\xa0\x54\x5b\x6e\xc0\xad\xa0\xe8\x8e\x38\xbc\x82\x06\x4a\xab\xfd\x37\x59\x05\x5a\x77\x5f\xcd\x3e\x24\x5f\xdb\x9f\xb1\x88\x22\x6f\x28\xa2\x69\x51\xc1\x83\x42\x6d\xac\x4d\xd0\x62\x6d\x5d\xa4\xe2\x2b\x47\x49\x99\x62\x44\xae\x5a\x48\xb0\x45\x36\x5c\x22\x4a\x6d\x2a\x0b\x39\xfc\x62\x2a\x59\xfa\xa1\xca\x3a\x22\xf6\x21\x5d\x6a\x19\x6b\x19\x85\x0a\x3b\x3c\x35\x45\x04\x41\x31\xd6\x76\xc8\xcd\xe9\xdb\x16\x75\x00\x30\x82\xe2\xb1\x2c\xd9\xf7\xe5\x44\x63\xb1\x98\x22\xb1\xc3\xa4\x23\xe4\x05\x2a\x83\xba\xdd\x6c\x68\x22\x3f\xb6\xb9\xfc\xb2\x9c\x31\xbb\x16\x05\x2d\x23\xc4\xe0\xe5\x21\x88\x20\x77\xc1\x8d\x3d\xc4\x20\xfa\xf1\xab\xfa\xf2\x30\x1b\x0f\xce\x51\xb9\xf6\xf7\x1e\x02\xe5\xfe\xe0\x44\x31\x69\x47\xb1\xb4\xd7\x76\x7b\x36\xfe\x9c\x5d\x4c\x3e\x53\xb8\xb5\xe6\x89\xd0\x61\xb2\xf7\xaa\x32\xcf\x27\xe4\x47\x48\x3e\xa4\xed\xac\xa0\x50\xc4\x0d\xfe\xeb\x3b\xdf\x9f\x78\x43\xd5\x58\x3b\x8d\xe5\x5d\x0d\x29\xcd\x7f\x74\x7a\xcc\xe3\x30\xfe\x47\x90\xef\xcf\x0d\x0d\x92\xc1\x61\x6d\xf7\xa5\xc1\x4a\x5e\x44\xb1\x3d\x63\x7e\x0f\x07\xf2\x7d\x38\x90\x4f\x00\xdf\x02\x00\x00\xff\xff\xa3\x37\x61\xe4\x95\x04\x00\x00") func ccmYamlBytes() ([]byte, error) { return bindataRead(