This commit is contained in:
59
deployment/deploy-yml.tmpl
Normal file
59
deployment/deploy-yml.tmpl
Normal file
@ -0,0 +1,59 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: jupyter
|
||||
labels:
|
||||
app: jupyter
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: jupyter
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: jupyter
|
||||
spec:
|
||||
containers:
|
||||
- name: jupyter
|
||||
image: %IMAGE%
|
||||
ports:
|
||||
- containerPort: 8888
|
||||
protocol: TCP
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: jupyter
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: jupyter
|
||||
ports:
|
||||
- name: http
|
||||
targetPort: 8888
|
||||
port: 80
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: jupyter
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-staging-http
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- jupyter.hottis.de
|
||||
secretName: jupyter-cert
|
||||
rules:
|
||||
- host: jupyter.hottis.de
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: jupyter
|
||||
port:
|
||||
number: 80
|
||||
|
26
deployment/deploy.sh
Executable file
26
deployment/deploy.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$IMAGE_TAG" == "" ]; then
|
||||
echo "Make sure IMAGE_TAG is set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
IMAGE_NAME=gitea.hottis.de/wn/jupyter-scipy-database-extension
|
||||
NAMESPACE=jupyter
|
||||
DEPLOYMENT_DIR=$PWD/deployment
|
||||
|
||||
pushd $DEPLOYMENT_DIR > /dev/null
|
||||
|
||||
kubectl create namespace $NAMESPACE \
|
||||
--dry-run=client \
|
||||
-o yaml | \
|
||||
kubectl -f - apply
|
||||
|
||||
|
||||
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