Build HLF k8s on GCP with skaffold
2 min readMar 30, 2021
Install GCP SDK
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-333.0.0-linux-x86_64.tar.gzunzip
./google-cloud-sdk/install.sh
gcloud initgcloud components updatei@DESKTOP-GJNS5EN:~$ gcloud config list
[compute]
region = asia-east2
zone = asia-east2-c
[core]
account = xxxxxxxxx
disable_usage_reporting = False
project = avid-phoenix-266706
[proxy]
address = 127.0.0.1
port = 8123
type = httpYour active configuration is: [default]
config git and pull hlf-k8s from source
git config --global user.name xxx
git config --global user.email xxx@gmail.com
git clone https://github.com/SubstraFoundation/hlf-k8s.git
install helm
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3chmod 700 get_helm.sh
./get_helm.shhelm repo add owkin https://owkin.github.io/chartsi@DESKTOP-GJNS5EN:~$ helm repo list
NAME URL
stable https://charts.helm.sh/stable
owkin https://owkin.github.io/charts
install skaffold
gcloud components install skaffold
skaffold config set default-repo docker.io/interbeing/
docker logini@DESKTOP-GJNS5EN:~$ skaffold config list
skaffold config:
kube-context: gke_avid-phoenix-266706_asia-east2-c_cluster-name
default-repo: docker.io/interbeing
insecure-registries:
- docker.ioskaffold runi@DESKTOP-GJNS5EN:~$ gcloud compute instances list | grep gke
gke-cluster-name-default-pool-1903636a-0ntq asia-east2-c e2-medium 10.170.0.3 x.x.x.x RUNNINGi@DESKTOP-GJNS5EN:~$ kubectl get node -A
NAME STATUS ROLES AGE VERSION
gke-cluster-name-default-pool-1903636a-0ntq Ready <none> 159m v1.18.15-gke.1501i@DESKTOP-GJNS5EN:~$ gcloud container clusters list
NAME LOCATION MASTER_VERSION MASTER_IP MACHINE_TYPE NODE_VERSION NUM_NODES STATUS
cluster-name asia-east2-c 1.18.15-gke.1501 x.x.x.x e2-medium 1.18.15-gke.1501 1 RUNNING
i@DESKTOP-GJNS5EN:~$ gcloud container clusters resize cluster-name --num-nodes=0
Pool [default-pool] for [cluster-name] will be resized to 0.Do you want to continue (Y/n)? yResizing cluster-name...done.
Updated [https://container.googleapis.com/v1/projects/avid-phoenix-266706/zones/asia-east2-c/clusters/cluster-name].