github.com/imran-kn/cilium-fork@v1.6.9/Documentation/gettingstarted/k8s-install-gke.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      http://docs.cilium.io
     6  
     7  **************************
     8  Installation on Google GKE
     9  **************************
    10  
    11  GKE Requirements
    12  ================
    13  
    14  1. Install the Google Cloud SDK (``gcloud``) see [Installing Google Cloud SDK](https://cloud.google.com/sdk/install)
    15  
    16  2. Create a project or use an existing one
    17  
    18  ::
    19  
    20     export GKE_PROJECT=gke-clusters
    21     gcloud projects create $GKE_PROJECT
    22  
    23  
    24  3. Enable the GKE API for the project if not already done
    25  
    26  ::
    27  
    28     gcloud services enable --project $GKE_PROJECT container.googleapis.com
    29  
    30  Create a GKE Cluster
    31  ====================
    32  
    33  You can apply any method to create a GKE cluster. The example given here is
    34  using the `Google Cloud SDK <https://cloud.google.com/sdk/>`_. This guide
    35  will create a cluster on zone ``europe-west4-a``; feel free to change the zone
    36  if you are in a different region of the globe.
    37  
    38  .. code:: bash
    39  
    40      export GKE_ZONE="europe-west4-a"
    41      gcloud container --project $GKE_PROJECT clusters create cluster1 \
    42         --username "admin" --image-type COS --num-nodes 2 --zone ${GKE_ZONE}
    43  
    44  When done, you should be able to access your cluster like this:
    45  
    46  .. code:: bash
    47  
    48      kubectl get nodes
    49      NAME                                      STATUS   ROLES    AGE   VERSION
    50      gke-cluster1-default-pool-a63a765c-flr2   Ready    <none>   6m    v1.11.7-gke.4
    51      gke-cluster1-default-pool-a63a765c-z73c   Ready    <none>   6m    v1.11.7-gke.4
    52  
    53  Create a cluster-admin-binding
    54  ==============================
    55  
    56  .. code:: bash
    57  
    58      kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user your@google.email
    59  
    60  Prepare & Deploy Cilium
    61  =======================
    62  
    63  .. include:: k8s-install-download-release.rst
    64  
    65  Generate the required YAML files and deploy them:
    66  
    67  .. code:: bash
    68  
    69      helm template cilium \
    70        --namespace cilium \
    71        --set global.nodeinit.enabled=true \
    72        --set nodeinit.reconfigureKubelet=true \
    73        --set nodeinit.removeCbrBridge=true \
    74        --set global.cni.binPath=/home/kubernetes/bin \
    75        > cilium.yaml
    76      kubectl create namespace cilium
    77      kubectl create -f cilium.yaml
    78  
    79  The NodeInit DaemonSet is required to prepare the GKE nodes as nodes are added
    80  to the cluster. The NodeInit DaemonSet will perform the following actions:
    81  
    82  * Reconfigure kubelet to run in CNI mode
    83  * Mount the BPF filesystem
    84  
    85  Restart remaining pods
    86  ======================
    87  
    88  Once Cilium is up and running, restart all pods in ``kube-system`` so they can
    89  be managed by Cilium, similar to the steps that we have previously performed
    90  for ``kube-dns``
    91  
    92  ::
    93  
    94      $ kubectl delete pods -n kube-system $(kubectl get pods -n kube-system -o custom-columns=NAME:.metadata.name,HOSTNETWORK:.spec.hostNetwork --no-headers=true | grep '<none>' | awk '{ print $1 }')
    95      pod "event-exporter-v0.2.3-f9c896d75-cbvcz" deleted
    96      pod "fluentd-gcp-scaler-69d79984cb-nfwwk" deleted
    97      pod "heapster-v1.6.0-beta.1-56d5d5d87f-qw8pv" deleted
    98      pod "kube-dns-5f8689dbc9-2nzft" deleted
    99      pod "kube-dns-5f8689dbc9-j7x5f" deleted
   100      pod "kube-dns-autoscaler-76fcd5f658-22r72" deleted
   101      pod "kube-state-metrics-7d9774bbd5-n6m5k" deleted
   102      pod "l7-default-backend-6f8697844f-d2rq2" deleted
   103      pod "metrics-server-v0.3.1-54699c9cc8-7l5w2" deleted
   104  
   105  .. include:: k8s-install-validate.rst