Skip to content

Commit 4a936a9

Browse files
authored
Expose flag to explicitly disable cloud-provider=external kubelet argument (#60)
* Expose flag to explicitly set cloud-provider=external kubelet argument
1 parent ab40c40 commit 4a936a9

12 files changed

+77
-11
lines changed

bootstrap/api/v1beta1/kthreesconfig_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ type KThreesServerConfig struct {
103103
// DisableComponents specifies extra commands to run before k3s setup runs
104104
// +optional
105105
DisableComponents []string `json:"disableComponents,omitempty"`
106+
107+
// DisableExternalCloudProvider suppresses the 'cloud-provider=external' kubelet argument. (default: false)
108+
// +optional
109+
DisableExternalCloudProvider bool `json:"disableExternalCloudProvider,omitempty"`
106110
}
107111

108112
type KThreesAgentConfig struct {

bootstrap/api/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ spec:
166166
items:
167167
type: string
168168
type: array
169+
disableExternalCloudProvider:
170+
description: 'DisableExternalCloudProvider suppresses the ''cloud-provider=external''
171+
kubelet argument. (default: false)'
172+
type: boolean
169173
httpsListenPort:
170174
description: 'HTTPSListenPort HTTPS listen port (default: 6443)'
171175
type: string

bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigtemplates.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ spec:
180180
items:
181181
type: string
182182
type: array
183+
disableExternalCloudProvider:
184+
description: 'DisableExternalCloudProvider suppresses
185+
the ''cloud-provider=external'' kubelet argument. (default:
186+
false)'
187+
type: boolean
183188
httpsListenPort:
184189
description: 'HTTPSListenPort HTTPS listen port (default:
185190
6443)'

bootstrap/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanes.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ spec:
246246
items:
247247
type: string
248248
type: array
249+
disableExternalCloudProvider:
250+
description: 'DisableExternalCloudProvider suppresses the
251+
''cloud-provider=external'' kubelet argument. (default:
252+
false)'
253+
type: boolean
249254
httpsListenPort:
250255
description: 'HTTPSListenPort HTTPS listen port (default:
251256
6443)'

bootstrap/config/manager/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ kind: Kustomization
55
images:
66
- name: controller
77
newName: ghcr.io/cluster-api-provider-k3s/cluster-api-k3s/bootstrap-controller
8-
newTag: v0.2.0
8+
newTag: v0.1.7

bootstrap/controllers/kthreesconfig_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func (r *KThreesConfigReconciler) joinWorker(ctx context.Context, scope *Scope)
290290
return err
291291
}
292292

293-
configStruct := k3s.GenerateWorkerConfig(serverURL, tokn, scope.Config.Spec.AgentConfig)
293+
configStruct := k3s.GenerateWorkerConfig(serverURL, tokn, scope.Config.Spec.ServerConfig, scope.Config.Spec.AgentConfig)
294294

295295
b, err := kubeyaml.Marshal(configStruct)
296296
if err != nil {

controlplane/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigs.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ spec:
166166
items:
167167
type: string
168168
type: array
169+
disableExternalCloudProvider:
170+
description: 'DisableExternalCloudProvider suppresses the ''cloud-provider=external''
171+
kubelet argument. (default: false)'
172+
type: boolean
169173
httpsListenPort:
170174
description: 'HTTPSListenPort HTTPS listen port (default: 6443)'
171175
type: string
@@ -181,6 +185,12 @@ spec:
181185
items:
182186
type: string
183187
type: array
188+
kubeSchedulerArgs:
189+
description: KubeSchedulerArgs is a customized flag for kube-scheduler
190+
process
191+
items:
192+
type: string
193+
type: array
184194
serviceCidr:
185195
description: 'ServiceCidr Network CIDR to use for services IPs
186196
(default: "10.43.0.0/16")'

controlplane/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigtemplates.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ spec:
180180
items:
181181
type: string
182182
type: array
183+
disableExternalCloudProvider:
184+
description: 'DisableExternalCloudProvider suppresses
185+
the ''cloud-provider=external'' kubelet argument. (default:
186+
false)'
187+
type: boolean
183188
httpsListenPort:
184189
description: 'HTTPSListenPort HTTPS listen port (default:
185190
6443)'
@@ -196,6 +201,12 @@ spec:
196201
items:
197202
type: string
198203
type: array
204+
kubeSchedulerArgs:
205+
description: KubeSchedulerArgs is a customized flag for
206+
kube-scheduler process
207+
items:
208+
type: string
209+
type: array
199210
serviceCidr:
200211
description: 'ServiceCidr Network CIDR to use for services
201212
IPs (default: "10.43.0.0/16")'

controlplane/config/crd/bases/controlplane.cluster.x-k8s.io_kthreescontrolplanes.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ spec:
246246
items:
247247
type: string
248248
type: array
249+
disableExternalCloudProvider:
250+
description: 'DisableExternalCloudProvider suppresses the
251+
''cloud-provider=external'' kubelet argument. (default:
252+
false)'
253+
type: boolean
249254
httpsListenPort:
250255
description: 'HTTPSListenPort HTTPS listen port (default:
251256
6443)'
@@ -262,6 +267,12 @@ spec:
262267
items:
263268
type: string
264269
type: array
270+
kubeSchedulerArgs:
271+
description: KubeSchedulerArgs is a customized flag for kube-scheduler
272+
process
273+
items:
274+
type: string
275+
type: array
265276
serviceCidr:
266277
description: 'ServiceCidr Network CIDR to use for services
267278
IPs (default: "10.43.0.0/16")'

0 commit comments

Comments
 (0)