Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
abc25a8e7f | |||
5660eba61c
|
|||
6cb8a65a21 |
@ -1,17 +1,62 @@
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pv-energy-calculator
|
||||
name: pv-stats
|
||||
labels:
|
||||
app: pv-stats
|
||||
spec:
|
||||
schedule: "15 * * * *"
|
||||
jobTemplate:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: pv-stats
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: pv-stats
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
containers:
|
||||
- name: pv-energy-calculator
|
||||
image: %IMAGE%
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: pv-energy-calculator
|
||||
containers:
|
||||
- name: pv-stats
|
||||
image: %IMAGE%
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: pv-stats
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
protocol: TCP
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: pv-stats
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: pv-stats
|
||||
ports:
|
||||
- name: http
|
||||
targetPort: 8080
|
||||
port: 80
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: pv-stats
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-production-http
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- pv-stats.hottis.de
|
||||
secretName: pv-stats-cert
|
||||
rules:
|
||||
- host: pv-stats.hottis.de
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: pv-stats
|
||||
port:
|
||||
number: 80
|
||||
|
||||
|
@ -9,7 +9,7 @@ if [ "$GPG_PASSPHRASE" == "" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
IMAGE_NAME=gitea.hottis.de/wn/mini_flask
|
||||
IMAGE_NAME=gitea.hottis.de/wn/pv-stats
|
||||
NAMESPACE=homea
|
||||
DEPLOYMENT_DIR=$PWD/deployment
|
||||
|
||||
@ -24,7 +24,7 @@ gpg --decrypt --passphrase $GPG_PASSPHRASE --yes --batch --homedir /tmp/.gnupg -
|
||||
. $SECRETS_FILE
|
||||
rm $SECRETS_FILE
|
||||
|
||||
kubectl create secret generic mini_flask \
|
||||
kubectl create secret generic pv-stats \
|
||||
--dry-run=client \
|
||||
-o yaml \
|
||||
--save-config \
|
||||
@ -35,13 +35,12 @@ kubectl create secret generic mini_flask \
|
||||
--from-literal=PGHOST="$PGHOST" \
|
||||
--from-literal=PGSSLMODE="$PGSSLMODE" \
|
||||
--from-literal=PGDATABASE="$PGDATABASE" \
|
||||
--from-literal=OIDC_CLIENT_SECRETS="$OIDC_CLIENT_SECRETS" | \
|
||||
--from-literal=OIDC_CLIENT_SECRETS="$OIDC_CLIENT_SECRETS" | \
|
||||
kubectl apply -f - -n $NAMESPACE
|
||||
rm $SECRETS_FILE
|
||||
|
||||
# cat $DEPLOYMENT_DIR/deploy-yml.tmpl | \
|
||||
# sed -e 's,%IMAGE%,'$IMAGE_NAME':'$IMAGE_TAG','g | \
|
||||
# kubectl apply -f - -n $NAMESPACE
|
||||
cat $DEPLOYMENT_DIR/deploy-yml.tmpl | \
|
||||
sed -e 's,%IMAGE%,'$IMAGE_NAME':'$IMAGE_TAG','g | \
|
||||
kubectl apply -f - -n $NAMESPACE
|
||||
|
||||
popd > /dev/null
|
||||
|
||||
|
Reference in New Issue
Block a user