apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapptodo
  labels:
    deployment: myapptodo
spec:
  selector:
    matchLabels:
      app: myapp   # This label identifies our application, used for filtering output
      component: todo    # This label identifies component, used for Service definition
      type: release    # This label identifies actual release vs. canary etc.
  replicas: 1
  template:
    metadata:
      labels:
        app: myapp   # This label identifies our application, used for filtering output
        component: todo    # This label identifies component, used for Service definition
        type: release    # This label identifies actual release vs. canary etc.
    spec:
      containers:
      - name: myappspa
        image: YOUROCIRNAME/myapptodo:v1   # Best practice - always define specific tag, do not rely on latest
        imagePullPolicy: Always    # Best practice for security - user will no access to image might get it from local cache
        ports:  # We cannot run on ports <1024 because that would require root
        - containerPort: 8080
        livenessProbe:    # Best practice for stability - always define probes to detect hanged process
          httpGet:
            path: /
            port: 8080
        readinessProbe:
          httpGet:
            path: /
            port: 8080
        resources:
          limits:
            cpu: 500m
            memory: 256Mi
          requests:
            cpu: 250m
            memory: 256Mi
        env:
          - name: NGINX_HTTP_PORT_NUMBER
            value: "8080"
          - name: ORASQL_URL
            valueFrom:
              secretKeyRef:
                name: myapptodo-secret
                key: orasqlurl
        volumeMounts:
          - name: config-volume
            mountPath: /home/user/orawalet
      imagePullSecrets:
        - name: ocirsecret
      volumes:
        - name: config-volume
          configMap:
            # Provide the name of the ConfigMap containing the files you want
            # to add to the container
            name: my-config
