-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(k8sd): Add datastore and nodeTaints to the GetClusterConfig response #1065
base: main
Are you sure you want to change the base?
Changes from all commits
43d3537
69b9ee6
55bd546
0132f84
2203a96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,7 +112,7 @@ func (e *Endpoints) Endpoints() []rest.Endpoint { | |
Name: "ClusterConfig", | ||
Path: apiv1.GetClusterConfigRPC, // == apiv1.SetClusterConfigRPC | ||
Put: rest.EndpointAction{Handler: e.putClusterConfig, AccessHandler: e.restrictWorkers}, | ||
Get: rest.EndpointAction{Handler: e.getClusterConfig, AccessHandler: e.restrictWorkers}, | ||
Get: rest.EndpointAction{Handler: e.getClusterConfig}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does this affect There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a really good catch. I'll add an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added this check in |
||
}, | ||
// Kubernetes auth tokens and token review webhook for kube-apiserver | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,8 +41,8 @@ func KubeletControlPlane(snap snap.Snap, hostname string, nodeIP net.IP, cluster | |
} | ||
|
||
// KubeletWorker configures kubelet on a worker node. | ||
func KubeletWorker(snap snap.Snap, hostname string, nodeIP net.IP, clusterDNS string, clusterDomain string, cloudProvider string, extraArgs map[string]*string) error { | ||
return kubelet(snap, hostname, nodeIP, clusterDNS, clusterDomain, cloudProvider, nil, kubeletWorkerLabels, extraArgs) | ||
func KubeletWorker(snap snap.Snap, hostname string, nodeIP net.IP, clusterDNS string, clusterDomain string, cloudProvider string, extraArgs map[string]*string, taints []string) error { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Turns out that we were not passing the taints to Kubelet for worker nodes at all. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we didn't have a test for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well we did test the kubelet package, but the "taints" were not being tested specifically. |
||
return kubelet(snap, hostname, nodeIP, clusterDNS, clusterDomain, cloudProvider, taints, kubeletWorkerLabels, extraArgs) | ||
} | ||
|
||
// kubelet configures kubelet on the local node. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Contains the bootstrap configuration for the cluster config test. | ||
control-plane-taints: | ||
- "taint1=:PreferNoSchedule" | ||
- "taint2=value:PreferNoSchedule" | ||
cluster-config: | ||
network: | ||
enabled: true | ||
dns: | ||
enabled: true | ||
ingress: | ||
enabled: true | ||
load-balancer: | ||
enabled: true | ||
local-storage: | ||
enabled: true | ||
gateway: | ||
enabled: true | ||
metrics-server: | ||
enabled: true | ||
extra-node-config-files: | ||
bootstrap-extra-file.yaml: extra-args-test-file-content | ||
extra-node-kube-apiserver-args: | ||
--request-timeout: 2m | ||
extra-node-kube-controller-manager-args: | ||
--leader-elect-retry-period: 3s | ||
extra-node-kube-scheduler-args: | ||
--authorization-webhook-cache-authorized-ttl: 11s | ||
extra-node-kube-proxy-args: | ||
--config-sync-period: 14m | ||
extra-node-kubelet-args: | ||
--authentication-token-webhook-cache-ttl: 3m | ||
extra-node-containerd-args: | ||
--log-level: debug | ||
extra-node-k8s-dqlite-args: | ||
--watch-storage-available-size-interval: 6s |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Contains the join configuration for the worker nodes in the cluster config test. | ||
extra-node-kubelet-args: | ||
"--register-with-taints": "workerTaint1=:PreferNoSchedule,workerTaint2=workerValue:PreferNoSchedule" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my local machine, the
make go.doc
basically deleted all the generated docs due to multiple packages error. I don't know how this seems to be working on the CI. Had to make this change to be able to run locally. I think this issue was due to a very recent change in k8s-snap-api where we added a test file: https://github.com/canonical/k8s-snap-api/pull/26/files