Skip to content

Commit 1f4b84a

Browse files
committedFeb 20, 2024··
pk8s [sipwork]: hass influxdb
* traefik: add needed plugins to deal with influxdb not able to work properly in path /influxdb > influxdata/influxdb#15721
1 parent f3d480e commit 1f4b84a

File tree

6 files changed

+196
-0
lines changed

6 files changed

+196
-0
lines changed
 

‎apps/pk8s/sipwork/home-assistant.yaml

+75
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,78 @@
1+
---
2+
apiVersion: helm.toolkit.fluxcd.io/v2beta2
3+
kind: HelmRelease
4+
metadata:
5+
name: influxdb-sipwork
6+
namespace: flux-system
7+
spec:
8+
interval: 30m
9+
releaseName: influxdb-sipwork
10+
targetNamespace: sipwork
11+
serviceAccountName: helm-controller
12+
chart:
13+
spec:
14+
chart: influxdb
15+
version: 5.15.x
16+
sourceRef:
17+
kind: HelmRepository
18+
name: bitnami
19+
namespace: flux-system
20+
interval: 12h
21+
valuesFrom:
22+
- kind: ConfigMap
23+
name: influxdb-sipwork-values
24+
valuesKey: values-influxdb.yaml
25+
- kind: Secret
26+
name: influxdb-sipwork-config
27+
---
28+
apiVersion: traefik.containo.us/v1alpha1
29+
kind: Middleware
30+
metadata:
31+
name: influxdb-cookie-path
32+
namespace: sipwork
33+
spec:
34+
plugin:
35+
cookiePathPrefix:
36+
prefix: influxdb
37+
---
38+
apiVersion: traefik.containo.us/v1alpha1
39+
kind: Middleware
40+
metadata:
41+
name: influxdb
42+
namespace: sipwork
43+
spec:
44+
stripPrefix:
45+
prefixes:
46+
- /influxdb
47+
forceSlash: true
48+
---
49+
apiVersion: traefik.containo.us/v1alpha1
50+
kind: Middleware
51+
metadata:
52+
name: influxdb-rewrite-body
53+
namespace: sipwork
54+
spec:
55+
plugin:
56+
rewrite-body:
57+
lastModified: true
58+
rewrites:
59+
- regex: src="/
60+
replacement: src="/influxdb/
61+
- regex: href="/
62+
replacement: href="/influxdb/
63+
- regex: data-basepath="
64+
replacement: data-basepath="/influxdb/
65+
- regex: n.p="/"
66+
replacement: n.p="/influxdb/"
67+
- regex: o.p="/"
68+
replacement: o.p="/influxdb/"
69+
- regex: /api/
70+
replacement: /influxdb/api/
71+
- regex: api/v2/query
72+
replacement: influxdb/api/v2/query
73+
- regex: \)}/health`
74+
replacement: )}/influxdb/health`
75+
---
176
apiVersion: apps/v1
277
kind: Deployment
378
metadata:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
auth:
2+
admin:
3+
password: ENC[AES256_GCM,data:fe8Wd9+oam5zCCu7+91e,iv:THJ94OIAzw9dQIFmebMoNJk6IKW9fpaFZAtITTd4UFo=,tag:WYaDR5CkIX9uk9QgtN4XKw==,type:str]
4+
token: ENC[AES256_GCM,data:InMiHXr88wEV0+guX7FGGe7/f5NeLPt/ZmByuP40/w4K76VkSUobQj76YlirFWT2r9UnpDANFVw37FdUUb5ELjEDZ/8pxWuLY1AX6oo6wtXwwVDcQY70RA==,iv:kZuwk4bxk68qnbVB8s3fht1OVMT40YpOw7FZnNDofk0=,tag:DnbxITF3CTYC+odFJX9iIA==,type:str]
5+
user:
6+
username: ENC[AES256_GCM,data:bTZ8uA==,iv:oXoHv+twpg0n+LIwaCWLwG1cloQeyA4x4xIRhH2wqFA=,tag:QNJ2oCAX3pSTfKANGz3x9A==,type:str]
7+
password: ENC[AES256_GCM,data:THD3XEgqBiReBSm/qiqa,iv:bbbBp8oibEfx7GVBB26oWwxFHmulMeYkGdeMqSKAU24=,tag:tb80PCLETSk5W/WHvgWTaA==,type:str]
8+
org: ENC[AES256_GCM,data:9yZiuA==,iv:KDHKa2TTCXPP452twdDp8x3hb262vTN5c4FxcpjtHrA=,tag:OuPmStg1QrNzd6bjhehR0g==,type:str]
9+
token: ENC[AES256_GCM,data:NZjrJqPklRXg6/s+GHhbTYirWgGL3uiNzIY8qNrgkbDkhp/7MhBwG/OOGm3MBTL5M/WBsxssB0irXukOo7us2FvBB5ka75s1HWRqMsB4RfWB5w0onMn2HQ==,iv:4YNs8KM09EjgGbkNtb1wvFSlmT5w7QcXPnD4jpqjAug=,tag:6pokX7+VEpJPAyP+sgGc7A==,type:str]
10+
sops:
11+
kms: []
12+
gcp_kms: []
13+
azure_kv: []
14+
hc_vault: []
15+
age:
16+
- recipient: age1lpqp7ue6rj8x020uvlrklk2pz6k6va80qh3c7fzce0v7gq2m3akssrfmkr
17+
enc: |
18+
-----BEGIN AGE ENCRYPTED FILE-----
19+
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBZZ2hGR1pPSS9VcEk4WkEx
20+
RVJsQ2h6dE1neUJ6K2E5T0ZWd0wvcjM5RHlVCjk4ZDBKSXNqems1RGd5dml1TXJm
21+
QU5wTWxGOUk4Q3IyTnVRU0hSZEJTWXcKLS0tIGV2UjZ6K0pYeU5peXZTaXQrWTIy
22+
Z0xNS1Z4VlJvbStLUFlOL3NxTHZncGMKsa1wnhYLN8yn2gnLT2C1Y/MQENvofBoA
23+
B4vmAPbNmeEQ0wlN1/XhFj0xb1p+hYJCy3RvgMFrmxych8gS83rg6w==
24+
-----END AGE ENCRYPTED FILE-----
25+
lastmodified: "2024-02-20T02:06:17Z"
26+
mac: ENC[AES256_GCM,data:GvHP68E1n7y4tnf+lcWu0PiH/KhVscY0FGBsnLKxAFddM9A+XGdROlR6vFFcTVg/YdRdpqQQu0RyaVd2VxiTJDsjRmoQqsQKC6YOrq2Z1JKpHV0SYpwq7x/giKqiX+tlljTCOFwKrVCj/bT9mXTwrCr+Xi5Cw6qSddQLwp+ntQc=,iv:yl2iZiT0ucAa9hyPIQkzzAlvz6NwCciZ/hBhZJwcgao=,tag:TuIFMQNv1gJsEiiuh2HhXg==,type:str]
27+
pgp: []
28+
encrypted_regex: .*
29+
version: 3.8.1
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
influxdb:
3+
service:
4+
type: ClusterIP
5+
persistence:
6+
enabled: true
7+
size: 2Gbi
8+
existingClaim: influxdb-data
9+
ingress:
10+
enabled: true
11+
hostname: panel.sipwork.pro
12+
pathType: Prefix
13+
path: /influxdb
14+
ingressClassName: traefik
15+
annotations:
16+
traefik.ingress.kubernetes.io/router.tls: 'true'
17+
traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
18+
traefik.ingress.kubernetes.io/router.middlewares: traefik-redirectscheme@kubernetescrd,traefik-internal-ipwhitelist@kubernetescrd,sipwork-influxdb-cookie-path@kubernetescrd,sipwork-influxdb-rewrite-body@kubernetescrd,sipwork-influxdb@kubernetescrd
19+
extraTls:
20+
- hosts:
21+
- panel.sipwork.pro
22+
secretName: sipwork.pro-tls

