Managing Kubernetes objects on GKE with Terraform

Authentication

provider "kubernetes" {
}
provider "kubernetes" {
config_context_auth_info = "ops"
config_context_cluster = "mycluster"
}
provider "kubernetes" {
host = "https://104.196.242.174"

client_certificate = "${file("~/.kube/client-cert.pem")}"
client_key = "${file("~/.kube/client-key.pem")}"
cluster_ca_certificate = "${file("~/.kube/cluster-ca-cert.pem")}"
}
provider "kubernetes" {
host = "https://104.196.242.174"

username = "username"
password = "password"
}

Managing namespaces on GKE

gcloud beta container clusters get-credentials <cluster_name> --region <region> --project <project_id>
provider "kubernetes" {
version = "1.10"
}
resource "kubernetes_namespace" "app" {
metadata {
labels = {
name = "app"
}
name = "app"
}
}

Conclusion

--

--

--

Brazilian Software Engineer living in London. Java addicted. Clean Code and Software craftsmanship Enthusiast. Cloud. https://www.linkedin.com/in/femrtnz/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

9 Best Project and Resource Scheduling Softwares of 2019

Ok, But… What is Docker?

CS373 Spring 2021: Riddhi Bhave

CS373 Spring 2022 — Week 4 Blog, Joseph Muffoletto

Building a business from scratch — day 9

Most Software Is Never “Done”

5 Strategies to Work With a Dominant Personality

Working with a dominant personality is not fun, but sometimes avoiding them is not an option either. Their authoritative behavior combined with a body language that reeks of dominance can be quite upsetting, more so when it’s your boss or someone who plays a significant role in controlling your success at work. When you can’t avoid or quit, what should you do? Learn to work with them

GURUFIN PROJECT TEAM SERVICES

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Felipe Martinez

Felipe Martinez

Brazilian Software Engineer living in London. Java addicted. Clean Code and Software craftsmanship Enthusiast. Cloud. https://www.linkedin.com/in/femrtnz/

More from Medium

A step-by-step introduction to running your app in Kubernetes.

Integrating Kubernetes Jobs With Azure Pipelines

AKS Resource Monitoring using Prometheus & Grafana

Kubectl Tip #2