Skip to content

Latest commit

 

History

History
 
 

mkbuild-cluster

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

MkBuild-Cluster

The mkbuild-cluster program helps create cluster.yaml files that plank accepts via the --build-cluster flag.

This allows prow to run jobs in different clusters than the one where plank runs.

See the getting started guide for general info about how to configure jobs that target these clusters.

Usage

Create a new cluster.yaml to send to plank via --build-cluster:

# Create initial entry
bazel run //prow/cmd/mkbuild-cluster -- \
  --project=P --zone=Z --cluster=C --alias=default > cluster.yaml
# Write secret with this entry
kubectl create secret generic build-cluster --from-file=cluster.yaml

Now update plank to mount this secret in the container and use the --build-cluster flag:

spec:
  containers:
  - name: plank
    args:
    - --build-cluster=/etc/cluster/cluster.yaml
    volumeMounts:
    - mountPath: /etc/cluster
      name: cluster
      readOnly: true
  volumes:
  - name: cluster
    secret:
      defaultMode: 420
      secretName: build-cluster

Note: restart plank to see the --build-cluster flag.

Append additional entries to cluster.yaml:

# Get current values:
kubectl get secrets/build-cluster -o yaml > old.yaml
# Add new value
cat old.yaml | bazel run //prow/cmd/mkbuild-cluster -- \
  --project=P --zone=Z --cluster=C --alias=NEW_CLUSTER \
  > updated.yaml
kubectl apply -f updated.yaml

Note: restart plank to see the updated values.

More options:

# Full list of flags like --account, --print-entry, --get-client-cert, etc.
bazel run //prow/cmd/mkbulid-cluster -- --help