working deployment

This commit is contained in:
jem 2021-04-16 16:28:19 +02:00
parent 822b263845
commit 54cb0ac9e7
3 changed files with 31 additions and 8 deletions

2
.gitignore vendored
View file

@ -21,3 +21,5 @@ public/js/
*.iml
.idea/
myauth.edn
myconfig.edn

View file

@ -31,6 +31,16 @@ apt update && apt install kubectl
kubectl completion bash >> /etc/bash_completion.d/kubernetes
```
## install kubeval
```
wget https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz
tar xf kubeval-linux-amd64.tar.gz
sudo cp kubeval /usr/local/bin
## remote access to k8s
```
## remote access to k8s
```
@ -43,3 +53,10 @@ ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@devops.test
kubectl get pods
```
## deploy mastodon-bot
```
java -jar target/uberjar/k8s-mastodon-bot-standalone.jar myconfig.edn myauth.edn | kubeval -
java -jar target/uberjar/k8s-mastodon-bot-standalone.jar myconfig.edn myauth.edn | kubectl apply -f -
```

View file

@ -13,20 +13,24 @@ spec:
labels:
app.kubernetes.io/name: k8s-mastodon-bot
spec:
volumes:
- name: config-volume
configMap:
name: mastodon-bot
containers:
- image: mastodon-bot
- image: domaindrivenarchitecture/mastodon-bot
name: mastodon-bot
env:
- name: MASTODON_BOT_CREDENTIALS
value: /app/credentials.edn
value: /credentials.edn
cmd:
volumeMounts:
- name: mastodon-bot
mountPath: /app/config.edn
subPath: config.conf
- name: config-volume
mountPath: /config.edn
subPath: config.edn
readOnly: true
- name: mastodon-bot
mountPath: /app/credentials.edn
subPath: credentials.conf
- name: config-volume
mountPath: /credentials.edn
subPath: credentials.edn
readOnly: true