Skip to content

Commit

Permalink
doc: de-duplicate instructions in kind and hubble getting started guides
Browse files Browse the repository at this point in the history
These 2 guides have a lot of instructions in common as the Hubble guide
instructs to create a sandbox environment using Kind. This commit
ensures that instructions are not duplicated in the two guides but are
included from separate files from the 2 guides.

In addition to this, this commit also updates the instructions about
possible conflict of IP address when deploying a cluster with Kind: the
"tip" has been moved to the "Configure Kind" section as the fix needs to
be applied when configuring Kind.

Moreover, remove the "Optional" wording with regard to pre-loading the
cilium image into the Kind cluster.

Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
  • Loading branch information
rolinh authored and joestringer committed Jun 19, 2020
1 parent 93d32dd commit de01754
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 67 deletions.
35 changes: 6 additions & 29 deletions Documentation/gettingstarted/hubble.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,14 @@ across the globe, there is almost always someone available to help.

.. include:: kind-install.rst

.. note::
The cluster nodes will remain in state ``NotReady`` until Cilium is deployed.
This behavior is expected.

Deploy Cilium and Hubble
========================

.. include:: k8s-install-download-release.rst
.. include:: kind-preload.rst

**(optional, but recommended)** Pre-load Cilium images into the kind cluster so
each worker doesn't have to pull them.

.. parsed-literal::
docker pull cilium/cilium:|IMAGE_TAG|
kind load docker-image cilium/cilium:|IMAGE_TAG|
Install Cilium release via Helm:
Install Cilium, enable Hubble and deploy Hubble Relay and Hubble's graphical UI
in one command using Helm:

.. parsed-literal::
Expand All @@ -58,18 +48,6 @@ Install Cilium release via Helm:
--set global.hubble.relay.enabled=true \\
--set global.hubble.ui.enabled=true
.. tip::
If your local network subnet conflicts with the one picked up by kind,
update the ``networking`` section of the kind configuration file to specify
different subnets (pick a network range that does not conflict with yours)
and re-create the cluster.

.. parsed-literal::
networking:
disableDefaultCNI: true
podSubnet: "10.244.0.0/16"
serviceSubnet: "10.245.0.0/16"
Validate the Installation
=========================

Expand Down Expand Up @@ -192,17 +170,16 @@ port-forward the Hubble Relay service locally:
This terminal window needs to be remain open to keep port-forwarding in
place. Open a separate terminal window to use the ``hubble`` CLI.

You may test that your setup is working by issuing this command which gives you
the status of the Hubble Relay service:
Confirm that the Hubble Relay service is healthy via ``hubble status``:

.. parsed-literal::
$ hubble status --server localhost:4245
Healthcheck (via localhost:4245): Ok
Max Flows: 16384
In order to avoid passing ``--server localhost:4245`` to ever command below,
you may export the following environment variable:
In order to avoid passing ``--server localhost:4245`` to every command, you may
export the following environment variable:

.. parsed-literal::
$ export HUBBLE_DEFAULT_SOCKET_PATH=localhost:4245
Expand Down
56 changes: 43 additions & 13 deletions Documentation/gettingstarted/kind-install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,66 @@ Install Dependencies
4. Install ``kind`` >= v0.7.0 per kind documentation:
`Installation and Usage <https://kind.sigs.k8s.io/#installation-and-usage>`_

Kind Configuration
==================
Configure kind
==============

Kind does not use flags for configuration. Instead, it uses YAML configuration
that is very similar to Kubernetes.
Configuring kind cluster creation is done using a YAML configuration file.
This step is necessary in order to disable the default CNI and replace it with
Cilium.

Create a :download:`kind-config.yaml <./kind-config.yaml>` file based on the
following template. The template will create 3 nodes + 1 apiserver cluster with
the latest version of Kubernetes from when the kind release was created.
following template. It will create a cluster with 3 worker nodes and 1
control-plane node.

.. literalinclude:: kind-config.yaml
:language: yaml

