ื—ืœืง 1 โ€” ื‘ื“ื™ืงืช ืžืฆื‘ ื”ืงืœืืกื˜ืจ

ืœืคื ื™ ืฉืžืชื—ื™ืœื™ื, ื ื•ื•ื“ื ืฉื”ื›ื•ืœ ืชืงื™ืŸ:

kubectl get pods
kubectl get svc
kubectl get deploy
kubectl get rs

ืื ื—ื ื• ืžืฆืคื™ื ืœืจืื•ืช:

ืื ื”ื›ื•ืœ ืชืงื™ืŸ โ€” ืžืžืฉื™ื›ื™ื.


ื—ืœืง 2 โ€” ื™ืฆื™ืจืช ืงื•ื‘ืฅ NodePort

ื ืขืชื™ืง ืืช ืงื•ื‘ืฅ ื”ึพClusterIP

ื•ื ื™ืฆื•ืจ:

color-api-nodeport.yaml

ืชื•ื›ืŸ ื”ืงื•ื‘ืฅ:

apiVersion: v1
kind: Service
metadata:
  name: color-api-nodeport
  labels:
    app: color-api
spec:
  type: NodePort
  selector:
    app: color-api
  ports:
    - port: 80
      targetPort: 80
      nodePort: 30007

ืžื” ื”ืฉืชื ื”?