How do you add additional values.yaml files to helm/chart-testing-action?
Something like helm lint -f my-values.yaml.
You can use --values or --set to add additional values to chart.
Example:
helm install helm/chart-testing-action -f <Value file>
or
helm install helm/chart-testing-action --values <Value file>
Related
I have a problem with my GitLab job:
.render:
stage: validate
image: alpine:3.7
before_script: |
function render() {
apk add --no-cache gettext
envsubst < $1 > temp-file;
cp temp-file $1
rm temp-file
cat $1
}
This job has a function, that will replace environment variable of the file given to it. The job is based on the alpine image, to get the envsusbt command. ✔️
This .render job will then be extended by other validation jobs, and one of them being a job for validating helm charts. ✔️
But the issue is helm is not installed on the alpine image. Do I have to install it? I would've preferred to use the .render job like a tool, rather than extending it. ❌
What is the best way for one job to have both the envsubst command and the helm command at the same time?
render-test:
extends: .render
stage: validate
variables:
...
script: |
helm version
This job will fail, since helm is not present on the image
The solution I found was making an image that can have both the envsubst command and helm command. The image is hamuto/tools:1.0.0
I'm trying to deploy a helm file using gitlab ci/cd process, and it seems like variables aren't being provided correctly.
I've added some echo statements to make sure the runner knew about it:
echo $CI_ENVIRONMENT_NAME
devplatform
$ echo $DOCKER_REGISTRY
1234abcd.dkr.ecr.us-west-2.amazonaws.com
$ echo $CI_PROJECT_NAME
gitlab-project
$ echo $CI_COMMIT_SHA
7d3f491cf........7c73f65daec4d
$ export IMAGE_NAME="$DOCKER_REGISTRY/$CI_PROJECT_NAME"
$ export IMAGE_TAG=$CI_COMMIT_SHA
$ echo $IMAGE_NAME
abcd1234.dkr.ecr.us-west-2.amazonaws.com/gitlabproject
$ echo $IMAGE_TAG
7d3f491.........3100e7c73f65daec4d
$ gl-helmfile --environment $CI_ENVIRONMENT_NAME --namespace $CI_ENVIRONMENT_NAME --state-values-set image_name="$DOCKER_REGISTRY/$CI_PROJECT_NAME",image_tag=$CI_COMMIT_SHA sync
however when gl-helmfile deployes the helmfile, which has some values being set using "env" (such as "env $APP_PORT"), the resulting pods have blank values for things using "env". The only way I've been able to get around this is by setting blank values in values file, like
image_tag=""
image_name=""
app_port=""
and then setting the helmfile to use .Values.image_name, and then using:
--state-values-set image_name="$DOCKER_REGISTRY/$CI_PROJECT_NAME",image_tag=$CI_COMMIT_SHA
Is there a way to get environmental variables passed to helm during deployment?
I have done bitnami redis-cluster deployment using helm chart. I have followed below link for redis-cluster deployment-
https://github.com/bitnami/charts/tree/master/bitnami/redis-cluster
I wanted to enable redis logs, but not sure how to do it, as in the current bitnami redis image configuration file located at /opt/bitnami/redis/etc/redis.conf having parameter value logfile:"" as empty strings.
Please let me is there any ways to enable a redis server logs on each pod??
You can use helm --set flag to overwrite the default values in the redis.conf file.
// Add your custom configurations
$ export CUSTOM_CONFIG="logfile /data/logs/file.log"
// Apply those while installing
$ helm install redis bitnami/redis-cluster --set redis.configmap=$CUSTOM_CONFIG
You can check it from inside the pod:
$ kubectl exec -it redis-redis-cluster-0 -- cat /opt/bitnami/redis/etc/redis.conf
.
.
.
logfile /data/logs/file.log
Iam getting a message as No package kubectl available while installing kubectl
I have followed the documentation mentioned here
for CentOS VERSION="7 (Core)" , Linux kernel version = 3.10.0-862.14.4.el7.x8
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
yum search kubectl
yum install -y kubectl
when it is executing the command yum search kubectl it is giving the following logs
yum -y search kubectl
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
* base: mirror.ancl.hawaii.edu
* epel: fedora-epel.mirrors.tds.net
* extras: centos-distro.1gservers.com
* updates: centos.mirror.lstn.net
Retrieving key from https://packages.cloud.google.com/yum/doc/yum-key.gpg
Importing GPG key 0x.......(some value):
Userid : "Google Cloud Packages RPM Signing Key <gc-team#google.com>"
Fingerprint: xxxx xxxx ... (some value)
From : https://packages.cloud.google.com/yum/doc/yum-key.gpg
Retrieving key from https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
=============================== Matched: kubectl ===============================
kubernetes-client.x86_64 : Kubernetes client tools
$ yum install -y kubectl
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirror.ancl.hawaii.edu
* epel: fedora-epel.mirrors.tds.net
* extras: centos-distro.1gservers.com
* updates: centos.mirror.lstn.net
No package kubectl available.
Error: Nothing to do
I think it is not retrieving the key from "https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg"
The package is clearly available from that repository, so we just need to check your configuration to make sure we can install it.
<package pkgid="3d5dd3e6a783afcd660f9954dec3999efa7e498cac2c14d63725fafa1b264f14" name="kubectl" arch="x86_64"><version epoch="0" ver="1.15.0" rel="0"/><file>/usr/bin/kubectl</file></package>
Source: https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64/repodata/filelists.xml
I would first check that A)/etc/yum.repos.d/kubernetes.repo actually exists, and B) that the contents match, i.e., via cat /etc/yum.repos.d/kubernetes.repo.
Next, both of the commands below can be used to search for the kubectl package.
# Using search
yum search kubectl
# Using grep
yum list | grep kubectl
For importing the GPG key for use with yum, see the following answer:
https://unix.stackexchange.com/q/337257/247886
Try with this:
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
setenforce 0
yum install -y kubelet kubeadm kubectl
You may also try to install a specific version by executing: yum install -y kubelet-<version> kubectl-<version> kubeadm-<version>
Always make sure your versions satisfy dependency requirements.
If you have some older versions, uninstall them first.
You may also consider using kubeadm init.
Please let me know if that helped.
Ideally it should work with kubernetes.repo file also but it didn't work in my case. So installed using below steps from the official documentation and it was successful.
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
I am following a tutorial that can be found here to set up a headless selenium scraper on an ec2 instance:
https://krbnite.github.io/Driving-Headless-Chrome-with-Selenium-on-AWS-EC2/
The tutorial I am using seems to assume an ubuntu distro whereas the ec2 instance I am using is an AWS AMI. As such apt-get is not available to me and instead I use yum to install things.
The first step of the installation process is the following:
wget -q -O - "https://dl-ssl.google.com/linux/linux_signing_key.pub" | sudo apt-key add -
When I do this I get the following, to be expected error on my AWS AMI instance:
sudo: apt-key: command not found
I was wondering what the equivalent command would be without using apt, apt-get, or apt-key but instead using yum. I have blindly tried the following but they did not work:
wget -q -O - "https://dl-ssl.google.com/linux/linux_signing_key.pub" | sudo yum add -
wget -q -O - "https://dl-ssl.google.com/linux/linux_signing_key.pub" | sudo yum-key add -
Thanks
Below is from an article on Baeldung which I think answers this questions properly:
Adding a repository in YUM is a manual operation, which consists in creating a file with the .repo extension under the folder /etc/yum.repos.d.
The file must contain all the information about the custom repository that we are connecting to.
Let’s try adding the AdoptOpenJDK repository:
# /etc/yum.repos.d/adoptopenjdk.repo
[AdoptOpenJDK]
name=AdoptOpenJDK
baseurl=http://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/7/$(uname -m)
enabled=1
gpgcheck=1
gpgkey=https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public
In APT, though, things are quite different. The GPG key of the repository must be downloaded and added to the APT keyring with apt-key add:
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
Then, at this point, the repository can be added through add-apt-repository –yes followed by the URL:
add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
Contrary to YUM, all the repositories are saved in a single file,
/etc/apt/sources.list.
Add the repo and then import the repo GPG key
sudo wget -o /etc/yum.repos.d/reponame.repo <repo url>
sudo rpm --import <key url>
Confirm
yum repolist