- Manages a kubernetes cluster using kops
From here
From here
- Create a custom role from IAM and Admin section.
- The role should have the following permissions
- Create a GCP
service account
. - Assign the above role to the service account.
- Download the json formatted service account key and use it to run
cdktf
scripts. - It is recommended to rename the downloaded json file and rename it to something understable.
- All of the
cdktf
scripts can pick up the service account file by passing it through[-c|--credentials]
command line option.
The scripts are kept in the src/deploy
folder of this repository. The two commands
yarn synth
and yarn deploy
will be used to run those scripts.
yarn synth -a "tsx src/main.ts --pi <google cloud project id>
yarn deploy vm-instance k0s-cluster -a `tsx src/main.ts --pi <google cloud project id>
The deploy
command do run synth
, however it is easier to verify the command
by the synth
separately.