Skip to content

Commit

Permalink
Rename things to clients
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffMboya committed Jan 23, 2025
1 parent 7d75bd3 commit c0c08e9
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 94 deletions.
2 changes: 1 addition & 1 deletion charts/magistrala/templates/adapter_coap-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
- name: MG_MESSAGE_BROKER_URL
value: nats://{{ .Release.Name }}-nats:{{ .Values.defaults.natsPort }}
- name: MG_THINGS_AUTH_GRPC_URL
value: {{ .Release.Name }}-envoy:{{ .Values.things.authGrpcPort }}
value: {{ .Release.Name }}-envoy:{{ .Values.clients.authGrpcPort }}
- name: MG_COAP_ADAPTER_LOG_LEVEL
value: {{ default .Values.defaults.logLevel .Values.adapter_coap.logLevel | quote }}
- name: MG_COAP_ADAPTER_HTTP_HOST
Expand Down
2 changes: 1 addition & 1 deletion charts/magistrala/templates/adapter_http-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
- name: MG_MESSAGE_BROKER_URL
value: nats://{{ .Release.Name }}-nats:{{ .Values.defaults.natsPort }}
- name: MG_THINGS_AUTH_GRPC_URL
value: {{ .Release.Name }}-envoy:{{ .Values.things.authGrpcPort }}
value: {{ .Release.Name }}-envoy:{{ .Values.clients.authGrpcPort }}
ports:
- containerPort: {{ .Values.adapter_http.httpPort }}
protocol: TCP
Expand Down
2 changes: 1 addition & 1 deletion charts/magistrala/templates/adapter_mqtt-statefulstet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ spec:
- name: MG_MESSAGE_BROKER_URL
value: nats://{{ .Release.Name }}-nats:{{ .Values.defaults.natsPort }}
- name: MG_THINGS_AUTH_GRPC_URL
value: {{ .Release.Name }}-envoy:{{ .Values.things.authGrpcPort }}
value: {{ .Release.Name }}-envoy:{{ .Values.clients.authGrpcPort }}
- name: MG_JAEGER_URL
value: "http://{{ .Release.Name }}-jaeger-collector:{{ .Values.defaults.jaegerCollectorPort }}/v1/traces"
- name: MG_MQTT_ADAPTER_MQTT_TARGET_HOST
Expand Down
6 changes: 3 additions & 3 deletions charts/magistrala/templates/certs-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
- name: MG_AUTH_GRPC_URL
value: {{ .Release.Name }}-envoy:{{ .Values.auth.grpcPort }}
- name: MG_THINGS_URL
value: http://{{ .Release.Name }}-things:{{ .Values.things.httpPort }}
value: http://{{ .Release.Name }}-clients:{{ .Values.clients.httpPort }}
- name: MG_CERTS_DB_HOST
{{- if .Values.postgresqlcerts.enabled }}
value: {{ .Release.Name }}-postgresqlcerts
Expand Down Expand Up @@ -75,9 +75,9 @@ spec:
- name: MG_CERTS_VAULT_NAMESPACE
value: {{ .Values.certs.vault.namespace | quote }}
- name: MG_CERTS_VAULT_THINGS_CERTS_PKI_PATH
value: {{ .Values.certs.vault.thingsCertsPkiPath | quote }}
value: {{ .Values.certs.vault.clientsCertsPkiPath | quote }}
- name: MG_CERTS_VAULT_THINGS_CERTS_PKI_ROLE_NAME
value: {{ .Values.certs.vault.thingsCertsPkiRoleName | quote }}
value: {{ .Values.certs.vault.clientsCertsPkiRoleName | quote }}
ports:
- containerPort: {{ .Values.certs.httpPort }}
protocol: TCP
Expand Down
78 changes: 39 additions & 39 deletions charts/magistrala/templates/clients-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,86 +4,86 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-things
name: {{ .Release.Name }}-clients
spec:
replicas: {{ .Values.defaults.replicaCount }}
selector:
matchLabels:
app: {{ .Release.Name }}
component: things
component: clients
template:
metadata:
annotations:
prometheus.io/path: /metrics
prometheus.io/port: "{{ .Values.things.httpPort }}"
prometheus.io/port: "{{ .Values.clients.httpPort }}"
prometheus.io/scrape: "true"
labels:
app: {{ .Release.Name }}
component: things
component: clients
spec:
{{- with (default .Values.defaults.image.pullSecrets .Values.things.image.pullSecrets) }}
{{- with (default .Values.defaults.image.pullSecrets .Values.clients.image.pullSecrets) }}
imagePullSecrets:
{{- toYaml . | nindent 12 }}
{{- end }}
dnsPolicy: ClusterFirst
restartPolicy: Always
containers:
- name: {{ .Release.Name }}-things
image: "{{ default (printf "%s/things" .Values.defaults.image.rootRepository) .Values.things.image.repository }}:{{ default .Values.defaults.image.tag .Values.things.image.tag }}"
imagePullPolicy: {{ default .Values.defaults.image.pullPolicy .Values.things.image.pullPolicy }}
- name: {{ .Release.Name }}-clients
image: "{{ default (printf "%s/clients" .Values.defaults.image.rootRepository) .Values.clients.image.repository }}:{{ default .Values.defaults.image.tag .Values.clients.image.tag }}"
imagePullPolicy: {{ default .Values.defaults.image.pullPolicy .Values.clients.image.pullPolicy }}
env:
- name: SMQ_JAEGER_URL
value: "http://{{ .Release.Name }}-jaeger-collector:{{ .Values.defaults.jaegerCollectorPort }}/v1/traces"
- name: SMQ_THINGS_AUTH_GRPC_HOST
- name: SMQ_CLIENTS_AUTH_GRPC_HOST
value: "0.0.0.0"
- name: SMQ_THINGS_AUTH_GRPC_PORT
value: {{ .Values.things.authGrpcPort | quote}}
- name: SMQ_THINGS_AUTH_HTTP_HOST
- name: SMQ_CLIENTS_AUTH_GRPC_PORT
value: {{ .Values.clients.authGrpcPort | quote}}
- name: SMQ_CLIENTS_AUTH_HTTP_HOST
value: "0.0.0.0"
- name: SMQ_THINGS_AUTH_HTTP_PORT
value: {{ .Values.things.authHttpPort | quote}}
- name: SMQ_THINGS_CACHE_URL
value: redis://{{ .Release.Name }}-redis-things-master:{{ .Values.things.redisCachePort }}/0
- name: SMQ_THINGS_DB_HOST
{{- if .Values.postgresqlthings.enabled }}
value: {{ .Release.Name }}-postgresqlthings
- name: SMQ_CLIENTS_AUTH_HTTP_PORT
value: {{ .Values.clients.authHttpPort | quote}}
- name: SMQ_CLIENTS_CACHE_URL
value: redis://{{ .Release.Name }}-redis-clients-master:{{ .Values.clients.redisCachePort }}/0
- name: SMQ_CLIENTS_DB_HOST
{{- if .Values.postgresqlclients.enabled }}
value: {{ .Release.Name }}-postgresqlclients
{{- else }}
value: {{ .Values.postgresqlthings.host | quote}}
value: {{ .Values.postgresqlclients.host | quote}}
{{- end }}
- name: SMQ_THINGS_DB_PORT
value: {{ .Values.postgresqlthings.port | quote}}
- name: SMQ_THINGS_DB_USER
value: {{ .Values.postgresqlthings.username | quote }}
- name: SMQ_THINGS_DB_PASS
value: {{ .Values.postgresqlthings.password | quote }}
- name: SMQ_THINGS_DB_NAME
value: {{ .Values.postgresqlthings.database | quote }}
- name: SMQ_CLIENTS_DB_PORT
value: {{ .Values.postgresqlclients.port | quote}}
- name: SMQ_CLIENTS_DB_USER
value: {{ .Values.postgresqlclients.username | quote }}
- name: SMQ_CLIENTS_DB_PASS
value: {{ .Values.postgresqlclients.password | quote }}
- name: SMQ_CLIENTS_DB_NAME
value: {{ .Values.postgresqlclients.database | quote }}
- name: SMQ_ES_URL
value: {{ .Values.defaults.eventStreamURL | quote }}
- name: SMQ_THINGS_HTTP_HOST
- name: SMQ_CLIENTS_HTTP_HOST
value: "0.0.0.0"
- name: SMQ_THINGS_HTTP_PORT
value: {{ .Values.things.httpPort | quote }}
- name: SMQ_THINGS_LOG_LEVEL
value: {{ default .Values.defaults.logLevel .Values.things.logLevel | quote }}
- name: SMQ_CLIENTS_HTTP_PORT
value: {{ .Values.clients.httpPort | quote }}
- name: SMQ_CLIENTS_CACHE_KEY_DURATION
value: {{ .Values.clients.cacheKeyduration | quote }}
- name: SMQ_AUTH_GRPC_URL
value: {{ .Release.Name }}-envoy:{{ .Values.auth.grpcPort }}
ports:
- containerPort: {{ .Values.things.httpPort }}
- containerPort: {{ .Values.clients.httpPort }}
protocol: TCP
- containerPort: {{ .Values.things.authGrpcPort }}
- containerPort: {{ .Values.clients.authGrpcPort }}
protocol: TCP
- containerPort: {{ .Values.things.authHttpPort }}
- containerPort: {{ .Values.clients.authHttpPort }}
protocol: TCP
{{- with .Values.things.nodeSelector }}
{{- with .Values.clients.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.things.affinity }}
{{- with .Values.clients.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.things.tolerations }}
{{- with .Values.clients.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
32 changes: 16 additions & 16 deletions charts/magistrala/templates/clients-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,38 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-things
name: {{ .Release.Name }}-clients
spec:
selector:
app: {{ .Release.Name }}
component: things
component: clients
ports:
- port: {{ .Values.things.httpPort }}
- port: {{ .Values.clients.httpPort }}
protocol: TCP
name: {{ .Release.Name }}-things-{{ .Values.things.httpPort }}
- port: {{ .Values.things.authGrpcPort }}
name: {{ .Release.Name }}-clients-{{ .Values.clients.httpPort }}
- port: {{ .Values.clients.authGrpcPort }}
protocol: TCP
name: {{ .Release.Name }}-things-{{ .Values.things.authGrpcPort }}
- port: {{ .Values.things.authHttpPort }}
name: {{ .Release.Name }}-clients-{{ .Values.clients.authGrpcPort }}
- port: {{ .Values.clients.authHttpPort }}
protocol: TCP
name: {{ .Release.Name }}-things-{{ .Values.things.authHttpPort }}
name: {{ .Release.Name }}-clients-{{ .Values.clients.authHttpPort }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-things-headless
name: {{ .Release.Name }}-clients-headless
spec:
selector:
app: {{ .Release.Name }}
component: things
component: clients
ports:
- port: {{ .Values.things.httpPort }}
- port: {{ .Values.clients.httpPort }}
protocol: TCP
name: {{ .Release.Name }}-things-{{ .Values.things.httpPort }}
- port: {{ .Values.things.authGrpcPort }}
name: {{ .Release.Name }}-clients-{{ .Values.clients.httpPort }}
- port: {{ .Values.clients.authGrpcPort }}
protocol: TCP
name: {{ .Release.Name }}-things-{{ .Values.things.authGrpcPort }}
- port: {{ .Values.things.authHttpPort }}
name: {{ .Release.Name }}-clients-{{ .Values.clients.authGrpcPort }}
- port: {{ .Values.clients.authHttpPort }}
protocol: TCP
name: {{ .Release.Name }}-things-{{ .Values.things.authHttpPort }}
name: {{ .Release.Name }}-clients-{{ .Values.clients.authHttpPort }}
clusterIP: None
18 changes: 9 additions & 9 deletions charts/magistrala/templates/envoy-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,23 @@ static_resources:
- address:
socket_address:
address: 0.0.0.0
port_value: {{ .Values.things.authGrpcPort }}
port_value: {{ .Values.clients.authGrpcPort }}
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
codec_type: AUTO
stat_prefix: {{ .Release.Name }}-things-envoy
stat_prefix: {{ .Release.Name }}-clients-envoy
route_config:
name: things_route
name: clients_route
virtual_hosts:
- name: things_service
- name: clients_service
domains: ["*"]
routes:
- match: { prefix: "/" }
route:
cluster: {{ .Release.Name }}_things_cluster
cluster: {{ .Release.Name }}_clients_cluster
http_filters:
- name: envoy.filters.http.grpc_web
typed_config:
Expand Down Expand Up @@ -96,20 +96,20 @@ static_resources:
address: {{ .Release.Name }}-auth-headless
port_value: {{ .Values.auth.grpcPort }}

- name: {{ .Release.Name }}_things_cluster
- name: {{ .Release.Name }}_clients_cluster
connect_timeout: 0.25s
type: STRICT_DNS
lb_policy: ROUND_ROBIN
http2_protocol_options: {}
load_assignment:
cluster_name: {{ .Release.Name }}_things_cluster
cluster_name: {{ .Release.Name }}_clients_cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: {{ .Release.Name }}-things-headless
port_value: {{ .Values.things.authGrpcPort }}
address: {{ .Release.Name }}-clients-headless
port_value: {{ .Values.clients.authGrpcPort }}
admin:
access_log_path: "/dev/null"
address:
Expand Down
6 changes: 3 additions & 3 deletions charts/magistrala/templates/envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
protocol: TCP
- containerPort: {{ .Values.auth.grpcPort }}
protocol: TCP
- containerPort: {{ .Values.things.authGrpcPort }}
- containerPort: {{ .Values.clients.authGrpcPort }}
protocol: TCP
- containerPort: 8001
protocol: TCP
Expand Down Expand Up @@ -68,9 +68,9 @@ spec:
- port: {{ .Values.auth.grpcPort }}
protocol: TCP
name: auth-grpc
- port: {{ .Values.things.authGrpcPort }}
- port: {{ .Values.clients.authGrpcPort }}
protocol: TCP
name: things-grpc
name: clients-grpc
- port: 8001
protocol: TCP
name: admin
24 changes: 12 additions & 12 deletions charts/magistrala/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ spec:
pathType: Exact
backend:
service:
name: {{ .Release.Name }}-things
name: {{ .Release.Name }}-clients
port:
number: {{ .Values.things.httpPort }}
number: {{ .Values.clients.httpPort }}
{{- if .Values.ingress.tls }}
tls:
- hosts:
Expand All @@ -44,12 +44,12 @@ spec:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}-users-things-ingress
name: {{ .Release.Name }}-users-clients-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/configuration-snippet: |
if ($request_method = GET) {
proxy_pass http://{{ .Release.Name }}-things.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.things.httpPort }};
proxy_pass http://{{ .Release.Name }}-clients.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.clients.httpPort }};
break;
}
spec:
Expand All @@ -58,7 +58,7 @@ spec:
- host: "{{ .Values.ingress.hostname }}"
http:
paths:
- path: /((users|groups)/(.+)/(channels|things))
- path: /((users|groups)/(.+)/(channels|clients))
pathType: ImplementationSpecific
backend:
service:
Expand All @@ -69,7 +69,7 @@ spec:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}-things-users-ingress
name: {{ .Release.Name }}-clients-users-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/configuration-snippet: |
Expand All @@ -83,13 +83,13 @@ spec:
- host: "{{ .Values.ingress.hostname }}"
http:
paths:
- path: /((channels|things)/(.+)/(users|groups))
- path: /((channels|clients)/(.+)/(users|groups))
pathType: ImplementationSpecific
backend:
service:
name: {{ .Release.Name }}-things
name: {{ .Release.Name }}-clients
port:
number: {{ .Values.things.httpPort }}
number: {{ .Values.clients.httpPort }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand Down Expand Up @@ -174,13 +174,13 @@ spec:
name: {{ .Release.Name }}-users
port:
number: {{ .Values.users.httpPort }}
- path: /((things|channels|connect|disconnect|identify).*)
- path: /((clients|channels|connect|disconnect|identify).*)
pathType: ImplementationSpecific
backend:
service:
name: {{ .Release.Name }}-things
name: {{ .Release.Name }}-clients
port:
number: {{ .Values.things.httpPort }}
number: {{ .Values.clients.httpPort }}
- path: /(invitations.*)
pathType: ImplementationSpecific
backend:
Expand Down
2 changes: 1 addition & 1 deletion charts/magistrala/templates/ui-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
- name: MG_HTTP_ADAPTER_URL
value: {{ default (printf "http://%s-adapter-http:%s " .Release.Name (.Values.adapter_http.httpPort | toString )) .Values.ui.httpAdapterUrl }}
- name: MG_THINGS_URL
value: {{ default (printf "http://%s-things:%s" .Release.Name (.Values.things.httpPort | toString )) .Values.ui.thingsUrl }}
value: {{ default (printf "http://%s-clients:%s" .Release.Name (.Values.clients.httpPort | toString )) .Values.ui.clientsUrl }}
- name: MG_USERS_URL
value: {{ default (printf "http://%s-users:%s" .Release.Name (.Values.users.httpPort | toString )) .Values.ui.usersUrl }}
- name: MG_INVITATIONS_URL
Expand Down
Loading

0 comments on commit c0c08e9

Please sign in to comment.