Table of Contents |
---|
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
...
The base layer defines all defaults for a component/resource.
Folder Structure
Customer Template
Code Block | ||||
---|---|---|---|---|
| ||||
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: initialization
namespace: ncyd-flux
spec:
interval: 10m0s
sourceRef:
kind: GitRepository
name: ncyd-flux
path: ./components
prune: true
wait: true
timeout: 5m0s
|
Code Block | ||||
---|---|---|---|---|
| ||||
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 specific to a customer can be included in the custom folder
# and referenced under resources
# ---------------------------------------------------------------------------
resources:
- ../../../../releases/2023-01-16_22.0.1-2473477/onprem/core
- ../../../../releases/2023-01-16_22.0.1-2473477/onprem/infra
# - ../../../../releases/2023-01-16_22.0.1-2473477/onprem/monitoring
# extras
# - ../../../../releases/base/onprem/extras/azuremockapi.yaml
- ../../../../releases/base/onprem/extras/ckaf-rest.yaml
- ../../../../releases/base/onprem/extras/ckaf-schema-registry.yaml
- ../../../../releases/base/onprem/extras/jira.yaml
- ../../../../releases/base/onprem/extras/kowl.yaml
# - ../../../../releases/base/onprem/extras/mock-server.yaml
- ../../../../releases/base/onprem/extras/ssh-server.yaml
# use cases
# - ../../../../usecases/onprem/helmrelease-etlflow-1301-ncom-data-enrichment.yaml
# custom
# - ./custom/helmrelease_sample.yaml
# ---------------------------------------------------------------------------
# PatchesStrategicMerge
# define overrides specific for a customer
# ---------------------------------------------------------------------------
patchesStrategicMerge:
- ./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
- ./overrides/infra/ingress-nginx.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
# - ./overrides/usecases/helmrelease-etlflow-1301-ncom-data-enrichment.yaml
|
Releases
...
language | yml |
---|---|
title | kustomization.yaml |
...
Creating a Cluster from the Template
All clusters are defined under the /clusters folder in the GitLab repository.
Contents of the CLUSTER_TEMPLATE folder should be copied to a new folder. Once this is done, we can make changes specific to the cluster which includes:
- Release Version
- Cluster Overrides