# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements; and to You under the Apache License, Version 2.0.

apiVersion: batch/v1
kind: Job
metadata:
  name: install-routemgmt
  namespace: openwhisk
spec:
  activeDeadlineSeconds: 600
  template:
    metadata:
      name: install-routemgmt
    spec:
      containers:
      - name: routemgmt
        image: openwhisk/kube-routemgmt
        env:
          - name: "WHISK_CLI_VERSION"
            valueFrom:
              configMapKeyRef:
                name: whisk.config
                key: whisk_cli_version_tag
          - name: "WHISK_AUTH"
            valueFrom:
              secretKeyRef:
                name: whisk.auth
                key: system
          - name: "WHISK_API_HOST_NAME"
            valueFrom:
              configMapKeyRef:
                name: whisk.ingress
                key: api_host
          - name: "WHISK_NAMESPACE"
            valueFrom:
              configMapKeyRef:
                name: whisk.config
                key: whisk_system_namespace
          - name: "WHISK_API_GATEWAY_HOST_V2"
            value: "http://$(APIGATEWAY_SERVICE_HOST):$(APIGATEWAY_SERVICE_PORT_API)/v2"

      restartPolicy: Never
