major: séparer commande de librairie importable
Bump major version à 9 package main déplacé vers cmd/bottin/ pour garder `go install` qui nomme l'exécutable `bottin`, sans empêcher d'importer le code à l'extérieur du projet avec pkg/bottin/. Déplacer fichiers SQL vers queries/ Déplacer fichiers html vers templates/ Ajouter scripts/ avec génération et injection de certificats x509 (https) et les ajouter au Makefile Ajouter début d'exemple de manifests dans deployments/kubernetes/
This commit is contained in:
parent
a17d6bf06c
commit
b419a5b260
25 changed files with 513 additions and 451 deletions
60
deployments/kubernetes/bottin-pod.yaml
Normal file
60
deployments/kubernetes/bottin-pod.yaml
Normal file
|
@ -0,0 +1,60 @@
|
|||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: bottin-pod
|
||||
spec:
|
||||
initContainers:
|
||||
- name: clone
|
||||
image: alpine:3.20
|
||||
command: ['sh', '-c']
|
||||
args:
|
||||
- apk add git &&
|
||||
git clone -- https://git.agecem.com/agecem/bottin /opt/bottin-src
|
||||
volumeMounts:
|
||||
- name: bottin-src
|
||||
mountPath: /opt/bottin-src
|
||||
- name: build
|
||||
image: golang:1.23
|
||||
env:
|
||||
- name: CGO_ENABLED
|
||||
value: '0'
|
||||
command: ['sh', '-c']
|
||||
args:
|
||||
- cd /opt/bottin-src &&
|
||||
go build -a -o /opt/bottin-executable/bottin
|
||||
volumeMounts:
|
||||
- name: bottin-src
|
||||
mountPath: /opt/bottin-src
|
||||
- name: bottin-executable
|
||||
mountPath: /opt/bottin-executable
|
||||
containers:
|
||||
- name: api
|
||||
image: alpine:3.20
|
||||
command: ['sh', '-c']
|
||||
args:
|
||||
- ln -s /opt/bottin-executable/bottin /usr/bin/bottin
|
||||
volumeMounts:
|
||||
- name: bottin-executable
|
||||
mountPath: /opt/bottin-executable
|
||||
- name: bottin-secret
|
||||
readOnly: true
|
||||
mountPath: '/etc/bottin'
|
||||
- name: ui
|
||||
image: alpine:3.20
|
||||
command: ['sh', '-c']
|
||||
args:
|
||||
- bottin --config /etc/bottin/ui.yaml server ui
|
||||
volumeMounts:
|
||||
- name: bottin-executable
|
||||
mountPath: /opt/bottin-executable
|
||||
- name: bottin-secret
|
||||
readOnly: true
|
||||
mountPath: '/etc/bottin'
|
||||
volumes:
|
||||
- name: bottin-src
|
||||
emptyDir: {}
|
||||
- name: bottin-executable
|
||||
emptyDir: {}
|
||||
- name: bottin-secret
|
||||
secret:
|
||||
secretName: bottin-secret
|
26
deployments/kubernetes/example-bottin-secret.yaml
Normal file
26
deployments/kubernetes/example-bottin-secret.yaml
Normal file
|
@ -0,0 +1,26 @@
|
|||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: bottin-secret
|
||||
stringData:
|
||||
api.yaml: |
|
||||
bottin:
|
||||
server:
|
||||
api:
|
||||
db:
|
||||
database: 'bottin'
|
||||
host: 'db.example.com'
|
||||
password: 'bottin'
|
||||
sslmode: 'require'
|
||||
user: 'bottin'
|
||||
key: 'bottin'
|
||||
ui.yaml: |
|
||||
bottin:
|
||||
server:
|
||||
ui:
|
||||
api:
|
||||
tls:
|
||||
skipverify: 'true'
|
||||
key: 'bottin'
|
||||
password: 'bottin'
|
||||
user: 'bottin'
|
Reference in a new issue