This repository has been archived by the owner on Apr 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
WIP: Run on kubernetes #36
Open
basvdl
wants to merge
37
commits into
master
Choose a base branch
from
run-on-kubernetes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
d480ec0
Initial setup for kubernetes using `kompose convert` and some manual …
58502df
Fix the key in `labels` to get the network between pods going
b3b4e4a
Change web app service type to be LoadBalancer
JCZuurmond 38dd8d3
Make shop-api also of type loadbalancer to expose it on localhost
3ff4214
Start
ee26a59
Merge branch 'run-on-kubernetes' of github.com:divolte/shop into run-…
faa2216
First attempt to load shop content using Job pod, not working
9c1e9f0
Loading the shop content using job pod
8b405c7
Back the bare minimum config
7b41316
Change shop API service to ClusterIP
JCZuurmond 8b89bb3
Change shop webapp service to ClusterIP
JCZuurmond 1be73e4
Add ingress yaml
JCZuurmond 601b808
Change path to webshop to be index
JCZuurmond 966daac
Add set-up for Ingress nginx to README
JCZuurmond cc058ec
Add initContainers to delay the start of the put-categories pods.
505d7e8
Merge branch 'run-on-kubernetes' of github.com:divolte/shop into run-…
49d91b9
Bug fix: change index path was not committed correctly
JCZuurmond 32dc2cc
add Liveness probe for API with own route
anibaldk 0a9c94e
Merge branch 'live-probes' into run-on-kubernetes
anibaldk 8cdee5d
Change init container to check if shop-api service is alive
JCZuurmond dc83947
Add init containers which checks if API is alive
JCZuurmond 9f0c106
Solve flake8 issues
JCZuurmond 76fed7b
Change input order according to PEP8
JCZuurmond 4393bf4
Put json requests in separate function
JCZuurmond 292fe7d
Retry json put if 10 times ConnectionError
JCZuurmond 2a5d2f0
Bug fix: json.dump --> json.dumps
JCZuurmond 3438536
Add retrying to be pip installed
JCZuurmond 3e01af4
Add utility script to build the jars, without the need of sbt/gradle.
ffa2b94
Add comment explaining ttlSecondsAfterFinished
JCZuurmond be74dc2
Make catalog-builder an image to load data into the shop
anibaldk 2fcd672
merge work with Cor
anibaldk b8ff7a1
Clean up deployment file
anibaldk d326724
Merge branch 'run-on-kubernetes' of github.com:divolte/shop into run-…
JCZuurmond b4831d5
Make sure the docker-compose also works.
3081478
Fix typo
8927773
Uniform the docker context of catalog builder.
9722410
Small readme update
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: clickstream-analyzer | ||
labels: | ||
app: clickstream-analyzer | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: clickstream-analyzer | ||
template: | ||
metadata: | ||
labels: | ||
app: clickstream-analyzer | ||
spec: | ||
containers: | ||
- env: | ||
- name: KAFKA_BROKERS | ||
value: kafka:9092 | ||
- name: KAFKA_TOPIC | ||
value: divolte | ||
- name: SPARK_JOB_CLASS | ||
value: sparkjob.SparkEventsPerMinute | ||
image: shop_clickstream-analyzer | ||
name: clickstream-analyzer | ||
imagePullPolicy: Never # always local | ||
ports: | ||
- containerPort: 7077 | ||
- containerPort: 4040 | ||
- containerPort: 18080 | ||
hostname: clickstream-analyzer | ||
restartPolicy: Always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: clickstream-analyzer | ||
labels: | ||
app: clickstream-analyzer | ||
spec: | ||
ports: | ||
- name: "7077" | ||
port: 7077 | ||
targetPort: 7077 | ||
- name: "4040" | ||
port: 4040 | ||
targetPort: 4040 | ||
- name: "18080" | ||
port: 18080 | ||
targetPort: 18080 | ||
selector: | ||
app: clickstream-analyzer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: clickstream-collector | ||
labels: | ||
app: clickstream-collector | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: clickstream-collector | ||
template: | ||
metadata: | ||
labels: | ||
app: clickstream-collector | ||
spec: | ||
containers: | ||
- env: | ||
- name: DIVOLTE_CONF_DIR | ||
value: /etc/shop/divolte | ||
- name: DIVOLTE_KAFKA_BROKER_LIST | ||
value: kafka:9092 | ||
image: shop_clickstream-collector | ||
name: clickstream-collector | ||
imagePullPolicy: Never | ||
ports: | ||
- containerPort: 8290 | ||
hostname: clickstream-collector | ||
restartPolicy: Always | ||
subdomain: divolte-divolte |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: clickstream-collector | ||
labels: | ||
app: clickstream-collector | ||
spec: | ||
ports: | ||
- name: "8290" | ||
port: 8290 | ||
targetPort: 8290 | ||
selector: | ||
app: clickstream-collector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: elastic | ||
labels: | ||
app: elastic | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: elastic | ||
template: | ||
metadata: | ||
labels: | ||
app: elastic | ||
spec: | ||
containers: | ||
- env: | ||
- name: ES_JAVA_OPTS | ||
value: -Xms512m -Xmx512m | ||
- name: cluster.name | ||
value: elasticsearch | ||
- name: discovery.type | ||
value: single-node | ||
- name: network.bind_host | ||
value: 0.0.0.0 | ||
- name: network.publish_host | ||
value: elastic | ||
- name: xpack.security.enabled | ||
value: "false" | ||
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.0 | ||
name: elastic | ||
ports: | ||
- containerPort: 9200 | ||
- containerPort: 9300 | ||
hostname: elastic | ||
restartPolicy: Always | ||
subdomain: divolte-divolte |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: elastic | ||
labels: | ||
app: elastic | ||
spec: | ||
ports: | ||
- name: "9200" | ||
port: 9200 | ||
targetPort: 9200 | ||
- name: "9300" | ||
port: 9300 | ||
targetPort: 9300 | ||
selector: | ||
app: elastic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: nginx-ingress | ||
annotations: | ||
ingress.kubernetes.io/rewrite-target: / | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: / | ||
backend: | ||
serviceName: shop-webapp | ||
servicePort: 9011 | ||
- path: /api | ||
backend: | ||
serviceName: shop-api | ||
servicePort: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: kafka | ||
labels: | ||
app: kafka | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: kafka | ||
template: | ||
metadata: | ||
labels: | ||
app: kafka | ||
spec: | ||
containers: | ||
- env: | ||
- name: ADVERTISED_HOST | ||
value: kafka | ||
- name: ADVERTISED_LISTENERS | ||
value: PLAINTEXT://kafka:9092,INTERNAL://localhost:9093 | ||
- name: AUTO_CREATE_TOPICS | ||
value: "false" | ||
- name: INTER_BROKER | ||
value: INTERNAL | ||
- name: KAFKA_CREATE_TOPICS | ||
value: divolte:4:1 | ||
- name: LISTENERS | ||
value: PLAINTEXT://0.0.0.0:9092,INTERNAL://0.0.0.0:9093 | ||
- name: LOG_RETENTION_HOURS | ||
value: "1" | ||
- name: SECURITY_PROTOCOL_MAP | ||
value: PLAINTEXT:PLAINTEXT,INTERNAL:PLAINTEXT | ||
image: krisgeus/docker-kafka | ||
name: kafka | ||
ports: | ||
- containerPort: 9092 | ||
- containerPort: 2181 | ||
hostname: kafka | ||
restartPolicy: Always | ||
subdomain: divolte-divolte |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: kafka | ||
labels: | ||
app: kafka | ||
spec: | ||
ports: | ||
- name: "9092" | ||
port: 9092 | ||
targetPort: 9092 | ||
- name: "2182" | ||
port: 2181 | ||
targetPort: 2181 | ||
selector: | ||
app: kafka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: kibana | ||
labels: | ||
app: kibana | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: kibana | ||
template: | ||
metadata: | ||
labels: | ||
app: kibana | ||
spec: | ||
containers: | ||
- env: | ||
- name: ELASTICSEARCH_URL | ||
value: http://elastic:9200 | ||
- name: LOGGING_QUIET | ||
value: "true" | ||
- name: SERVER_NAME | ||
value: kibana.divolte-divolte | ||
image: docker.elastic.co/kibana/kibana:6.4.0 | ||
name: kibana | ||
ports: | ||
- containerPort: 5601 | ||
hostname: kibana | ||
restartPolicy: Always | ||
subdomain: divolte-divolte |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: kibana | ||
labels: | ||
app: kibana | ||
spec: | ||
ports: | ||
- name: "5601" | ||
port: 5601 | ||
targetPort: 5601 | ||
selector: | ||
app: kibana |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: put-categories | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: put-categories | ||
image: python:3.6 | ||
workingDir: /shop | ||
volumeMounts: | ||
- mountPath: /shop | ||
name: divolte-shop | ||
command: ["bash"] | ||
args: ["-c", "pip install requests && python catalog-builder/put-categories.py --api-base-url http://shop-api:8080/api data/categories/animals.json data/categories/architecture.json data/categories/cars.json data/categories/cities.json data/categories/flowers.json data/categories/landscape.json data/categories/nautical.json"] | ||
restartPolicy: Never | ||
volumes: | ||
- name: divolte-shop | ||
hostPath: | ||
path: /Users/bas/code/gdd/shop | ||
type: Directory | ||
initContainers: | ||
- name: wait-for-shop-api | ||
image: busybox:1.28 | ||
command: ['sh', '-c', 'sleep 30'] | ||
backoffLimit: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: shop-api | ||
labels: | ||
app: shop-api | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: shop-api | ||
template: | ||
metadata: | ||
labels: | ||
app: shop-api | ||
spec: | ||
containers: | ||
- env: | ||
- name: ELASTICSEARCH_CLUSTER_NAME | ||
value: elasticsearch | ||
- name: ELASTICSEARCH_HOSTS | ||
value: '["elastic"]' | ||
- name: JAVA_OPTS | ||
value: -Xms512m -Xmx512m | ||
image: shop_shop-api | ||
name: shop-api | ||
imagePullPolicy: Never | ||
ports: | ||
- containerPort: 8080 | ||
- containerPort: 8081 | ||
livenessProbe: | ||
httpGet: | ||
path: /api/status/ping | ||
port: 8080 | ||
initialDelaySeconds: 3 | ||
periodSeconds: 3 | ||
hostname: shop-api | ||
restartPolicy: Always | ||
subdomain: divolte-divolte |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User specific path