Skip to content

Commit

Permalink
Add proxy configuration documentation for CAPX (nutanix-cloud-native#33)
Browse files Browse the repository at this point in the history
* Add proxy configuration documentation for CAPX

* Update proxy.md

---------

Co-authored-by: Andy Daniel <andy.daniel@nutanix.com>
  • Loading branch information
yannickstruyf3 and vnephologist authored Mar 14, 2023
1 parent e81ddda commit e76f143
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
62 changes: 62 additions & 0 deletions docs/capx/v1.1.x/experimental/proxy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Proxy configuration

!!! warning
The scenario and features described on this page are experimental and should not be deployed in production environments.

CAPX can be configured to use a proxy to connect to external networks. This proxy configuration needs to be applied to control plane and worker nodes.

Follow the steps below to configure a CAPX cluster to use a proxy.

## Steps
1. Generate a `cluster.yaml` file with the required CAPX cluster configuration. Refer to the [Getting Started](../getting_started.md){target=_blank} page for more information on how to generate a `cluster.yaml` file. Do not apply the `cluster.yaml` file.
2. Edit the `cluster.yaml` file and modify the following resources as shown in the [example](#example) below to add the proxy configuration.
1. `KubeadmControlPlane`:
* Add the proxy configuration to the `spec.kubeadmConfigSpec.files` list. Do not modify other items in the list.
* Add `systemctl` commands to apply the proxy config in `spec.kubeadmConfigSpec.preKubeadmCommands`. Do not modify other items in the list.
2. `KubeadmConfigTemplate`:
* Add the proxy configuration to the `spec.template.spec.files` list. Do not modify other items in the list.
* Add `systemctl` commands to apply the proxy config in `spec.template.spec.preKubeadmCommands`. Do not modify other items in the list.
4. Apply the `cluster.yaml` file

## Example

```YAML
---
# controlplane proxy settings
kind: KubeadmControlPlane
spec:
kubeadmConfigSpec:
files:
- content: |
[Service]
Environment="HTTP_PROXY=<my-http-proxy-configuration>"
Environment="HTTPS_PROXY=<my-https-proxy-configuration>"
Environment="NO_PROXY=<my-no-proxy-configuration>"
owner: root:root
path: /etc/systemd/system/containerd.service.d/http-proxy.conf
...
preKubeadmCommands:
- sudo systemctl daemon-reload
- sudo systemctl restart containerd
...
---
# worker proxy settings
kind: KubeadmConfigTemplate
spec:
template:
spec:
files:
- content: |
[Service]
Environment="HTTP_PROXY=<my-http-proxy-configuration>"
Environment="HTTPS_PROXY=<my-https-proxy-configuration>"
Environment="NO_PROXY=<my-no-proxy-configuration>"
owner: root:root
path: /etc/systemd/system/containerd.service.d/http-proxy.conf
...
preKubeadmCommands:
- sudo systemctl daemon-reload
- sudo systemctl restart containerd
...
```

1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ nav:
- "Autoscaler": "capx/v1.1.x/experimental/autoscaler.md"
- "OIDC Integration": "capx/v1.1.x/experimental/oidc.md"
- "Flow VPC": "capx/v1.1.x/experimental/vpc.md"
- "Proxy Configuration": "capx/v1.1.x/experimental/proxy.md"
- "Troubleshooting": "capx/v1.1.x/troubleshooting.md"
- "v1.0.x":
- "Getting Started": "capx/v1.0.x/getting_started.md"
Expand Down

0 comments on commit e76f143

Please # to comment.