apiVersion: v1
kind: Service
metadata:
name: myapp-service
spec:
type: LoadBalancer
ports:
- targetPort: 80
port: 80
nodePort: 30008
----------------------------------------------------------------------------------------------
apiVersion: v1
kind: Service
metadata:
name: webapp-service
spec:
type: NodePort
ports:
- targetPort: 8080
port: 8080
nodePort: 30080
selector:
name: simple-webapp
kubectl create -f service-definition-1.yaml
----------------------------------------------------------------------------------------------
kubectl get service
kubectl get svc
kubectl describe svc kubernetes
kubectl describe deploy
kubectl describe deploy simple-webapp-deployment
----------------------------------------------------------------------------------------------
'개발 및 관리 > 클라우드' 카테고리의 다른 글
Container와 Devops, MSA (0) | 2023.09.06 |
---|---|
K8S Imperative / Declarative Commands (0) | 2023.09.04 |
K8S, Services Command (0) | 2023.08.29 |
K8S, Deployment Command (0) | 2023.08.28 |
K8S, ReplicaSets Command (0) | 2023.08.28 |