Kubernetes

The Kubernetes Credential configuration below is used for integrating with the kubernetes.core collection.

Please refer to the kubeconfig parameter details in the kubernetes.core documentation for more information regarding how the collection leverages the injected file.

Input Configuration

fields:
  - id: kube_config
    type: string
    label: Kubernetes Config File
    secret: true
    multiline: true
required:
  - kube_config

Injector Configuration

env:
  K8S_AUTH_KUBECONFIG: '{{ tower.filename }}'
file:
  template: '{{ kube_config }}'

Deploy with Controller Configuration

# Task to be included in a playbook
- name: Create Kubernetes Credential Type
  ansible.builtin.include_role:
    name: infra.controller_configuration.credential_types
  vars:
    controller_credential_types:
      - name: Kubernetes Credential
        description: Intended for use with the kubernetes.core collection
        inputs:
          fields:
            - id: kube_config
              type: string
              label: Kubernetes Config File
              secret: true
              multiline: true
          required:
            - kube_config
        injectors:
          env:
            K8S_AUTH_KUBECONFIG: !unsafe "{{ tower.filename }}"
          file:
            template: !unsafe  "{{ kube_config }}"