apiVersion: v1
kind: ServiceAccount
metadata:
  name: ignite-cache-sa
  namespace: fcat-stage

---
apiVersion: v1
kind: Service
metadata:
  name: ignite-cache-service
  namespace: fcat-stage
spec:
  type: LoadBalancer
  ports:
    - name: rest
      port: 8080
      targetPort: 8080
    - name: sql
      port: 10800
      targetPort: 10800
    - name: thinclients
      port: 10900
      targetPort: 10900

  selector:
    app: ignite-cache

---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: ignite-cache
  namespace: fcat-stage
  labels:
    app: ignite-cache
spec:
  replicas: 2
  template:
    metadata:
      labels:
        app: ignite-cache
    spec:
      serviceAccountName: ignite-cache-sa
      containers:
      - name: ignite-cache
        image: ccsdev.azurecr.io/fcat/ignite-cache:v3
        env:
            - name: OPTION_LIBS
              value: ignite-kubernetes,ignite-rest-http
        resources:
              requests:
                memory: "20Gi"
              limits:
                memory: "20Gi"
        ports:
        - containerPort: 11211 # REST port number.
          name: rest
        - containerPort: 47100 # communication SPI port number.
          name: spi
        - containerPort: 47500 # discovery SPI port number.
          name: discovery
        - containerPort: 49112 # JMX port number.
          name: jmx
        - containerPort: 10800 # SQL port number.
          name: sql
        - containerPort: 10900 # Thin clients port number.
          name: thin-clients

      imagePullSecrets:
      - name: ccsdev
---

apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: ignite-rbac
subjects:
  - kind: ServiceAccount
    name: ignite-cache-sa
    namespace: fcat-stage
roleRef:
  kind: ClusterRole
  name: cluster-admin
  apiGroup: rbac.authorization.k8s.io


