Skip to content

Instantly share code, notes, and snippets.

@hh
Last active May 2, 2018 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hh/c8ea65c8e7067fbfe8a4385b6e4d7290 to your computer and use it in GitHub Desktop.
Save hh/c8ea65c8e7067fbfe8a4385b6e4d7290 to your computer and use it in GitHub Desktop.
Simple Charts that use the Kubernetes API

Need to run charts that use service accounts

#+NAME 162 stable 41 incubator 206 total charts

  ls stable | wc -l
  ls incubator | wc -l
echo ===
  ls stable incubator | wc -l
162
41
===
206

First let’s find ones using serviceAccount in values.yaml

#+NAME serviceAccount is a main value here

grep -r serviceAccount: ./stable/ ./incubator/ | grep serviceAccount | grep :serviceAccount | awk -F: '{print "file:"$1"::serviceAccount"}'
#grep -r serviceAccount: ./stable/ ./incubator/ | grep values

Inspecting this list directly shows that other than etcd-operator, simply supplying a service account name, and create set to false will likely allow us to use a service account per chart.

grep -r serviceAccount: ./stable/ ./incubator/ | grep serviceAccount | grep :serviceAccount | awk -F: '{print $1}'|  xargs -n 1 grep -H -A10 serviceAccount: | sed /\#/d | grep -B2 name:  | grep -v '\-\-'

Let’s remove etc-operator and anything else that’s not simple for now:

grep -r serviceAccount: ./stable/ ./incubator/ | grep serviceAccount | grep :serviceAccount \
  | awk -F: '{print $1}'|  xargs -n 1 grep -H -A10 serviceAccount: \
  | sed /\#/d | grep -B2 name:  | grep -v '\-\-' | grep :serviceAccount: | awk -F: '{print $1}' | sed s:values.yaml::

Now let’s look for serviceAccount Elsewhere

#+NAME look for service account

grep -r serviceAccount: ./stable/ ./incubator/ | grep -v ^serviceAccount | grep -v :serviceAccount | awk -F: '{print "file:"$1"::serviceAccount"}' 

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