Skip to content

Commit

Permalink
chore: 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zulfikar4568 committed Sep 14, 2024
1 parent 2c3f9c2 commit 2fcdbbf
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 116 deletions.
4 changes: 2 additions & 2 deletions helm/charts/vechr-iiot/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: "0.0.1"
appVersion: "0.0.2"

name: vechr-iiot
description: Helm Chart for Vechr Kubernetes
Expand All @@ -8,7 +8,7 @@ keywords:
- IoT

type: application
version: 1.0.2
version: 1.1.0
home: https://github.com/vechr/k8s
maintainers:
- name: zulfikar
Expand Down
19 changes: 5 additions & 14 deletions helm/charts/vechr-iiot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,6 @@ influx:

# you need to specify port in each microservices
microservices:
-
enabled: true
name: audit-service

... please refer to default yaml

# you need this setup this!
db:
serviceName: postgres-service
username: vechrUser
password: vechr123
port: 5432

... please refer to default yaml
-
enabled: true
name: auth-service
Expand Down Expand Up @@ -129,6 +115,11 @@ serviceExternal:
externalName: host.docker.internal # You need pointing into your influx host db
ports:
- port: 8086 # You need pointing into your influx port
- name: redis-ext-service # you need this setup this!
enabled: true
externalName: host.docker.internal # You need pointing into your redis host db
ports:
- port: 6379 # You need pointing into your redis port
```
### You run with option external influxdb and postgres locally and you have docker.
Expand Down
19 changes: 19 additions & 0 deletions helm/charts/vechr-iiot/templates/microservice/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{{$namespace := include "vechr.namespace" .}}
{{$releasename := include "vechr.releasename" .}}

{{/* >>>>>>>> This is variable for Redis <<<<<<<<< */}}
{{$isRedisInternalEnabled := .Values.redis.enabled}}
{{$redisName := .Values.redis.name}}
{{$redisPort := .Values.redis.deployment.port}}
{{/* >>>>>>>> This is variable for Redis <<<<<<<<< */}}

{{/* >>>>>>>> This is variable for Influx <<<<<<<<< */}}
{{$isInfluxInternalEnabled := .Values.influx.enabled}}
{{$influxName := .Values.influx.name}}
Expand Down Expand Up @@ -98,6 +104,8 @@ spec:
imagePullPolicy: {{$value.imagePullPolicy | default "Always"}}
{{ if $value.env}}
env:
- name: APP_NAME
value: {{ $value.name}}
{{ if $isMonitoringEnabled }}
- name: LOKI_HOST
value: {{ $lokiHost | default ""}}
Expand All @@ -118,6 +126,17 @@ spec:
value: "nats://nats-lb.{{$namespace}}.svc.cluster.local:4222"
- name: APP_PORT
value: {{$value.externalPort | quote }}
{{if $value.redis}}
- name: REDIS_TTL
value: "300"
{{if $isRedisInternalEnabled}}
- name: REDIS_URL
value: "redis://{{$redisName}}-service.{{$namespace}}.svc.cluster.local:{{$redisPort}}"
{{else}}
- name: REDIS_URL
value: "redis://{{$value.redis.serviceName}}.{{$namespace}}.svc.cluster.local:{{$value.redis.port}}"
{{end}}
{{end}}
{{if $value.influx}}
{{if $isInfluxInternalEnabled}}
- name: INFLUX_URL
Expand Down
39 changes: 39 additions & 0 deletions helm/charts/vechr-iiot/templates/redis/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{if .Values.redis.enabled}}
---
apiVersion: apps/v1
kind: Deployment
metadata:
metadata:
name: {{ default "redis" .Values.redis.name }}
namespace: {{ include "vechr.namespace" . }}
labels:
app.kubernetes.io/component: vechr-redis
app.kubernetes.io/instance: {{ default "redis" .Values.redis.name }}
app.kubernetes.io/name: redis
app.kubernetes.io/part-of: vechr-iiot
app.kubernetes.io/version: {{ default "latest" .Values.redis.deployment.tag }}
spec:
replicas: {{ default 1 .Values.redis.replicas }}
selector:
matchLabels:
app.kubernetes.io/component: vechr-redis
app.kubernetes.io/instance: {{ default "redis" .Values.redis.name }}
app.kubernetes.io/name: redis
app.kubernetes.io/part-of: vechr-iiot
template:
metadata:
name: {{ default "redis" .Values.redis.name }}
labels:
app.kubernetes.io/component: vechr-redis
app.kubernetes.io/instance: {{ default "redis" .Values.redis.name }}
app.kubernetes.io/name: redis
app.kubernetes.io/part-of: vechr-iiot
app.kubernetes.io/version: {{ default "latest" .Values.redis.deployment.tag }}
spec:
containers:
- name: {{ default "redis" .Values.redis.name }}
image: {{ default "redis" .Values.redis.deployment.image }}:{{ default "latest" .Values.redis.deployment.tag }}
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: {{ default 6379 .Values.redis.deployment.port }}
{{end}}
27 changes: 27 additions & 0 deletions helm/charts/vechr-iiot/templates/redis/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{if .Values.redis.enabled}}
---
apiVersion: v1
kind: Service
metadata:
name: {{ default "redis" .Values.redis.name }}-service
namespace: {{ include "vechr.namespace" . }}
labels:
app.kubernetes.io/component: vechr-redis
app.kubernetes.io/instance: {{ default "redis" .Values.redis.name }}
app.kubernetes.io/name: redis
app.kubernetes.io/part-of: vechr-iiot
app.kubernetes.io/version: {{ default "latest" .Values.redis.deployment.tag }}
spec:
type: ClusterIP
selector:
app.kubernetes.io/component: vechr-redis
app.kubernetes.io/instance: {{ default "redis" .Values.redis.name }}
app.kubernetes.io/name: redis
app.kubernetes.io/part-of: vechr-iiot
ports:
- protocol: TCP
name: http
port: {{ default 6379 .Values.redis.port }}
targetPort: 6379

{{end}}
Loading

0 comments on commit 2fcdbbf

Please sign in to comment.