A script to bootstrap the Google Kubernetes Engine (GKE) using terraform and Knative.
- Shell 69.6%
- HCL 30.4%
| .gitignore | ||
| .terraform.lock.hcl | ||
| bootstrap-gke.sh | ||
| gke.tf | ||
| kubectl-proxy.pid | ||
| kubernetes-dashboard-admin.rbac.yaml | ||
| LICENSE.md | ||
| outputs.tf | ||
| README.md | ||
| terraform.tfvars | ||
| versions.tf | ||
| vpc.tf | ||
BootStrap GKE Cluster
This is a simple script to bootstrap a GKE cluster with a few basic components.
Prerequisites
Install gcloud
curl https://sdk.cloud.google.com | bash
Access GKE Cluster
exec -l $SHELL
Initialize gcloud
gcloud init
Install kubectl
gcloud components install kubectl
Install helm
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
Install knative client
Linux AMD64
Clone the release
curl -L https://github.com/knative/client/releases/download/knative-v1.1.0/kn-linux-amd64
Rename to "kn" and move to /usr/local/bin
sudo mv kn-linux-amd64 /usr/local/bin/kn
Make the file executable
sudo chmod +x /usr/local/bin/kn
Add 'kn' to your PATH
echo 'export PATH=$PATH:/usr/local/bin/kn' >> ~/.bashrc
Test KN Installation
echo "Test kn installation"
kn version
Install terraform
Clone the release
wget https://releases.hashicorp.com/terraform/0.14.5/terraform_0.14.5_linux_amd64.zip
Unzip the package
unzip terraform_0.14.5_linux_amd64.zip
Move terraform to /usr/local/bin
sudo mv terraform /usr/local/bin/
Add terraform to your PATH
echo 'export PATH=$PATH:/usr/local/bin/terraform' >> ~/.bashrc
Test terraform installation
echo "Test terraform installation"
terraform version
Install Flux CLI
Linux AMD64
Clone the release
brew install fluxcd/tap/flux
Add flux to your PATH
echo 'export PATH=$PATH:/usr/local/bin/flux' >> ~/.bashrc
Export Github Credentials
export GITHUB_TOKEN=<your github token>
export GITHUB_USER=<your github username>
Usage
- Clone this repo
- Make bootstrap.sh executable
chmod +x bootstrap.sh - Run bootstrap.sh
./bootstrap.sh - Follow the prompts
What does it do?
- Creates a GKE cluster
- Installs Knative Serving
- Installs Knative Eventing
- Installs Flux (Not yet implemented)
What does it not do?
- This project does not create a git repo for you. You will need to create a git repo and add the flux manifests to it.
- This project does not create a docker registry for you. You will need to create a docker registry and add the container urls to the flux manifests.
Resources
Contributing
- Fork this repo
- Create a branch for your feature
- Commit your changes
- Push to your branch
- Create a pull request
License
APGL-3.0 © RDS Ventures LLC
This license is based on the GNU Affero General Public License and is intended to protect the source code of the project and any derivative works. It is not intended to protect the data of the project. If you are using this project to store data, you should consider using a different license. Read the License for more information.
Acknowledgements
Adopted from Learn Terraform - Provision a GKE Cluster and Knative Install