Skip to content
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

fix: fix Affinity and Probe #704

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 6 additions & 0 deletions pkg/clusterlink/clusterlink-operator/agent/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ spec:
- matchExpressions:
- key: kosmos.io/exclude
operator: DoesNotExist
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app: clusterlink-agent
topologyKey: kubernetes.io/hostname
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: clusterlink-agent
Expand Down
5 changes: 5 additions & 0 deletions pkg/clusterlink/clusterlink-operator/elector/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ spec:
- matchExpressions:
- key: kosmos.io/exclude
operator: DoesNotExist
- key: node-role.kubernetes.io/master
operator: Exists
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
Expand Down Expand Up @@ -93,6 +95,9 @@ spec:
operator: "Equal"
value: "value"
effect: "NoSchedule"
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
volumes:
- name: proxy-config
secret:
Expand Down
10 changes: 10 additions & 0 deletions pkg/clusterlink/clusterlink-operator/manager/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,18 @@ spec:
labels:
app: clusterlink-controller-manager
spec:
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
serviceAccountName: {{ .Name }}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
Expand Down
8 changes: 8 additions & 0 deletions pkg/kosmosctl/manifest/manifest_daemonsets.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ spec:
- matchExpressions:
- key: kosmos.io/exclude
operator: DoesNotExist
- key: node-role.kubernetes.io/master
operator: Exists
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app: clusterlink-floater
topologyKey: kubernetes.io/hostname
containers:
- name: floater
image: {{ .ImageRepository }}/clusterlink-floater:v{{ .Version }}
Expand Down
142 changes: 142 additions & 0 deletions pkg/kosmosctl/manifest/manifest_deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,48 @@ spec:
labels:
app: clusterlink-network-manager
spec:
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app: clusterlink-network-manager
topologyKey: kubernetes.io/hostname
serviceAccountName: clusterlink-network-manager
containers:
- name: manager
image: {{ .ImageRepository }}/clusterlink-network-manager:{{ .Version }}
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
command:
- cat
- /proc/1/cmdline
failureThreshold: 30
initialDelaySeconds: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
readinessProbe:
exec:
command:
- cat
- /proc/1/cmdline
failureThreshold: 30
initialDelaySeconds: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
command:
- clusterlink-network-manager
- --v=4
Expand Down Expand Up @@ -54,8 +91,18 @@ spec:
labels:
app: operator
spec:
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
serviceAccountName: clusterlink-operator
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
Expand All @@ -71,6 +118,26 @@ spec:
- name: operator
image: {{ .ImageRepository }}/clusterlink-operator:{{ .Version }}
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
command:
- cat
- /proc/1/cmdline
failureThreshold: 30
initialDelaySeconds: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
readinessProbe:
exec:
command:
- cat
- /proc/1/cmdline
failureThreshold: 30
initialDelaySeconds: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
command:
- clusterlink-operator
- --controlpanelconfig=/etc/clusterlink-operator/kubeconfig
Expand Down Expand Up @@ -115,11 +182,49 @@ spec:
labels:
app: clustertree-cluster-manager
spec:
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app: clustertree-cluster-manager
topologyKey: kubernetes.io/hostname
serviceAccountName: clustertree
containers:
- name: manager
image: {{ .ImageRepository }}/clustertree-cluster-manager:{{ .Version }}
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
command:
- cat
- /proc/1/cmdline
failureThreshold: 30
initialDelaySeconds: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
name: manager
readinessProbe:
exec:
command:
- cat
- /proc/1/cmdline
failureThreshold: 30
initialDelaySeconds: 3
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
env:
- name: APISERVER_CERT_LOCATION
value: /etc/cluster-tree/cert/cert.pem
Expand Down Expand Up @@ -280,6 +385,23 @@ spec:
labels:
app: scheduler
spec:
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app: scheduler
topologyKey: kubernetes.io/hostname
volumes:
- name: scheduler-config
configMap:
Expand All @@ -293,6 +415,26 @@ spec:
- name: kosmos-scheduler
image: {{ .ImageRepository }}/scheduler:{{ .Version }}
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 10259
scheme: HTTPS
initialDelaySeconds: 15
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
name: kosmos-scheduler
readinessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 10259
scheme: HTTPS
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
command:
- scheduler
- --config=/etc/kubernetes/kube-scheduler/scheduler-config.yaml
Expand Down
Loading