This commit is contained in:
parent
f3a447cb68
commit
e967a474cf
11 changed files with 151 additions and 1 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
.env
|
||||
envfile
|
22
README.md
22
README.md
|
@ -1,6 +1,26 @@
|
|||
# stappabot
|
||||
|
||||
## Getting started
|
||||
## Run on minikube
|
||||
|
||||
Running in minikube doesn't really work right now, but you can still try if the docker container builds and deploys successfully.
|
||||
|
||||
Make sure the `bots` namespace exists!
|
||||
|
||||
### Requirements
|
||||
|
||||
- [Skaffold](https://skaffold.dev/docs/install/)
|
||||
|
||||
Create a file in `kubernetes/overlays/development` called `envfile` with these values:
|
||||
|
||||
```sh
|
||||
STAPPA_TOKEN=telegram-bot-token
|
||||
STAPPA_WEBHOOK=https://telegram.webhook/endpoint
|
||||
STAPPA_PATH=endpoint
|
||||
```
|
||||
|
||||
Run `skaffold dev`
|
||||
|
||||
## Run locally
|
||||
|
||||
Install stappabot
|
||||
|
||||
|
|
26
kubernetes/base/deployment.yaml
Normal file
26
kubernetes/base/deployment.yaml
Normal file
|
@ -0,0 +1,26 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: stappabot
|
||||
svctype: bot
|
||||
name: stappabot
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: stappabot
|
||||
strategy: {}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: stappabot
|
||||
spec:
|
||||
containers:
|
||||
- image: registry.zyg.ovh/hamcha/stappabot
|
||||
name: stappabot
|
||||
resources: {}
|
||||
restartPolicy: Always
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
status: {}
|
15
kubernetes/base/ingress.yaml
Normal file
15
kubernetes/base/ingress.yaml
Normal file
|
@ -0,0 +1,15 @@
|
|||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: stappabot
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
|
||||
nginx.ingress.kubernetes.io/ssl-redirect: "false"
|
||||
spec:
|
||||
rules:
|
||||
- host: stappabot.zyg.ovh
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: stappabot
|
||||
servicePort: http
|
12
kubernetes/base/kustomization.yaml
Normal file
12
kubernetes/base/kustomization.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
commonLabels:
|
||||
app: stappabot
|
||||
|
||||
namespace: bots
|
||||
|
||||
resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
- ingress.yaml
|
16
kubernetes/base/service.yaml
Normal file
16
kubernetes/base/service.yaml
Normal file
|
@ -0,0 +1,16 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app: stappabot
|
||||
svctype: bot
|
||||
name: stappabot
|
||||
spec:
|
||||
ports:
|
||||
- name: "http"
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
selector:
|
||||
app: stappabot
|
||||
status:
|
||||
loadBalancer: {}
|
13
kubernetes/overlays/development/deployment.yaml
Normal file
13
kubernetes/overlays/development/deployment.yaml
Normal file
|
@ -0,0 +1,13 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: stappabot
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: stappabot
|
||||
imagePullPolicy: "Never"
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: stappabot-secret
|
14
kubernetes/overlays/development/kustomization.yaml
Normal file
14
kubernetes/overlays/development/kustomization.yaml
Normal file
|
@ -0,0 +1,14 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
bases:
|
||||
- ../../base
|
||||
|
||||
namespace: bots
|
||||
|
||||
secretGenerator:
|
||||
- name: stappabot-secret
|
||||
env: envfile
|
||||
|
||||
patchesStrategicMerge:
|
||||
- deployment.yaml
|
12
kubernetes/overlays/production/deployment.yaml
Normal file
12
kubernetes/overlays/production/deployment.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: stappabot
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: stappabot
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: stappabot-secret
|
10
kubernetes/overlays/production/kustomization.yaml
Normal file
10
kubernetes/overlays/production/kustomization.yaml
Normal file
|
@ -0,0 +1,10 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
bases:
|
||||
- ../../base
|
||||
|
||||
namespace: bots
|
||||
|
||||
patchesStrategicMerge:
|
||||
- deployment.yaml
|
10
skaffold.yaml
Normal file
10
skaffold.yaml
Normal file
|
@ -0,0 +1,10 @@
|
|||
apiVersion: skaffold/v2alpha2
|
||||
kind: Config
|
||||
build:
|
||||
artifacts:
|
||||
- image: registry.zyg.ovh/hamcha/stappabot
|
||||
local:
|
||||
push: false
|
||||
deploy:
|
||||
kustomize:
|
||||
path: "kubernetes/overlays/development"
|
Loading…
Reference in a new issue