Skip to content

Commit e763a02

Browse files
authored
Merge pull request #1864 from agrare/update_openshift_token_instructions
Update openshift management token instructions
2 parents 258d815 + dc7504c commit e763a02

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed
Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
Run the following to obtain the token needed to add a Red Hat OpenShift provider:
22

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:
417
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+
```

0 commit comments

Comments
 (0)