kubectl-cmd
agseijas/kubectl-cmd/kubernetes
Terraform kubectl-cmd
kubectl-cmd Terraform module which launches kubectl commands from a shell using terraform kubernetes provider credentials, see /test//main.tf and test//provider.tf for some AWS with EKS based examples on how to configure. Allows using manually forged custom kubeconfig files too. Basically requires these variables for setting up the kubernetes provider: - Host/endpoint (non-sensitive) - ca-certificate (non-sensitive) - token (sensitive) Since there are sensitive values, the output will be marked as sensitive and won't show. It's therefore not recommended to use this module with terraform versions which don't implement sensitive values handling (so use this module only from TF 1.0+). Usage You might configure a list of (by default: bash-based) scripts with kubectl commands to be launched in
| Name | Type | Description | Default |
|---|---|---|---|
| cmds | list(string) | Command(s) which will ultimately contain a `kubectl` command execution | required |
| app | string | The console-log output file names will use this app name variable. Ex. for `myap | required |
| cluster-name | string | Name of the k8s cluster to connect to. Ex. for a k8s cluster named `my-cluster-h | required |
| ca-certificate | string | Deprecated, please use the equivalent credentials.ca-certificate var. This will | null |
| credentials | object({ token: optional(o | Currently only supports token and kubeconfig-path | {} |
| token | string | Deprecated, please use the equivalent credentials.token.* var. This will be remo | null |
| destroy-cmds | list(string) | Commands to execute during the destroy phase of the terraform module, using kube | [
""
] |
| endpoint | string | Deprecated, please use the equivalent credentials.token.* var. This will be remo | null |
| interpreter | list | Provide a different than default ('/bin/bash') interpreter. | [
"/bin/bash",
"-c"
] |
| always-apply | bool | true |
logfile-namelogfile-destroy-namedeprecation_warning