Skip to content

Latest commit

 

History

History
125 lines (96 loc) · 4.64 KB

00-installing.adoc

File metadata and controls

125 lines (96 loc) · 4.64 KB

Installing dklb

Prerequisites

To install dklb, the following prerequisites must be met:

  • A DC/OS cluster having EdgeLB installed.

    • DC/OS must be v1.12.0 or later.

    • EdgeLB must be built and installed from the master branch. A stub-universe is available, see here for details.

      • EdgeLB v1.4.0 may be used instead, but some functionality might be missing.

  • An MKE v2.2.0-1.13.3 (or later) cluster.

    • The current kubeconfig context must be configured to point at this cluster.

Installing

To install dklb, the following commands may be run from the root of this repository:

$ hack/service-account.sh
$ kubectl create -f docs/deployment/00-prereqs.yaml
$ kubectl create -f docs/deployment/10-deployment.yaml

This will create a DC/OS service account for dklb, a Kubernetes secret named dklb-dcos-config and dklb deployment in the kube-system namespace having two replicas:

$ kubectl -n kube-system get pod --selector "app=dklb"
NAME                    READY   STATUS    RESTARTS   AGE
dklb-756c6c7d88-cgp69   1/1     Running   0          5m45s
dklb-756c6c7d88-slddz   1/1     Running   0          5m45s

The Kubernetes secret dklb-dcos-config, created by hack/service-account.sh script, contains the DC/OS service account secret required to access your DC/OS cluster. It’s used to setup TLS for you EdgeLB pools.

Advanced

Customizing the DC/OS service group for EdgeLB pools

By default, EdgeLB pools are created on the dcos-edgelb/pools service group. In some DC/OS clusters, however, it may be required to customize the service group where EdgeLB pools are created. This may happen, for example, if EdgeLB itself is installed under a different service group (e.g. networking/dcos-edgelb). In order to achieve this, the following flag must be provided as an argument to dklb:

--edgelb-pool-group=<edgelb-pool-group>

Customizing the default number of load balancers in the EdgeLB pools

By default, the number of load balancers in the EdgeLB pool is set to 1. In some DC/OS clusters it may be required to customize it. To do this, you can use the following flag:

--edgelb-default-pool-size=<edgelb-pool-size>

Tailing logs

At any given time, only a single replica is actively working in order to satisfy Ingress/Service resources. This replica is called the leader. Inspecting the logs of any of the two pods allows for checking which one is the current leader:

$ kubectl -n kube-system logs dklb-756c6c7d88-cgp69 | grep leader
time="2018-12-28T16:55:12Z" level=info msg="current leader: dklb-756c6c7d88-slddz"

This means that the current leader is the dklb-756c6c7d88-slddz pod. To understand what dklb is currently doing, it is necessary to tail the logs of this same pod:

$ kubectl -n kube-system logs dklb-756c6c7d88-slddz
time="2018-12-28T16:54:55Z" level=info msg="dklb is starting" version=0ab11a8-dev
time="2018-12-28T16:54:55Z" level=info msg="detected edgelb version: v1.2.3-22-ga35988a"
(...)
time="2018-12-28T16:55:11Z" level=debug msg="starting workers" controller=service-controller
time="2018-12-28T16:55:11Z" level=info msg="started workers" controller=service-controller
time="2018-12-28T16:55:11Z" level=debug msg="starting workers" controller=ingress-controller
time="2018-12-28T16:55:11Z" level=info msg="started workers" controller=ingress-controller
(...)

Uninstalling

To uninstall dklb, the following commands may be run from the root of this repository:

$ kubectl delete -f docs/deployment/10-deployment.yaml
$ kubectl delete -f docs/deployment/00-prereqs.yaml

Additionally, the admission webhook must be manually unregistered using the following command:

$ kubectl delete mutatingwebhookconfiguration dklb
ℹ️
Deleting dklb DOES NOT delete any EdgeLB pools that may have been created.