Skip to content

Commit

Permalink
Allow aws-iam-authenticator to be scheduled onto dedicated apiserver …
Browse files Browse the repository at this point in the history
…nodes
  • Loading branch information
rifelpet committed Sep 26, 2021
1 parent c742621 commit 42ecaba
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
Expand Up @@ -129,11 +129,15 @@ spec:

# run on each master node
nodeSelector:
node-role.kubernetes.io/master: ""
{{ APIServerNodeRole }}: ""
priorityClassName: system-node-critical
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
- effect: NoSchedule
key: node-role.kubernetes.io/api-server
- key: node.cloudprovider.kubernetes.io/uninitialized
operator: Exists
- key: CriticalAddonsOnly
operator: Exists

Expand Down
8 changes: 8 additions & 0 deletions upup/pkg/fi/cloudup/template_functions.go
Expand Up @@ -101,6 +101,7 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS
dest["GetNodeInstanceGroups"] = tf.GetNodeInstanceGroups
dest["HasHighlyAvailableControlPlane"] = tf.HasHighlyAvailableControlPlane
dest["ControlPlaneControllerReplicas"] = tf.ControlPlaneControllerReplicas
dest["APIServerNodeRole"] = tf.APIServerNodeRole

dest["CloudTags"] = tf.CloudTagsForInstanceGroup
dest["KubeDNS"] = func() *kops.KubeDNSConfig {
Expand Down Expand Up @@ -299,6 +300,13 @@ func (tf *TemplateFunctions) ControlPlaneControllerReplicas() int {
return 1
}

func (tf *TemplateFunctions) APIServerNodeRole() string {
if featureflag.APIServerNodes.Enabled() {
return "node-role.kubernetes.io/api-server"
}
return "node-role.kubernetes.io/master"
}

// HasHighlyAvailableControlPlane returns true of the cluster has more than one control plane node. False otherwise.
func (tf *TemplateFunctions) HasHighlyAvailableControlPlane() bool {
cp := 0
Expand Down
Expand Up @@ -189,6 +189,10 @@ spec:
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
- effect: NoSchedule
key: node-role.kubernetes.io/api-server
- key: node.cloudprovider.kubernetes.io/uninitialized
operator: Exists
- key: CriticalAddonsOnly
operator: Exists
volumes:
Expand Down
Expand Up @@ -47,7 +47,7 @@ spec:
k8s-addon: storage-aws.addons.k8s.io
- id: k8s-1.12
manifest: authentication.aws/k8s-1.12.yaml
manifestHash: 7fab0163a43a38470011072ed69967e28c8d6acf5f47ad9c82f437878f78eb77
manifestHash: e560afb9c07a966239a54546698ff2ce489b26cbc51db6508914fc68cfb8b599
name: authentication.aws
selector:
role.kubernetes.io/authentication: "1"

0 comments on commit 42ecaba

Please sign in to comment.