Skip to content

Commit

Permalink
Use kubernetes secret for config.ini file.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronjbrown committed Nov 6, 2022
1 parent 6e9ebc2 commit 738c111
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
12 changes: 12 additions & 0 deletions kubernetes/pygrowatt-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ spec:
labels:
app: pygrowatt
spec:
volumes:
- name: pygrowatt-config
secret:
secretName: pygrowatt-config
items:
- key: config.ini
path: config.ini
containers:
- name: pygrowatt-container
image: pygrowatt
Expand All @@ -26,6 +33,11 @@ spec:
ports:
- containerPort: 5279
protocol: TCP
volumeMounts:
- mountPath: "/opt/PyGrowatt/scripts/config.ini"
subPath: "config.ini"
name: pygrowatt-config
readOnly: true
---
apiVersion: v1
kind: Service
Expand Down
20 changes: 20 additions & 0 deletions kubernetes/pygrowatt-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
apiVersion: v1
kind: Secret
metadata:
name: pygrowatt-config
type: Opaque
stringData:
config.ini: |-
[Growatt]
KEY = Growatt
UpdateInterval = 5
[Pvoutput]
Apikey = Your-API-Key
SystemId = Your-System-Id
StatusInterval = 5
[MQTT]
ServerIP = test.mosquitto.org
ServerPort = 1883

0 comments on commit 738c111

Please sign in to comment.