Add the skia-switchboard cluster.
Bug: skia:12063
Change-Id: I54286cee058aeba076aa0a9e1fd75682f6ff7d14
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/417004
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
diff --git a/kube/README.md b/kube/README.md
index 5c5cc9a..ee69a93 100644
--- a/kube/README.md
+++ b/kube/README.md
@@ -1,8 +1,7 @@
# Kubernetes config and applications
Scripts, YAML files, and utility apps to run our kubernetes cluster(s). Each
-cluster will have its own subdirectory that matches the name of the GCE
-project.
+cluster will have its own subdirectory that matches the name of the GCE project.
## Ingress
@@ -33,13 +32,15 @@
The k8s YAML files are checked into https://skia.googlesource.com/k8s-config/,
with one sub-directory for each cluster.
+See http://go/corp-ssh-helper for details on setting up SSH.
+
When you run pushk it will update the images for all the clusters and then run
`kubectl apply` for each file and for each cluster.
## Standing up a new cluster in a different project
- 1. Add a new `__skia_NNN` function to `clusters.sh`.
- 2. Create the `config-NNN.sh` file.
- 3. Copy and modify the `create-cluster-corp.sh` script.
- 4. Add a node pool if necessary using the web UI.
- 5. Update `kube/clusters/config.json` with info on the new cluster.
+1. Add a new `__skia_NNN` function to `clusters.sh`.
+2. Create the `config-NNN.sh` file.
+3. Copy and modify the `create-cluster-corp.sh` script.
+4. Add a node pool if necessary using the web UI.
+5. Update `kube/clusters/config.json` with info on the new cluster.
diff --git a/kube/clusters.sh b/kube/clusters.sh
index 7ff629b..2f10dda 100644
--- a/kube/clusters.sh
+++ b/kube/clusters.sh
@@ -11,3 +11,8 @@
gcloud config set project google.com:skia-corp > /dev/null 2>&1
gcloud container clusters get-credentials skia-corp --zone us-central1-a --project google.com:skia-corp > /dev/null 2>&1
}
+
+function __skia_switchboard() {
+ gcloud config set project skia-switchboard > /dev/null 2>&1
+ gcloud container clusters get-credentials skia-switchboard --zone us-central1-c --project skia-switchboard > /dev/null 2>&1
+}
diff --git a/kube/clusters/config.json b/kube/clusters/config.json
index 218bf07..4caf53f 100644
--- a/kube/clusters/config.json
+++ b/kube/clusters/config.json
@@ -14,6 +14,12 @@
"project": "google.com:skia-corp",
"context_name": "gke_google.com:skia-corp_us-central1-a_skia-corp"
},
+ "skia-switchboard": {
+ "type": "gke",
+ "zone": "us-central1-c",
+ "project": "skia-switchboard",
+ "context_name": "gke_skia-switchboard_us-central1_skia-switchboard"
+ },
"skolo-rack4": {
"type": "k3s",
"context_name": "skolo-rack4",
diff --git a/kube/switchboard-config.sh b/kube/switchboard-config.sh
new file mode 100644
index 0000000..4680310
--- /dev/null
+++ b/kube/switchboard-config.sh
@@ -0,0 +1,21 @@
+DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+source "${DIR}/clusters.sh"
+# Common config values used by all create-* scripts.
+
+# Your Project ID
+PROJECT_ID=skia-switchboard
+
+# The Project ID rewritten as GCE does when putting in an email address.
+PROJECT_SUBDOMAIN=skia-switchboard
+
+# Your Zone. E.g. us-west1-c
+ZONE=us-central1-c
+
+# Name for your cluster we will create or modify. E.g. example-secure-cluster
+CLUSTER_NAME=skia-switchboard
+
+# The ID of the security account used by kubernetes.
+SA_NAME=${CLUSTER_NAME}-k8s
+
+# Switch gcloud and kubectl to the skia-corp project/cluster.
+__skia_switchboard