Answers for "kubernetes deployment yaml"

5

kubernetes get deployments

# Get pods in default namespace
kubectl get deployments

#Get Pods in my-namespace
kubectl get deployments -n my-namespace

#Get Pods in all namespaces
kubectl get deployments --all-namespaces
Posted by: Guest on October-20-2020
4

deployment example

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
Posted by: Guest on June-21-2020
2

kubernetes deployment yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
Posted by: Guest on November-20-2020
0

kubectl get yaml for deployment

kubectl -n <namespace> get <resource type> <resource Name> -o yaml

##example (will display the yaml on your terminal)###

kubectl -n hrservices get deployment payroll-deployment -o yaml

##example (will save the yaml to a file in current directory)###

kubectl -n hrservices get deployment payroll-deployment -o yaml > payroll.yaml
Posted by: Guest on July-06-2021

Browse Popular Code Answers by Language