mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-04 15:25:00 -04:00
AB#2234: Introduce AddNodeSelectorsToDeployment
Add the above function to the different client interfaces. Remove previously used Command.Exec call.
This commit is contained in:
parent
6b6a3ee976
commit
ff5100f332
6 changed files with 109 additions and 21 deletions
|
@ -46,6 +46,7 @@ type Client interface {
|
|||
SetKubeconfig(kubeconfig []byte)
|
||||
CreateConfigMap(ctx context.Context, configMap corev1.ConfigMap) error
|
||||
AddTolerationsToDeployment(ctx context.Context, tolerations []corev1.Toleration, name string) error
|
||||
AddNodeSelectorsToDeployment(ctx context.Context, selectors map[string]string, name string) error
|
||||
}
|
||||
|
||||
type installer interface {
|
||||
|
@ -227,10 +228,6 @@ func (k *KubernetesUtil) setupGCPPodNetwork(ctx context.Context, nodeName, nodeP
|
|||
}
|
||||
|
||||
// allow coredns to run on uninitialized nodes (required by cloud-controller-manager)
|
||||
err = exec.CommandContext(ctx, kubectlPath, "--kubeconfig", kubeConfig, "-n", "kube-system", "patch", "deployment", "coredns", "--type", "json", "-p", "[{\"op\":\"add\",\"path\":\"/spec/template/spec/tolerations/-\",\"value\":{\"key\":\"node.cloudprovider.kubernetes.io/uninitialized\",\"value\":\"true\",\"effect\":\"NoSchedule\"}},{\"op\":\"add\",\"path\":\"/spec/template/spec/nodeSelector\",\"value\":{\"node-role.kubernetes.io/control-plane\":\"\"}}]").Run()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tolerations := []corev1.Toleration{
|
||||
{
|
||||
Key: "node.cloudprovider.kubernetes.io/uninitialized",
|
||||
|
@ -241,6 +238,12 @@ func (k *KubernetesUtil) setupGCPPodNetwork(ctx context.Context, nodeName, nodeP
|
|||
if err = kubectl.AddTolerationsToDeployment(ctx, tolerations, "coredns"); err != nil {
|
||||
return err
|
||||
}
|
||||
selectors := map[string]string{
|
||||
"node-role.kubernetes.io/control-plane": "",
|
||||
}
|
||||
if err = kubectl.AddNodeSelectorsToDeployment(ctx, selectors, "coredns"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ciliumInstall := exec.CommandContext(ctx, "cilium", "install", "--ipam", "kubernetes", "--ipv4-native-routing-cidr", subnetworkPodCIDR,
|
||||
"--helm-set", "endpointRoutes.enabled=true,tunnel=disabled,encryption.enabled=true,encryption.type=wireguard,l7Proxy=false")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue