Skip to content

Commit

Permalink
K8s setup (#13)
Browse files Browse the repository at this point in the history
* Added Lighthouse Kubernetes YAML

* phobos must be explicitly enabled in order to run

* added YAML deployment files for a bunch of services

* added final K8s yaml files
  • Loading branch information
Aaronontheweb authored May 24, 2019
1 parent 0e14cb1 commit 84baabc
Show file tree
Hide file tree
Showing 9 changed files with 601 additions and 0 deletions.
155 changes: 155 additions & 0 deletions k8s/jaeger-all-in-one.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
#
# Copyright 2017-2019 The Jaeger Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#

apiVersion: v1
kind: List
items:
- apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: jaeger
labels:
app: jaeger
app.kubernetes.io/name: jaeger
app.kubernetes.io/component: all-in-one
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
app: jaeger
app.kubernetes.io/name: jaeger
app.kubernetes.io/component: all-in-one
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "16686"
spec:
containers:
- env:
- name: COLLECTOR_ZIPKIN_HTTP_PORT
value: "9411"
image: jaegertracing/all-in-one
name: jaeger
ports:
- containerPort: 5775
protocol: UDP
- containerPort: 6831
protocol: UDP
- containerPort: 6832
protocol: UDP
- containerPort: 5778
protocol: TCP
- containerPort: 16686
protocol: TCP
- containerPort: 9411
protocol: TCP
readinessProbe:
httpGet:
path: "/"
port: 14269
initialDelaySeconds: 5
- apiVersion: v1
kind: Service
metadata:
name: jaeger-query
labels:
app: jaeger
app.kubernetes.io/name: jaeger
app.kubernetes.io/component: query
spec:
ports:
- name: query-http
port: 80
protocol: TCP
targetPort: 16686
selector:
app.kubernetes.io/name: jaeger
app.kubernetes.io/component: all-in-one
type: LoadBalancer
- apiVersion: v1
kind: Service
metadata:
name: jaeger-collector
labels:
app: jaeger
app.kubernetes.io/name: jaeger
app.kubernetes.io/component: collector
spec:
ports:
- name: jaeger-collector-tchannel
port: 14267
protocol: TCP
targetPort: 14267
- name: jaeger-collector-http
port: 14268
protocol: TCP
targetPort: 14268
- name: jaeger-collector-zipkin
port: 9411
protocol: TCP
targetPort: 9411
selector:
app.kubernetes.io/name: jaeger
app.kubernetes.io/component: all-in-one
type: ClusterIP
- apiVersion: v1
kind: Service
metadata:
name: jaeger-agent
labels:
app: jaeger
app.kubernetes.io/name: jaeger
app.kubernetes.io/component: agent
spec:
ports:
- name: agent-zipkin-thrift
port: 5775
protocol: UDP
targetPort: 5775
- name: agent-compact
port: 6831
protocol: UDP
targetPort: 6831
- name: agent-binary
port: 6832
protocol: UDP
targetPort: 6832
- name: agent-configs
port: 5778
protocol: TCP
targetPort: 5778
clusterIP: None
selector:
app.kubernetes.io/name: jaeger
app.kubernetes.io/component: all-in-one
- apiVersion: v1
kind: Service
metadata:
name: zipkin
labels:
app: jaeger
app.kubernetes.io/name: jaeger
app.kubernetes.io/component: zipkin
spec:
ports:
- name: jaeger-collector-zipkin
port: 9411
protocol: TCP
targetPort: 9411
clusterIP: None
selector:
app.kubernetes.io/name: jaeger
app.kubernetes.io/component: all-in-one
55 changes: 55 additions & 0 deletions k8s/lighthouse-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: v1
kind: Service
metadata:
name: lighthouse
labels:
app: lighthouse
spec:
clusterIP: None
ports:
- port: 4053
selector:
app: lighthouse
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: lighthouse
labels:
app: lighthouse
spec:
serviceName: lighthouse
replicas: 3
selector:
matchLabels:
app: lighthouse
template:
metadata:
labels:
app: lighthouse
spec:
terminationGracePeriodSeconds: 35
containers:
- name: lighthouse
image: petabridge/lighthouse:latest
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "pbm 127.0.0.1:9110 cluster leave"]
env:
- name: ACTORSYSTEM
value: AkkaTrader
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: CLUSTER_IP
value: "$(POD_NAME).lighthouse"
- name: CLUSTER_SEEDS
value: akka.tcp://$(ACTORSYSTEM)@lighthouse-0.lighthouse:4053,akka.tcp://$(ACTORSYSTEM)@lighthouse-1.lighthouse:4053,akka.tcp://$(ACTORSYSTEM)@lighthouse-2.lighthouse:4053
livenessProbe:
tcpSocket:
port: 4053
ports:
- containerPort: 4053
protocol: TCP
30 changes: 30 additions & 0 deletions k8s/mongodb-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v1
kind: Service
metadata:
name: mongodb
spec:
ports:
- port: 27017
selector:
app: mongodb
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: mongodb
spec:
replicas: 1
template:
metadata:
labels:
app: mongodb
spec:
containers:
- name: mongo
image: mongo:4.0
env:
- name: MONGO_INITDB_DATABASE
value: "akkaTrader"
ports:
- containerPort: 27017
name: mongodb
67 changes: 67 additions & 0 deletions k8s/pricing-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: v1
kind: Service
metadata:
name: pricing
labels:
app: pricing
spec:
clusterIP: None
ports:
- port: 5110
selector:
app: pricing
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: pricing
labels:
app: pricing
spec:
serviceName: pricing
replicas: 3
selector:
matchLabels:
app: pricing
template:
metadata:
labels:
app: pricing
spec:
terminationGracePeriodSeconds: 35
containers:
- name: pricing
image: akka.cqrs.pricing:0.1.0
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "pbm 127.0.0.1:9110 cluster leave"]
env:
- name: ACTORSYSTEM
value: AkkaTrader
- name: ENABLE_PHOBOS
value: "true"
- name: MONGO_CONNECTION_STR
value: "mongodb://mongodb:27017/akkaTrader"
- name: STATSD_PORT
value: "8125"
- name: STATSD_URL
value: "statsd-agent"
- name: JAEGER_AGENT_HOST
value: "jaeger-agent"
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: CLUSTER_IP
value: "$(POD_NAME).pricing"
- name: CLUSTER_PORT
value: "5110"
- name: CLUSTER_SEEDS
value: akka.tcp://$(ACTORSYSTEM)@lighthouse-0.lighthouse:4053,akka.tcp://$(ACTORSYSTEM)@lighthouse-1.lighthouse:4053,akka.tcp://$(ACTORSYSTEM)@lighthouse-2.lighthouse:4053
livenessProbe:
tcpSocket:
port: 5110
ports:
- containerPort: 5110
protocol: TCP
76 changes: 76 additions & 0 deletions k8s/pricing-web-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: v1
kind: Service
metadata:
name: pricing-web
labels:
app: pricing-web
spec:
clusterIP: None
ports:
- port: 16666
selector:
app: pricing-web
---
- apiVersion: v1
kind: Service
metadata:
name: pricing-ui
labels:
app: pricing-web
spec:
ports:
- name: query-http
port: 8999
protocol: TCP
targetPort: 80
selector:
app: pricing-web
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: pricing-web
labels:
app: pricing-web
spec:
serviceName: pricing-web
replicas: 3
selector:
matchLabels:
app: pricing-web
template:
metadata:
labels:
app: pricing-web
spec:
terminationGracePeriodSeconds: 35
containers:
- name: pricing-web
image: akka.cqrs.pricing.web:0.1.0
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "pbm 127.0.0.1:9110 cluster leave"]
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: CLUSTER_IP
value: "$(POD_NAME).web-pricing"
- name: CLUSTER_SEEDS
value: akka.tcp://AkkaTrader@pricing-0.pricing:5110,akka.tcp://AkkaTrader@pricing-1.pricing:5110,akka.tcp://AkkaTrader@pricing-2.pricing:5110
livenessProbe:
tcpSocket:
port: 16666
readinessProbe:
httpGet:
path: "/"
port: 80
initialDelaySeconds: 5
ports:
- containerPort: 16666
protocol: TCP
- containerPort: 80
protocol: TCP
Loading

0 comments on commit 84baabc

Please sign in to comment.