sparse-intern-71089
10/09/2021, 3:23 PMclean-easter-25831
10/10/2021, 7:23 PMbroad-parrot-139
10/11/2021, 11:15 AMfast-easter-23401
10/15/2021, 9:09 PMconst certManagerRelease = new k8s.helm.v3.Release(
'cert-manager',
{
chart: "cert-manager",
version: version,
repositoryOpts: {
repo: repoUrl
},
values: { 'installCRDs': true },
namespace: 'cert-manager'
},
{
parent: this,
dependsOn: [cluster],
provider: cluster.provider
}
);
Perhaps you want to make sure that pulumi is fetching the chart correctly, which you can test by setting the parameter {verify: true}
in args.
As for the provider, you can pass it on the opts. I found these docs that are really insightful: https://www.pulumi.com/docs/tutorials/kubernetes/gke/
export 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
`;
});
// Create a Kubernetes provider instance that uses our cluster from above.
const clusterProvider = new k8s.Provider(name, {
kubeconfig: kubeconfig,
});
This works like a charm on GCP. Basically, what you want to do is to implement a provider factory that you can pass to your Helm.Release resource.
Hope this helps,broad-parrot-139
10/15/2021, 10:15 PM