mirror of
https://github.com/jcwimer/multi-cloud-kubernetes
synced 2026-03-25 01:44:43 +00:00
2dff05ed7dc8f3c66d15b5dc15d78b191e4a46e1
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.3.1 to 5.4. - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES) - [Commits](https://github.com/yaml/pyyaml/compare/5.3.1...5.4) Signed-off-by: dependabot[bot] <support@github.com>
multi-cloud-kubernetes
This is example code for how I deploy a cross cloud Kubernetes cluster to my home openstack, ramnode openstack, and digital ocean.
Run
Set ENVS on test.env
- DIGITALOCEAN_ACCESS_TOKEN - api token to interact with Digital Ocean. Used by
terraform-code/digitalocean.tf - RAMNODE_USERNAME - ramnode openstack username. Used by
terraform-code/ramnode.tf - RAMNODE_PASSWORD - ramnode openstack password. Used by
terraform-code/ramnode.tf - HOME_USERNAME - home openstack username. Used by
terraform-code/home.tf - HOME_PASSWORD - home openstack password. Used by
terraform-code/home.tf - ZEROTIER_NETWORK - zerotier network id. Used by
terraform-code/user-data.sh - CLOUDFLARE_API - cloudflare api token. Used by
ansible/roles/kubernetes/templates/cloudflare-updater.yamlto be passed to the cloudflare updater pod. - LONGHORN_USERNAME - any username you want to use for basic auth http for longhorn. Used by
ansible/roles/longhorn/templates/longhorn-ingress.yaml. Basic auth created bybin/longhorn-basic-auth.sh - LONGHORN_PASSWORD - any password you want to use for basic auth http for longhorn. Used by
ansible/roles/longhorn/templates/longhorn-ingress.yaml. Basic auth created bybin/longhorn-basic-auth.sh
Then run source test.env
NOTES
- My personal domain (codywimer.com) is hard coded throughout this project. If replicating, you'll have to change this.
- My home openstack cloud and ramnodes openstack envs are hard coded in
terraform-code/home.tfandterraform-code/ramnode.tf
Deploy
make deploy
This will take your ENV's, pass them to terraform and ansible (see bin/deploy.sh) and do the following:
- Install terraform in this repo
- Run terraform to deploy cloud resources. Instances will be pre-configured via
terraform-code/user-data.shand use a Debian 10 cloud image. - Terraform will ouput an ansible inventory to
hosts.cfg - Ansible will be run to deploy Kubernetes via RKE. It will create the
rkedirectory where you will findrke/kube_config_rke-k8s.yamlto runkubectlcommands after Kubernetes is deployed.
Deploy Notes
- The
rkedirectory contains your kube config file as stated above, a state file rke uses when configuring,rke/rke-k8s.yamlwhich is the rke cluster config,rke/authwhich is the Kubernetes secret for http basic auth for Longhorn, therke/configsdirectory which has default resources deployed into Kubernetes, and therke/lonhorndirectory which has the Longhorn configs. - The Terraform state file is located at
terraform-code/terraform.tfstate
Destroy
make destroy
Description
Languages
HCL
57.1%
Shell
41.5%
Makefile
1.4%