Skip to content

Latest commit

 

History

History
61 lines (51 loc) · 1.72 KB

File metadata and controls

61 lines (51 loc) · 1.72 KB

Pods, services and deployments

slide 1 slide 2 slide 3 slide 4 slide 5 slide 6 slide 7 slide 8 slide 9 slide 10 slide 11

Our Deployment

cat <<EOF | kubectl apply -f -
apiVersion: apps/v1 
kind: Deployment
metadata:
  name: webapp-deployment
spec:
  selector:
    matchLabels:
      app: webapp
  replicas: 3
  template:
    metadata:
      labels:
        app: webapp
    spec:
      containers:
      - name: webapp
        image: scottyc/webapp:latest
        ports:
        - containerPort: 3000
          hostPort: 3000
EOF

Now check our deployment

kubectl get deployments
kubectl get pods
kubectl get services

slide 14 slide 15

Expose our service

kubectl expose deployment webapp-deployment --type=LoadBalancer
kubectl get service

kubectl get service will give you the public ip address for the application. It will then be available

slide 17

Now we move onto the next module here