Skip to content

WIP: PoC Bundling charts

Shinya Maeda requested to merge poc-bundle-charts into master

This MR is PoC for gitlab-org/charts/auto-deploy-app#70 (moved). Not for merge.

The chart directory in this MR is programmatically copied by the following script

image_repo=/home/shinya/workspace/auto-deploy-image
chart_repo=/home/shinya/workspace/auto-deploy-app
new_chart_dir=vendor/auto-deploy-app-chart
cd $image_repo
rm -Rf $new_chart_dir && mkdir -p $new_chart_dir
git -C $chart_repo checkout master
git -C $chart_repo pull origin master
cp -R $chart_repo/* $image_repo/$new_chart_dir

https://gitlab.com/gitlab-org/charts/auto-deploy-app

What's changed aside from chart directory.

  • Dockerfile ... To bundle the chart into the auto-deploy image.
  • src/bin/auto-deploy ... Copying bundled chart if user-defined chart and chart repository variable do not exist.

Sample output on AutoDevOps pipelines

https://gitlab.com/dosuken123/new-sentimentality/-/jobs/615225100

Sample output on local env

shinya@shinya-MS-7A34:~/workspace/auto-deploy-image$ docker run -ti auto-deploy-image:bundling /bin/bash
bash-4.4# mkdir runner-build
bash-4.4# cd runner-build
bash-4.4# auto-deploy download_chart
Copying bundled charts...
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 
Adding local repo with URL: http://127.0.0.1:8879/charts 
$HELM_HOME has been configured at /root/.helm.
Not installing Tiller due to 'client-only' flag having been set
"gitlab" has been added to your repositories
Hang tight while we grab the latest from your chart repositories...
...Unable to get an update from the "local" chart repository (http://127.0.0.1:8879/charts):
        Get http://127.0.0.1:8879/charts/index.yaml: dial tcp 127.0.0.1:8879: connect: connection refused
...Successfully got an update from the "stable" chart repository
...Successfully got an update from the "gitlab" chart repository
Update Complete.
Saving 1 charts
Downloading postgresql from repo https://kubernetes-charts.storage.googleapis.com/
Deleting outdated charts
Hang tight while we grab the latest from your chart repositories...
...Unable to get an update from the "local" chart repository (http://127.0.0.1:8879/charts):
        Get http://127.0.0.1:8879/charts/index.yaml: dial tcp 127.0.0.1:8879: connect: connection refused
...Successfully got an update from the "stable" chart repository
...Successfully got an update from the "gitlab" chart repository
Update Complete.
Saving 1 charts
Downloading postgresql from repo https://kubernetes-charts.storage.googleapis.com/
Deleting outdated charts
Edited by Shinya Maeda

Merge request reports