Distribution

Deploy the distribution on top of a Kubernetes Cluster

This Quick Start guide will guide you through the process of deploying KFD in a Kubernetes cluster.

Pre-requirements

To continue with this Quick Start guide and install the Kubernetes Fury Distribution, you'll need a running Kubernetes cluster, if you don't have one available, you can create it quickly using one of the two alternatives described in the section before: create a cluster on aws or you can run a local cluster

The following software is required to deploy the distribution:

  • kubectl: Will be used to managing our cluster. Recommended version: 1.16.9
  • kustomize: Used to render distribution manifests. Required version > 3.3
  • furyctl: Downloads distribution files. Required version > v0.2.2

Check your requirements before start:

$ kubectl version --client
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.9", GitCommit:"a17149e1a189050796ced469dbd78d380f2ed5ef", GitTreeState:"clean", BuildDate:"2020-04-16T11:44:51Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"darwin/amd64"}
$ kustomize version
Version: {Version:kustomize/v3.3.0 GitCommit:7050c6a7b692fdba6e831e63c7b83920ab03ad76 BuildDate:2019-10-24T17:54:30Z GoOs:darwin GoArch:amd64}
$ furyctl version
2020/02/12 12:09:17 Furyctl version  0.2.2

Hands-on

Let's define some useful variables:

$ export CLUSTER_DIR="/tmp/sighup.io/cluster"
$ export KFD_VERSION="v1.3.0"

Download the distribution files:

$ cd ${CLUSTER_DIR}
$ ls
config		kind-kfd-config
$ furyctl init --version ${KFD_VERSION}
2020/05/18 14:04:02 downloading: http::https://github.com/sighupio/fury-distribution/releases/download/v1.3.0/Furyfile.yml -> Furyfile.yml
2020/05/18 14:04:03 downloading: http::https://github.com/sighupio/fury-distribution/releases/download/v1.3.0/kustomization.yaml -> kustomization.yaml
$ furyctl vendor -H
2020/06/25 06:25:28 using v1.3.0 for package networking/calico
2020/06/25 06:25:28 using v1.8.0 for package monitoring/prometheus-operator
2020/06/25 06:25:28 using v1.8.0 for package monitoring/prometheus-operated
2020/06/25 06:25:28 using v1.8.0 for package monitoring/grafana
2020/06/25 06:25:28 using v1.8.0 for package monitoring/goldpinger
2020/06/25 06:25:28 using v1.8.0 for package monitoring/kubeadm-sm
2020/06/25 06:25:28 using v1.8.0 for package monitoring/kube-state-metrics
2020/06/25 06:25:28 using v1.8.0 for package monitoring/node-exporter
2020/06/25 06:25:28 using v1.8.0 for package monitoring/metrics-server
2020/06/25 06:25:28 using v1.5.0 for package logging/elasticsearch-single
2020/06/25 06:25:28 using v1.5.0 for package logging/cerebro
2020/06/25 06:25:28 using v1.5.0 for package logging/curator
2020/06/25 06:25:28 using v1.5.0 for package logging/fluentd
2020/06/25 06:25:28 using v1.5.0 for package logging/kibana
2020/06/25 06:25:28 using v1.7.0 for package ingress/cert-manager
2020/06/25 06:25:28 using v1.7.0 for package ingress/nginx
2020/06/25 06:25:28 using v1.7.0 for package ingress/forecastle
2020/06/25 06:25:28 using v1.4.0 for package dr/velero
2020/06/25 06:25:28 using v1.1.0 for package opa/gatekeeper
2020/06/25 06:25:28 downloading: git::https://github.com/sighupio/fury-kubernetes-networking.git//katalog/calico?ref=v1.3.0 -> vendor/katalog/networking/calico
2020/06/25 06:25:28 downloading: git::https://github.com/sighupio/fury-kubernetes-monitoring.git//katalog/prometheus-operator?ref=v1.8.0 -> vendor/katalog/monitoring/prometheus-operator
2020/06/25 06:25:28 downloading: git::https://github.com/sighupio/fury-kubernetes-monitoring.git//katalog/prometheus-operated?ref=v1.8.0 -> vendor/katalog/monitoring/prometheus-operated
2020/06/25 06:25:30 downloading: git::https://github.com/sighupio/fury-kubernetes-monitoring.git//katalog/grafana?ref=v1.8.0 -> vendor/katalog/monitoring/grafana
2020/06/25 06:25:30 downloading: git::https://github.com/sighupio/fury-kubernetes-monitoring.git//katalog/goldpinger?ref=v1.8.0 -> vendor/katalog/monitoring/goldpinger
2020/06/25 06:25:31 downloading: git::https://github.com/sighupio/fury-kubernetes-monitoring.git//katalog/kubeadm-sm?ref=v1.8.0 -> vendor/katalog/monitoring/kubeadm-sm
2020/06/25 06:25:31 downloading: git::https://github.com/sighupio/fury-kubernetes-monitoring.git//katalog/kube-state-metrics?ref=v1.8.0 -> vendor/katalog/monitoring/kube-state-metrics
2020/06/25 06:25:32 downloading: git::https://github.com/sighupio/fury-kubernetes-monitoring.git//katalog/node-exporter?ref=v1.8.0 -> vendor/katalog/monitoring/node-exporter
2020/06/25 06:25:32 downloading: git::https://github.com/sighupio/fury-kubernetes-monitoring.git//katalog/metrics-server?ref=v1.8.0 -> vendor/katalog/monitoring/metrics-server
2020/06/25 06:25:34 downloading: git::https://github.com/sighupio/fury-kubernetes-logging.git//katalog/elasticsearch-single?ref=v1.5.0 -> vendor/katalog/logging/elasticsearch-single
2020/06/25 06:25:34 downloading: git::https://github.com/sighupio/fury-kubernetes-logging.git//katalog/cerebro?ref=v1.5.0 -> vendor/katalog/logging/cerebro
2020/06/25 06:25:34 downloading: git::https://github.com/sighupio/fury-kubernetes-logging.git//katalog/curator?ref=v1.5.0 -> vendor/katalog/logging/curator
2020/06/25 06:25:35 downloading: git::https://github.com/sighupio/fury-kubernetes-logging.git//katalog/fluentd?ref=v1.5.0 -> vendor/katalog/logging/fluentd
2020/06/25 06:25:35 downloading: git::https://github.com/sighupio/fury-kubernetes-logging.git//katalog/kibana?ref=v1.5.0 -> vendor/katalog/logging/kibana
2020/06/25 06:25:35 downloading: git::https://github.com/sighupio/fury-kubernetes-ingress.git//katalog/cert-manager?ref=v1.7.0 -> vendor/katalog/ingress/cert-manager
2020/06/25 06:25:36 downloading: git::https://github.com/sighupio/fury-kubernetes-ingress.git//katalog/nginx?ref=v1.7.0 -> vendor/katalog/ingress/nginx
2020/06/25 06:25:37 downloading: git::https://github.com/sighupio/fury-kubernetes-ingress.git//katalog/forecastle?ref=v1.7.0 -> vendor/katalog/ingress/forecastle
2020/06/25 06:25:37 downloading: git::https://github.com/sighupio/fury-kubernetes-dr.git//katalog/velero?ref=v1.4.0 -> vendor/katalog/dr/velero
2020/06/25 06:25:37 downloading: git::https://github.com/sighupio/fury-kubernetes-opa.git//katalog/gatekeeper?ref=v1.1.0 -> vendor/katalog/opa/gatekeeper

Apply the distribution to the cluster:

$ kustomize build
$ kustomize build | kubectl apply -f -

After some time (depens of the capacity of your computer):

