Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm (built docker image) really heavy on cloud build pipeline and affect execution time #480

Open
Emixam23-FCMS opened this issue Jan 28, 2021 · 2 comments

Comments

@Emixam23-FCMS
Copy link

Affected builder image

gcr.io/cloud-builders-community/helm

The image built for helm to be used on cloud build is very (very) heavy, more than 3GB
https://github.com/GoogleCloudPlatform/cloud-builders-community/tree/master/helm

Expected Behavior

I would like the build to result to a smaller image so the cloud build step can execute faster (as the pull would be less significant)

Actual Behavior

The image built for helm to be used on cloud build is very (very) heavy, more than 3GB

@sakulh
Copy link

sakulh commented Oct 9, 2021

I have same problem. Due to big size of the Helm docker image the duration time of the deploy step is 00:01:37.

My deploy step in cloudbuild.yaml:

  - name: gcr.io/$_GOOGLE_CLOUD_PROJECT/helm
    id: Deploy chart
    args:
      - upgrade
      - -i
      - my-project
      - ./my-project-chart
      - -f
      - ./my-project-chart/values.yaml
    env:
      - KUBECONFIG=/workspace/.kube/config
      - TILLERLESS=true

I'am using Kaniko for building of the docker images and duration time is 5-10 seconds but deploy step is almost 2 minutes.
Any idea how to speed up?

Thank you.

@c4talyst
Copy link

c4talyst commented Apr 19, 2023

Ended up building a custom image for helm.

cloud-builders-community/helm: 1.1GB
this image: 82.4MB

Dockerfile

FROM ubuntu:22.04

RUN apt update

RUN apt install -y \
    apt-transport-https \
    ca-certificates \
    gnupg \
    curl

RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" \
    | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg \
    | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

RUN curl https://baltocdn.com/helm/signing.asc \
    | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" \
    | tee /etc/apt/sources.list.d/helm-stable-debian.list

RUN apt update
RUN apt install -y \
    helm \
    google-cloud-sdk-gke-gcloud-auth-plugin

cloudbuild.yaml

substitutions:
  _GCR_REGISTRY: eu.gcr.io
steps:
- name: gcr.io/cloud-builders/kubectl
  id: Configure kubectl
  args:
    - cluster-info
  env:
    - CLOUDSDK_COMPUTE_REGION=$_CUSTOM_REGION
    - CLOUDSDK_CONTAINER_CLUSTER=$_CUSTOM_CLUSTER
    - KUBECONFIG=/workspace/.kube/config
- name: $_GCR_REGISTRY/$PROJECT_ID/helm-ubuntu
  id: Helm upgrade whatever
  entrypoint: 'helm'
  args:
    - upgrade
    - -i
    - ... whatever ...
  env:
    - KUBECONFIG=/workspace/.kube/config
    - TILLERLESS=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants