Skip to content

Instantly share code, notes, and snippets.

@prashanth-sams
Created June 26, 2019 15:39
Show Gist options
  • Save prashanth-sams/cb07d45522e5f2fcf5160fdb16d69331 to your computer and use it in GitHub Desktop.
Save prashanth-sams/cb07d45522e5f2fcf5160fdb16d69331 to your computer and use it in GitHub Desktop.
docker compose -> kubernetes yml
version: '3'
services:
sitespeed.io:
image: sitespeedio/sitespeed.io
command: -V
privileged: true
shm_size: 1g
volumes:
- ./:/sitespeed.io
grafana:
image: grafana/grafana:6.2.0
depends_on:
- graphite
links:
- graphite
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=hdeAga76VG6ga7plZ1
- GF_SECURITY_ADMIN_USER=sitespeedio
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_USERS_ALLOW_SIGN_UP=false
- GF_USERS_ALLOW_ORG_CREATE=false
volumes:
- grafana:/var/lib/grafana
restart: always
graphite:
image: sitespeedio/graphite:1.1.5-3
ports:
- "2003:2003"
- "8080:80"
restart: always
volumes:
# In production you should configure/map these to your container
# Make sure whisper and graphite.db/grafana.db lives outside your containerr
# https://www.sitespeed.io/documentation/sitespeed.io/graphite/#graphite-for-production-important
- whisper:/opt/graphite/storage/whisper
# Download an empty graphite.db from https://github.com/sitespeedio/sitespeed.io/tree/master/docker/graphite
#- ./graphite/graphite.db:/opt/graphite/storage/graphite.db
#- ./graphite/conf/storage-schemas.conf:/opt/graphite/conf/storage-schemas.conf
#- ./graphite/conf/storage-aggregation.conf:/opt/graphite/conf/storage-aggregation.conf
#- ./graphite/conf/carbon.conf:/opt/graphite/conf/carbon.conf
grafana-setup:
image: sitespeedio/grafana-bootstrap:9.0.1
links:
- grafana
environment:
- GF_PASSWORD=hdeAga76VG6ga7plZ1
- GF_USER=sitespeedio
volumes:
grafana:
whisper:
---
kind: Service
apiVersion: v1
metadata:
name: sitespeed-io
labels:
run: sitespeed-io
spec:
ports:
- name: graf
protocol: TCP
port: 4444
targetPort: 4444
selector:
run: sitespeed-io
type: NodePort
externalTrafficPolicy: Cluster
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: sitespeed-io
labels:
run: sitespeed-io
spec:
replicas: 1
selector:
matchLabels:
run: sitespeed-io
template:
metadata:
labels:
run: sitespeed-io
spec:
containers:
- name: sitespeed-io
image: sitespeedio/sitespeed.io
restartPolicy: Always
command: [ "/bin/bash", "-ce", "tail -f /dev/null" ]
# volumeMounts:
# - mountPath: ./
# name: data-volume
# volumes:
# - name: data-volume
# persistentVolumeClaim:
# claimName: /sitespeed.io
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: grafana
labels:
run: grafana
spec:
replicas: 1
selector:
matchLabels:
run: grafana
template:
metadata:
labels:
run: grafana
spec:
containers:
- name: grafana
image: grafana/grafana:6.2.0
# volumeMounts:
# - mountPath: grafana
# name: data-volume
restartPolicy: Always
ports:
- containerPort: 3000
env:
- name: GF_SECURITY_ADMIN_PASSWORD
value: hdeAga76VG6ga7plZ1
- name: GF_SECURITY_ADMIN_USER
value: 'sitespeedio'
- name: GF_AUTH_ANONYMOUS_ENABLED
value: 'true'
- name: GF_USERS_ALLOW_SIGN_UP
value: 'false'
- name: GF_USERS_ALLOW_ORG_CREATE
value: 'false'
# volumes:
# - name: data-volume
# persistentVolumeClaim:
# claimName: /var/lib/grafana
# ports:
# - port: 3000
# targetPort: 3000
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: graphite
labels:
run: graphite
spec:
replicas: 1
selector:
matchLabels:
run: graphite
template:
metadata:
labels:
run: graphite
spec:
containers:
- name: graphite
image: sitespeedio/graphite:1.1.5-3
# volumeMounts:
# - mountPath: whisper
# name: data-volume
restartPolicy: Always
ports:
- name: graphiteone
containerPort: 8080
hostPort: 80
- name: graphitetwo
containerPort: 2003
hostPort: 2003
# ports:
# - port: 2003
# targetPort: 2003
# - port: 8080
# targetPort: 80
# volumes:
# - name: data-volume
# persistentVolumeClaim:
# claimName: /opt/graphite/storage/whisper
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: grafana-setup
labels:
run: grafana-setup
spec:
replicas: 1
selector:
matchLabels:
run: grafana-setup
template:
metadata:
labels:
run: grafana-setup
spec:
containers:
- name: grafana-setup
image: sitespeedio/grafana-bootstrap:9.0.1
env:
- name: GF_PASSWORD
value: hdeAga76VG6ga7plZ1
- name: GF_USER
value: 'sitespeedio'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment