- Kubectl
- The cli that will be used to work with any of the K8s clusters
- Gcloud sdk
- The cli that will be used to work with Google Cloud in order to provision and delete resources
- Helm
- Allows us to automate and better control our kubernetes resources. Helms allows you to define a custom application as a resource and it will manage all the subcomponents for you.
Deployment and configuration is done via Helm.
The reason for the decoupled configuration/charts is to have better control over each component.
The full stack chart for Loki + Grafana + Prometheus + Promtail is really restricted in terms of configurations, like importing custom dashboards during provisioning.
cAdvisor is used to expose some additional metrics for container resource usage.
./cluster.sh <cluster-name> <project-name> - To build,delete or get credentials for your cluster
- cluster-name - Name you want to give to the new GKE cluster
- project-name - Name of the google project you wish to assign the GKE cluster
Example:
./cluster.sh test-cluster-demo automation-test-demo
Options : build / delete / creds
build - builds your cluster with predefined settings
delete - deletes your cluster
creds - configures your kubectl config in order to use the cluster
Once you you have finished building your cluster and gotten your credntials using the ./cluster.sh script.
Simply run ./deploy.sh in order to deploy all the components
Two things are needed to access grafana:
- Credentials
Username is
adminPassword: In order to get the password runkubectl get secret --namespace default grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echoin the terminal - This basic setup and configuration does not have an ingress so in order to access it from your machine you would have to expose the service:
kubectl port-forward svc/grafana 8000:80Once you have the port-forwarding in place you can navigate tohttp://localhost:8000and login
./cluster.sh test-cluster-demo automation-test-demo- selectbuild, wait for it to complete./cluster.sh test-cluster-demo automation-test-demo- selectcreds, wait for it to complete./deploy.sh- To build your resourceskubectl get secret --namespace default grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo- to get login credentialskubectl port-forward svc/grafana 8000:80- To expose the service Note: If you are unable to expose the service due to pod being in a Pending state, please wait a few minutes and retry.http://localhost:8000