add k8s setup

This commit is contained in:
jem 2021-02-26 12:19:37 +01:00
parent c6eadbc37b
commit daa28a46b9
2 changed files with 31 additions and 4 deletions

View file

@ -1,2 +1 @@
# k8s-mastodon-bot # k8s-mastodon-bot

View file

@ -1,5 +1,33 @@
# Project Setup # Project Setup
* npm (`sudo apt install npm`) ## dev environment
* npx (e.g. with `sudo npm install -g npx`)
* Run `npm install --ignore-scripts` in project root to retrieve all dependencies ```
sudo apt install npm
sudo npm install -g npx
# in project root to retrieve all dependencies
npm install --ignore-scripts
```
## install kubectl
```
sudo -i
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" \
| tee -a /etc/apt/sources.list.d/kubernetes.list
kubectl completion bash >> /etc/bash_completion.d/kubernetes
```
## remote access to k8s
```
scp -r root@devops.test.meissa-gmbh.de:/home/k8s/.kube ~/
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@devops.test.meissa-gmbh.de -L 8002:localhost:8002 -L 6443:192.168.5.1:6443
# add in /etc/hosts "127.0.0.1 kubernetes"
# change in ~/.kube/config 192.168.5.1 -> kubernetes
kubectl get pods
```