helm

command
v1.2.0-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 3 Imported by: 0

README

Helm executor

Helm is the Botkube executor plugin that allows you to run the Helm CLI commands directly from any communication platform.

Manual testing

This section describes a manual testing of all supported Helm executor commands. It utilizes the k3d cluster and the leverages a built-in functionality to access your host system by referring to it as host.k3d.internal.

Only Slack integration is described, but described steps are the same for all communication platforms.

Install Botkube
  1. Export Slack tokens:

    export SLACK_API_APP_TOKEN={token} # should start with xapp-1-
    export SLACK_API_BOT_TOKEN={token} # should start with xoxb-
    
  2. Create /tmp/test-values.yaml:

    cat << EOF > /tmp/test-values.yaml
    communications:
      default-group:
        socketSlack:
          enabled: true
          channels:
            default:
              name: random
              bindings:
                executors:
                  - 'plugin-based'
          appToken: "${SLACK_API_APP_TOKEN}"
          botToken: "${SLACK_API_BOT_TOKEN}"
    
    executors:
      'plugin-based':
        botkube/helm:
          enabled: true
    
    extraEnv:
      - name: LOG_LEVEL_EXECUTOR_BOTKUBE_HELM
        value: "debug"
    
    plugins:
      cacheDir: "/tmp/plugins"
      repositories:
        botkube:
          url: http://host.k3d.internal:3000/botkube.yaml
    
    rbac:
      create: true
      rules:
        - apiGroups: ["*"]
          resources: ["*"]
          verbs: ["get", "watch", "list", "create", "delete", "update", "patch"]
    EOF
    
  3. Start k3d cluster

    k3d cluster create labs --image=rancher/k3s:v1.25.0-k3s1
    
  4. Build plugins:

    make build-plugins
    
  5. Start plugin server:

    env PLUGIN_SERVER_HOST=http://host.k3d.internal go run test/helpers/plugin_server.go
    
  6. Install Botkube

    helm upgrade botkube --install --namespace botkube ./helm/botkube --wait --create-namespace \
      -f /tmp/test-values.yaml
    
Steps
  1. Global Help

    @Botkube helm help
    
  2. Version

    @Botkube helm version -h
    @Botkube helm version
    
  3. Install

    @Botkube helm install -h
    
    # By absolute URL:
    @Botkube helm install
      --repo https://charts.bitnami.com/bitnami psql postgresql
      --set clusterDomain='testing.local'
    
    # By chart reference:
    @Botkube helm install https://charts.bitnami.com/bitnami/postgresql-12.1.0.tgz --create-namespace -n test --generate-name
    
  4. List

    @Botkube helm list -h
    @Botkube helm list -A
    @Botkube helm list -f 'p' -A
    
  5. Status

    @Botkube helm status -h
    @Botkube helm status psql
    
  6. Upgrade

    @Botkube helm upgrade -h
    @Botkube helm upgrade --repo https://charts.bitnami.com/bitnami psql postgresql --set clusterDomain='cluster.local'
    
  7. History

    @Botkube helm history -h
    @Botkube helm history psql
    @Botkube helm hist psql
    @Botkube helm history psql -o json
    
  8. Get

    @Botkube helm get -h
    
  9. Get all

    @Botkube helm get all -h
    @Botkube helm get all psql
    @Botkube helm get all psql --template {{.Release.Name}}
    
  10. Get hooks

    @Botkube helm get hooks -h
    @Botkube helm get hooks psql
    @Botkube helm get hooks psql --revision 1
    @Botkube helm get hooks psql --revision 2
    @Botkube helm get hooks psql --revision 3
    
  11. Get manifest

    @Botkube helm get manifest -h
    @Botkube helm get manifest psql
    
  12. Get notes

    @Botkube helm get notes -h
    @Botkube helm get notes psql -n test2
    
  13. Get values

    @Botkube helm get values -h
    @Botkube helm get values psql
    @Botkube helm get values psql --all
    @Botkube helm get values psql --all --output json --revision 1
    
  14. Rollback

    @Botkube helm rollback -h
    @Botkube helm rollback psql
    
  15. Test

    @Botkube helm test -h
    @Botkube helm test psql
    
  16. Uninstall

    @Botkube helm uninstall -h
    @Botkube helm uninstall psql
    
  17. Unknown flag

    @Botkube helm uninstall psql --random-flag
    
  18. Known but not supported flag

    @Botkube helm install --repo https://charts.bitnami.com/bitnami psql postgresql --wait
    

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL