sparse-intern-71089
06/04/2020, 1:20 AMcreamy-potato-29402
06/04/2020, 1:23 AMabundant-airplane-93796
06/04/2020, 2:05 AMpulumi preview
with a -r
flagabundant-airplane-93796
06/04/2020, 2:05 AMwarning: configured Kubernetes cluster is unreachable: unable to load schema information from the API server: the server has asked for the client to provide credentials
messagesabundant-airplane-93796
06/04/2020, 2:05 AMabundant-airplane-93796
06/04/2020, 2:07 AMpulumi up -r
has the same errorscreamy-potato-29402
06/04/2020, 2:31 AMpreview
doesn’t consult the cluster, preview -r
does. does normal pulumi up
work?abundant-airplane-93796
06/04/2020, 3:13 AMcreamy-potato-29402
06/04/2020, 3:30 AMcreamy-potato-29402
06/04/2020, 3:31 AMabundant-airplane-93796
06/04/2020, 12:54 PMabundant-airplane-93796
06/04/2020, 12:55 PMexport function GenerateK8sProvider(name: string, cluster: gcp.container.Cluster): k8s.Provider {
// prettier-ignore
const kubeconfig = pulumi.
all([ cluster.name, cluster.endpoint, cluster.masterAuth ]).
apply(([ name, endpoint, masterAuth ]) => {
const context = `${gcp.config.project}_${gcp.config.zone}_${name}`;
return `apiVersion: v1
clusters:
- cluster:
certificate-authority-data: ${masterAuth.clusterCaCertificate}
server: https://${endpoint}
name: ${context}
contexts:
- context:
cluster: ${context}
user: ${context}
name: ${context}
current-context: ${context}
kind: Config
preferences: {}
users:
- name: ${context}
user:
auth-provider:
config:
cmd-args: config config-helper --format=json
cmd-path: gcloud
expiry-key: '{.credential.token_expiry}'
token-key: '{.credential.access_token}'
name: gcp
`;
});
return new k8s.Provider(name, { kubeconfig: kubeconfig });
}