|
| 1 | +# Setup |
| 2 | + |
| 3 | +## Creation of GCVE |
| 4 | + |
| 5 | +```sh |
| 6 | +gcloud auth application-default login |
| 7 | +terraform init |
| 8 | +terraform apply |
| 9 | +``` |
| 10 | + |
| 11 | +## Setup jumphost/vpn for further configuration |
| 12 | + |
| 13 | +See [maintenance-jumphost/README.md](./maintenance-jumphost/README.md). |
| 14 | + |
| 15 | +## Manual creation of a user and other IAM configuration in vSphere |
| 16 | + |
| 17 | +> **Note:** |
| 18 | +> The configuration described here cannot be done via terraform due to non-existing functionality. |
| 19 | +
|
| 20 | +First we generate a password for the user which will be used in prow and set it as environment variable: |
| 21 | + |
| 22 | +```sh |
| 23 | + export GCVE_PROW_CI_PASSWORD="SomePassword" |
| 24 | +``` |
| 25 | + |
| 26 | +And set credentials for `govc`: |
| 27 | + |
| 28 | +```sh |
| 29 | + export GOVC_URL="$(gcloud vmware private-clouds describe k8s-gcp-gcve-pc --location us-central1-a --format='get(vcenter.fqdn)')" |
| 30 | + export GOVC_USERNAME= '[email protected]' |
| 31 | + export GOVC_PASSWORD= "$(gcloud vmware private-clouds vcenter credentials describe --private-cloud=k8s-gcp-gcve-pc [email protected] --location=us-central1-a --format='get(password)')" |
| 32 | +``` |
| 33 | + |
| 34 | +Run the script to setup the user, groups and IAM in vSphere. |
| 35 | + |
| 36 | +``` |
| 37 | +./vsphere/scripts/ensure-users-groups.sh |
| 38 | +``` |
| 39 | + |
| 40 | +Create relevant secrets in Secrets Manager |
| 41 | + |
| 42 | +```sh |
| 43 | +gcloud secrets describe k8s-gcp-gcve-ci-url 2>/dev/null || echo "$GOVC_URL" | gcloud secrets create k8s-gcp-gcve-ci-url --data-file=- |
| 44 | +gcloud secrets describe k8s-gcp-gcve-ci-username 2>/dev/null || echo "[email protected]" | gcloud secrets create k8s-gcp-gcve-ci-username --data-file=- |
| 45 | +gcloud secrets describe k8s-gcp-gcve-ci-password 2>/dev/null || echo "${GCVE_PROW_CI_PASSWORD}" | gcloud secrets create k8s-gcp-gcve-ci-password --data-file=- |
| 46 | +gcloud secrets describe k8s-gcp-gcve-ci-thumbprint 2>/dev/null || echo "$(govc about.cert -json | jq -r '.thumbprintSHA256')" | gcloud secrets create k8s-gcp-gcve-ci-thumbprint --data-file=- |
| 47 | +``` |
| 48 | + |
| 49 | +* `k8s-gcp-gcve-ci-username` with value `[email protected]` |
| 50 | +* `k8s-gcp-gcve-ci-password` with value set above for `GCVE_PROW_CI_PASSWORD` |
| 51 | +* `k8s-gcp-gcve-ci-url` with value set above for `GOVC_URL` |
| 52 | + |
| 53 | +> **Note:** Changing the GCVE CI user's password |
| 54 | +> |
| 55 | +> 1. Set GOVC credentials as above. |
| 56 | +> 2. Run govc command to update password: `govc sso.user.update -p "${GCVE_PROW_CI_PASSWORD}" prow-ci-user` |
| 57 | +> 3. Update secret `k8s-gcp-gcve-ci-password` in secrets-manager: `echo "${GCVE_PROW_CI_PASSWORD}" | gcloud secrets versions add k8s-gcp-gcve-ci-password --data-file=-` |
| 58 | +
|
| 59 | +## Configuration of GCVE |
| 60 | + |
| 61 | +```sh |
| 62 | + |
| 63 | + export TF_VAR_vsphere_password= "$(gcloud vmware private-clouds vcenter credentials describe --private-cloud=k8s-gcp-gcve-pc [email protected] --location=us-central1-a --format='get(password)')" # gcloud command |
| 64 | + export TF_VAR_vsphere_server="$(gcloud vmware private-clouds describe k8s-gcp-gcve-pc --location us-central1-a --format='get(vcenter.fqdn)')" |
| 65 | + export TF_VAR_nsxt_user=admin |
| 66 | + export TF_VAR_nsxt_password="$(gcloud vmware private-clouds nsx credentials describe --private-cloud k8s-gcp-gcve-pc --location us-central1-a --format='get(password)')" |
| 67 | + export TF_VAR_nsxt_server="$(gcloud vmware private-clouds describe k8s-gcp-gcve-pc --location us-central1-a --format='get(nsx.fqdn)')" |
| 68 | +``` |
| 69 | + |
| 70 | +```sh |
| 71 | +cd vsphere |
| 72 | +terraform init |
| 73 | +terraform apply |
| 74 | +``` |
0 commit comments