在尝试使用terraform在GKE中的集群上创建复制控制器时,出现以下错误:
kubernetes_replication_controller.k8_pod: Failed to create replication controller: replicationcontrollers is forbidden: User "client" cannot create replicationcontrollers in the namespace "default"
我已配置kubectl
并通过在谷歌kubernetes引擎上创建pod /复制控制器进行了测试。我也尝试使用
gcloud config unset container/use_client_certificate
,如一些资源所示:
Resource 1 Resource 2
资源供应代码示例如下:
resource "kubernetes_replication_controller" "k8_pod" {
metadata {
name = "testing-deployment"
labels {
App = "wassup"
}
}
spec {
selector {
App = "wassup"
}
template {
container {
image = "image/name/here"
name = "testing-deployment"
port {
container_port = 8080
}
}
}
}
}