using Helm behind a proxy - kubernetes-helm

I want to use Helm on new environment that only have access to Internte via Proxy.
How can I use Helm commands with proxy?
helm repo add ....
helm repo update
I tried to give proxy in command but I get following error:
Error: "helm repo add" requires 2 arguments

Related

How to add Jfrog Artifactory as a HELM registry in Spinnaker

I am trying to add the Jfrog Artifactory to spinnaker so that spinnaker will be able to fetch the helm chart and makes the deployment. I am trying this command but it's not working
hal config artifact helm account add my-helm-account \
--username-password-file $USERNAME_PASSWORD_FILE
When I run the pipeline it shows me this error
Status: 500, URL: http://spin-clouddriver.spinnaker:7002/artifacts/fetch/, Message: Failed to download index.yaml file in
You'll need to provide the --repository flag as well. I'm guessing that spin-clouddriver URL is the default if a repository isn't specified.
The final hal command may look like this:
hal config artifact helm account add my-helm-account --username-password-file $USERNAME_PASSWORD_FILE --repository https://my.artifactory.com/artifactory/helm
Reference for the command: https://spinnaker.io/docs/reference/halyard/commands/#hal-config-artifact-helm-account-add

Error in installing csidrvier to a kubernetes namesapce - This command needs 1 argument: chart name

