Add kubernetes files
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Hamcha 2020-01-30 17:03:28 +01:00
parent f3a447cb68
commit e967a474cf
Signed by: hamcha
GPG Key ID: 44AD3571EB09A39E
11 changed files with 151 additions and 1 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.env
envfile

View File

@ -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

View 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: {}

View 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

View 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

View 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: {}

View 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

View 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

View File

@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: stappabot
spec:
template:
spec:
containers:
- name: stappabot
envFrom:
- secretRef:
name: stappabot-secret

View 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
View 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"