Overview

This document will cover the steps required to configure a cluster with a defined version.

When configuring a cluster's deployment we will be defining the following:

  • Version of helm charts and images
  • Components to be installed.
  • Custom configurations/overrides

Background

Our components are deployed using Flux.

Flux is a tool that allows us to define the components to install on a cluster. After initial installation, Flux will poll the source(GitLab) and apply any changes.


In our configuration, we use GitLab as our source for defining multiple Helm Releases. A Helm Release defines the helm chart and configuration values to use for a particular component. 


Releases

Using Kustomize, we can package our components into releases. This is done by applying overrides on top of the base layer. 


Cluster Layer

The cluster layer defines what release to use and the overrides to apply for the specific cluster.

These overrides include such things as:

  • Helm Chart and Container Registry
  • Host Aliases
  • Cluster specific values


clusters/acm/onprem/components/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
# ---------------------------------------------------------------------------
# Resources
# core    - contains core components
# infra   - contains nginx-ingress controller used in develop and test environments
# extras  - contains extra components used in develop and test environments
# monitoring - contains components used for monitoring
# usecases - contains etls for the various use cases
#
# additional helmreleases can be included in the custom folder
# and referenced under resources.
# ---------------------------------------------------------------------------
resources:
  - ../../../../releases/2023-02-03_22.0.1-2525403/onprem/core
  - ../../../../releases/2023-02-03_22.0.1-2525403/onprem/infra
  - ../../../../releases/2023-02-03_22.0.1-2525403/onprem/extras
#  - ../../../../releases/2023-01-16_22.0.1-2473477/onprem/monitoring

# use cases
#  - ../../../../usecases/onprem/helmrelease-etlflow-1301-ncom-data-enrichment.yaml

# custom
#  - ./custom/helmrelease_sample.yaml

# ---------------------------------------------------------------------------
# PatchesStrategicMerge
# define overrides specific for a cluster
# ---------------------------------------------------------------------------
patchesStrategicMerge:

#core
  - ./overrides/core/helmrepo-ncyd-helm-virtual.yaml
  - ./overrides/core/ckaf-connect.yaml
  - ./overrides/core/ckaf-connect-configurator.yaml
  - ./overrides/core/ckaf-kafka.yaml
  - ./overrides/core/fluent-bit.yaml
  - ./overrides/core/kafka-azure-sink.yaml
  - ./overrides/core/nginx-proxy.yaml
  - ./overrides/core/topology-adapter.yaml

# extras
  - ./overrides/extras/azuremockapi.yaml
  - ./overrides/extras/ckaf-rest.yaml
  - ./overrides/extras/ckaf-schema-registry.yaml
  - ./overrides/extras/jira.yaml
  - ./overrides/extras/kowl.yaml
  - ./overrides/extras/mock-server.yaml
  - ./overrides/extras/ssh-server.yaml

# infra
  - ./overrides/infra/ingress-nginx.yaml

# monitoring
#  - ./overrides/monitoring/file.yaml

#usecases
#  - ./overrides/usecases/helmrelease-etlflow-1301-ncom-data-enrichment.yaml

Release Layer

A release specifies the base resources to use and applies a version/tag to the helm chart and images using an patch file defined under the patchesStrategicMerge section.

releases/2023-01-16_22.0.1.../onprem/core/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - ../../../base/onprem/core/helmrepo-ncyd-helm-virtual.yaml
  - ../../../base/onprem/core/ckaf-kafka.yaml
  - ../../../base/onprem/core/ckaf-connect.yaml
  - ../../../base/onprem/core/ckaf-connect-configurator.yaml
  - ../../../base/onprem/core/fluent-bit.yaml
  - ../../../base/onprem/core/kafka-azure-sink.yaml
  - ../../../base/onprem/core/nginx-proxy.yaml
  - ../../../base/onprem/core/topology-adapter.yaml
patchesStrategicMerge:
  - ckaf-kafka.yaml
  - ckaf-connect.yaml
  - ckaf-connect-configurator.yaml
  - fluent-bit.yaml
  - nginx-proxy.yaml
  - topology-adapter.yaml
  - kafka-azure-sink.yaml

Base Layer

The base layer defines all defaults for a component/resource.


Creating a Cluster from the Template

All clusters are defined under the /clusters folder in the GitLab repository. A template has been created that can be copied for use with other clusters.

Copy the /clusters/TEMPLATE folder to a new folder. Once this is done, we can make changes specific to the cluster which includes:

  • Release Version
  • Cluster Overrides


Updating the Components and Version

We can update the components and version by updating the following files:

  • components/kustomization.yaml
  • components/overrides/*.yaml


clusters/acm/onprem/components/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
# ---------------------------------------------------------------------------
# Resources
# core    - contains core components
# infra   - contains nginx-ingress controller used in develop and test environments
# extras  - contains extra components used in develop and test environments
# monitoring - contains components used for monitoring
# usecases - contains etls for the various use cases
#
# additional helmreleases can be included in the custom folder
# and referenced under resources.
# ---------------------------------------------------------------------------
resources:
  - ../../../../releases/2023-02-03_22.0.1-2525403/onprem/core
  - ../../../../releases/2023-02-03_22.0.1-2525403/onprem/infra
  - ../../../../releases/2023-02-03_22.0.1-2525403/onprem/extras
#  - ../../../../releases/2023-01-16_22.0.1-2473477/onprem/monitoring

# use cases
#  - ../../../../usecases/onprem/helmrelease-etlflow-1301-ncom-data-enrichment.yaml

# custom
#  - ./custom/helmrelease_sample.yaml

# ---------------------------------------------------------------------------
# PatchesStrategicMerge
# define overrides specific for a cluster
# ---------------------------------------------------------------------------
patchesStrategicMerge:

#core
  - ./overrides/core/helmrepo-ncyd-helm-virtual.yaml
  - ./overrides/core/ckaf-connect.yaml
  - ./overrides/core/ckaf-connect-configurator.yaml
  - ./overrides/core/ckaf-kafka.yaml
  - ./overrides/core/fluent-bit.yaml
  - ./overrides/core/kafka-azure-sink.yaml
  - ./overrides/core/nginx-proxy.yaml
  - ./overrides/core/topology-adapter.yaml

# extras
  - ./overrides/extras/azuremockapi.yaml
  - ./overrides/extras/ckaf-rest.yaml
  - ./overrides/extras/ckaf-schema-registry.yaml
  - ./overrides/extras/jira.yaml
  - ./overrides/extras/kowl.yaml
  - ./overrides/extras/mock-server.yaml
  - ./overrides/extras/ssh-server.yaml

# infra
  - ./overrides/infra/ingress-nginx.yaml

# monitoring
#  - ./overrides/monitoring/file.yaml

#usecases
#  - ./overrides/usecases/helmrelease-etlflow-1301-ncom-data-enrichment.yaml
  • No labels