Skip to content

Commit 2fcdbbf

Browse files
committed
chore: 0.0.2
1 parent 2c3f9c2 commit 2fcdbbf

File tree

7 files changed

+171
-116
lines changed

7 files changed

+171
-116
lines changed

helm/charts/vechr-iiot/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v2
2-
appVersion: "0.0.1"
2+
appVersion: "0.0.2"
33

44
name: vechr-iiot
55
description: Helm Chart for Vechr Kubernetes
@@ -8,7 +8,7 @@ keywords:
88
- IoT
99

1010
type: application
11-
version: 1.0.2
11+
version: 1.1.0
1212
home: https://github.com/vechr/k8s
1313
maintainers:
1414
- name: zulfikar

helm/charts/vechr-iiot/README.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,6 @@ influx:
4343

4444
# you need to specify port in each microservices
4545
microservices:
46-
-
47-
enabled: true
48-
name: audit-service
49-
50-
... please refer to default yaml
51-
52-
# you need this setup this!
53-
db:
54-
serviceName: postgres-service
55-
username: vechrUser
56-
password: vechr123
57-
port: 5432
58-
59-
... please refer to default yaml
6046
-
6147
enabled: true
6248
name: auth-service
@@ -129,6 +115,11 @@ serviceExternal:
129115
externalName: host.docker.internal # You need pointing into your influx host db
130116
ports:
131117
- port: 8086 # You need pointing into your influx port
118+
- name: redis-ext-service # you need this setup this!
119+
enabled: true
120+
externalName: host.docker.internal # You need pointing into your redis host db
121+
ports:
122+
- port: 6379 # You need pointing into your redis port
132123
```
133124
134125
### You run with option external influxdb and postgres locally and you have docker.

helm/charts/vechr-iiot/templates/microservice/deployment.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{{$namespace := include "vechr.namespace" .}}
22
{{$releasename := include "vechr.releasename" .}}
33

4+
{{/* >>>>>>>> This is variable for Redis <<<<<<<<< */}}
5+
{{$isRedisInternalEnabled := .Values.redis.enabled}}
6+
{{$redisName := .Values.redis.name}}
7+
{{$redisPort := .Values.redis.deployment.port}}
8+
{{/* >>>>>>>> This is variable for Redis <<<<<<<<< */}}
9+
410
{{/* >>>>>>>> This is variable for Influx <<<<<<<<< */}}
511
{{$isInfluxInternalEnabled := .Values.influx.enabled}}
612
{{$influxName := .Values.influx.name}}
@@ -98,6 +104,8 @@ spec:
98104
imagePullPolicy: {{$value.imagePullPolicy | default "Always"}}
99105
{{ if $value.env}}
100106
env:
107+
- name: APP_NAME
108+
value: {{ $value.name}}
101109
{{ if $isMonitoringEnabled }}
102110
- name: LOKI_HOST
103111
value: {{ $lokiHost | default ""}}
@@ -118,6 +126,17 @@ spec:
118126
value: "nats://nats-lb.{{$namespace}}.svc.cluster.local:4222"
119127
- name: APP_PORT
120128
value: {{$value.externalPort | quote }}
129+
{{if $value.redis}}
130+
- name: REDIS_TTL
131+
value: "300"
132+
{{if $isRedisInternalEnabled}}
133+
- name: REDIS_URL
134+
value: "redis://{{$redisName}}-service.{{$namespace}}.svc.cluster.local:{{$redisPort}}"
135+
{{else}}
136+
- name: REDIS_URL
137+
value: "redis://{{$value.redis.serviceName}}.{{$namespace}}.svc.cluster.local:{{$value.redis.port}}"
138+
{{end}}
139+
{{end}}
121140
{{if $value.influx}}
122141
{{if $isInfluxInternalEnabled}}
123142
- name: INFLUX_URL
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{{if .Values.redis.enabled}}
2+
---
3+
apiVersion: apps/v1
4+
kind: Deployment
5+
metadata:
6+
metadata:
7+
name: {{ default "redis" .Values.redis.name }}
8+
namespace: {{ include "vechr.namespace" . }}
9+
labels:
10+
app.kubernetes.io/component: vechr-redis
11+
app.kubernetes.io/instance: {{ default "redis" .Values.redis.name }}
12+
app.kubernetes.io/name: redis
13+
app.kubernetes.io/part-of: vechr-iiot
14+
app.kubernetes.io/version: {{ default "latest" .Values.redis.deployment.tag }}
15+
spec:
16+
replicas: {{ default 1 .Values.redis.replicas }}
17+
selector:
18+
matchLabels:
19+
app.kubernetes.io/component: vechr-redis
20+
app.kubernetes.io/instance: {{ default "redis" .Values.redis.name }}
21+
app.kubernetes.io/name: redis
22+
app.kubernetes.io/part-of: vechr-iiot
23+
template:
24+
metadata:
25+
name: {{ default "redis" .Values.redis.name }}
26+
labels:
27+
app.kubernetes.io/component: vechr-redis
28+
app.kubernetes.io/instance: {{ default "redis" .Values.redis.name }}
29+
app.kubernetes.io/name: redis
30+
app.kubernetes.io/part-of: vechr-iiot
31+
app.kubernetes.io/version: {{ default "latest" .Values.redis.deployment.tag }}
32+
spec:
33+
containers:
34+
- name: {{ default "redis" .Values.redis.name }}
35+
image: {{ default "redis" .Values.redis.deployment.image }}:{{ default "latest" .Values.redis.deployment.tag }}
36+
imagePullPolicy: "IfNotPresent"
37+
ports:
38+
- containerPort: {{ default 6379 .Values.redis.deployment.port }}
39+
{{end}}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{if .Values.redis.enabled}}
2+
---
3+
apiVersion: v1
4+
kind: Service
5+
metadata:
6+
name: {{ default "redis" .Values.redis.name }}-service
7+
namespace: {{ include "vechr.namespace" . }}
8+
labels:
9+
app.kubernetes.io/component: vechr-redis
10+
app.kubernetes.io/instance: {{ default "redis" .Values.redis.name }}
11+
app.kubernetes.io/name: redis
12+
app.kubernetes.io/part-of: vechr-iiot
13+
app.kubernetes.io/version: {{ default "latest" .Values.redis.deployment.tag }}
14+
spec:
15+
type: ClusterIP
16+
selector:
17+
app.kubernetes.io/component: vechr-redis
18+
app.kubernetes.io/instance: {{ default "redis" .Values.redis.name }}
19+
app.kubernetes.io/name: redis
20+
app.kubernetes.io/part-of: vechr-iiot
21+
ports:
22+
- protocol: TCP
23+
name: http
24+
port: {{ default 6379 .Values.redis.port }}
25+
targetPort: 6379
26+
27+
{{end}}

0 commit comments

Comments
 (0)