Can a Helm values.yaml file be Updated from the Command Line? - gitlab

I'm using gitlab for my build pipeline and helm to package my application.
When the build for my app succeeds I want to update my chart repo with a new image tag.
Is there a way to update the values.yaml file for a helm chart from the helm cli?

You can use yq to update the files, but helm does not do this.
I use this to update the version in my chart.yaml
yq -i eval '.version = "${nextVersion}"' Chart.yaml

Related

Automate helm chart deployment

We in the process migrating our application from VM to azure OpenShift.
we have:
converted docker compose files to kubernetes manfifests
created a helm chart with the manifest files
Manually giving helm install command to install the application
What are the options to automate the deployment in azure OpenShift.
Please advice.
Manual helm install we are using , looking for automating in an efficient way.

Install Linux package on launch when deploying Airflow with Helm in Azure Kubernets Service

I'm trying to install Airflow on Azure Kubernetes Service (AKS) using Helm. I've found some guides to do so, and with some difficulty I've managed to get it working fine. I was now trying to run some DAGs I made and in one of those DAGs I use the bash operator to run a specific command, and that command needs a Linux package that does not come with the default image Helm uses for Airflow...
https://github.com/airflow-helm/charts/tree/main/charts/airflow
Is there a way to include extra Linux packages for the Helm Airflow chart installation? I've looked all over for it but couldn't find anything
Hope someone can help me on this.
Helm itself is a templating language. Most of the helm charts give you a flexibility to change your base image of the applications. As long as you are using the related image, the helm chart will create a correct deployment for you.
In your case, if you want to extend the functionalities or install more packages in the base image, you will need to create your own image and push to an image repository.
For example, you can install your package like this with Dockerfile defined locally.
FROM apache/airflow:1.10.12-python3.6
RUN apt update && \
apt install vim -y && \
rm -rf /var/lib/apt/lists/*
Then, run the following command to build and upload your custom image.
docker build -t my-account/my-airflow:latest .
docker push my-account/my-airflow:latest
In your values file, you can specify your image name and tag then.
airflow:
image:
repository: my-account
tag: my-airflow
Once you apply this values file, helm will help you to change the default image to your customized one.
The tutorial in the doc also mentions the custom image but it is for the DAG building. But with the same technique, you can customize your own base image.

How to install gitlab-runner in Azure Kubernetes Service?

I'm trying to install Gitlab Runner inside my cluster in Azure Kubernetes Service (AKS), but I have 2 errors:
Helm Tiller doesn't appear in the application list of Gitlab CI:
Most of tutorials tell that it has to be installed, but today it is not even proposed as you can see here:
When I install gitlab-runner from this list, I have a message error like
"Something went wrong while installing Gitlab Runner
Operation failed. Check pod logs for install-runner for more details"
So when I check the logs, I have this:
The 2 last lines there is an error, some answers tell that I need to change the repo with Helm command, so I do that from the Azure CLI bash in the portal, but I still have the same error, I execute the code like this :
helm repo rm stable
helm repo add stable https://charts.helm.sh/stable
And then I update, do I need to give more arguments in commands?
GitLab 13.12 (May 2021) does clearly mention:
Helm v2 support
Helm v2 was officially deprecated in November of 2020, with the stable repository being de-listed from the Helm Hub shortly thereafter.
With the release of GitLab 14.0 (June 2021), which will include the 5.0 release of the GitLab Helm chart, Helm v2 will no longer be supported.
Users of the chart should upgrade to Helm v3 to deploy GitLab 14.0 and above.
So that is why Helm Tiller doesn't appear in the application list of Gitlab CI.

IBM Cloud DevOps continuous delivery pipeline Node version too low

We need to build an Angular 6 front end project on IBM Cloud using the DevOps pipeline, but the project requires at least Node v8, while IBM Cloud DevOps pipeline only support v6.7. How can we build our project? Is it possible to upgrade or customize a Node version in DevOps pipeline environment?
It is true that IBM's DevOps Toolchains currently export up to node 6.7.0 as detailed here https://console.bluemix.net/docs/services/ContinuousDelivery/pipeline_deploy_var.html#deliverypipeline_environment.
But you are free to install any version of node. To do so, add the following to your build job and remove any existing export to node supplied by the pipeline.
#!/bin/bash
npm config delete prefix
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | bash
. ~/.nvm/nvm.sh
nvm install 8.9.0
node --version
# build instructions follow
This approach uses Node Version Manager.
Another different solutions is using a custom Docker image with the Node version required by your service.
So, to configure your Pipeline Step, you need to select as Compilator Type a "Custom Docker image" and then, in the input field for the container name, select one for your Node version, for example "node:10.15.2"

Gitlab-Omnibus Helm chart not launching

I have launched a Kubernetes managed cluster on Azure [AKS].
I am trying to deploy a Gitlab chart via Helm by downloading the zip file and trying to install it.
I use these charts .
I go to this directory C:\Users\wehappyfew\Documents\Projects\k8s\omnibus\gitlab-omnibus and I use this command
helm install --name gitlab1 --namespace dev .
and I get this error
Error: found in requirements.yaml, but missing in charts/ directory: gitlab-runner
The gitlab-runner directory exists in the C:\Users\wehappyfew\Documents\Projects\k8s\omnibus path.
What am I doing wrong?
You need to pull dependencies first.
Follow the following steps:
helm repo add gitlab https://charts.gitlab.io
helm repo list to confirm the repo is added
helm dep build
Then run the helm install command

Resources