Skip to content

Commit 738c111

Browse files
committed
Use kubernetes secret for config.ini file.
1 parent 6e9ebc2 commit 738c111

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

kubernetes/pygrowatt-deployment.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ spec:
1717
labels:
1818
app: pygrowatt
1919
spec:
20+
volumes:
21+
- name: pygrowatt-config
22+
secret:
23+
secretName: pygrowatt-config
24+
items:
25+
- key: config.ini
26+
path: config.ini
2027
containers:
2128
- name: pygrowatt-container
2229
image: pygrowatt
@@ -26,6 +33,11 @@ spec:
2633
ports:
2734
- containerPort: 5279
2835
protocol: TCP
36+
volumeMounts:
37+
- mountPath: "/opt/PyGrowatt/scripts/config.ini"
38+
subPath: "config.ini"
39+
name: pygrowatt-config
40+
readOnly: true
2941
---
3042
apiVersion: v1
3143
kind: Service

kubernetes/pygrowatt-secret.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: pygrowatt-config
6+
type: Opaque
7+
stringData:
8+
config.ini: |-
9+
[Growatt]
10+
KEY = Growatt
11+
UpdateInterval = 5
12+
13+
[Pvoutput]
14+
Apikey = Your-API-Key
15+
SystemId = Your-System-Id
16+
StatusInterval = 5
17+
18+
[MQTT]
19+
ServerIP = test.mosquitto.org
20+
ServerPort = 1883

0 commit comments

Comments
 (0)