Configuring IPsec encryption

    IPsec is disabled by default. It can be enabled either during or after installing the cluster. For information about cluster installation, see OKD installation overview. If you need to enable IPsec after cluster installation, you must first resize your cluster MTU to account for the overhead of the IPsec ESP IP header.

    The following documentation describes how to enable and disable IPSec after cluster installation.

    • You have decreased the size of the cluster MTU by bytes to allow for the additional overhead of the IPsec ESP header. For more information on resizing the MTU that your cluster uses, see Changing the MTU for the cluster network.

    Types of network traffic flows encrypted by IPsec

    With IPsec enabled, only the following network traffic flows between pods are encrypted:

    • Traffic from a pod on the host network to a pod on the cluster network

    The following traffic flows are not encrypted:

    • Traffic between pods on the same node on the cluster network

    • Traffic between pods on the host network

    • Traffic from a pod on the cluster network to a pod on the host network

    The encrypted and unencrypted flows are illustrated in the following diagram:

    You must configure the network connectivity between machines to allow OKD cluster components to communicate. Each machine must be able to resolve the hostnames of all other machines in the cluster.

    The encrypt cipher used is AES-GCM-16-256. The integrity check value (ICV) is 16 bytes. The key length is 256 bits.

    The IPsec mode used is Transport mode, a mode that encrypts end-to-end communication by adding an Encapsulated Security Payload (ESP) header to the IP header of the original packet and encrypts the packet data. OKD does not currently use or support IPsec Tunnel mode for pod-to-pod communication.

    Security certificate generation and rotation

    The Cluster Network Operator (CNO) generates a self-signed X.509 certificate authority (CA) that is used by IPsec for encryption. Certificate signing requests (CSRs) from each node are automatically fulfilled by the CNO.

    The CA is valid for 10 years. The individual node certificates are valid for 5 years and are automatically rotated after 4 1/2 years elapse.

    As a cluster administrator, you can enable IPsec encryption after cluster installation.

    Prerequisites

    • Install the OpenShift CLI ().

    • Log in to the cluster with a user with cluster-admin privileges.

    • You have reduced the size of your cluster MTU by 46 bytes to allow for the overhead of the IPsec ESP header.

    Procedure

    • To enable IPsec encryption, enter the following command:

    Verifying that IPsec is enabled

    As a cluster administrator, you can verify that IPsec is enabled.

    Verification

      1. $ oc get pods -n openshift-ovn-kubernetes | grep ovnkube-master

      Example output

    As a cluster administrator, you can disable IPsec encryption only if you enabled IPsec after cluster installation.

    If you enabled IPsec when you installed your cluster, you cannot disable IPsec with this procedure.

    Prerequisites

    • Install the OpenShift CLI (oc).

    • Log in to the cluster with a user with cluster-admin privileges.

    Procedure

    1. To disable IPsec encryption, enter the following command:

      1. $ oc patch networks.operator.openshift.io/cluster --type=json \
      2. -p='[{"op":"remove", "path":"/spec/defaultNetwork/ovnKubernetesConfig/ipsecConfig"}]'
    2. Optional: You can increase the size of your cluster MTU by 46 bytes because there is no longer any overhead from the IPsec ESP header in IP packets.

    Additional resources