By default, the latest version of Kubernetes from when the kind release was
created is used.

To change the version of Kubernetes being run, ``image`` has to be defined for
each node. See the
`Node Configration <https://kind.sigs.k8s.io/docs/user/configuration/#nodes>`_
documentation.
`Node Configuration <https://kind.sigs.k8s.io/docs/user/configuration/#nodes>`_
documentation for more information.

.. tip::
By default, kind uses the following pod and service subnets:

.. parsed-literal::
Networking.PodSubnet = "10.244.0.0/16"
Networking.ServiceSubnet = "10.96.0.0/12"
If any of these subnets conflicts with your local network address range,
update the ``networking`` section of the kind configuration file to specify
different subnets that do not conflict or you risk having connectivity
issues when deploying Cilium. For example:

Start Kind
==========
.. code-block:: yaml
Pass the ``kind-config.yaml`` you created with the ``--config`` flag of kind.
networking:
disableDefaultCNI: true
podSubnet: "10.10.0.0/16"
serviceSubnet: "10.11.0.0/16"
Create a cluster
================

To create a cluster with the configuration defined above, pass the
``kind-config.yaml`` you created with the ``--config`` flag of kind.

.. code:: bash
kind create cluster --config=kind-config.yaml
This will add a ``kind-kind`` context to ``KUBECONFIG`` or if unset,
``${HOME}/.kube/config``
After a couple of seconds or minutes, a 4 nodes cluster should be created.

A new ``kubectl`` context (``kind-kind``) should be added to ``KUBECONFIG`` or, if unset,
to ``${HOME}/.kube/config``:

.. code:: bash
kubectl cluster-info --context kind-kind
.. note::
The cluster nodes will remain in state ``NotReady`` until Cilium is deployed.
This behavior is expected.
6 changes: 6 additions & 0 deletions Documentation/gettingstarted/kind-preload.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Preload the ``cilium`` image into each worker node in the kind cluster:

.. parsed-literal::
docker pull cilium/cilium:|IMAGE_TAG|
kind load docker-image cilium/cilium:|IMAGE_TAG|
29 changes: 4 additions & 25 deletions Documentation/gettingstarted/kind.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ Getting Started Using Kind
**************************

This guide uses `kind <https://kind.sigs.k8s.io/>`_ to demonstrate deployment
and operation of Cilium in a multi-node Kubernetes cluster.

Kind requires docker to be installed and running.
and operation of Cilium in a multi-node Kubernetes cluster running locally on
Docker.

.. include:: kind-install.rst

Expand All @@ -23,17 +22,9 @@ Install Cilium
==============

.. include:: k8s-install-download-release.rst
.. include:: kind-preload.rst


**(optional, but recommended)** Pre-load Cilium images into the kind cluster so
each worker doesn't have to pull them.

.. parsed-literal::
docker pull cilium/cilium:|IMAGE_TAG|
kind load docker-image cilium/cilium:|IMAGE_TAG|
Install Cilium release via Helm:
Then, install Cilium release via Helm:

.. parsed-literal::
Expand All @@ -48,18 +39,6 @@ Install Cilium release via Helm:
--set global.pullPolicy=IfNotPresent \\
--set config.ipam=kubernetes
.. tip::
If your local network subnet conflicts with the one picked up by kind,
update the ``networking`` section of the kind configuration file to specify
different subnets (pick a network range that does not conflict with yours)
and re-create the cluster.

.. parsed-literal::
networking:
disableDefaultCNI: true
podSubnet: "10.244.0.0/16"
serviceSubnet: "10.245.0.0/16"
.. include:: k8s-install-validate.rst
.. include:: namespace-kube-system.rst
.. include:: hubble-enable.rst
Expand Down
1 change: 1 addition & 0 deletions Documentation/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Polytechnique
Portmap
Pre
Prefilter
Preload
Profiler
Proxylib
QCon
Expand Down

0 comments on commit de01754

Please sign in to comment.