Skip to content

Commit

Permalink
Merge pull request #525 from cfoos/main
Browse files Browse the repository at this point in the history
k3s/kubernettes install
  • Loading branch information
jasonacox authored Sep 26, 2024
2 parents 4eb2a55 + eb2c61a commit fdbf065
Show file tree
Hide file tree
Showing 24 changed files with 10,979 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tools/k3s/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: powerwall-secret
namespace: powerwall
data:
email: "user@domain.tld"
password: "supersecurepass"
host: "xx.xx.xx.xx"
pwtz: "America/Chicago"
timezone: "America/Chicago"
debug: "no"
style: "grafana-dark"
21 changes: 21 additions & 0 deletions tools/k3s/grafanadatasources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-datasources
namespace: powerwall
data:
ds.yaml: |-
{
"apiVersion": 1,
"datasources": [
{
"name": "Sun and Moon (auto provisioned)",
"type": "fetzerch-sunandmoon-datasource",
"jsonData":{
"latitude": "xx.xxxx",
"longitude":"xx.xxxx"
}
}
]
}
{{ end }}
68 changes: 68 additions & 0 deletions tools/k3s/grafanadeployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: grafana
name: grafana
namespace: powerwall
spec:
selector:
matchLabels:
app: grafana
template:
metadata:
labels:
app: grafana
spec:
securityContext:
fsGroup: 472
supplementalGroups:
- 0
containers:
- name: grafana
image: grafana/grafana-enterprise
imagePullPolicy: Always
env:
- name: GF_INSTALL_PLUGINS
value: "grafana-piechart-panel,fetzerch-sunandmoon-datasource,vonage-status-panel,lehmannch-flow-panel,simpod-json-datasource"
ports:
- containerPort: 3000
name: http-grafana
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /robots.txt
port: 3000
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 2
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 3000
timeoutSeconds: 1
resources:
requests:
cpu: 250m
memory: 750Mi
volumeMounts:
- mountPath: /var/lib/grafana
name: grafana-pv
- mountPath: /etc/grafana/provisioning/datasources
name: grafana-datasources
readOnly: false
volumes:
- name: grafana-pv
persistentVolumeClaim:
claimName: grafana-pvc
- name: grafana-datasources
configMap:
defaultMode: 420
name: grafana-datasources
13 changes: 13 additions & 0 deletions tools/k3s/grafanapvc-local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: grafana-pvc
namespace: powerwall
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: local-path
14 changes: 14 additions & 0 deletions tools/k3s/grafanapvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: grafana-pvc
namespace: powerwall
spec:
accessModes:
- ReadWriteMany
volumeMode: Filesystem
resources:
requests:
storage: 500Gi
storageClassName: rook-cephfs
22 changes: 22 additions & 0 deletions tools/k3s/grafanaservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
apiVersion: v1
kind: Service
metadata:
name: grafana
namespace: powerwall
spec:
allocateLoadBalancerNodePorts: true
externalTrafficPolicy: Local
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
loadBalancerIP: xx.xx.xx.xx
ports:
- port: 3000
protocol: TCP
targetPort: http-grafana
selector:
app: grafana
sessionAffinity: None
type: LoadBalancer
31 changes: 31 additions & 0 deletions tools/k3s/influxdbdeployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: influxdb
name: influxdb
namespace: powerwall
spec:
selector:
matchLabels:
app: influxdb
template:
metadata:
labels:
app: influxdb
spec:
containers:
- image: influxdb:1.8
name: influxdb
imagePullPolicy: Always
ports:
- containerPort: 8086
name: influxdb
volumeMounts:
- mountPath: /var/lib/influxdb
name: influx-data
volumes:
- name: influx-data
persistentVolumeClaim:
claimName: influx-data
14 changes: 14 additions & 0 deletions tools/k3s/influxdbpvc-local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: influx-data
namespace: powerwall
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 5Gi
storageClassName: local-path
14 changes: 14 additions & 0 deletions tools/k3s/influxdbpvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: influx-data
namespace: powerwall
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 500Gi
storageClassName: rook-cephfs
14 changes: 14 additions & 0 deletions tools/k3s/influxdbservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: influxdb
namespace: powerwall
spec:
externalTrafficPolicy: Local
ports:
- name: influxdb
port: 8086
targetPort: influxdb
selector:
app: influxdb
type: NodePort
Loading

0 comments on commit fdbf065

Please sign in to comment.