This repository is an example how to use autopilot in GKE. If you want yo read more about it:
GKE Autopilot is a mode of operation in GKE in which Google manages your cluster configuration, including your nodes, scaling, security, and other preconfigured settings. Autopilot clusters are optimized to run most production workloads, and provision compute resources based on your Kubernetes manifests. The streamlined configuration follows GKE best practices and recommendations for cluster and workload setup, scalability, and security. For a list of built-in settings, refer to the Autopilot and Standard comparison table.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project.
- git
- terraform
- kubectl
- kubectx
- gcloud
To deloy this project you will need a Google Cloud account, create here.
This tutorial uses the following billable components of Google Cloud:
To generate a cost estimate based on your projected usage, use the pricing calculator.
When you finish this tutorial, you can avoid continued billing by deleting the resources you created. For more information, see Clean up.
First of all you need to clone this repository:
git clone https://github.com/claick-oliveira/gke-autopilot
First let's check the architecture that we will create.
#TODO: ## Add the architecture diagram
Now that we know about the architecture and resources, let's create. First we need to connect our shell to the gcloud
:
gcloud auth login
Now that we connected:
cd terraform
terraform apply
This project you need to fill some variables:
- gcp_project_name: The GCP project ID
- gcp_region: The GCP region
- gcp_zone: The GCP availability zone
First we need to connect in our GKE:
gcloud container clusters get-credentials <CLUSTER_NAME> --region <REGION> --project <PROJECT_ID>
To be easy and skaffold use the correct environment, let's configure kubectx
:
Get the name of the environment:
kubectx
Now change the name for staging:
kubectx staging=<YOUR ENVIRONMENT>
#TODO: ## Add an examplekubernetes deployment
To clean the files generated as coverage, builds, env you can use:
cd terraform
terraform destroy
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Claick Oliveira - Initial work - claick-oliveira
See also the list of contributors who participated in this project.
This project is licensed under the GNU General Public License - see the LICENSE file for details