# License terms and conditions for Gluu Cloud Native Edition:
# https://www.apache.org/licenses/LICENSE-2.0
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: jackrabbit
spec:
  serviceName: jackrabbit
  replicas: 1
  selector:
    matchLabels:
      app: jackrabbit
  volumeClaimTemplates: []
  template:
    metadata:
      labels:
        APP_NAME: jackrabbit
      annotations:
        sidecar.istio.io/rewriteAppHTTPProbers: "true"
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: app
                    operator: In
                    values:
                      - jackrabbit
              topologyKey: "kubernetes.io/hostname"
      volumes: []
      containers:
      - name: jackrabbit
        imagePullPolicy: Always
        image: gluufederation/jackrabbit:4.3.0_01
        envFrom:
        - configMapRef:
            name: gluu-config-cm
        ports:
          - containerPort: 8080
            name: jackrabbit
        volumeMounts:
          - mountPath: /opt/jackrabbit/repository
            name: jackrabbit-pvc
            subPath: repository
          - mountPath: /opt/jackrabbit/version
            name: jackrabbit-pvc
            subPath: version
          - mountPath: /opt/jackrabbit/workspaces
            name: jackrabbit-pvc
            subPath: workspaces
        resources:
          requests:
            memory: "1500Mi"
            cpu: "1000m"
          limits:
            memory: "1500Mi"
            cpu: "1000m"
        readinessProbe:
          tcpSocket:
            port: 8080
          initialDelaySeconds: 25
          periodSeconds: 25
          timeoutSeconds: 5
        livenessProbe:
          tcpSocket:
            port: 8080
          initialDelaySeconds: 30
          periodSeconds: 30
          timeoutSeconds: 5