Resource Type: kubectl_apply
Overview
Example:
To encode the bootstrap token “tokenid.tokensecret” into a Kubernetes secret;
$tokenid = 'tokenid'
$tokensecret = 'tokensecret'
kubectl_apply { "bootstrap-token-${tokenid}":
namespace => 'kube-system',
kubeconfig => '/root/.kube/config',
api_version => 'v1,
kind => 'Secret',
content => {
type => 'bootstrap.kubernetes.io/token',
data => {
'token-id' => Binary.new($tokenid, '%s'),
'token-secret' => Binary.new($tokensecret, '%s'),
'usage-bootstrap-authentication' => 'true',
},
},
}