Skip to content

Commit

Permalink
Merge pull request #306 from m-lab/sandbox-kinkade
Browse files Browse the repository at this point in the history
Adds a new deployment, service and ingress for GMX.
  • Loading branch information
nkinkade authored Sep 13, 2018
2 parents 82fab1b + c8260dc commit 8f3583b
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
50 changes: 50 additions & 0 deletions k8s/prometheus-federation/deployments/gmx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: gmx-server
namespace: default
spec:
replicas: 1
selector:
matchLabels:
# Used to match pre-existing pods that may be affected during updates.
run: gmx-server
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
# Pod template.
template:
metadata:
labels:
# Note: run=gmx-server should match a service config with a
# public IP and port so that it is publically accessible.
run: gmx-server
spec:
containers:
- image: measurementlab/github-maintenance-exporter:v0.1
name: gmx-server
args: ["--storage.state-file=/var/lib/gmx/gmx-state"]
env:
- name: GITHUB_WEBHOOK_SECRET
valueFrom:
secretKeyRef:
name: gmx-webhook-secret
key: gmx-webhook-secret
imagePullPolicy: Always
ports:
- containerPort: 9999
resources:
requests:
memory: "500M"
cpu: "200m"
volumeMounts:
- mountPath: /var/lib/gmx
name: gmx-storage
# Disks created manually, can be named here explicitly using
# gcePersistentDisk instead of the persistentVolumeClaim.
volumes:
- name: gmx-storage
persistentVolumeClaim:
claimName: auto-gmx-disk0
13 changes: 13 additions & 0 deletions k8s/prometheus-federation/persistentvolumes/persistent-volumes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,16 @@ spec:
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: auto-gmx-disk0
annotations:
volume.beta.kubernetes.io/storage-class: "slow"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
41 changes: 41 additions & 0 deletions k8s/prometheus-federation/services/gmx-tls-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/scrape: 'true'
name: gmx-tls-service
namespace: default
spec:
ports:
- port: 9999
protocol: TCP
targetPort: 9999
selector:
# Pods with labels matching this key/value pair will be publically
# accessible through the service IP and port.
run: gmx-server
sessionAffinity: None
type: NodePort
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: gmx-tls
namespace: default
annotations:
kubernetes.io/tls-acme: "true"
kubernetes.io/ingress.class: "nginx"
spec:
tls:
- hosts:
- gmx.{{GCLOUD_PROJECT}}.measurementlab.net
secretName: gmx-tls
rules:
- host: gmx.{{GCLOUD_PROJECT}}.measurementlab.net
http:
paths:
- path: /
backend:
serviceName: gmx-tls-service
servicePort: 9999

0 comments on commit 8f3583b

Please sign in to comment.