#!/bin/bash APISERVER=$(kubectl config view | grep server | cut -f 2- -d ":" | tr -d " ") TOKEN=$(kubectl config view | grep token | cut -f 2- -d ":" | tr -d " ") echo "APISERVER=$APISERVER" echo "TOKEN=$TOKEN" curl -v -k -H "Authorization: Bearer $TOKEN" $APISERVER/api/v1 curl -v -k -H "Authorization: Bearer $TOKEN" $APISERVER/api/v1/nodes curl -v -k -H "Authorization: Bearer $TOKEN" $APISERVER/api/v1/pods | cs |
Docker
- How to access k8s APIs 2018.05.02
- Tip - How to create a file with multiple lines on a Dockerfile 2018.03.14
How to access k8s APIs
2018. 5. 2. 07:23
Tip - How to create a file with multiple lines on a Dockerfile
2018. 3. 14. 06:02
EOF can be used for creating a file with multiple lines in shell script as following.
cat << EOF > /tmp/yourfilehere These contents will be written to the file. This line is indented. EOF | cs |
https://stackoverflow.com/questions/2953081/how-can-i-write-a-heredoc-to-a-file-in-bash-script
However, this cannot be applied to Dockerfile.
Instead, the following way can be used in a similar way.
RUN echo $'[user]\n\ email = bumjoon_kim@comcast.com\n\ name = Bumjoon Kim\n[push]\n\ default = current\n' >> /root/.gitconfig | cs |