---
apiVersion: v1
kind: Pod
metadata:
  name: gooddata-cn-ce
  labels:
    app.kubernetes.io/name: gooddata-cn-ce
spec:
  containers:
  - name: gooddata-cn-ce
    env:
    - name: LICENSE_AND_PRIVACY_POLICY_ACCEPTED
      value: "YES"
    image: gooddata/gooddata-cn-ce:1.0.1
    imagePullPolicy: IfNotPresent
    ports:
    - containerPort: 3000
      name: http
      protocol: TCP
  dnsPolicy: ClusterFirst
  restartPolicy: Always
  # optionally PV could be added and mounted to /data
---
apiVersion: v1
kind: Service
metadata:
  labels:
    kubernetes.io/name: gooddata-cn-ce
  name: gooddata-cn-ce
spec:
  type: ClusterIP
  ports:
  - port: 3000
    protocol: TCP
    targetPort: 3000
  selector:
    app.kubernetes.io/name: gooddata-cn-ce

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    cert-manager.io/issuer: ca-issuer
    nginx.ingress.kubernetes.io/configuration-snippet: |
      proxy_set_header X-Forwarded-Host "localhost";
    nginx.ingress.kubernetes.io/proxy-buffer-size: 16k
    nginx.ingress.kubernetes.io/proxy-redirect-from: http://localhost:3000/
    nginx.ingress.kubernetes.io/proxy-redirect-to: https://acme.example.com/
    nginx.ingress.kubernetes.io/upstream-vhost: localhost:3000
  labels:
    app.kubernetes.io/name: gooddata-cn-ce
  name: gooddata-cn-ce
spec:
  rules:
  - host: acme.example.com
    http:
      paths:
      - backend:
          serviceName: gooddata-cn-ce
          servicePort: 3000
        path: /
        pathType: ImplementationSpecific
  tls:
  - hosts:
    - acme.example.com
    secretName: gooddata-cn-tls
