Skip to content

Instantly share code, notes, and snippets.

@seaneagan
Last active April 13, 2018 18:51
Show Gist options
  • Save seaneagan/0f13a34613fe78e1853f33b735ac1094 to your computer and use it in GitHub Desktop.
Save seaneagan/0f13a34613fe78e1853f33b735ac1094 to your computer and use it in GitHub Desktop.

Analysis: Replacing Armada gRPC calls with helm cli calls

Aramda gRPC usage by command

Most commands are in armada CLI and API, and behave similarly.

apply

gRPC calls

install:

  • if no successful release found for chart
  • returned release response ignored

update:

  • if successful release found for chart
  • returned release response ignored

uninstall:

  • to clear failed release before installing
  • if chart cleanup enabled

test:

status:

  • upon failure of install/update/uninstall/test (for debugging purposes)
  • to return release status after test

list:

  • when cleanup enabled, to determine releases that need to be uninstalled (due to armada manifest changes)
  • to determine failed releases (failed are unininstalled/re-installed, successful are updated)
  • includes release config values used for diffing config values with release being updated

test

gRPC calls

list:

  • to determine releases that exist to be able to test

release_content:

  • to determine if a release has a test hook defined

test:

  • to test the release

delete (command only in armada CLI currently)

gRPC calls

list:

  • to determine releases that exist to be able to uninstall

uninstall:

  • to uninstall the release

tiller status

gRPC calls

get_version:

  • to get the tiller version

k8s api calls:

  • to determine tiller status

tiller releases

gRPC calls

list: to list releases

Helm CLI equivalency:

all commands have exit code to represent success/failure

actions:

  • install > install (--values can be used for input)
  • update > upgrade (--values can be used for input)
  • uninstall > delete
  • test > test

Already has machine readable output:

  • helm version --server --short
  • helm status -o (json/yaml)
  • helm get hooks
    • yaml output
    • could be used to see if a test is defined, or could just run helm test ... regardless:
      $ helm test mychart
      No Tests Found
      $ echo $?
      0
  • helm get values
    • yaml output
    • for armada release update diff functionality

Helm CLI updates needed:

  • helm list json/yaml output:

  • Error message(s) capturability?

    • Exit code is just 0/1, so when exit code = 1:
      • is stderr (+stdout?) sufficient to use as error message?
      • do we need to captur multiple errors?
  • helm upgrade/install json/yaml output?

    • not used by armada gRPC calls currently
    • would it return:
      • status?
        • currently armada only retrieves status on error
        • can get from helm status -o (json|yaml)
        • wasted status call by upgrade/install which cannot be disabled, could add --quiet mode to remove?
        • thus separate call makes sense?
      • release content?
        • not used/needed by armada currently
      • something else?
  • ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment