Created
September 25, 2018 13:57
-
-
Save mulbc/ee35bf18cb0bc351965cc3131b0481ab to your computer and use it in GitHub Desktop.
oncall.tools deployment on Kubernetes
This file contains hidden or 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
kubectl create ns oncall | |
kubectl config set-context (kubectl config current-context) --namespace=oncall | |
kubectl create secret generic mysql-pass --from-literal=password='1234' | |
kubectl apply -f oncall_config.yml | |
kubectl apply -f oncall_depl.yml |
This file contains hidden or 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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: oncall-cmap | |
labels: | |
app: oncall | |
data: | |
config.yaml: |- | |
server: | |
host: 0.0.0.0 | |
port: 8080 | |
debug: True | |
oncall_host: http://localhost:8080 | |
metrics: dummy | |
db: | |
conn: | |
kwargs: | |
scheme: mysql+pymysql | |
user: root | |
password: '1234' | |
host: mysql | |
database: oncall | |
charset: utf8 | |
echo: True | |
str: "%(scheme)s://%(user)s:%(password)s@%(host)s/%(database)s?charset=%(charset)s" | |
kwargs: | |
pool_recycle: 3600 | |
session: | |
encrypt_key: 'abc' | |
sign_key: '123' | |
auth: | |
debug: False | |
module: 'oncall.auth.modules.debug' | |
notifier: | |
skipsend: True | |
healthcheck_path: /tmp/status | |
messengers: | |
- type: dummy | |
application: oncall | |
iris_api_key: magic | |
# allow_origins_list: | |
# - http://www.example.com | |
supported_timezones: | |
- 'US/Pacific' | |
- 'US/Eastern' | |
- 'US/Central' | |
- 'US/Mountain' | |
- 'UTC' | |
- 'Europe/Berlin' | |
index_content_setting: | |
footer: | | |
<ul> | |
<li>Oncall © LinkedIn 2017</li> | |
<li>Feedback</li> | |
<li><a href="http://oncall.tools" target="_blank">About</a></li> | |
</ul> | |
notifications: | |
default_roles: | |
- "primary" | |
- "secondary" | |
- "shadow" | |
- "manager" | |
default_times: | |
- 86400 | |
- 604800 | |
default_modes: | |
- "email" | |
reminder: | |
activated: True | |
polling_interval: 360 | |
default_timezone: 'Europe/Berlin' | |
user_validator: | |
activated: True | |
subject: 'Warning: Missing phone number in Oncall' | |
body: 'You are scheduled for an on-call shift in the future, but have no phone number recorded. Please update your information in Oncall.' | |
slack_instance: foobar | |
header_color: '#3a3a3a' | |
iris_plan_integration: | |
activated: True | |
app: oncall | |
api_key: magic | |
api_host: http://localhost:16649 | |
plan_url: '/v0/applications/oncall/plans' |
This file contains hidden or 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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: mysql | |
labels: | |
app: oncall | |
spec: | |
ports: | |
- port: 3306 | |
selector: | |
app: oncall | |
tier: mysql | |
clusterIP: None | |
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: mysql-pv-claim | |
labels: | |
app: oncall | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 20Gi | |
--- | |
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 | |
kind: Deployment | |
metadata: | |
name: oncall-mysql | |
labels: | |
app: oncall | |
spec: | |
selector: | |
matchLabels: | |
app: oncall | |
tier: mysql | |
strategy: | |
type: Recreate | |
template: | |
metadata: | |
labels: | |
app: oncall | |
tier: mysql | |
spec: | |
containers: | |
- image: mysql:5.7 | |
name: mysql | |
env: | |
- name: MYSQL_ROOT_PASSWORD | |
valueFrom: | |
secretKeyRef: | |
name: mysql-pass | |
key: password | |
ports: | |
- containerPort: 3306 | |
name: mysql | |
volumeMounts: | |
- name: mysql-persistent-storage | |
mountPath: /var/lib/mysql | |
volumes: | |
- name: mysql-persistent-storage | |
persistentVolumeClaim: | |
claimName: mysql-pv-claim | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: oncall | |
labels: | |
app: oncall | |
spec: | |
ports: | |
- port: 8080 | |
selector: | |
app: oncall | |
tier: frontend | |
type: ClusterIP | |
--- | |
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 | |
kind: Deployment | |
metadata: | |
name: oncall | |
labels: | |
app: oncall | |
spec: | |
selector: | |
matchLabels: | |
app: oncall | |
tier: frontend | |
strategy: | |
type: Recreate | |
template: | |
metadata: | |
labels: | |
app: oncall | |
tier: frontend | |
spec: | |
containers: | |
- image: quay.io/iris/oncall:latest | |
name: oncall | |
# env: | |
# - name: DOCKER_DB_BOOTSTRAP | |
# value: '1' | |
ports: | |
- containerPort: 8080 | |
name: oncall | |
volumeMounts: | |
- name: oncall-persistent-storage | |
mountPath: /home/oncall/config | |
volumes: | |
- name: oncall-persistent-storage | |
configMap: | |
name: oncall-cmap |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment