linkyard / concourse-helm-resource

Deploy to kubernetes helm from your concourse.ci.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

deploy chart doesn't work for some reason.

ldbl opened this issue · comments

I follow this tutorial :https://cloud.google.com/solutions/continuous-integration-helm-concourse
With the images provided there. It works but it use helm 2.6.2 and concourse-helm-resource:2.6.2
I tried to use the latest version 1.12.2 but it fails for some strange reason and I can't find how to fix it.
Here is some info.
My resoure type:

- name: helm
  type: docker-image
  source:
    repository: ldbl/helm-concourse-gcp

My job:

    plan:
    - get: app-image
      trigger: true
      passed:
      - build-image
    - get: chart-source
      trigger: true
    - task: build-chart
      file: chart-source/tasks/prep-chart.yaml
      params:
	bucket: {{bucket}}
        chart_name: {{chart_name}}
    - put: {{release_name}}
      params:
        chart: gcs-repo/{{chart_name}}
        override_values:
        - key: image.repository
          path: app-image/repository
        - key: image.digest
          path: app-image/digest

My dockerfile

FROM linkyard/concourse-helm-resource

ENV PATH=$PATH:/opt/google-cloud-sdk/bin
ENV GCLOUD_SDK_VERSION=234.0.0
ENV GCLOUD_SDK_URL=https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GCLOUD_SDK_VERSION}-linux-x86_64.tar.gz

# Add helm-gcs pluginf
RUN helm init --client-only && \
    helm plugin install https://github.com/viglesiasce/helm-gcs.git --version v0.2.0

# Install gcloud
RUN apk update && apk add curl openssl python \
 && mkdir -p /opt && cd /opt \
 && wget -q -O - $GCLOUD_SDK_URL |tar zxf - \
 && /bin/bash -l -c "echo Y | /opt/google-cloud-sdk/install.sh && exit"

I got this error

Initializing kubectl...
Cluster "default" set.
User "admin" set.
Context "default" created.
Switched to context "default".
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.6", GitCommit:"b1d75deca493a24a2f87eb1efde1a569e52fc8d9", GitTreeState:"clean", BuildDate:"2018-12-16T04:39:52Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11+", GitVersion:"v1.11.6-gke.2", GitCommit:"04ad69a117f331df6272a343b5d8f9e2aee5ab0c", GitTreeState:"clean", BuildDate:"2019-01-04T16:19:46Z", GoVersion:"go1.10.3b4", Compiler:"gc", Platform:"linux/amd64"}
Initializing helm...
Client: &version.Version{SemVer:"v2.12.2", GitCommit:"7d2b0c73d734f6586ed222a567c5d103fed435be", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.12.2", GitCommit:"7d2b0c73d734f6586ed222a567c5d103fed435be", GitTreeState:"clean"}
Installing helm repository gcs-repo gs://modular-robot-222611-helm-repo
"gcs-repo" has been added to your repositories
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository
...Successfully got an update from the "stable" chart repository
...Successfully got an update from the "gcs-repo" chart repository
Update Complete. ⎈ Happy Helming!⎈ 
Resource setup successful.
Installing dev-site
Running command helm upgrade dev-site gcs-repo/"nginx" --tiller-namespace=kube-system --set image.repository=gcr.io/modular-robot-222611/app-image --set image.digest=sha256:5b49c8e2c890fbb0a35f6050ed3c5109c5bb47b9e774264f4f3aa85bb69e2033 --install --namespace default | tee /tmp/log
Error: failed to download "gcs-repo/\"nginx\"" (hint: running `helm repo update` may help)

More interesting is that if I intercept this step and execute exactly the same command from the containter it actually works and I don't know what is wrong exactly

helm upgrade dev-site gcs-repo/"nginx" --tiller-namespace=kube-system --set image.repository=gcr.io/modular-robot-222611/app-image --set image.digest=sha256:5b49c8e2c890fbb0a35f6050ed3c5109c5bb47b9e774264f4f3aa85bb69e2033 --install --namespace default

I .

1: build #3, step: dev-site, type: put
2: build #4, step: build-chart, type: task
3: build #4, step: dev-site, type: put
4: build #5, step: build-chart, type: task
5: build #5, step: dev-site, type: put
choose a container: 5
bash-4.4# helm upgrade dev-site gcs-repo/"nginx" --tiller-namespace=kube-system --set image.repository=gcr.io/modular-robot-222611/app-image --set image.digest=sha256:5b49c8e2c890fbb0a35f6050ed3c5109c5bb47b9e774264f4f3aa85bb69e2033 --install --namespace default
Release "dev-site" does not exist. Installing it now.
NAME:   dev-site
LAST DEPLOYED: Fri Feb 15 09:57:54 2019
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/Service
NAME            TYPE       CLUSTER-IP    EXTERNAL-IP  PORT(S)  AGE
dev-site-nginx  ClusterIP  10.3.240.104  <none>       80/TCP   0s

==> v1beta1/Deployment
NAME            DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE
dev-site-nginx  1        1        1           0          0s

==> v1/Pod(related)
NAME                             READY  STATUS             RESTARTS  AGE
dev-site-nginx-78f78f6b58-bqm6l  0/1    ContainerCreating  0         0s

==> v1/ConfigMap
NAME                   DATA  AGE
dev-site-nginx-static  1     0s


NOTES:
1. Get the application URL by running these commands:
  export POD_NAME=$(kubectl get pods --namespace default -l "app=nginx,release=dev-site" -o jsonpath="{.items[0].metadata.name}")
  echo "Visit http://127.0.0.1:8080 to use your application"
  kubectl port-forward $POD_NAME 8080:80

Can someone give me some clue how to fix this ?

Btw this is the result if I use this docker file only change is the version

FROM linkyard/concourse-helm-resource:2.6.2

ENV PATH=$PATH:/opt/google-cloud-sdk/bin
ENV GCLOUD_SDK_VERSION=234.0.0
ENV GCLOUD_SDK_URL=https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GCLOUD_SDK_VERSION}-linux-x86_64.tar.gz

# Add helm-gcs pluginf
RUN helm init --client-only && \
    helm plugin install https://github.com/viglesiasce/helm-gcs.git --version v0.2.0

# Install gcloud
RUN apk update && apk add curl openssl python \
 && mkdir -p /opt && cd /opt \
 && wget -q -O - $GCLOUD_SDK_URL |tar zxf - \
 && /bin/bash -l -c "echo Y | /opt/google-cloud-sdk/install.sh && exit"

It works fine even the helm on the server is completely different version.

Initializing kubectl...
Cluster "default" set.
User "admin" set.
Context "default" created.
Switched to context "default".
Kubernetes master is running at https://kubernetes
GLBCDefaultBackend is running at https://kubernetes/api/v1/namespaces/kube-system/services/default-http-backend/proxy
Heapster is running at https://kubernetes/api/v1/namespaces/kube-system/services/heapster/proxy
KubeDNS is running at https://kubernetes/api/v1/namespaces/kube-system/services/kube-dns/proxy
Metrics-server is running at https://kubernetes/api/v1/namespaces/kube-system/services/metrics-server/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
Currently deployed namespaces on https://kubernetes:
NAME          STATUS    AGE
default       Active    2d
kube-public   Active    2d
kube-system   Active    2d
Initializing helm...
Client: &version.Version{SemVer:"v2.6.2", GitCommit:"be3ae4ea91b2960be98c07e8f73754e67e87963c", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.12.2", GitCommit:"7d2b0c73d734f6586ed222a567c5d103fed435be", GitTreeState:"clean"}
Installing helm repository gcs-repo gs://modular-robot-222611-helm-repo
"gcs-repo" has been added to your repositories
Resource setup successful.
Upgrading dev-site
Running command helm upgrade dev-site --set image.repository=gcr.io/modular-robot-222611/app-image --set image.digest=sha256:5b49c8e2c890fbb0a35f6050ed3c5109c5bb47b9e774264f4f3aa85bb69e2033 gcs-repo/"nginx" | tee /tmp/log
Release "dev-site" has been upgraded. Happy Helming!
LAST DEPLOYED: Fri Feb 15 10:33:36 2019
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/ConfigMap
NAME                   DATA  AGE
dev-site-nginx-static  1     35m

==> v1/Service
NAME            TYPE       CLUSTER-IP    EXTERNAL-IP  PORT(S)  AGE
dev-site-nginx  ClusterIP  10.3.240.104  <none>       80/TCP   35m

==> v1beta1/Deployment
NAME            DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE
dev-site-nginx  1        2        1           1          35m

==> v1/Pod(related)
NAME                             READY  STATUS   RESTARTS  AGE
dev-site-nginx-78f78f6b58-bqm6l  1/1    Running  0         35m
dev-site-nginx-bd97c7b66-hpkqc   0/1    Pending  0         0s


NOTES:
1. Get the application URL by running these commands:
  export POD_NAME=$(kubectl get pods --namespace default -l "app=nginx,release=dev-site" -o jsonpath="{.items[0].metadata.name}")
  echo "Visit http://127.0.0.1:8080 to use your application"
  kubectl port-forward $POD_NAME 8080:80

Deployed revision 2 of dev-site

Hm, that's really strange, deploying with a version mismatch should not work.. maybe 2.6.2 is so old that it does not even check.
Are you still working on it or may I close the issue?

Hi , I fixed this by removing the quotes.
gcs-repo/"nginx" to gcs-repo/nginx
You can close this .

Great, thanks for the feedback!