Commit 6fb399b4 authored by militarpancho's avatar militarpancho
Browse files

k8s changed and pipeline added

parent d5824193
variables:
LUIGI_IMAGE: $CI_REGISTRY_IMAGE/luigi
WEB_IMAGE: $CI_REGISTRY_IMAGE/web
stages:
- push
- deploy
- clean
before_script:
- make -e login
stages:
- build
- push
- deploy
- clean
build-luigi:
stage: build
script:
- make -e build-luigi
build-web:
stage: build
script:
- make -e build-web
push-web:
.image: &image_definition
stage: push
script:
- make -e push-web
- make -e push
only:
- tags
- triggers
push:
<<: *image_definition
variables:
PYTHON_VERSION: latest
only:
- tags
- triggers
push-luigi:
stage: push
script:
- make -e push-luigi
deploy:
stage: deploy
environment: test
environment: production
script:
- make -e deploy
only:
- master
\ No newline at end of file
- tags
- triggers
clean :
stage: clean
script:
- make -e clean
when: manual
version: '2'
services:
sefarad:
build: .
image: registry.cluster.gsi.dit.upm.es/sefarad/dashboard-reddit
ports:
- "8080:8080"
volumes:
- .:/usr/src/app
environment:
- ES_ENDPOINT_EXTERNAL=${ES_ENDPOINT_EXTERNAL}
- FUSEKI_ENDPOINT_DASHBOARD=${FUSEKI_ENDPOINT_DASHBOARD}
networks:
- sefarad-network
elasticsearch:
image: "docker.elastic.co/elasticsearch/elasticsearch:5.5.2"
ulimits:
......
......@@ -4,17 +4,11 @@ kind: ConfigMap
metadata:
name: gsicrawler-config
data:
REDDIT_USER: $REDDIT_USER
REDDIT_CLIENT: $REDDIT_CLIENT
REDDIT_TOKEN: $REDDIT_TOKEN
REDDIT_PASS: $REDDIT_PASS
ES_ENDPOINT_EXTERNAL: "$ES_ENDPOINT_EXTERNAL"
ES_ENDPOINT: $ES_ENDPOINT
ES_PORT: "$ES_PORT"
LUIGI_ENDPOINT: $LUIGI_ENDPOINT
LUIGI_ENDPOINT_EXTERNAL: $LUIGI_ENDPOINT_EXTERNAL
CRAWLER_ENDPOINT: $CRAWLER_ENDPOINT
CRAWLER_ENDPOINT_EXTERNAL: $CRAWLER_ENDPOINT_EXTERNAL
TWITTER_CONSUMER_KEY: $TWITTER_CONSUMER_KEY
TWITTER_CONSUMER_SECRET: $TWITTER_CONSUMER_SECRET
TWITTER_ACCESS_TOKEN: $TWITTER_ACCESS_TOKEN
......@@ -26,84 +20,27 @@ data:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gsicrawler-web
spec:
replicas: 1
template:
metadata:
labels:
role: gsicrawler-web
app: gsicrawler
spec:
containers:
- name: gsicrawler-web
image: registry.cluster.gsi.dit.upm.es/sefarad/gsicrawler/web:latest
imagePullPolicy: Always
resources:
limits:
memory: "512Mi"
cpu: "500m"
ports:
- name: web
containerPort: 8080
envFrom:
- configMapRef:
name: gsicrawler-config
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gsicrawler-luigi
name: ${NAME}
spec:
replicas: 1
template:
metadata:
labels:
role: gsicrawler-luigi
app: gsicrawler
app: ${NAME}
spec:
containers:
- name: gsicrawler-luigi
image: registry.cluster.gsi.dit.upm.es/sefarad/gsicrawler/luigi:latest
image: ${CI_REGISTRY_IMAGE}:${VERSION}
imagePullPolicy: Always
resources:
limits:
memory: "512Mi"
cpu: "1000m"
ports:
- name: luigiproxy
containerPort: 8000
- name: luigiweb
containerPort: 8082
envFrom:
- configMapRef:
name: gsicrawler-config
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gsicrawler-fuseki
spec:
replicas: 1
template:
metadata:
labels:
role: gsicrawler-fuseki
app: gsicrawler
spec:
containers:
- name: gsicrawler-fuseki
image: stain/jena-fuseki
imagePullPolicy: Always
resources:
limits:
memory: "512Mi"
cpu: "1000m"
ports:
- name: fuseki
containerPort: 3030
envFrom:
- configMapRef:
name: gsicrawler-config
......@@ -2,33 +2,15 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: gsicrawler-ingress
name: ${NAME}
annotations:
ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: $CRAWLER_ENDPOINT_EXTERNAL
http:
paths:
- path: /
backend:
serviceName: $CRAWLER_ENDPOINT
servicePort: 8080
- host: $LUIGI_ENDPOINT_EXTERNAL
http:
paths:
- path: /
backend:
serviceName: $LUIGI_ENDPOINT
servicePort: 8000
- path: /tasks/
backend:
serviceName: $LUIGI_ENDPOINT
servicePort: 8082
- host: $FUSEKI_ENDPOINT_EXTERNAL
http:
paths:
- path: /
backend:
serviceName: $FUSEKI_ENDPOINT
servicePort: 3030
\ No newline at end of file
---
apiVersion: v1
kind: Service
metadata:
name: $CRAWLER_ENDPOINT
spec:
type: ClusterIP
ports:
- port: 8080
protocol: TCP
selector:
role: gsicrawler-web
---
apiVersion: v1
kind: Service
metadata:
name: $LUIGI_ENDPOINT
spec:
type: ClusterIP
ports:
- name: luigiproxy
port: 8000
protocol: TCP
- name: luigiweb
port: 8082
protocol: TCP
selector:
role: gsicrawler-luigi
---
apiVersion: v1
kind: Service
metadata:
name: $FUSEKI_ENDPOINT
spec:
type: ClusterIP
ports:
port: 3030
protocol: TCP
selector:
role: gsicrawler-fuseki
\ No newline at end of file
Supports Markdown
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