Added join step
This commit is contained in:
@@ -26,3 +26,36 @@ And use it like this
|
||||
```bash
|
||||
./send.sh start_crio
|
||||
```
|
||||
|
||||
|
||||
Create join token from control plane
|
||||
```
|
||||
kubeadm token create --print-join-command
|
||||
```
|
||||
|
||||
Export the token inside the device
|
||||
```
|
||||
export DEBUG=1
|
||||
export HOSTNAME=monok8s-master-1
|
||||
export BOOTSTRAP_TOKEN=
|
||||
export TOKEN_CACERT_HASH=
|
||||
```
|
||||
|
||||
Generate using kubectl
|
||||
```
|
||||
TOKEN_NAME=bootstrap-token-iwotl0
|
||||
|
||||
API_SERVER=$(kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}' | sed 's|https://||') && \
|
||||
TOKEN=$(kubectl -n kube-system get secret ${TOKEN_NAME} -o jsonpath='{.data.token-id}' | base64 -d).$(kubectl -n kube-system get secret ${TOKEN_NAME} -o jsonpath='{.data.token-secret}' | base64 -d) && \
|
||||
HASH=$(kubectl -n kube-public get configmap cluster-info -o jsonpath='{.data.kubeconfig}' \
|
||||
| grep 'certificate-authority-data' \
|
||||
| awk '{print $2}' \
|
||||
| base64 -d \
|
||||
| openssl x509 -pubkey -noout \
|
||||
| openssl rsa -pubin -outform der 2>/dev/null \
|
||||
| openssl dgst -sha256 -hex \
|
||||
| awk '{print "sha256:" $2}')
|
||||
echo "export API_SERVER_ENDPOINT=${API_SERVER}"
|
||||
echo "export BOOTSTRAP_TOKEN=${TOKEN}"
|
||||
echo "export TOKEN_CACERT_HASH=${HASH}"
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user