mirror of
https://github.com/gsi-upm/senpy
synced 2024-11-24 09:02:28 +00:00
Add k8s deployment
This commit is contained in:
parent
a7849bb029
commit
e9266af924
@ -7,7 +7,10 @@
|
|||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
- publish
|
- publish
|
||||||
- check_published
|
- deploy
|
||||||
|
|
||||||
|
variables:
|
||||||
|
KUBENS: senpy
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
stage: publish
|
stage: publish
|
||||||
@ -63,9 +66,29 @@ check_pypi:
|
|||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
image: python:3.7
|
image: python:3.7
|
||||||
stage: check_published
|
stage: deploy
|
||||||
script:
|
script:
|
||||||
- pip install senpy==$CI_COMMIT_TAG
|
- pip install senpy==$CI_COMMIT_TAG
|
||||||
# Allow PYPI to update its index before we try to install
|
# Allow PYPI to update its index before we try to install
|
||||||
when: delayed
|
when: delayed
|
||||||
start_in: 10 minutes
|
start_in: 10 minutes
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
only:
|
||||||
|
refs:
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
image: alpine/k8s:1.22.6
|
||||||
|
stage: deploy
|
||||||
|
environment: production
|
||||||
|
variables:
|
||||||
|
KUBECONFIG_FILE: "/kubeconfig"
|
||||||
|
IMAGEWTAG: "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
|
||||||
|
KUBEAPP: "senpy"
|
||||||
|
script:
|
||||||
|
- cat ${KUBECONFIG} > $KUBECONFIG_FILE
|
||||||
|
- kubectl version
|
||||||
|
- cd k8s/
|
||||||
|
- cat *.yaml *.tmpl 2>/dev/null | envsubst | kubectl --kubeconfig $KUBECONFIG_FILE apply --namespace ${KUBENS:-default} -f -
|
||||||
|
- kubectl --kubeconfig $KUBECONFIG_FILE get all,ing -l app=${KUBEAPP} --namespace=${KUBENS:-default}
|
||||||
|
@ -9,7 +9,7 @@ spec:
|
|||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
role: senpy-latest
|
role: senpy-latest
|
||||||
app: test
|
app: senpy
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: senpy-latest
|
- name: senpy-latest
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
---
|
---
|
||||||
apiVersion: extensions/v1beta1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: senpy-ingress
|
name: senpy-ingress
|
||||||
|
labels:
|
||||||
|
app: senpy
|
||||||
spec:
|
spec:
|
||||||
rules:
|
rules:
|
||||||
- host: latest.senpy.gsi.upm.es
|
- host: latest.senpy.gsi.upm.es
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: /
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
backend:
|
backend:
|
||||||
serviceName: senpy-latest
|
service:
|
||||||
servicePort: 5000
|
name: senpy-latest
|
||||||
- host: latest.senpy.gsi.upm.es
|
port:
|
||||||
http:
|
number: 5000
|
||||||
paths:
|
|
||||||
- path: /
|
|
||||||
backend:
|
|
||||||
serviceName: senpy-latest
|
|
||||||
servicePort: 5000
|
|
||||||
|
@ -3,6 +3,8 @@ apiVersion: v1
|
|||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: senpy-latest
|
name: senpy-latest
|
||||||
|
labels:
|
||||||
|
app: senpy
|
||||||
spec:
|
spec:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
ports:
|
ports:
|
||||||
|
Loading…
Reference in New Issue
Block a user