apiVersion: batch/v1
kind: Job
metadata:
  name: install-aura-full
  namespace: aura
spec:
  activeDeadlineSeconds: 36000
  backoffLimit: 10
  template:
    spec:
      serviceAccountName: aura-job
      initContainers:
      - name: helm-install
        image: phx.ocir.io/oraclepaasmicroservices/aura/helm-base:0.2.1-SNAPSHOT
        command: ["helm",  "init", "--service-account=helm"]
        imagePullPolicy: Always
      - name: helm-ready
        image: phx.ocir.io/oraclepaasmicroservices/aura/helm-base:0.2.1-SNAPSHOT
        command: ["helm", "ls"]
        imagePullPolicy: Always
      - name: istio-install
        image: phx.ocir.io/oraclepaasmicroservices/aura/istio-install:0.2.1-SNAPSHOT
        command: ["sh", "-c", "install-istio"]
        env:
        - name: HELM_OPTS
          value: " --set sidecar-injector.enabled=true --set sidecar-injector.includeIPRanges=10.21.0.0/16 --set global.proxy.image=proxyv2 --set grafana.enabled=true --set prometheus.enabled=true --set zipkin.enabled=true"
        imagePullPolicy: Always
      - name: kafka
        image: phx.ocir.io/oraclepaasmicroservices/aura/kafka-install:0.2.1-SNAPSHOT
        command: ["sh", "-c", "install-chart"]
        env:
        - name: HELM_OPTS
          value: " --set Persistence.enabled=false --set zookeeper.Persistence.enabled=false"
        imagePullPolicy: Always
      - name: events-broker
        image: phx.ocir.io/oraclepaasmicroservices/aura/events-broker-install:0.2.1-SNAPSHOT
        command: ["sh", "-c", "install-chart"]
        env:
        - name: HELM_OPTS
          value: " --set apiserver.persistence.size=50Gi --set global.namespace=aura-eb --set global.kafka.enabled=false --set global.kafka.url=kafka-kafka.kafka:9092 --set global.zipkinUrl='http://zipkin.istio-system:9411' --set global.fnServerUrl='http://fn-fn-api.default:80/r'"
        imagePullPolicy: Always
      - name: fn
        image: phx.ocir.io/oraclepaasmicroservices/aura/fn-install:0.2.1-SNAPSHOT
        command: ["sh", "-c", "install-chart"]
        imagePullPolicy: Always
      - name: api-registry
        image: phx.ocir.io/oraclepaasmicroservices/aura/api-registry-install:0.2.1-SNAPSHOT
        command: ["sh", "-c", "install-chart"]
        env:
        - name: HELM_OPTS
          value: " --set api-server.persistence.size=50Gi --set global.images.pullpolicy=Always --set global.images.pullPolicy=Always"
        imagePullPolicy: Always
      - name: observability-tools
        image: phx.ocir.io/oraclepaasmicroservices/aura/observability-tools-install:0.2.1-SNAPSHOT
        command: ["sh", "-c", "install-chart"]
        env:
        - name: HELM_OPTS
          value: " --set api-server.persistence.size=50Gi --set global.images.pullpolicy=Always --set global.images.pullPolicy=Always"
        imagePullPolicy: Always
      containers:
      - name: installation-complete
        image: busybox
        command: ['sh', '-c', 'echo "Helm, Istio, Aura, Kafka, Fn and Events Broker Installed"']
        imagePullPolicy: Always
      restartPolicy: Never
      imagePullSecrets:
      - name: aura-install-job
