Compare commits
6 commits
Author | SHA1 | Date | |
---|---|---|---|
9b63282dd9 | |||
e11206c492 | |||
636f255e89 | |||
7bb4a6356c | |||
54f1c78b8b | |||
a546db566b |
7 changed files with 91 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
.env
|
.env
|
||||||
.swp
|
.swp
|
||||||
|
k8s/prod.secret.yaml
|
||||||
|
|
|
@ -14,9 +14,7 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
- 'db'
|
- 'db'
|
||||||
image: 'git.agecem.com/bottin/agendas:latest'
|
image: 'git.agecem.com/bottin/agendas:latest'
|
||||||
build:
|
build: '.'
|
||||||
context: '../../../'
|
|
||||||
dockerfile: './deployments/docker/agendas/Dockerfile'
|
|
||||||
restart: 'unless-stopped'
|
restart: 'unless-stopped'
|
||||||
ports:
|
ports:
|
||||||
- '3333:3333'
|
- '3333:3333'
|
45
k8s/deployment.yaml
Normal file
45
k8s/deployment.yaml
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: agendas-deployment
|
||||||
|
labels:
|
||||||
|
app: agendas
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: agendas
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: agendas
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: agendas
|
||||||
|
image: git.agecem.com/bottin/agendas:latest
|
||||||
|
command: ['agendas', '--config', '/etc/agendas/config.yaml']
|
||||||
|
imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- containerPort: 3333
|
||||||
|
volumeMounts:
|
||||||
|
- name: config-secret
|
||||||
|
mountPath: '/etc/agendas/'
|
||||||
|
readOnly: true
|
||||||
|
- name: localtime
|
||||||
|
mountPath: /etc/localtime
|
||||||
|
readOnly: true
|
||||||
|
volumes:
|
||||||
|
- name: config-secret
|
||||||
|
secret:
|
||||||
|
secretName: agendas-config-secret
|
||||||
|
items:
|
||||||
|
- key: config.yaml
|
||||||
|
path: config.yaml
|
||||||
|
- key: cert.pem
|
||||||
|
path: cert.pem
|
||||||
|
- key: key.pem
|
||||||
|
path: key.pem
|
||||||
|
- name: localtime
|
||||||
|
hostPath:
|
||||||
|
path: /etc/localtime
|
||||||
|
type: File
|
31
k8s/example-secret.yaml
Normal file
31
k8s/example-secret.yaml
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: agendas-config-secret
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
config.yaml: |
|
||||||
|
Bottin:
|
||||||
|
Host: 'api.bottin.agecem.com'
|
||||||
|
Key: 'CHANGE_ME'
|
||||||
|
Port: 443
|
||||||
|
TLS:
|
||||||
|
Enabled: true
|
||||||
|
SkipVerify: false
|
||||||
|
Credentials:
|
||||||
|
'agendas': 'CHANGE_ME'
|
||||||
|
DB:
|
||||||
|
Database: 'agendas'
|
||||||
|
Host: 'db'
|
||||||
|
Password: 'CHANGE_ME'
|
||||||
|
Port: 5432
|
||||||
|
SSLMode: 'prefer'
|
||||||
|
Username: 'agendas'
|
||||||
|
TLS:
|
||||||
|
Enabled: true
|
||||||
|
Cert: '/etc/agendas/cert.pem'
|
||||||
|
Key: '/etc/agendas/key.pem'
|
||||||
|
cert.pem: |
|
||||||
|
CHANGE_ME
|
||||||
|
key.pem: |
|
||||||
|
CHANGE_ME
|
11
k8s/service.yaml
Normal file
11
k8s/service.yaml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: agendas-service
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
selector:
|
||||||
|
app: agendas
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 3333
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"crypto/subtle"
|
"crypto/subtle"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
"git.agecem.com/bottin/agendas/ui"
|
"git.agecem.com/bottin/agendas/ui"
|
||||||
"git.agecem.com/bottin/bottin/v10/pkg/bottin"
|
"git.agecem.com/bottin/bottin/v10/pkg/bottin"
|
||||||
|
@ -63,6 +64,7 @@ func RunServer(ctx context.Context, cfg Config, bottinClient *bottin.APIClient,
|
||||||
)
|
)
|
||||||
|
|
||||||
e.GET("/", UIIndex(ctx, bottinClient, dbClient))
|
e.GET("/", UIIndex(ctx, bottinClient, dbClient))
|
||||||
|
e.GET("/nothing/", func(c echo.Context) error { return c.NoContent(http.StatusOK) })
|
||||||
//e.GET("/transaction/", UIReadTransaction
|
//e.GET("/transaction/", UIReadTransaction
|
||||||
e.POST("/transaction/", UICreateTransaction(ctx, cfg, bottinClient, dbClient))
|
e.POST("/transaction/", UICreateTransaction(ctx, cfg, bottinClient, dbClient))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue