File tree Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Original file line number Diff line number Diff line change 1
1
Run the following to obtain the token needed to add a Red Hat OpenShift provider:
2
2
3
- 1 . Obtain the ` management ` service account token name:
3
+ 1 . Create the service account token
4
+ ``` bash
5
+ oc apply -f - << EOF
6
+ apiVersion: v1
7
+ kind: Secret
8
+ metadata:
9
+ name: $service_account_name -secret
10
+ namespace: $project_name
11
+ annotations:
12
+ kubernetes.io/service-account.name: $service_account_name
13
+ type: kubernetes.io/service-account-token
14
+ EOF
15
+ ` ` `
16
+ 2. Describe the secret to retrieve the full token value:
4
17
5
- # oc describe sa -n $project_name $service_account_name
6
- ...
7
- Tokens: management-admin-token-0f3fh
8
- management-admin-token-q7a87
9
-
10
- 2 . Select and describe one of the tokens to retrieve the full token
11
- output, replacing ` management-admin-token-0f3fh ` with the name of
12
- your token:
13
-
14
- # oc describe secret -n $project_name management-admin-token-0f3fh
15
- ...
16
- Data
17
- ====
18
- token: eyJhbGciOiJSUzI1NiI...
18
+ ` ` ` bash
19
+ oc get secret -o template --template {{.data.token}} -n $project_name $service_account_name -secret
20
+ eyJhbGciOiJSUzI1N...
21
+ ` ` `
You can’t perform that action at this time.
0 commit comments