After this part you will be able to
After Setting up your Kubernetes cluster and control repository it is now time to deploy the first Building Block.
As the Building Blocks are heavily optimized for production-ready environments, their interdependencies come naturally. One of the core dependencies is the Observability Building Block. It ensures that following Building Blocks integrate automatically into your environment and can be added to your Monitoring and Logging seamlessly.
This Step will be explained by using the CLI shell, so we have a single window to work in. Please adapt accordingly to your needs.
As Metakube Accelerator focuses on DevOps we expect you to have enough experience to work with the common tool set for administration tasks on unix
Furthermore, we will use "syseleven" as Project and Company name, "showcase" as our control repository name as well as "development as our environment. Please adjust accordingly. You can add the following content for every environment.
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm pull --untar --untardir /tmp/kube-prometheus-stack --version 13.12.0 prometheus-community/kube-prometheus-stack kubectl apply -f /tmp/kube-prometheus-stack/kube-prometheus-stack/crds/ # rm -r /tmp/kube-prometheus-stack
If you haven't done it already clone your control repository and add a suitable folder for the incoming building block:
# Make sure you are in a suitable directory for a new folder, clone your own control-repository git clone email@example.com:/syseleven/showcase # When listing the files you should see the .gitlab-ci.yml you created on the previous step, e.g. # -rw-r--r-- 1 user staff 1647 8 Feb 16:27 .gitlab-ci.yml mkdir syseleven-kube-prometheus-stack
.gitlab-ci.yml to this folder with the following content to include the JobDevelopment.yaml which includes the best practices for a development environment:
include: - project: syseleven/building-blocks/helmfiles/kube-prometheus-stack file: JobDevelopment.yaml ref: 4.2.0
values-kube-prometheus-stack.yaml with the following content to specify all global settings:
prometheus: prometheusSpec: retention: 10d
Now include environment-specific settings in
grafana: replicas: 1 persistence: enabled: true adminPassword: $PASSWORD ingress: enabled: false alertmanager: ingress: enabled: false prometheus: prometheusSpec: resources: requests: memory: 500Mi cpu: 500m limits: memory: 2Gi cpu: "2" storageSpec: volumeClaimTemplate: spec: resources: requests: storage: 2Gi
After adding all these file your control repo should look like this:
/ └── syseleven-kube-prometheus-stack/ ├── .gitlab-ci.yml ├── values-kube-prometheus-development.yaml └── values-kube-prometheus.yaml .gitlab-ci.yml
In the End you can now include the
.gitlab-ci.yml from your syseleven-kube-prometheus-stack to your CI/CD pipeline.
.gitlab-ci.yml in your root folder
*/* should now look like this:
stages: - diff - deploy include: - /syseleven-kube-prometheus-stack/.gitlab-ci.yml
And it is all set! Now you can commit your changes and your pipeline will start testing and deploying your Building Block.
git add . git commit -m "add kube-prometheus-stack as building block" git push
and watch the output of your pipeline on SysEleven Code!