Created
March 4, 2021 04:56
-
-
Save turnipsoup/247bd3d459c2f535cfe1a8188618f742 to your computer and use it in GitHub Desktop.
For deploying influxdb and grafana together in 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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: ifg-deployment | |
namespace: house-infra | |
labels: | |
app: ifg | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: ifg | |
template: | |
metadata: | |
labels: | |
name: ifg-pod | |
namespace: house-infra | |
app: ifg | |
spec: | |
containers: | |
- name: grafana | |
image: grafana/grafana | |
ports: | |
- containerPort: 3000 | |
volumeMounts: | |
- mountPath: /var/lib/grafana | |
name: grafana-volume | |
- name: influxdb | |
image: quay.io/influxdb/influxdb:v2.0.3 | |
ports: | |
- containerPort: 8086 | |
volumeMounts: | |
- mountPath: /root/.influxdbv2 | |
name: influxdb-volume | |
volumes: | |
- name: grafana-volume | |
hostPath: | |
path: /opt/grafana/ | |
type: DirectoryOrCreate | |
- name: influxdb-volume | |
hostPath: | |
path: /opt/influxdb/db/influxdbv2 | |
type: DirectoryOrCreate |
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
kind: Service | |
apiVersion: v1 | |
metadata: | |
name: ifg-service | |
namespace: house-infra | |
spec: | |
type: NodePort | |
selector: | |
app: ifg | |
ports: | |
- protocol: TCP | |
name: grafana-web-interface | |
port: 3000 | |
nodePort: 40000 | |
- protocol: TCP | |
name: influxdb-interface | |
port: 8086 | |
nodePort: 8086 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You will need to exec into your influxdb pod and follow the standard setup instructions for influxdb.
You will also need to configure grafana yourself: https://docs.influxdata.com/influxdb/v2.0/tools/grafana/?t=InfluxQL#configure-your-influxdb-connection