Provider configuration currently carries kapp kubeconfig.
kapp
(optional) Required if kapp resource is usedkubeconfig
(optional) Required if kapp resource is usedfrom_env
(bool; optional; default=false) Use kubeconfig from the environment (e.g.~/.kube/config
orKUBECONFIG
, etc.)context
(string; optional) Context name. Only applies toenv
configuration.server
(string; optional) Required iffrom_env
is not used. Specifies API server URL.username
(string; optional) Usernamepassword
(string; optional) Passwordca_cert
(string; optional) CA certificate in PEM format (multiline strings are indent-trimmed)client_cert
(string; optional) Client certificate in PEM format (multiline strings are indent-trimmed)client_key
(string; optional) Client key in PEM format (multiline strings are indent-trimmed)token
(string; optional) Authentication token
kubeconfig_yaml
(string; optional) Kubeconfig as YAML (multiline strings are indent-trimmed)diff_output_file
(string; optional) Path to a file that will contan kapp diffs. This file will be truncated each time provider starts.
Use published provider to Terraform registry:
terraform {
required_providers {
carvel = {
source = "vmware-tanzu/carvel"
version = "0.11.0" // or pick version (started publishing v0.10.0+)
}
}
}
provider "carvel" {}
Use configuration used by kubectl:
provider "carvel" {
kapp {
kubeconfig {
from_env = true
}
}
}
Use specific context with environment config:
provider "carvel" {
kapp {
kubeconfig {
from_env = true
context = "prod-ctx"
}
}
}
Authenticate with username and password:
provider "carvel" {
kapp {
kubeconfig {
server = "https://..."
ca_cert = <<EOF
-----BEGIN CERTIFICATE-----
MIIDCzCCAfOgAwIBAgIQAkwp/felW4+kYeaI0LwmezANBgkqhkiG9w0BAQsFADAv
...
NPB7dNDuLFmCvKX9Anhr
-----END CERTIFICATE-----
EOF
username = "admin"
password = "supersecret..."
}
}
}
Authenticate with client certificate:
provider "carvel" {
kapp {
kubeconfig {
server = "https://..."
ca_cert = <<EOF
-----BEGIN CERTIFICATE-----
MIIDCzCCAfOgAwIBAgIQAkwp/felW4+kYeaI0LwmezANBgkqhkiG9w0BAQsFADAv
...
NPB7dNDuLFmCvKX9Anhr
-----END CERTIFICATE-----
EOF
client_cert = "-----BEGIN CERTIFICATE-----\n..."
client_key = "-----BEGIN PRIVATE KEY-----\n..."
}
}
}
Authenticate with token:
provider "carvel" {
kapp {
kubeconfig {
server = "https://..."
ca_cert = <<EOF
-----BEGIN CERTIFICATE-----
MIIDCzCCAfOgAwIBAgIQAkwp/felW4+kYeaI0LwmezANBgkqhkiG9w0BAQsFADAv
...
NPB7dNDuLFmCvKX9Anhr
-----END CERTIFICATE-----
EOF
token = "IBAgIQAkwp..."
}
}
}