service-definition.yml
apiVersion: v1
kind: Service
metadata:
name: back-end
spec:
type: ClusterIP
ports:
- targetPort: 80
port: 80
selector:
app: myapp
type: back-end
------------------------------------------------------------------------------------------
kubectl create -f
service-definition.yml
kubectl get services
------------------------------------------------------------------------------------------
Services-LoandBalancer
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
----------------------------------------------------------------------------------------------
'개발 및 관리 > 클라우드' 카테고리의 다른 글
K8S Imperative / Declarative Commands (0) | 2023.09.04 |
---|---|
K8S, Services Command, Services-LoandBalancer (0) | 2023.09.01 |
K8S, Deployment Command (0) | 2023.08.28 |
K8S, ReplicaSets Command (0) | 2023.08.28 |
쿠버네티스 KCA 관련 자료 URL (0) | 2023.08.03 |