apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2, before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
  name: tetrinetx
  labels:
    app: tetrinetx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tetrinetx
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: tetrinetx
    spec:
      hostname: tetrinet
      subdomain: azurebootcamp
      containers:
      - image: cmilanf/tetrinetx
        imagePullPolicy: Always
        name: tetrinetx
        env:
        - name: OP_PASSWORD
          valueFrom:
            secretKeyRef:
              name: tetrinetx
              key: op-pwd
        - name: SPEC_PASSWORD
          valueFrom:
            secretKeyRef:
              name: tetrinetx
              key: spec-pwd
        ports:
        - containerPort: 80
          name: http
        - containerPort: 31457
          name: tetrinetx
        - containerPort: 31458
          name: tetrispec
