Skip to content

Commit

Permalink
fix: fix Affinity and Probe
Browse files Browse the repository at this point in the history
Signed-off-by: renxiangyu_yewu <[email protected]>
  • Loading branch information
renxiangyu_yewu committed Sep 11, 2024
1 parent 978e257 commit 822cee6
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 0 deletions.
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

0 comments on commit 822cee6

Please sign in to comment.