‎apps/pk8s/sipwork/kustomization.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@ secretGenerator:
1717
namespace: flux-system
1818
files:
1919
- values.yaml=wp-secret-values.enc.yaml
20+
- name: influxdb-sipwork-config
21+
namespace: flux-system
22+
files:
23+
- values.yaml=influxdb-secret-values.enc.yaml
2024
configMapGenerator:
2125
- name: wp-sipwork-values
2226
namespace: flux-system
2327
files:
2428
- values-wp.yaml=wp-values.yaml
29+
- name: influxdb-sipwork-values
30+
namespace: flux-system
31+
files:
32+
- values-influxdb.yaml=influxdb-values.yaml
2533
configurations:
2634
- kustomizeconfig.yaml

‎apps/pk8s/sipwork/storage.yaml

+54
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,57 @@ spec:
305305
- ReadWriteOnce
306306
persistentVolumeReclaimPolicy: Retain
307307
volumeMode: Filesystem
308+
---
309+
apiVersion: v1
310+
kind: PersistentVolumeClaim
311+
metadata:
312+
name: influxdb-data
313+
namespace: sipwork
314+
spec:
315+
accessModes:
316+
- ReadWriteOnce
317+
selector:
318+
matchLabels:
319+
org.democratic-csi.manual: sipwork-influxdb-data
320+
resources:
321+
requests:
322+
storage: 100Mi
323+
---
324+
apiVersion: v1
325+
kind: PersistentVolume
326+
metadata:
327+
name: sipwork-influxdb-data
328+
labels:
329+
org.democratic-csi.manual: sipwork-influxdb-data
330+
spec:
331+
capacity:
332+
storage: 2Gi
333+
csi:
334+
driver: org.democratic-csi.node-manual
335+
volumeHandle: pvc-aaf36432-556a-493d-8584-35dde4d8be9c
336+
fsType: ext4
337+
volumeAttributes:
338+
interface: ''
339+
iqn: >-
340+
iqn.2005-10.org.freenas.ctl:csi-pvc-aaf36432-556a-493d-8584-35dde4d8be9c-cluster
341+
lun: '0'
342+
node_attach_driver: iscsi
343+
portal: 192.168.4.5:3260
344+
portals: ''
345+
provisioner_driver: node-manual
346+
controllerPublishSecretRef:
347+
name: controller-publish-secret-freenas-iscsi-csi-democratic-csi
348+
namespace: democratic-csi
349+
nodeStageSecretRef:
350+
name: node-stage-secret-freenas-iscsi-csi-democratic-csi
351+
namespace: democratic-csi
352+
nodePublishSecretRef:
353+
name: node-publish-secret-freenas-iscsi-csi-democratic-csi
354+
namespace: democratic-csi
355+
controllerExpandSecretRef:
356+
name: controller-expand-secret-freenas-iscsi-csi-democratic-csi
357+
namespace: democratic-csi
358+
accessModes:
359+
- ReadWriteOnce
360+
persistentVolumeReclaimPolicy: Retain
361+
volumeMode: Filesystem

‎infrastructure/pk8s/controllers/traefik-values.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,11 @@ spec:
3030
externalTrafficPolicy: Local
3131
loadBalancerSourceRanges: []
3232
externalIPs: []
33+
experimental:
34+
plugins:
35+
rewrite-body:
36+
moduleName: github.com/traefik/plugin-rewritebody
37+
version: v0.3.1
38+
cookiePathPrefix:
39+
moduleName: github.com/SchmitzDan/traefik-plugin-cookie-path-prefix
40+
version: v0.0.3

0 commit comments

Comments
 (0)
Please sign in to comment.