Git Product home page Git Product logo

helmize's Introduction

Helmize

Go Reference Go Report Card Test Codecov

A KRM function to enable Helm on Kustomize with Glob support

The motivation for this project is quite simple. While Helm integration in Kustomize is already available, it falls short in scenarios where dynamic use of Glob is required to fetch all necessary values.yaml files. In such cases, it lacks support. With the likelihood of glob support being added to Kustomize remaining uncertain for the foreseeable future, this project was initiated to address this limitation.

Usage

Exec KRM Function

Create HelmRelease Manifest

cat <<EOF > release-simple.yaml
apiVersion: toolkit.ardikabs.com/v1alpha1
kind: HelmRelease
metadata:
  name: simple-a
  namespace: default
  annotations:
    config.kubernetes.io/function: |
      exec:
        path: helmize
spec:
  chart: minecraft
  repo:
    name: minecraft
    url: https://itzg.github.io/minecraft-server-charts
EOF

cat <<EOF > release-with-glob.yaml
apiVersion: toolkit.ardikabs.com/v1alpha1
kind: HelmRelease
metadata:
  name: service-a
  namespace: default
  annotations:
    config.kubernetes.io/function: |
      exec:
        path: helmize
spec:
  chart: common-app
  repo:
    name: ardikabs
    url: https://charts.ardikabs.com
  version: 0.4.1
  values:
    - values.yaml
    - values/*.yaml
    - values/**/*.yaml
EOF

cat <<EOF > release-with-oci-repo.yaml
apiVersion: toolkit.ardikabs.com/v1alpha1
kind: HelmRelease
metadata:
  name: envoy-gateway
  namespace: envoy-gateway-system
  annotations:
    config.kubernetes.io/function: |
      exec:
        path: helmize
spec:
  repo:
    url: oci://docker.io/envoyproxy/gateway-helm
  version: v0.5.0
  includeCRDs: true
  createNamespace: true
EOF

Generate Manifest

cat <<EOF > kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

generators:
- release-simple.yaml
- release-with-glob.yaml
- release-with-oci-repo.yaml
EOF

kustomize build --enable-alpha-plugins --enable-exec .

Legacy Plugin

Download Helmize binary

curl -sSfL -O https://github.com/ardikabs/helmize/releases/download/v0.1.1/helmize_0.1.1_linux_amd64

export HELMIZE_PLUGIN_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/kustomize/plugin/toolkit.ardikabs.com/v1alpha1/helmrelease"
mkdir -p $HELMIZE_PLUGIN_DIR
mv helmize_0.1.1_linux_amd64 "${HELMIZE_PLUGIN_DIR}/HelmRelease"

Create HelmRelease Manifest

cat <<EOF > release-simple.yaml
apiVersion: toolkit.ardikabs.com/v1alpha1
kind: HelmRelease
metadata:
  name: simple-a
  namespace: default
spec:
  chart: minecraft
  repo:
    name: minecraft
    url: https://itzg.github.io/minecraft-server-charts
EOF

cat <<EOF > release-with-glob.yaml
apiVersion: toolkit.ardikabs.com/v1alpha1
kind: HelmRelease
metadata:
  name: service-a
  namespace: default
spec:
  chart: common-app
  repo:
    name: ardikabs
    url: https://charts.ardikabs.com
  version: 0.4.1
  values:
    - values.yaml
    - values/*.yaml
    - values/**/*.yaml
EOF

cat <<EOF > release-with-oci-repo.yaml
apiVersion: toolkit.ardikabs.com/v1alpha1
kind: HelmRelease
metadata:
  name: envoy-gateway
  namespace: envoy-gateway-system
spec:
  repo:
    url: oci://docker.io/envoyproxy/gateway-helm
  version: v0.5.0
  includeCRDs: true
  createNamespace: true
EOF

Generate Manifest

cat <<EOF > kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

generators:
- release-simple.yaml
- release-with-glob.yaml
- release-with-oci-repo.yaml
EOF

kustomize build --enable-alpha-plugins .

More

For more example, please refer to examples directory.

helmize's People

Contributors

ardikabs avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.