diff --git a/docs/capx/v1.1.x/experimental/proxy.md b/docs/capx/v1.1.x/experimental/proxy.md new file mode 100644 index 00000000..fcc79072 --- /dev/null +++ b/docs/capx/v1.1.x/experimental/proxy.md @@ -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=" + Environment="HTTPS_PROXY=" + Environment="NO_PROXY=" + 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=" + Environment="HTTPS_PROXY=" + Environment="NO_PROXY=" + owner: root:root + path: /etc/systemd/system/containerd.service.d/http-proxy.conf + ... + preKubeadmCommands: + - sudo systemctl daemon-reload + - sudo systemctl restart containerd + ... +``` + diff --git a/mkdocs.yml b/mkdocs.yml index 460443f1..64bac7ba 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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"