HarrisKirk / blue-green-dreams

2 stars 1 forks source link

Create a deployment using kubectl #21

Closed HarrisKirk closed 1 year ago

HarrisKirk commented 1 year ago

Use a kind:Deployment file and then use kubectl to create the deployment

HarrisKirk commented 1 year ago
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gwa-deployment
  labels:
    app: gwa
spec:
  replicas: 2
  selector:
    matchLabels:
      app: gwa
  template:
    metadata:
      labels:
        app: gwa
    spec:
      containers:
      - name: gwa
        image: cjtkirk1/gwa:latest
        ports:
        - containerPort: 80

The above is the deployment file. Next step is to automate this in python with kubectl kubectl apply -f deployment.yaml