Here, we will go through the steps of configuring our k8s environment, playing around with the necessary commands and such, then distributing some manifests to our cluster.
- install local dependencies
- cloud setup
- enable k8s engine
- create service account
- git and configure
- test cluster connectivity
You need kubectl (cube-control) to manage and operate your k8s cluster from a local machine.
- Mac
brew install kubernetes-cli
You will need helm too
- Mac
brew install kubernetes-helm
You should have gcloud on your system as well. This way you can manipulate gcp from the local cli.
brew cask install google-cloud-sdk
- Navigate to K8s Engine in GCP Console
- Enable the K8s API
- Navigate to the IAM section
- Navigate to Service Accounts
- Create a new service account
- Give it admin credentials
- Generate a .json key_file
- Store the .json key_file locally somewhere you can access later
- clone the repo
- if you don't have terraform, please download it or build it from source
- change into the k8s dir
cd k8s
- read the comments and make the necessary changes
- initialize
terraform init
- plan
terraform plan
- apply
terraform apply
- if you need references:
Assuming all went well and we all have k8s clusters on GCP, we should be able to navigate to our cluster from the k8s engine tab from the GCP console. Click on the connect button and copy/paste the gcloud command into your local terminal. Now run
kubectl get nodes
... I bet you see your cluster. If you don't, just let me know.
If all is well then we can move on to the k8sWithIstio directory and dig into the tool.