Complete Kubernetes Tutorial By School Of | Devops
Always set up kubectx and kubens to quickly switch between clusters and namespaces.
apiVersion: apps/v1 kind: Deployment metadata: name: api spec: replicas: 2 selector: matchLabels: app: api template: metadata: labels: app: api spec: containers: - name: api image: schoolofdevops/python-api:v2 env: - name: DB_PASSWORD valueFrom: secretKeyRef: name: db-secret key: password - name: REDIS_HOST valueFrom: configMapKeyRef: name: app-config key: REDIS_HOST ports: - containerPort: 5000 --- apiVersion: v1 kind: Service metadata: name: api-service spec: selector: app: api ports: - port: 80 targetPort: 5000 type: LoadBalancer # Gives an external IP in the cloud Complete Kubernetes Tutorial by School of Devops
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.8.1/deploy/static/provider/cloud/deploy.yaml Always set up kubectx and kubens to quickly
