github.com/cilium/cilium@v1.16.2/Documentation/gettingstarted/k8s-install-default.rst (about)

     1  .. only:: not (epub or latex or html)
     2  
     3      WARNING: You are looking at unreleased Cilium documentation.
     4      Please use the official rendered version released here:
     5      https://docs.cilium.io
     6  
     7  .. _k8s_install_quick:
     8  .. _k8s_quick_install:
     9  .. _k8s_install_standard:
    10  
    11  *************************
    12  Cilium Quick Installation
    13  *************************
    14  
    15  This guide will walk you through the quick default installation. It will
    16  automatically detect and use the best configuration possible for the Kubernetes
    17  distribution you are using. All state is stored using Kubernetes custom resource definitions (CRDs).
    18  
    19  This is the best installation method for most use cases.  For large
    20  environments (> 500 nodes) or if you want to run specific datapath modes, refer
    21  to the :ref:`getting_started` guide.
    22  
    23  Should you encounter any issues during the installation, please refer to the
    24  :ref:`troubleshooting_k8s` section and/or seek help on `Cilium Slack`_.
    25  
    26  .. _create_cluster:
    27  
    28  Create the Cluster
    29  ===================
    30  
    31  If you don't have a Kubernetes Cluster yet, you can use the instructions below
    32  to create a Kubernetes cluster locally or using a managed Kubernetes service:
    33  
    34  .. tabs::
    35  
    36      .. group-tab:: GKE
    37  
    38         The following commands create a Kubernetes cluster using `Google
    39         Kubernetes Engine <https://cloud.google.com/kubernetes-engine>`_.  See
    40         `Installing Google Cloud SDK <https://cloud.google.com/sdk/install>`_
    41         for instructions on how to install ``gcloud`` and prepare your
    42         account.
    43  
    44         .. code-block:: bash
    45  
    46             export NAME="$(whoami)-$RANDOM"
    47             # Create the node pool with the following taint to guarantee that
    48             # Pods are only scheduled/executed in the node when Cilium is ready.
    49             # Alternatively, see the note below.
    50             gcloud container clusters create "${NAME}" \
    51              --node-taints node.cilium.io/agent-not-ready=true:NoExecute \
    52              --zone us-west2-a
    53             gcloud container clusters get-credentials "${NAME}" --zone us-west2-a
    54  
    55         .. note::
    56  
    57            Please make sure to read and understand the documentation page on :ref:`taint effects and unmanaged pods<taint_effects>`.
    58  
    59      .. group-tab:: AKS
    60  
    61         The following commands create a Kubernetes cluster using `Azure
    62         Kubernetes Service <https://docs.microsoft.com/en-us/azure/aks/>`_ with
    63         no CNI plugin pre-installed (BYOCNI). See `Azure Cloud CLI
    64         <https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest>`_
    65         for instructions on how to install ``az`` and prepare your account, and
    66         the `Bring your own CNI documentation
    67         <https://docs.microsoft.com/en-us/azure/aks/use-byo-cni?tabs=azure-cli>`_
    68         for more details about BYOCNI prerequisites / implications.
    69  
    70         .. code-block:: bash
    71  
    72             export NAME="$(whoami)-$RANDOM"
    73             export AZURE_RESOURCE_GROUP="${NAME}-group"
    74             az group create --name "${AZURE_RESOURCE_GROUP}" -l westus2
    75  
    76             # Create AKS cluster
    77             az aks create \
    78               --resource-group "${AZURE_RESOURCE_GROUP}" \
    79               --name "${NAME}" \
    80               --network-plugin none
    81  
    82             # Get the credentials to access the cluster with kubectl
    83             az aks get-credentials --resource-group "${AZURE_RESOURCE_GROUP}" --name "${NAME}"
    84  
    85      .. group-tab:: EKS
    86  
    87         The following commands create a Kubernetes cluster with ``eksctl``
    88         using `Amazon Elastic Kubernetes Service
    89         <https://aws.amazon.com/eks/>`_.  See `eksctl Installation
    90         <https://github.com/weaveworks/eksctl>`_ for instructions on how to
    91         install ``eksctl`` and prepare your account.
    92  
    93         .. code-block:: none
    94  
    95             export NAME="$(whoami)-$RANDOM"
    96             cat <<EOF >eks-config.yaml
    97             apiVersion: eksctl.io/v1alpha5
    98             kind: ClusterConfig
    99  
   100             metadata:
   101               name: ${NAME}
   102               region: eu-west-1
   103  
   104             managedNodeGroups:
   105             - name: ng-1
   106               desiredCapacity: 2
   107               privateNetworking: true
   108               # taint nodes so that application pods are
   109               # not scheduled/executed until Cilium is deployed.
   110               # Alternatively, see the note below.
   111               taints:
   112                - key: "node.cilium.io/agent-not-ready"
   113                  value: "true"
   114                  effect: "NoExecute"
   115             EOF
   116             eksctl create cluster -f ./eks-config.yaml
   117  
   118         .. note::
   119  
   120            Please make sure to read and understand the documentation page on :ref:`taint effects and unmanaged pods<taint_effects>`.
   121  
   122      .. group-tab:: kind
   123  
   124         Install ``kind`` >= v0.7.0 per kind documentation:
   125         `Installation and Usage <https://kind.sigs.k8s.io/#installation-and-usage>`_
   126  
   127         .. parsed-literal::
   128  
   129            curl -LO \ |SCM_WEB|\/Documentation/installation/kind-config.yaml
   130            kind create cluster --config=kind-config.yaml
   131  
   132         .. note::
   133  
   134           Cilium may fail to deploy due to too many open files in one or more
   135           of the agent pods. If you notice this error, you can increase the
   136           ``inotify`` resource limits on your host machine (see
   137           `Pod errors due to "too many open files" <https://kind.sigs.k8s.io/docs/user/known-issues/#pod-errors-due-to-too-many-open-files>`__).
   138  
   139      .. group-tab:: minikube
   140  
   141         Install minikube ≥ v1.28.0 as per minikube documentation:
   142         `Install Minikube <https://kubernetes.io/docs/tasks/tools/install-minikube/>`_.
   143         The following command will bring up a single node minikube cluster prepared for installing cilium.
   144  
   145         .. code-block:: shell-session
   146  
   147            minikube start --cni=cilium
   148  
   149         .. note::
   150  
   151            - This may not install the latest version of cilium.
   152            - It might be necessary to add ``--host-dns-resolver=false`` if using the Virtualbox provider,
   153              otherwise DNS resolution may not work after Cilium installation.
   154  
   155      .. group-tab:: Rancher Desktop
   156  
   157         Install Rancher Desktop >= v1.1.0 as per Rancher Desktop documentation:
   158         `Install Rancher Desktop <https://docs.rancherdesktop.io/getting-started/installation>`_.
   159  
   160         Next you need to configure Rancher Desktop to disable the built-in CNI so you can install Cilium.
   161  
   162         .. include:: ../installation/rancher-desktop-configure.rst
   163  
   164      .. group-tab:: Alibaba ACK
   165  
   166          .. include:: ../beta.rst
   167  
   168          .. note::
   169  
   170              The AlibabaCloud ENI integration with Cilium is subject to the following limitations:
   171  
   172              - It is currently only enabled for IPv4.
   173              - It only works with instances supporting ENI. Refer to `Instance families <https://www.alibabacloud.com/help/doc-detail/25378.htm>`_ for details.
   174  
   175          Setup a Kubernetes on AlibabaCloud. You can use any method you prefer.
   176          The quickest way is to create an ACK (Alibaba Cloud Container Service for
   177          Kubernetes) cluster and to replace the CNI plugin with Cilium.
   178          For more details on how to set up an ACK cluster please follow
   179          the `official documentation <https://www.alibabacloud.com/help/doc-detail/86745.htm>`_.
   180  
   181  .. _install_cilium_cli:
   182  
   183  Install the Cilium CLI
   184  ======================
   185  
   186  .. include:: ../installation/cli-download.rst
   187  
   188  .. admonition:: Video
   189    :class: attention
   190  
   191    To learn more about the Cilium CLI, check out `eCHO episode 8: Exploring the Cilium CLI <https://www.youtube.com/watch?v=ndjmaM1i0WQ&t=1136s>`__.
   192  
   193  Install Cilium
   194  ==============
   195  
   196  You can install Cilium on any Kubernetes cluster. Pick one of the options below:
   197  
   198  .. tabs::
   199  
   200      .. group-tab:: Generic
   201  
   202         These are the generic instructions on how to install Cilium into any
   203         Kubernetes cluster. The installer will attempt to automatically pick the
   204         best configuration options for you. Please see the other tabs for
   205         distribution/platform specific instructions which also list the ideal
   206         default configuration for particular platforms.
   207  
   208         .. include:: ../installation/requirements-generic.rst
   209  
   210         **Install Cilium**
   211  
   212         Install Cilium into the Kubernetes cluster pointed to by your current kubectl context:
   213  
   214         .. parsed-literal::
   215  
   216            cilium install |CHART_VERSION|
   217  
   218      .. group-tab:: GKE
   219  
   220         .. include:: ../installation/requirements-gke.rst
   221  
   222         **Install Cilium:**
   223  
   224         Install Cilium into the GKE cluster:
   225  
   226         .. parsed-literal::
   227  
   228             cilium install |CHART_VERSION|
   229  
   230      .. group-tab:: AKS
   231         
   232         .. include:: ../installation/requirements-aks.rst
   233     
   234         **Install Cilium:**
   235  
   236         Install Cilium into the AKS cluster:
   237  
   238         .. parsed-literal::
   239  
   240             cilium install |CHART_VERSION| --set azure.resourceGroup="${AZURE_RESOURCE_GROUP}"
   241             
   242      .. group-tab:: EKS
   243  
   244         .. include:: ../installation/requirements-eks.rst
   245  
   246         **Install Cilium:**
   247  
   248         Install Cilium into the EKS cluster.
   249  
   250         .. parsed-literal::
   251  
   252             cilium install |CHART_VERSION|
   253             cilium status --wait
   254  
   255         .. note::
   256  
   257             If you have to uninstall Cilium and later install it again, that could cause
   258             connectivity issues due to ``aws-node`` DaemonSet flushing Linux routing tables.
   259             The issues can be fixed by restarting all pods, alternatively to avoid such issues
   260             you can delete ``aws-node`` DaemonSet prior to installing Cilium.
   261  
   262      .. group-tab:: OpenShift
   263  
   264         .. include:: ../installation/requirements-openshift.rst
   265  
   266         **Install Cilium:**
   267  
   268         Cilium is a `Certified OpenShift CNI Plugin <https://access.redhat.com/articles/5436171>`_
   269         and is best installed when an OpenShift cluster is created using the OpenShift
   270         installer. Please refer to :ref:`k8s_install_openshift_okd` for more information.
   271  
   272      .. group-tab:: RKE
   273  
   274         .. include:: ../installation/requirements-rke.rst
   275  
   276         **Install Cilium:**
   277  
   278         Install Cilium into your newly created RKE cluster:
   279  
   280         .. parsed-literal::
   281  
   282             cilium install |CHART_VERSION|
   283  
   284      .. group-tab:: k3s
   285  
   286         .. include:: ../installation/requirements-k3s.rst
   287  
   288         **Install Cilium:**
   289  
   290         Install Cilium into your newly created Kubernetes cluster:
   291  
   292         .. parsed-literal::
   293  
   294             cilium install |CHART_VERSION|
   295  
   296      .. group-tab:: Alibaba ACK
   297  
   298         You can install Cilium using Helm on Alibaba ACK, refer to `k8s_install_helm` for details.
   299  
   300  
   301  If the installation fails for some reason, run ``cilium status`` to retrieve
   302  the overall status of the Cilium deployment and inspect the logs of whatever
   303  pods are failing to be deployed.
   304  
   305  .. tip::
   306  
   307     You may be seeing ``cilium install`` print something like this:
   308  
   309     .. code-block:: shell-session
   310  
   311         ♻️  Restarted unmanaged pod kube-system/event-exporter-gke-564fb97f9-rv8hg
   312         ♻️  Restarted unmanaged pod kube-system/kube-dns-6465f78586-hlcrz
   313         ♻️  Restarted unmanaged pod kube-system/kube-dns-autoscaler-7f89fb6b79-fsmsg
   314         ♻️  Restarted unmanaged pod kube-system/l7-default-backend-7fd66b8b88-qqhh5
   315         ♻️  Restarted unmanaged pod kube-system/metrics-server-v0.3.6-7b5cdbcbb8-kjl65
   316         ♻️  Restarted unmanaged pod kube-system/stackdriver-metadata-agent-cluster-level-6cc964cddf-8n2rt
   317  
   318     This indicates that your cluster was already running some pods before Cilium
   319     was deployed and the installer has automatically restarted them to ensure
   320     all pods get networking provided by Cilium.
   321  
   322  Validate the Installation
   323  =========================
   324  
   325  .. include:: ../installation/cli-status.rst
   326  .. include:: ../installation/cli-connectivity-test.rst
   327  
   328  .. include:: ../installation/next-steps.rst