Archive for February, 2025

10
Feb

kubectl 3

   Posted by: admin    in Mẹo vặt của hiếu râu




kubectl get nodes --show-labels
kubectl label nodes <your-node-name> nodegroup=w45
apiVersion: v1
kind: Pod
metadata:
  name: nginx
  labels:
    env: test
spec:
  containers:
  - name: nginx
    image: nginx
    imagePullPolicy: IfNotPresent
  nodeSelector:
    nodegroup: w45



apiVersion: v1
kind: Pod
metadata:
  name: nginx
  labels:
    env: test
spec:
  containers:
  - name: nginx
    image: nginx
    imagePullPolicy: IfNotPresent
  nodeName: worker3.domain.com


spec:
containers:
- image: hieuvpn/lap:10
imagePullPolicy: IfNotPresent
name: lap
ports:
- containerPort: 80
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/www/html
name: 100mb
dnsPolicy: ClusterFirst
nodeSelector:
supportnodes: w45
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- hostPath:
path: /_STORAGE/support-desk
type: ""
name: 100mb