Mirantis Container Cloud (MCC) becomes part of Mirantis OpenStack for Kubernetes (MOSK)!
Starting with MOSK 25.2, the MOSK documentation set covers all product layers, including MOSK management (formerly Container Cloud). This means everything you need is in one place. Some legacy names may remain in the code and documentation and will be updated in future releases. The separate Container Cloud documentation site will be retired, so please update your bookmarks for continued easy access to the latest content.
Add or update a CA certificate for a MITM proxy using API¶
When you enable a man-in-the-middle (MITM) proxy access to a
MOSK cluster, your proxy requires a trusted CA certificate.
This section describes how to manually add the caCertificate field to the
spec section of the Proxy object. You can also use this instruction to
update an expired certificate on an existing cluster.
You can also add a CA certificate for a MITM proxy using the MOSK management console through the Proxies tab. For details, refer to the cluster creation procedure described in Create a MOSK cluster.
Warning
Any modification to the Proxy object, for example, changing
the proxy URL, NO_PROXY values, or certificate, leads to cordon-drain
and Docker restart on the cluster machines.
To add or update a CA certificate for a MITM proxy using API:
Encode your proxy CA certificate. For example:
cat ~/.mitmproxy/mitmproxy-ca-cert.cer | base64 -w0
Replace
~/.mitmproxy/mitmproxy-ca-cert.cerwith the path to your CA certificate file.Open the existing
Proxyobject for editing:Warning
The kubectl apply command automatically saves the applied data as plain text into the
kubectl.kubernetes.io/last-applied-configurationannotation of the corresponding object. This may result in revealing sensitive data in this annotation when creating or modifying the object.Therefore, do not use kubectl apply on this object. Use kubectl create, kubectl patch, or kubectl edit instead.
If you used kubectl apply on this object, you can remove the
kubectl.kubernetes.io/last-applied-configurationannotation from the object using kubectl edit.kubectl --kubeconfig <pathToManagementClusterKubeconfig> -n <projectName> edit proxy <proxyName>
In the system response, find the
specsection with the current proxy configuration. For example:spec: httpProxy: http://172.19.123.57:8080 httpsProxy: http://172.19.123.57:8080
In the
specsection, add or update thespec.caCertificatefield with the base64-encoded proxy CA certificate data. For example:spec: caCertificate: <BASE64_ENCODED_CA_CERTIFICATE> httpProxy: http://172.19.123.57:8080 httpsProxy: http://172.19.123.57:8080
Save the
Proxyobject and proceed with the MOSK cluster creation.If you update an expired certificate on an existing MOSK cluster, wait until the machines switch from the
ReconfiguretoReadystate to apply changes.Strongly recommended. Back up MKE as described in Mirantis Kubernetes Engine documentation: Back up MKE.
Since the procedure above modifies the cluster configuration, a fresh backup is required to restore the cluster in case further reconfigurations fail.