存储挂载pvc
yaml
apiVersion: v1
kind: Pod
metadata:
name: hw-mount
namespace: cnoc-hw-storage
#namespace: project-10321
spec:
# nodeSelector:
# csi.storage.k8s.io/lvm: "true"
# nodeName: 10-10-10-10.hw
# schedulerName: lvm-scheduler
containers:
- name: busybox
#image: docker.io/library/busybox:latest
image: ikubernetes/myapp:v1
resources:
limits:
cpu: "1"
memory: 1000Mi
requests:
cpu: 100m
memory: 300Mi
volumeMounts:
- name: mount
mountPath: /hw
volumes:
- name: mount
persistentVolumeClaim:
claimName: cnoc-pvc-1
查看挂载
bash
kubectl exec -it hw-mount -n cnoc-hw-storage -- sh
df -h
cronjob
bash
cat>hw-cronjob.yaml<<'EOF'
apiVersion: batch/v1
kind: CronJob
metadata:
creationTimestamp: null
#name: hw-cronjob
namespace: project-1
namespace: cnoc-hwdev
spec:
jobTemplate:
metadata:
creationTimestamp: null
name: hw-cronjob
spec:
template:
metadata:
creationTimestamp: null
spec:
containers:
- image: dev.registry:18083/hhhwww/service-14756:117041
name: hw-cronjob
resources: {}
restartPolicy: OnFailure
schedule: '*/1 * * * *'
status: {}
EOF
查看
bash
kubectl api-resources | grep job
kubectl get job -A
kubectl apply -f hw-cronjob.yaml
kubectl delete -f hw-cronjob.yaml
daemonset
bash
cat>hw-daemonset.yaml<<'EOF'
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
app: nginx
name: hw-daemonset
namespace: project-3556
spec:
revisionHistoryLimit: 10
selector:
matchLabels:
app: nginx
template:
metadata:
creationTimestamp: null
labels:
app: nginx
spec:
containers:
- name: nginx
image: dev.registry:18083/hhhwww/earth/service-14756:117041
imagePullPolicy: IfNotPresent
resources:
limits:
memory: 200Mi
requests:
cpu: 100m
memory: 200Mi
terminationGracePeriodSeconds: 30
EOF
查看
bash
kubectl get daemonset -A