---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: gdcn-pv-claim
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 3Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: gdcn
  name: gdcn
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: gdcn
  template:
    metadata:
      labels:
        app: gdcn
    spec:
      containers:
      - image: gooddata/gooddata-cn-ce:1.7.1
        name: gooddata-cn-ce
        ports:
        - containerPort: 3000
          name: http
        resources:
          requests:
            cpu: 4000m
            memory: 4Gi
          limits:
            cpu: 4000m
            memory: 4Gi
        env:
        - name: LICENSE_AND_PRIVACY_POLICY_ACCEPTED
          value: "YES"
        - name: GDCN_PUBLIC_URL
          # Please update to your hostname
          value: "https://analytics.example.com"
        volumeMounts:
        - mountPath: /data
          name: gdcn-data
      volumes:
      - name: gdcn-data
        persistentVolumeClaim:
          claimName: gdcn-pv-claim
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: gdcn
  name: gdcn
spec:
  ports:
  - name: http
    port: 3000
    protocol: TCP
    targetPort: http
  selector:
    app: gdcn
  type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: gdcn
  labels:
    app: gdcn
spec:
  ingressClassName: nginx
  rules:
    # Please update to your hostname
  - host: analytics.example.com
    http:
      paths:
      - backend:
          service:
            name: gdcn
            port:
              name: http
        path: /
        pathType: Prefix
