Skip to content

Instantly share code, notes, and snippets.

@pingkunga
Created November 12, 2023 03:19
Show Gist options
  • Save pingkunga/ed52c587b96fa564dae124bbd211c2d1 to your computer and use it in GitHub Desktop.
Save pingkunga/ed52c587b96fa564dae124bbd211c2d1 to your computer and use it in GitHub Desktop.
ุถามเพิ่มข้อ 4
ถามเพิ่ม สงสัยอันนี้
```
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: pingd
name: pingd
namespace: group-1
spec:
#Max 2 Per Node 5 Node = 10
replicas: 10
selector:
matchLabels:
app: pingd
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: pingd
spec:
topologySpreadConstraints:
#eveny node 2 pods
- maxSkew: 2
#topologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology
#topologyKey: topology.kubernetes.io/region=proenhn
topologyKey: node-name
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: pingd
containers:
- image: nginx
name: nginx
resources: {}
#warmup 10 seconds
#initialDelaySeconds + failureThreshold × periodSeconds
startupProbe:
httpGet:
path: /
port: 80
scheme: HTTP
initialDelaySeconds: 10
#Restart every 1 minute
livenessProbe:
httpGet:
path: /
port: 10456
initialDelaySeconds: 1
periodSeconds: 60
failureThreshold: 1
#Traffic every 16 seconds
readinessProbe:
httpGet:
path: /
port: 80
successThreshold: 1
periodSeconds: 16
failureThreshold: 4
# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: node-name
# operator: In
# values:
# - node-01
# - node-02
# - node-03
# - node-04
# - node-05
tolerations:
- key: "node"
operator: "Equal"
value: "no1"
effect: "NoSchedule"
- key: "node"
operator: "Equal"
value: "no2"
effect: "NoSchedule"
- key: "node"
operator: "Equal"
value: "no3"
effect: "NoSchedule"
- key: "node"
operator: "Equal"
value: "no4"
effect: "NoSchedule"
- key: "node"
operator: "Equal"
value: "no5"
effect: "NoSchedule"
status: {}
```
จะ Error บาง 2 pod Pod พอ Describbe ออกมา
```
Warning FailedScheduling 2m9s
- default-scheduler 0/9 nodes are available: 1 node(s) had untolerated taint {disktype: ssd}
, 3 node(s) had untolerated taint {node-role.kubernetes.io/control-plane: }
, 4 node(s) didn't match pod topology spread constraints
, 4 node(s) didn't match pod topology spread constraints (missing required label).
preemption: 0/9 nodes are available: 4 No preemption victims found for incoming pod, 5 Preemption is not helpful for scheduling.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment