Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

getporter/helm2-mixin

Repository files navigation

Helm v2 Mixin for Porter

Build Status

This is a Helm v2 mixin for Porter. It executes the appropriate helm command based on which action it is included within: install, upgrade, or delete.

🚨 Helm v2 is deprecated so you should move to Helm v3 as soon as possible. After you migrate to Helm 3, use the Helm 3 mixin. 🚀

Install or Upgrade

porter mixin install helm2

Mixin Configuration

Helm client version

- helm2:
    clientVersion: v2.17.0

Add repositories

- helm2:
    repositories:
      stable:
        url: "https://charts.helm.sh/stable

Mixin Syntax

Install

install:
- helm2:
    description: "Description of the command"
    name: RELEASE_NAME
    chart: STABLE_CHART_NAME
    version: CHART_VERSION
    namespace: NAMESPACE
    replace: BOOL
    devel: BOOL
    wait: BOOL # default true
    set:
      VAR1: VALUE1
      VAR2: VALUE2

Upgrade

install:
- helm2:
    description: "Description of the command"
    name: RELEASE_NAME
    chart: STABLE_CHART_NAME
    version: CHART_VERSION
    namespace: NAMESPACE
    resetValues: BOOL
    reuseValues: BOOL
    wait: BOOL # default true
    set:
      VAR1: VALUE1
      VAR2: VALUE2

Uninstall

uninstall:
- helm2:
    description: "Description of command"
    purge: BOOL
    releases:
      - RELEASE_NAME1
      - RELASE_NAME2

Outputs

The mixin supports saving secrets from Kuberentes as outputs.

outputs:
    - name: NAME
      secret: SECRET_NAME
      key: SECRET_KEY

The mixin also supports extracting resource metadata from Kubernetes as outputs.

outputs:
    - name: NAME
      resourceType: RESOURCE_TYPE
      resourceName: RESOURCE_TYPE_NAME
      namespace: NAMESPACE
      jsonPath: JSON_PATH_DEFINITION

Examples

Install

install:
- helm2:
    description: "Install MySQL"
    name: mydb
    chart: stable/mysql
    version: 0.10.2
    namespace: mydb
    replace: true
    set:
      mysqlDatabase: wordpress
      mysqlUser: wordpress
    outputs:
      - name: mysql-root-password
        secret: mydb-mysql
        key: mysql-root-password
      - name: mysql-password
        secret: mydb-mysql
        key: mysql-password
      - name: mysql-cluster-ip
        resourceType: service
        resourceName: porter-ci-mysql-service
        namespace: "default"
        jsonPath: "{.spec.clusterIP}"

Upgrade

upgrade:
- helm2:
    description: "Upgrade MySQL"
    name: porter-ci-mysql
    chart: stable/mysql
    version: 0.10.2
    wait: true
    resetValues: true
    reuseValues: false
    set:
      mysqlDatabase: mydb
      mysqlUser: myuser
      livenessProbe.initialDelaySeconds: 30
      persistence.enabled: true

Uninstall

uninstall:
- helm2:
    description: "Uninstall MySQL"
    purge: true
    releases:
      - mydb