You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the final command, the filename `e242d2da.0` should be the output of the previous command plus the suffix `.0`.
49
+
50
+
Please consult your operating system's documentation (or Google) for other operating systems.
51
+
52
+
### Sample operator REST client script
53
+
54
+
Here is a small sample BASH script that may help to prepare the necessary token, certificates, and such, to call the
55
+
operator's REST services. Please read the important caveats above before using this script:
28
56
29
57
```
30
58
#!/bin/bash
@@ -44,7 +72,7 @@ cat ${OPERATOR_CERT_FILE}
44
72
echo "Ready to call operator REST APIs"
45
73
46
74
STATUS_CODE=`curl \
47
-
-v -k \
75
+
-v \
48
76
--cacert ${OPERATOR_CERT_FILE} \
49
77
-H "Authorization: Bearer ${TOKEN}" \
50
78
-H Accept:application/json \
@@ -57,6 +85,8 @@ cat curl.err
57
85
cat curl.out | jq .
58
86
```
59
87
88
+
**Note**: you can use the `-k` option to bypass the check to verify that the operator's certificate is trusted (instead of `curl --cacert`), but this is insecure.
89
+
60
90
To use this script, pass in the Kubernetes server address and then the URL you want to call. The script assumes `jq` is installed and uses it to format the response. This can be removed if desired. The script also prints out quite a bit of useful debugging information in addition to the response. Here is an example of the output of this script:
0 commit comments