我正在尝试为 terraform 模块添加 kubectl 提供程序,我遵循Terraform kubectl的文档。我运行terraform init并成功安装了提供程序,但是当我尝试添加示例配置时,例如:(或来自此处的其他人)
resource "kubectl_server_version" "current" {}
Run Code Online (Sandbox Code Playgroud)
并运行terraform plan我得到以下消息:
Error: Could not load plugin
Failed to instantiate provider "registry.terraform.io/hashicorp/kubectl" to
obtain schema: unknown provider "registry.terraform.io/hashicorp/kubectl"
Run Code Online (Sandbox Code Playgroud)
当我调整时terraform init(资源在模块 k8s 中就位)
Error: Failed to install provider
Error while installing hashicorp/kubectl: provider registry
registry.terraform.io does not have a provider named
registry.terraform.io/hashicorp/kubectl
Run Code Online (Sandbox Code Playgroud)
一些输出:
$terraform plugins
??? provider[registry.terraform.io/hashicorp/kubernetes] 1.13.2
??? provider[registry.terraform.io/gavinbunney/kubectl] 1.9.1
??? module.k8s
? ??? provider[registry.terraform.io/hashicorp/kubectl]
? ??? provider[registry.terraform.io/hashicorp/kubernetes]
$terraform …Run Code Online (Sandbox Code Playgroud) 我正在尝试安装一个简单的舵图,我得到:
Internal error occurred: failed calling webhook "mservice.elbv2.k8s.aws": failed to call webhook: the server could not find the requested resource
如何在循环内.Values.someVal从values.yaml文件获取或通过 cli 传递{{ range .Values.smtg\xc2\xa0}}?
例如。
\nspec:\n containers:\n {{ range $k, $v := .Values.smtg }}\n - name: {{ $k }}\n image: {{ printf "%s:%s" (required "no img" $v) (required "no tag" .Values.someVal) | quote }} <<<--- how can I get .Values.someVal from values.yaml or cli? \n {{- end }}\nRun Code Online (Sandbox Code Playgroud)\n如果我尝试让他们在一起,.Values.smtg我会得到:... at <.Values.someVal>: nil pointer evaluating interface {}