straight-arm-50771
10/06/2022, 5:23 PMauth:
Fn::Invoke:
Function: command:local:run
Arguments:
command: USE_GKE_GCLOUD_AUTH_PLUGIN=True gcloud container clusters get-credentials ${cluster.id} --region us-east4 --project ${pulumi.stack}
options:
parent: ${cluster}
Tried shoe-horning it into a resource def, but I don't have a type
. All of the examples show this sort of thing in the variables:
section, which wouldn't work between resources that both create the k8s cluster, and those that write to it.
I'm familiar with command:local:Command
, but I need it to run every timesalmon-account-74572
10/06/2022, 8:56 PMstraight-arm-50771
10/06/2022, 8:58 PMsalmon-account-74572
10/06/2022, 9:03 PMclusterKubeconfig: |
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: ${gke-cluster.masterAuth["clusterCaCertificate"]}
server: https://${gke-cluster.endpoint}
name: ${gke-cluster.name}
contexts:
- context:
cluster: ${gke-cluster.name}
user: ${gke-cluster.name}
name: ${gke-cluster.name}
current-context: ${gke-cluster.name}
kind: Config
preferences: {}
users:
- name: ${gke-cluster.name}
user:
exec:
apiVersion: <http://client.authentication.k8s.io/v1beta1|client.authentication.k8s.io/v1beta1>
command: gke-gcloud-auth-plugin
provideClusterInfo: true
Here, gke-cluster
is the name of the cluster created earlier in the YAML program. This seems to work reasonably well, although I don’t know if it would address your particular use case.straight-arm-50771
10/06/2022, 9:08 PMsalmon-account-74572
10/06/2022, 9:13 PMdependsOn
. Is that what you’re trying to achieve?straight-arm-50771
10/06/2022, 9:17 PMsalmon-account-74572
10/06/2022, 9:21 PMechoing-dinner-19531
10/07/2022, 4:30 PM# {otherResource.id}
to the end of the command string might work (I forget if command.Run is shell based or exec based)