I am a Kubernetes novice. I am trying to install a csi driver to a Kubernetes Namespace in a kubernetes cluster. I am using helm 2.16 version to do the install using below command :
.\helm install csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver -n csi
Error: This command needs 1 argument: chart name
Also tried running :
.\helm install csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver --namespace csi and get below Error :
Error: This command needs 1 argument: chart name
Can some one help me with the correct command?
.\helm version
Client: &version.Version{SemVer:"v2.16.12", GitCommit:"47f0b88409e71fd9ca272abc7cd762a56a1c613e", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.16.1", GitCommit:"bbdfe5e7803a12bbdf97e94cd847859890cf4050", GitTreeState:"clean"}
Thanks
According to the official docs:
This command installs a chart archive.
The install argument must be a chart reference, a path to a packaged
chart, a path to an unpacked chart directory or a URL.
To override values in a chart, use either the –values flag and pass
in a file or use the –set flag and pass configuration from the
command line. To force string values in –set, use –set-string
instead. In case a value is large and therefore you want not to use
neither –values nor –set, use –set-file to read the single large
value from file.
CHART REFERENCES
A chart reference is a convenient way of reference a chart in a chart
repository.
When you use a chart reference with a repo prefix (‘stable/mariadb’),
Helm will look in the local configuration for a chart repository named
‘stable’, and will then look for a chart in that repository whose name
is ‘mariadb’. It will install the latest version of that chart unless
you also supply a version number with the ‘–version’ flag.
To see the list of chart repositories, use ‘helm repo list’. To search
for charts in a repository, use ‘helm search’.
helm install [CHART] [flags]
Note the:
-n, --name string release name. If unspecified, it will autogenerate one for you
and:
--namespace string namespace to install the release into. Defaults to the current kube config namespace.
The error you see means that you did not reference the chart name properly. It looks like there are too many arguments for --name (csi-secrets-store and csi). For example it should look more like this:
helm install --name <release name> --namespace <namespace>
which would be transleted into your use case as:
helm install --name csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver --namespace csi
*Note that I am not sure of the values you want to use so you have to check them yourself and adjust if needed. Here I assume that csi is the namespace, csi-secrets-store is the release name and secrets-store-csi-driver/secrets-store-csi-driver is the repo/chart name.
Also make sure that the chart you want to install does not require Helm v3.0+. If so, than you will have to upgrade it before installing.

How to resolve https://kubernetes-charts.storage.googleapis.com" is not a valid chart repository

I am working on helm 2 and trying to deploy Tiller as pod.
>helm init --service-account tiller
But i am getting below Error:
Error: error initializing: Looks like "https://kubernetes-charts.storage.googleapis.com" is not a valid chart repository or cannot be reached: Get https://kubernetes-charts.storage.googleapis.com/index.yaml: dial tcp 172.217.2.240:443: connect: connection timed out
Has anyone faced this error and if yes , what is the recommended way to overcome this for helm2?
Helm versions prior to 2.17.0 have the deprecated https://kubernetes-charts.storage.googleapis.com/index.yaml as the default stable repository, which no longer resolves. The new repo is https://charts.helm.sh/stable. You can choose to:
Use the --stable-repo-url argument to specify the new repository:
helm init --stable-repo-url https://charts.helm.sh/stable --service-account tiller
Use the --skip-refresh argument and replace the stable repo:
helm init --client-only --skip-refresh
helm repo rm stable
helm repo add stable https://charts.helm.sh/stable
Upgrade helm to 2.17.0 or later.
helm init --client-only --skip-refresh
helm repo rm stable
helm repo add stable https://charts.helm.sh/stable
update the urls like below solved my issue
Name : stable
Old Location:https://kubernetes-charts.storage.googleapis.com
New Location:https://charts.helm.sh/stable
Name : incubator
Old Location:https://kubernetes-charts-incubator.storage.googleapis.com
New Location:https://charts.helm.sh/incubator
Reference:https://helm.sh/blog/new-location-stable-incubator-charts/
repo is not avail. use below repo.
k8scka#master:~$ helm3 repo add stable https://charts.helm.sh/stable
"stable" has been added to your repositories
k8scka#master:~$
I had this issue when targeting a helm_release resource in Terraform that was using the helm2 provider. We tracked it down to the root cause being a missing ~/.helm/repository/repositories.yaml file that helm2 uses, which must be also used by the Terraform provider.
The file can be recreated with a helm v2 client with
helm2 init --stable-repo-url https://charts.helm.sh/stable --client-only
There is no need to keep the helm v2 client afterwards if you only want to use Terraform.
Just for history and maybe anyone else will face also. Community answer.
Errors like "Error: error initializing: Looks like "https://kubernetes-charts.storage.googleapis.com" is not a valid chart repository or cannot be reached: Get https://kubernetes-charts.storage.googleapis.com/index.yaml: dial tcp 172.217.2.240:443: connect: connection timed out" are typically due to problems with Proxy and non-direct connection.
This was discussed in related github issue Cannot perform helm init behind proxy, lots have same problems. As per topic - users can have such problems with some of helm versions. Its recommended to use it starting from v2.11.0

Helm prevent from adding the default chart repo on helm init

I want to use Helm with Gitlab to deploy my services to OpenShift.
I have a Gitlab Runner deployed in OpenShift.
I already have Tiller installed in Openshift under the tiller namespace and am using the docker image docker.greater.com.au/platform/images/dtzar/helm-kubectl:latest
My system is also behind a proxy which I won't be able to get past.
As part of one of my Gitlab CI build steps I have the following:
$ helm init --client-only
Creating /root/.helm
Creating /root/.helm/repository
Creating /root/.helm/repository/cache
Creating /root/.helm/repository/local
Creating /root/.helm/plugins
Creating /root/.helm/starters
Creating /root/.helm/cache/archive
Creating /root/.helm/repository/repositories.yaml
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
Error: Looks like "https://kubernetes-charts.storage.googleapis.com" is not a valid chart repository or cannot be reached: Get https://kubernetes-charts.storage.googleapis.com/index.yaml: Proxy Authorization Required
My main question is I am wondering if it's possible to disable Helm from trying to add https://kubernetes-charts.storage.googleapis.com as a repostiory as part of helm init?
It might be worth noting that I do not know if helm init --client-only is a required step in using helm with this setup.
I have also tried a simple helm version and the server is responding with a Proxy Authorization Required error.
Client: &version.Version{SemVer:"v2.12.1",
GitCommit:"02a47c7249b1fc6d8fd3b94e6b4babf9d818144e", GitTreeState:"clean"}
Error: Get https://---.---.---.---:---/api/v1/namespaces/tiller/pods?labelSelector=app%3Dhelm%2Cname%3Dtiller: Proxy Authorization Required
I've removed the IP address but it's trying to resolve the Tiller server from the wrong IP address when running this helm version command.
You can define which stable repository you would like to use with option -o --stable-repo-url url.
Example: helm init --client-only --stable-repo-url https://path.to.my.repo
You could found more info here

I can't load a Helm chart into IBM Cloud Private

I'm trying to load a Helm chart into IBM Cloud Private. When I run the bx pr load-ppa-archive --archive command or the bx pr load-helm-chart --archive command, I get an error that says that it can't load my Helm chart:
FAILED
Post https://mycluster.icp:8443/helm-repo/import: Service Unavailable
How do I make this work?
If you're trying to load the Helm chart from a node in the IBM Cloud Private cluster, this error can be caused by your http_proxy or HTTP_PROXY settings. You can try two things:
1. Install the CLI on a computer that's not in the cluster and upload the chart from there.
2. Add mycluster and mycluster.icp to the NO_PROXY variable on the cluster node and try again.