Skip to content

Commit

Permalink
Add infrastructure/*
Browse files Browse the repository at this point in the history
The infrastructure directory contains all what's needed (except secrets)
to deploy kubernetes-core and zuul-ci on top of it.

The deployment steps are documented in the README.md file.

Co-Authored-By: Jadon Naas <[email protected]>
Co-Authored-By: Peter Sabaini <[email protected]>
  • Loading branch information
3 people committed Sep 5, 2024
1 parent 8451f17 commit 680e041
Show file tree
Hide file tree
Showing 10 changed files with 1,601 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.tox
.stestr/
__pycache__/
infrastructure/secrets/*
infrastructure/terraform.tfstate*
infrastructure/.terraform
infrastructure/.terraform.lock.hcl
49 changes: 49 additions & 0 deletions infrastructure/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Deploy Zuul CI, MariaDB, and Apache Zookeeper

This repo contains a [Terraform](https://www.terraform.io) plan and
configuration files you can use to deploy [Zuul CI](zuul-ci.org/) 9.1 and its
dependencies - [MariaDB](https://mariadb.com) and [Apache
Zookeeper](https://zookeeper.apache.org/) - to
[Kubernetes](https://kubernetes.io) using [the Kubernetes Terraform
provider](https://registry.terraform.io/providers/hashicorp/kubernetes/latest).


## Deployment


1. Deploy a Kubernetes cluster on top of a OpenStack cloud.

``` bash
juju deploy ./kubernetes-core/bundle.yaml
```

2. Get the kubeconfig file

``` bash
juju run-action \
--format json \
--wait \
kubernetes-control-plane/leader get-kubeconfig \
| jq -r '.[]|.results.kubeconfig' > kubeconfig

```

3. Run the terraform plan
``` bash
terraform init
terraform apply
```

## Variables

The terraform plan offers the following variables to be overridden:

| Name | Default Value | Description |
|--------------------|----------------------------|-------------------------------------------------|
| kubeconfig | ~/.kube/config | Path to kubectl configuration file |
| storage_class_name | csi-cinder-default | Storage class name to use when creating volumes |
| docker-username | | Dockerhub username |
| docker-password | | Dockerhub password (or token) |
| docker-server | https://index.docker.io/v1 | Dockerhub server |
| docker-email | | Dockerhub email |
| ingress_class_name | nginx-ingress-controller | Ingress class name |
1 change: 1 addition & 0 deletions infrastructure/dockerconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"auths":{"${docker-server}":{"username":"${docker-username}","password":"${docker-password}","email":"${docker-email}","auth":"${auth}"}}}
Loading

0 comments on commit 680e041

Please sign in to comment.