Commit 12b005f9 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

kubernetes integration, first try

parent 91c6de2d
Pipeline #10623 passed with stages
in 7 minutes and 56 seconds
image: docker:latest
stages:
- build
- deploy
services:
- docker:dind
variables:
DOCKER_HOST: tcp://localhost:2375
build:
stage: build
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
only:
- master
tags:
- k8s
deploy:
stage: deploy
image: registry-gitlab.pasteur.fr/dsi-tools/docker-images:docker_kubernetes_image
variables:
NAMESPACE: "galaxy-cwl-dev"
PUBLIC_URL: "galaxy-cwl-dev.pasteur.cloud"
environment:
name: galaxy-cwl-dev
url: https://galaxy-cwl-dev.pasteur.cloud
script:
- kubectl delete secret registry-gitlab -n $NAMESPACE --ignore-not-found=true
- kubectl create secret docker-registry -n $NAMESPACE registry-gitlab --docker-server=registry-gitlab.pasteur.fr --docker-username=$DEPLOY_USER --docker-password=$DEPLOY_TOKEN --docker-email=hmenager@pasteur.fr
- sed "s/__NAMESPACE__/${NAMESPACE}/g" manifest.yaml | kubectl apply -f -
- kubectl patch deployment galaxy-cwl-is -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
only:
- master
tags:
- k8s
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: galaxy-cwl-is
spec:
replicas: 1
template:
metadata:
labels:
app: __NAMESPACE__
role: front
spec:
containers:
- name: galaxy-cwl-is
image: registry-gitlab.pasteur.fr/hub/galaxy-cwl-is:latest
imagePullPolicy: Always
ports:
- containerPort: 80
imagePullSecrets:
- name: registry-gitlab
---
apiVersion: v1
kind: Service
metadata:
name: galaxy-cwl-is
labels:
app: __NAMESPACE__
role: front
spec:
selector:
app: __NAMESPACE__
role: front
ports:
- name: http
port: 80
protocol: TCP
type: ClusterIP
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: galaxy-cwl-is
labels:
app: __NAMESPACE__
role: front
annotations:
kubernetes.io/ingress.class: "traefik"
spec:
rules:
- host: galaxy-cwl-dev.pasteur.cloud
http:
paths:
- backend:
serviceName: galaxy-cwl-is
servicePort: 80
path: /
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment