Skip to content

Commit

Permalink
add documentation for terraform overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech committed Apr 7, 2022
1 parent 045d112 commit cc106d8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
30 changes: 30 additions & 0 deletions docs/source/installation/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,36 @@ jupyterhub:
users: true
```

## Terraform Overrides

The QHub configuration file provides a huge number of configuration options for customizing your
QHub Infrastructure, while these options are sufficient for an average user, but aren't
exhaustive by any means. There are still a plenty of things you might want to achieve which
cannot be configured directly by the above mentioned options, hence we have introduced a
new option called terraform overrides (`terraform_overrides`), which lets you override
the values of terraform variables in specific modules/resource. This is a relatively
advance feature and must be used with utmost care and you should really know, what
you're doing.

Here we describe the overrides supported via QHub config file:

### Ingress

You can configure the IP of the load balancer and add annotations for the same via `ingress`'s
terraform overrides, one such example for GCP is:


```yaml
ingress:
terraform_overrides:
load_balancer_annotations:
"networking.gke.io/load-balancer-type": "Internal"
"networking.gke.io/internal-load-balancer-subnet": "pre-existing-subnet"
load_balancer_ip: "1.2.3.4"
```

This is quite useful for pinning the IP Address of the load balancer.

# Full configuration example

```yaml
Expand Down
2 changes: 1 addition & 1 deletion qhub/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ class Main(Base):
prevent_deploy: bool = (
False # Optional, but will be given default value if not present
)
ingress: Ingress
ingress: typing.Optional[Ingress]

# If the qhub_version in the schema is old
# we must tell the user to first run qhub upgrade
Expand Down
4 changes: 3 additions & 1 deletion qhub/stages/input_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ def stage_04_kubernetes_ingress(stage_outputs, config):
"acme-email": config["certificate"].get("acme_email"),
"acme-server": config["certificate"].get("acme_server"),
"certificate-secret-name": config["certificate"]["secret_name"],
"load-balancer-annotations": config["ingress"]["terraform_overrides"]["load_balancer_annotations"],
"load-balancer-annotations": config["ingress"]["terraform_overrides"][
"load_balancer_annotations"
],
"load-balancer-ip": config["ingress"]["terraform_overrides"]["load-balancer-ip"]
if config["certificate"]["type"] == "existing"
else None,
Expand Down

0 comments on commit cc106d8

Please sign in to comment.