github.com/yrj2011/jx-test-infra@v0.0.0-20190529031832-7a2065ee98eb/prow/cmd/mkbuild-cluster/README.md (about) 1 # MkBuild-Cluster 2 3 The `mkbuild-cluster` program helps create `cluster.yaml` files that [plank] accepts via the `--build-cluster` flag. 4 5 This allows prow to run jobs in different clusters than the one where [plank] runs. 6 7 See the [getting started] guide for general info about how to configure jobs that target these clusters. 8 9 ## Usage 10 11 Create a new `cluster.yaml` to send to [plank] via `--build-cluster`: 12 13 ```sh 14 # Create initial entry 15 bazel run //prow/cmd/mkbuild-cluster -- \ 16 --project=P --zone=Z --cluster=C --alias=default > cluster.yaml 17 # Write secret with this entry 18 kubectl create secret generic build-cluster --from-file=cluster.yaml 19 ``` 20 21 Now update plank to mount this secret in the container and use the `--build-cluster` flag: 22 23 ```yaml 24 spec: 25 containers: 26 - name: plank 27 args: 28 - --build-cluster=/etc/cluster/cluster.yaml 29 volumeMounts: 30 - mountPath: /etc/cluster 31 name: cluster 32 readOnly: true 33 volumes: 34 - name: cluster 35 secret: 36 defaultMode: 420 37 secretName: build-cluster 38 ``` 39 Note: restart plank to see the `--build-cluster` flag. 40 41 Append additional entries to `cluster.yaml`: 42 43 ```sh 44 # Get current values: 45 kubectl get secrets/build-cluster -o yaml > old.yaml 46 # Add new value 47 cat old.yaml | bazel run //prow/cmd/mkbuild-cluster -- \ 48 --project=P --zone=Z --cluster=C --alias=NEW_CLUSTER \ 49 > updated.yaml 50 kubectl apply -f updated.yaml 51 ``` 52 53 Note: restart plank to see the updated values. 54 55 ## More options: 56 57 ```sh 58 # Full list of flags like --account, --print-entry, --get-client-cert, etc. 59 bazel run //prow/cmd/mkbulid-cluster -- --help 60 ``` 61 62 63 [getting started]: /prow/getting_started.md 64 [plank]: /prow/cmd/plank