Skip to content

Instantly share code, notes, and snippets.

@iamtheindian
Created July 27, 2020 18:55
Show Gist options
  • Save iamtheindian/1b1da8ed1aeecd9ae032177d4ae138ea to your computer and use it in GitHub Desktop.
Save iamtheindian/1b1da8ed1aeecd9ae032177d4ae138ea to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Service
metadata:
name: prometheus
labels:
app: prometheus
spec:
ports:
- port: 9090
nodePort: 30000
selector:
app: prometheus
tier: frontend
type: NodePort
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: prometheus-volume
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /mnt/test_prometheus
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: prometheus-pv-claim
labels:
app: prometheus
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus
labels:
app: prometheus
spec:
replicas: 1
selector:
matchLabels:
app: prometheus
tier: frontend
template:
metadata:
labels:
app: prometheus
tier: frontend
spec:
containers:
- image: vimal13/prometheus
name: prometheus
volumeMounts:
- name: prometheus-persistent-storage
mountPath: /prometheus
volumes:
- name: prometheus-persistent-storage
persistentVolumeClaim:
claimName: prometheus-pv-claim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment