mirror of
https://github.com/slurm-personal/school-dev-k8s.git
synced 2026-06-27 13:50:24 +00:00
Change some practice
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# DaemonSet
|
||||
|
||||
1) Переходим в директорию с практикой.
|
||||
|
||||
```bash
|
||||
cd ~/slurm/practice/4.advanced-abstractions/1.daemonset
|
||||
```
|
||||
|
||||
2) Создаем демонсет
|
||||
|
||||
```bash
|
||||
kubectl apply -f daemonset.yaml
|
||||
```
|
||||
|
||||
В ответ должны увидеть
|
||||
|
||||
```bash
|
||||
daemonset.apps/node-exporter created
|
||||
```
|
||||
|
||||
3) Смотрим на поды
|
||||
|
||||
```bash
|
||||
kubectl get pod -o wide
|
||||
```
|
||||
|
||||
Видим
|
||||
```bash
|
||||
NAME READY STATUS RESTARTS AGE IP NODE
|
||||
node-exporter-g5tt8 2/2 Running 0 11s 10.107.32.4 gke-s000-default-pool-41fb7951-ntk8
|
||||
node-exporter-jczbm 2/2 Running 0 32s 10.107.32.3 gke-s000-default-pool-41fb7951-4sns
|
||||
node-exporter-xpb9f 2/2 Running 0 22s 10.107.32.2 gke-s000-default-pool-41fb7951-lkjn
|
||||
```
|
||||
|
||||
4) Чистим за собой кластер
|
||||
|
||||
```bash
|
||||
kubectl delete -f daemonset.yaml
|
||||
```
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
labels:
|
||||
app: node-exporter
|
||||
name: node-exporter
|
||||
spec:
|
||||
updateStrategy:
|
||||
rollingUpdate:
|
||||
maxUnavailable: 1
|
||||
type: RollingUpdate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: node-exporter
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: node-exporter
|
||||
spec:
|
||||
containers:
|
||||
- name: node-exporter
|
||||
image: k8s.gcr.io/pause:3.3
|
||||
imagePullPolicy: IfNotPresent
|
||||
resources:
|
||||
limits:
|
||||
cpu: 10m
|
||||
memory: 64Mi
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 64Mi
|
||||
nodeSelector:
|
||||
beta.kubernetes.io/os: linux
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 65534
|
||||
tolerations:
|
||||
- effect: NoSchedule
|
||||
key: node-role.kubernetes.io/ingress
|
||||
Reference in New Issue
Block a user