Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.78 KB

usage.md

File metadata and controls

47 lines (34 loc) · 1.78 KB

Usage

Prerequisites

  • The Operator requires a Terraform Cloud organization name and a team 'owners' token in order to access the Terraform Cloud API.
  • The API token must be stored in a Kubernetes secret.
  • A single instance of the Operator can manage Terraform Cloud resources for different organizations and/or different API tokens. For that purpose, the organization name and a reference to the corresponding Kubernetes secret are shipped within the custom resource.

Below are examples of how to create a Kubernetes secret and store the API token there. The examples assume that the API token is already known.

  1. kubectl command

    $ kubectl create secret generic tfc-operator --from-literal=token=APIt0k3n
  2. YAML manifest

    • Encode the API token

      $ echo -n "APIt0k3n" | base64
    • Create a YAML manifest and paste the encoded token from the previous step

      apiVersion: v1
      kind: Secret
      metadata:
        name: tfc-operator
      type: Opaque
      data:
        token: QVBJdDBrM24=
    • Apply YAML manifest

      $ kubectl apply -f secret.yaml

For more information about Kubernetes secrets please refer to the Kubernetes documentation. Please use the approach that is matching with the best practices which are accepted in your organization.

Controllers usage guides: