Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Use a Deployment for kube-apiserver #1455

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{- if eq (int .Values.apiserver.replicas) 1 }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -8,7 +7,7 @@ metadata:
tier: control-plane
k8s-app: kube-apiserver
spec:
replicas: 1
replicas: {{ .Values.apiserver.replicas }}
selector:
matchLabels:
tier: control-plane
Expand All @@ -22,9 +21,26 @@ spec:
labels:
tier: control-plane
k8s-app: kube-apiserver
helm-revision: {{ .Release.Revision | quote }}
annotations:
checkpointer.alpha.coreos.com/checkpoint: "true"
seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
spec:
{{- if ne (int .Values.apiserver.replicas) 1 }}
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: k8s-app
operator: In
values:
- kube-apiserver
- key: helm-revision
operator: In
values:
- {{ .Release.Revision | quote }}
topologyKey: kubernetes.io/hostname
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For topologyKey, wouldn't it be more correct to use either of the label

node.kubernetes.io/master
node.kubernetes.io/controller=true

Copy link
Member

@ipochi ipochi May 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this on the Kubernetes Docs

For requiredDuringSchedulingIgnoredDuringExecution pod anti-affinity, the admission controller
LimitPodHardAntiAffinityTopology was introduced to limit topologyKey to kubernetes.io/hostname. If you want to make it
available for custom topologies, you may modify the admission controller, or disable it.

https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#an-example-of-a-pod-that-uses-pod-affinity

{{- end }}
{{- template "containers" . }}
{{- end }}

12 changes: 2 additions & 10 deletions pkg/assets/generated_assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.