apiVersion: apps/v1 kind: Deployment metadata: name: web namespace: pypistats labels: app: pypistats component: web spec: replicas: 2 selector: matchLabels: app: pypistats component: web template: metadata: labels: app: pypistats component: web spec: initContainers: - name: migrate image: us.gcr.io/pypistats-org/pypistats:11 imagePullPolicy: Always envFrom: - secretRef: name: pypistats-secrets args: ["migrate"] containers: - name: web image: us.gcr.io/pypistats-org/pypistats:11 imagePullPolicy: Always envFrom: - secretRef: name: pypistats-secrets args: ["web"] ports: - containerPort: 5000 readinessProbe: httpGet: path: /health port: 5000 initialDelaySeconds: 5 periodSeconds: 5 --- apiVersion: v1 kind: Service metadata: name: web namespace: pypistats spec: type: NodePort ports: - name: http protocol: TCP port: 5000 targetPort: 5000 selector: app: pypistats component: web --- apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: web namespace: pypistats spec: backend: serviceName: web servicePort: http rules: - http: paths: - backend: serviceName: web servicePort: http path: /