apiVersion: anzo.cambridgesemantics.com/v2
kind: Anzo
metadata:
  name: graph-studio
  namespace: "${NAMESPACE}"
  annotations:
    cambridgesemantics.com/skip-lb-check: "true"
spec:
  role: AnzoServer
  jsonActivation: true
  certificate:
    spec:
      secretName: graph-studio-tls
      dnsNames:
        - "${GRAPH_HOSTNAME}"
      issuerRef:
        name: "${CERT_ISSUER}"
        kind: "${CERT_ISSUER_KIND}"
        group: cert-manager.io
  initJSON: |
    {
      "sysadminUser": "k8s://anzo-graph-studio/admin_user",
      "password": "k8s://anzo-graph-studio/admin_password",
      "hostname": "graph-studio",
      "serverId": "${SERVER_ID}",
      "licenseEncoded": "${CSI_LICENSE}"
    }
  service:
    spec:
      type: ClusterIP
  nodeConfig:
    spec:
      replicas: 1
      serviceName: graph-studio
      selector:
        matchLabels:
          app.kubernetes.io/name: graph-studio
      template:
        metadata:
          labels:
            app.kubernetes.io/name: graph-studio
        spec:
          serviceAccountName: anzo-operator
          imagePullSecrets:
            - name: graph-artifacts
          containers:
            - name: anzo
              image: artifacts.altair.com/graph-docker/anzo:6.3.1
              imagePullPolicy: IfNotPresent
              volumeMounts:
                - name: graph-studio-data
                  mountPath: /opt/graphstudio/Server/data
                - name: graph-studio-logs
                  mountPath: /opt/graphstudio/Server/logs
              resources:
                requests:
                  cpu: "2"
                  memory: 8Gi
                limits:
                  cpu: "8"
                  memory: 32Gi
  volumes:
    - name: graph-studio-data
      mountPath: /opt/graphstudio/Server/data
      deletePVC: false
      pvc:
        accessModes:
          - ReadWriteOnce
        storageClassName: "${STORAGE_CLASS}"
        resources:
          requests:
            storage: 100Gi
    - name: graph-studio-logs
      mountPath: /opt/graphstudio/Server/logs
      deletePVC: false
      pvc:
        accessModes:
          - ReadWriteOnce
        storageClassName: "${STORAGE_CLASS}"
        resources:
          requests:
            storage: 20Gi
