kind-fireman-33438
11/18/2023, 9:25 PM~ nodeConfig: {
~ oauthScopes: [
- [0]: "<https://www.googleapis.com/auth/monitoring>"
- [1]: "<https://www.googleapis.com/auth/logging.write>"
]
}
2. I’m trying to generate a kubeconfig and use that to create a provider for my gke cluster however every time I get an error for line 5 in the yaml.
error: rpc error: code = Unknown desc = failed to parse kubeconfig: yaml: line 5: found character that cannot start any token
Code is like this:
func generateKubeconfig(clusterEndpoint pulumi.StringOutput, clusterName pulumi.StringOutput,
clusterMasterAuth container.ClusterMasterAuthOutput) pulumi.StringOutput {
context := pulumi.Sprintf("dimo_%s", clusterName)
clusterCaCertificate := clusterMasterAuth.ClusterCaCertificate().Elem()
fmt.Printf("(gen config) clusterCaCertificate: %v", clusterCaCertificate)
fmt.Printf("(gen config) clusterEndpoint: %v", clusterEndpoint)
return pulumi.Sprintf(`apiVersion: v1
clusters:
- cluster:
certificate-authority-data: %v
server: <https://%v>
name: %s
contexts:
- context:
cluster: %s
user: %s
name: %s
current-context: %s
kind: Config
preferences: {}
users:
- name: %s
user:
exec:
apiVersion: <http://client.authentication.k8s.io/v1beta1|client.authentication.k8s.io/v1beta1>
command: gke-gcloud-auth-plugin
installHint: Install gke-gcloud-auth-plugin for use with kubectl by following
<https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke>
provideClusterInfo: true
`, clusterCaCertificate, clusterEndpoint, context, context, context, context, context, context)
}
You can see the full context here: https://github.com/phutchins/dimo-node/blob/main/infrastructure/k8s_provider_gke.goKubeConfig: {0x1400004a380}(pall) Args[0]: dimo-dev-401815-e2c3d0d(pall) Args[1]: 35.192.120.34
"plaintext": "\"\\napiVersion: v1\\nclusters:\\n- cluster:\\n\\tcertificate-authority-data:
rhythmic-accountant-71070
11/19/2023, 7:48 AMname
field does not belong to server section.kind-fireman-33438
11/19/2023, 2:28 PMpulumi stack export --show-secrets
has been really helpful to see the output of the compiled kubeconfig. Just can’t figure out how to get rid of the tabs! Or if thats even the actual problem…
Is there anything in Pulumi that adds those tab characters? Or anything in Pulumi that removes them before using the YAML with kubectl?salmon-account-74572
11/27/2023, 4:40 PM\t
character was in the Kubeconfig, which in turn was used to create an explicit provider, is that right?