Newer
Older
# create deploy environment
consists of
* _namespace_: where will all services be deployed
* _service account_: which account will deploy the services
## install via helm
assuming the service-account name is "testuser" and the namespace is "testns"
```
$ helm install k8s-admin/deployenv/ \
--wait \
--name test-deployenv \
--set saName=testuser \
--set namespace=testns \
```
_will create a service account *testuser* in namespace *testns*. the helm install-name is *test-deployenv*_
# remove serviceaccount
```
$ helm delete --purge test-deployenv
```
_will remove namespace service account, role and rolebinding for helm-install *test-deployenv*_
# retrieve bearer token for service account
```
$ export ns=testns
$ export user=testuser
$ kubectl --namespace $ns get secret $(kubectl --namespace ${ns} get serviceaccount $user -o jsonpath={.secrets[0].name}) -o jsonpath={.data.token}