{"id":15470648,"url":"https://github.com/mborne/gke-playground","last_synced_at":"2026-01-11T02:16:13.128Z","repository":{"id":162839678,"uuid":"621817240","full_name":"mborne/gke-playground","owner":"mborne","description":"[DEV] Expérimentation avec terraform et GKE","archived":false,"fork":false,"pushed_at":"2024-06-06T21:59:36.000Z","size":175,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T23:58:17.200Z","etag":null,"topics":["devops","example","gke","google-cloud","kubernetes","rwx","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mborne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-31T12:59:31.000Z","updated_at":"2024-06-06T21:59:39.000Z","dependencies_parsed_at":"2024-05-28T02:19:43.097Z","dependency_job_id":null,"html_url":"https://github.com/mborne/gke-playground","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mborne%2Fgke-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mborne%2Fgke-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mborne%2Fgke-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mborne%2Fgke-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mborne","download_url":"https://codeload.github.com/mborne/gke-playground/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246379385,"owners_count":20767696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devops","example","gke","google-cloud","kubernetes","rwx","terraform"],"created_at":"2024-10-02T02:06:03.301Z","updated_at":"2026-01-11T02:16:13.122Z","avatar_url":"https://github.com/mborne.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gke-playground\n\nExpérimentation avec Terraform pour création d'un environnement de développement Kubernetes dans Google Cloud :\n\n![docs/schema.drawio.png](docs/schema.drawio.png)\n\n## Mise en garde\n\n* Testé uniquement avec des bac à sable Google Cloud de [acloud.guru](https://learn.acloud.guru/).\n* Le stockage de l'état Terraform n'est pas traité (voir [backend GCS](https://developer.hashicorp.com/terraform/language/settings/backends/gcs))\n* La segmentation réseau (VPC) n'est pas traitée.\n* Les sauvegardes ne sont pas traitées.\n\n## Principe du déploiement\n\nLe déploiement est réalisé en plusieurs étapes :\n\n* [01-gke](01-gke) : Création du cluster Kubernetes et la production d'un fichier `gke-playground/output/kubeconfig.yml`\n* [02-rwx](02-rwx) : Création d'une instance Google FileStore (\"nfs-server\") et de la classe de stockage RWX associée (\"nfs-legacy\")\n* [03-lb](03-lb) : Déploiement de [ingress-nginx-controller](https://github.com/kubernetes/ingress-nginx?tab=readme-ov-file#ingress-nginx-controller) avec une IP réservée (\"lb-address\")\n\n## Pré-requis\n\n* Installer [gcloud](https://cloud.google.com/sdk/docs/install) (`gcloud --help`)\n* Installer [terraform](https://developer.hashicorp.com/terraform/downloads) (`terraform version`)\n* Se connecter sur un compte Google Cloud sur la console : https://console.cloud.google.com/\n* Se connecter avec gcloud :\n\n```bash\ngcloud auth login\ngcloud auth application-default login\n```\n\n## Déployer l'environnement de développement\n\nVoir script [install.sh](install.sh) qui assure :\n\n* Le contrôle de la variable d'environnement `PROJECT_ID`\n* Le contrôle de l'accès au projet Google Cloud correspondant\n* L'activation des services Google Cloud utilisés\n* L'appel de `terraform apply -auto-approve` sur chacun des dossiers\n\nA l'usage :\n\n```bash\n# Pour install.sh :\nexport PROJECT_ID=playground-s-11-946429c5\n# Pour utilisation direct de terraform :\nexport TF_VAR_project_id=$PROJECT_ID\n\n# Création de l'infrastructure avec terraform\nbash install.sh\n```\n\nRemarques :\n\n* Les paramètres disponibles au niveau des modules terraform sont définis dans le fichiers \"variables.tf\"\n* Noter que `PROJECT_ID` est traduite en `TF_VAR_project_id` et que ce principe peut être utilisé pour d'autres variables (voir [developer.hashicorp.com - Terraform - Input Variables](https://developer.hashicorp.com/terraform/language/values/variables))\n\n## Accès au cluster Kubernetes\n\n### Avec kubeconfig généré par Terraform\n\n```bash\nexport KUBECONFIG=$PWD/output/kubeconfig.yaml\n\n# Pour tester le fonctionnement :\nkubectl cluster-info\nkubectl get nodes\nkubectl get namespaces\n```\n\n### Avec une utilisation classique de Google Cloud\n\n```bash\ngcloud config set project $PROJECT_ID\n\ngcloud container clusters list\ngcloud compute addresses list\n\n# Pour configurer kubectl (~/.kube/config)\nZONE=$(gcloud container clusters describe primary --format=\"value(location)\")\ngcloud container clusters get-credentials primary --zone=$ZONE\n\n# Pour tester le fonctionnement :\nkubectl cluster-info\nkubectl get nodes\nkubectl get namespaces\n```\n\n\n## Utilisation avec docker-devbox\n\nPar exemple :\n\n```bash\nexport KUBECONFIG=$PWD/output/kubeconfig.yaml\n\n# Pour https://whoami.gke.quadtreeworld.net\nexport DEVBOX_HOSTNAME=gke.quadtreeworld.net\nexport DEVBOX_ISSUER=letsencrypt-http\nexport DEVBOX_INGRESS=nginx\n\ngit clone https://github.com/mborne/docker-devbox\n\n# déploiement de cert-manager\nbash docker-devbox/cert-manager/k8s-install.sh\nbash docker-devbox/cert-manager/cluster-issuer/letsencrypt-http.sh \u003cCONTACT_EMAIL\u003e\n\n# déploiement de whoami\nbash docker-devbox/whoami/k8s-install.sh\n```\n\n## License\n\n[MIT](LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmborne%2Fgke-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmborne%2Fgke-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmborne%2Fgke-playground/lists"}