Kubernetes YAML (deployment.yaml) File
apiVersion: v1
kind: Service
metadata:
  name: onlinecompiler-service
spec:
  selector:
    app: onlinecompiler
  ports:
  - protocol: "TCP"
    port: 80
    targetPort: 80
  type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: onlinecompiler
spec:
  selector:
    matchLabels:
      app: onlinecompiler
  replicas: 1
  template:
    metadata:
      labels:
        app: onlinecompiler
    spec:
      containers:
      - name: onlinecompiler
        image: shawon10/online-compiler
        imagePullPolicy: Always
        ports:
        - containerPort: 80
 
Kubernetes Deployment Command
kubectl apply -f deployment.yaml
 
Show Pods
kubectl get pods
Show IP and Port of pods
kubect get svc
 
Show Deployments
kubectl get deployments
 
Scale Pods
kubectl scale deployments  deployment_name --replicas=3
  
0 comments:
Post a Comment