Source

Implementation

Provisioner Type

Resource Type

Flavor

Tool

helm-upgrade-redis

For 10-redis-helm-template.provisioners.yaml

Prerequisites:

For 10-redis-helm-upgrade.provisioners.yaml

Prerequisites:

  • Have helm installed locally, this provisioner installs the Bitnami’s Redis Helm chart.
  • Have access to a cluster where the Helm chart will be installed.
    • If you don’t have one, you can deploy a Kind cluster locally by running this script: .scripts/setup-kind-cluster.sh.
Deploys the bitnami/redis Helm chart in an existing cluster.

type: redis
expected_outputs:
  - host
  - port
  - username
  - password

10-redis-helm-upgrade.provisioners.yaml (view on GitHub) :

- uri: cmd://bash#helm-upgrade-redis
  type: redis
  description: Deploys the bitnami/redis Helm chart in an existing cluster. 
  args:
  - -c
  - |
    STDIN=$(cat)
    SERVICE=$(echo $STDIN | yq eval -p json '.resource_id' | yq '. |= sub("\.", "-")')
    NAMESPACE=$(echo $STDIN | yq eval -p json '.namespace')
    if [ -z "$NAMESPACE" ]; then
      NAMESPACE="default"
    fi
    set -eu -o pipefail
    helm repo add bitnami https://charts.bitnami.com/bitnami >&2
    helm upgrade -i ${SERVICE} bitnami/redis --set replica.replicaCount=1 -n ${NAMESPACE} --wait >&2
    OUTPUTS='{"resource_outputs":{"host":"%s-master", "port":"6379", "username":"", "password":"🔐💬%s_redis-password💬🔐"},"manifests":[]}'
    printf "$OUTPUTS" "$SERVICE" "$SERVICE"    
  expected_outputs: 
    - host 
    - port 
    - username 
    - password