$ kubectl get nodes
NAME                            STATUS   ROLES    AGE   VERSION
kfd-quick-start-control-plane   Ready    master   13m   v1.16.4
kfd-quick-start-worker          Ready    <none>   13m   v1.16.4
$ kubectl get pods -A
NAMESPACE            NAME                                             READY   STATUS      RESTARTS   AGE
cert-manager         cert-manager-674bcbb689-hl7xc                    1/1     Running     0          5m39s
cert-manager         cert-manager-cainjector-779cfc77b6-69h8z         1/1     Running     0          5m39s
cert-manager         cert-manager-webhook-569fd8979-cbhqr             1/1     Running     0          5m39s
gatekeeper-system    gatekeeper-controller-manager-7fbd655b76-58q7j   1/1     Running     1          5m38s
gatekeeper-system    gatekeeper-controller-manager-7fbd655b76-86ppk   1/1     Running     0          5m38s
ingress-nginx        forecastle-6c6dd964d6-2x2wt                      1/1     Running     0          5m38s
ingress-nginx        nginx-ingress-controller-mftmv                   1/1     Running     0          5m13s
kube-system          calico-kube-controllers-5b8f97dcb5-ms4wz         1/1     Running     0          5m38s
kube-system          calico-node-899rx                                1/1     Running     0          5m37s
kube-system          calico-node-9vzd4                                1/1     Running     0          5m37s
kube-system          coredns-5644d7b6d9-2p6v4                         1/1     Running     0          7m28s
kube-system          coredns-5644d7b6d9-g2nxz                         1/1     Running     0          7m28s
kube-system          etcd-116-control-plane                           1/1     Running     0          6m20s
kube-system          kube-apiserver-116-control-plane                 1/1     Running     0          6m44s
kube-system          kube-controller-manager-116-control-plane        1/1     Running     0          6m43s
kube-system          kube-proxy-r72wx                                 1/1     Running     0          7m15s
kube-system          kube-proxy-vgts6                                 1/1     Running     0          7m29s
kube-system          kube-scheduler-116-control-plane                 1/1     Running     0          6m43s
kube-system          metrics-server-7496d99c5d-scmmj                  1/1     Running     0          5m38s
kube-system          minio-0                                          1/1     Running     0          5m37s
kube-system          minio-setup-bgnfx                                0/1     Completed   0          5m36s
kube-system          velero-767984974c-qxq68                          1/1     Running     0          5m38s
kube-system          velero-restic-kkwq8                              1/1     Running     0          5m13s
local-path-storage   local-path-provisioner-58f6947c7-qd687           1/1     Running     0          7m28s
logging              cerebro-cd876cf46-wz2ch                          1/1     Running     0          5m38s
logging              elasticsearch-0                                  2/2     Running     0          5m37s
logging              fluentd-dgk2r                                    1/1     Running     2          5m36s
logging              fluentd-zf5k7                                    1/1     Running     1          5m36s
logging              kibana-54d594b664-f4hbp                          1/1     Running     0          5m38s
monitoring           goldpinger-9tv8w                                 1/1     Running     0          5m36s
monitoring           goldpinger-qfxsq                                 1/1     Running     0          5m36s
monitoring           grafana-78c7dcf887-gcqnh                         1/1     Running     0          5m37s
monitoring           kube-state-metrics-66f7cfc565-cxld2              1/1     Running     0          5m37s
monitoring           node-exporter-dj9gn                              2/2     Running     0          5m36s
monitoring           node-exporter-htglh                              2/2     Running     0          5m36s
monitoring           prometheus-k8s-0                                 3/3     Running     1          3m25s
monitoring           prometheus-operator-689c56bbfc-kln6m             1/1     Running     0          5m37s

Everything will be up and running.

Test it

$ kubectl run fury-demo --image=nginx --restart=Always  --port 80 --expose
service/fury-demo created
deployment.apps/fury-demo created

Expose the service with the ingress controller.

But first, you have to know what's your IP:

$ curl ifconfig.co
54.171.105.73

Replace the following manifests with the right ip in spec.rules[0].host attribute (note the dash notation):

cat <<EOF | kubectl apply -f -
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: fury-demo
spec:
  rules:
  - host: fury-demo.54-171-105-73.nip.io
    http:
      paths:
      - path: /
        backend:
          serviceName: fury-demo
          servicePort: 80
EOF

Open a web browser and navigate to: fury-demo.54-171-105-73.nip.io:31080

Ingress Controller is exposed as node port in 31080 port.

nginx

Access Fury Components

Monitoring

cat <<EOF | kubectl apply -f -
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: monitoring
  namespace: monitoring
spec:
  rules:
  - host: grafana.54-171-105-73.nip.io
    http:
      paths:
      - path: /
        backend:
          serviceName: grafana
          servicePort: 3000
  - host: prometheus.54-171-105-73.nip.io
    http:
      paths:
      - path: /
        backend:
          serviceName: prometheus-k8s
          servicePort: 9090
  - host: goldpinger.54-171-105-73.nip.io
    http:
      paths:
      - path: /
        backend:
          serviceName: goldpinger
          servicePort: 8080
EOF

Open a web browser and navigate to: {grafana,prometheus,goldpinger}.54-171-105-73.nip.io:31080

Grafana

Grafana

Prometheus

Prometheus

Goldpinger

Goldpinger