From bdd43469127de35c2e95f2b85a18ce7a481c02dd Mon Sep 17 00:00:00 2001 From: hysyeah Date: Thu, 1 Aug 2024 23:44:45 +0800 Subject: [PATCH] feat: add support for nats (#286) --- .../market/templates/market_deploy.yaml | 2 +- .../cluster/deploy/appservice_deploy.yaml | 2 +- .../config/launcher/templates/bfl_deploy.yaml | 2 +- .../templates/systemserver_deploy.yaml | 25 ++ .../apr.bytetrade.io_middlewarerequests.yaml | 161 ++++++-- .../cluster/deploy/middleware_deploy.yaml | 4 +- .../cluster/deploy/nats_deployment.yaml | 350 ++++++++++++++++++ .../config/user/helm-charts/nats/.helmignore | 23 ++ .../config/user/helm-charts/nats/Chart.yaml | 24 ++ .../user/helm-charts/nats/templates/NOTES.txt | 1 + .../helm-charts/nats/templates/_helpers.tpl | 52 +++ .../nats/templates/deployment.yaml | 14 + .../config/user/helm-charts/nats/values.yaml | 0 13 files changed, 634 insertions(+), 26 deletions(-) create mode 100644 frameworks/tapr/config/cluster/deploy/nats_deployment.yaml create mode 100644 frameworks/tapr/config/user/helm-charts/nats/.helmignore create mode 100644 frameworks/tapr/config/user/helm-charts/nats/Chart.yaml create mode 100644 frameworks/tapr/config/user/helm-charts/nats/templates/NOTES.txt create mode 100644 frameworks/tapr/config/user/helm-charts/nats/templates/_helpers.tpl create mode 100644 frameworks/tapr/config/user/helm-charts/nats/templates/deployment.yaml create mode 100644 frameworks/tapr/config/user/helm-charts/nats/values.yaml diff --git a/apps/market/config/user/helm-charts/market/templates/market_deploy.yaml b/apps/market/config/user/helm-charts/market/templates/market_deploy.yaml index 9fe046b9..85821777 100644 --- a/apps/market/config/user/helm-charts/market/templates/market_deploy.yaml +++ b/apps/market/config/user/helm-charts/market/templates/market_deploy.yaml @@ -71,7 +71,7 @@ spec: ports: - containerPort: 80 - name: appstore-backend - image: beclab/market-backend:v0.2.10 + image: beclab/market-backend:v0.2.11 imagePullPolicy: IfNotPresent ports: - containerPort: 81 diff --git a/frameworks/app-service/config/cluster/deploy/appservice_deploy.yaml b/frameworks/app-service/config/cluster/deploy/appservice_deploy.yaml index ab7a9e93..fd19f7ed 100644 --- a/frameworks/app-service/config/cluster/deploy/appservice_deploy.yaml +++ b/frameworks/app-service/config/cluster/deploy/appservice_deploy.yaml @@ -153,7 +153,7 @@ spec: serviceAccount: os-internal containers: - name: app-service - image: beclab/app-service:0.2.22 + image: beclab/app-service:0.2.23 imagePullPolicy: IfNotPresent securityContext: runAsUser: 0 diff --git a/frameworks/bfl/config/launcher/templates/bfl_deploy.yaml b/frameworks/bfl/config/launcher/templates/bfl_deploy.yaml index e6164e80..a2240260 100644 --- a/frameworks/bfl/config/launcher/templates/bfl_deploy.yaml +++ b/frameworks/bfl/config/launcher/templates/bfl_deploy.yaml @@ -238,7 +238,7 @@ spec: mkdir -p /userspace/Data containers: - name: api - image: beclab/bfl:v0.3.34 + image: beclab/bfl:v0.3.35 imagePullPolicy: IfNotPresent volumeMounts: - name: userspace-dir diff --git a/frameworks/system-server/config/user/helm-charts/systemserver/templates/systemserver_deploy.yaml b/frameworks/system-server/config/user/helm-charts/systemserver/templates/systemserver_deploy.yaml index 49e431ba..e5b1fdad 100644 --- a/frameworks/system-server/config/user/helm-charts/systemserver/templates/systemserver_deploy.yaml +++ b/frameworks/system-server/config/user/helm-charts/systemserver/templates/systemserver_deploy.yaml @@ -173,6 +173,18 @@ data: "@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy stat_prefix: destination cluster: cluster_pg_proxy + - name: listener_nats_proxy + address: + socket_address: + address: 0.0.0.0 + port_value: 4222 + filter_chains: + - filters: + - name: envoy.filters.network.tcp_proxy + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy + stat_prefix: destination + cluster: cluster_nats_proxy - name: listener_auth_backend_proxy address: socket_address: @@ -249,6 +261,19 @@ data: socket_address: address: citus-0.citus-headless.os-system.svc.cluster.local port_value: 5432 + - name: cluster_nats_proxy + connect_timeout: 30s + type: LOGICAL_DNS + dns_lookup_family: V4_ONLY + load_assignment: + cluster_name: cluster_nats_proxy + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: + address: nats.os-system.svc.cluster.local + port_value: 4222 - name: cluster_auth_backend_proxy connect_timeout: 30s type: LOGICAL_DNS diff --git a/frameworks/tapr/config/cluster/crds/apr.bytetrade.io_middlewarerequests.yaml b/frameworks/tapr/config/cluster/crds/apr.bytetrade.io_middlewarerequests.yaml index b4fe3b4b..0419ea01 100644 --- a/frameworks/tapr/config/cluster/crds/apr.bytetrade.io_middlewarerequests.yaml +++ b/frameworks/tapr/config/cluster/crds/apr.bytetrade.io_middlewarerequests.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: middlewarerequests.apr.bytetrade.io spec: group: apr.bytetrade.io @@ -33,14 +32,19 @@ spec: Request properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -84,9 +88,10 @@ spec: be a valid secret key. type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, - uid?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the Secret or its key @@ -104,6 +109,113 @@ spec: - databases - user type: object + nats: + properties: + password: + properties: + value: + description: Defaults to "". + type: string + valueFrom: + description: Source for the environment variable's value. + Cannot be used if value is not empty. + properties: + secretKeyRef: + description: Selects a key of a secret in the pod's namespace + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid? + type: string + optional: + description: Specify whether the Secret or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + type: object + refs: + items: + properties: + appName: + type: string + appNamespace: + type: string + subjects: + items: + properties: + name: + type: string + perm: + items: + type: string + type: array + required: + - name + - perm + type: object + type: array + required: + - appName + - subjects + type: object + type: array + subjects: + items: + properties: + export: + properties: + appName: + type: string + pub: + description: default is deny + type: string + sub: + type: string + required: + - pub + - sub + type: object + name: + type: string + permission: + description: |- + // default allow for appName equals spec.App, others is deny + Pub string `json:"pub"` + // default allow for appName equals spec.App, others is deny + Sub string `json:"sub"` + Permissions indicates the permission that app can perform on this subject + properties: + appName: + type: string + pub: + description: default is deny + type: string + sub: + type: string + required: + - pub + - sub + type: object + required: + - name + - permission + type: object + type: array + user: + type: string + required: + - user + type: object postgreSQL: properties: databases: @@ -142,9 +254,10 @@ spec: be a valid secret key. type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, - uid?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the Secret or its key @@ -184,9 +297,10 @@ spec: be a valid secret key. type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, - uid?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the Secret or its key @@ -210,8 +324,10 @@ spec: description: The key to select. type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid? type: string namespace: type: string @@ -242,9 +358,10 @@ spec: be a valid secret key. type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, - uid?' + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the Secret or its key diff --git a/frameworks/tapr/config/cluster/deploy/middleware_deploy.yaml b/frameworks/tapr/config/cluster/deploy/middleware_deploy.yaml index d6296bc5..a90dfcb1 100644 --- a/frameworks/tapr/config/cluster/deploy/middleware_deploy.yaml +++ b/frameworks/tapr/config/cluster/deploy/middleware_deploy.yaml @@ -99,7 +99,7 @@ spec: - name: DISABLE_TELEMETRY value: "false" - name: operator-api - image: beclab/middleware-operator:0.1.32 + image: beclab/middleware-operator:0.1.33 imagePullPolicy: IfNotPresent ports: - containerPort: 9080 @@ -116,3 +116,5 @@ spec: mountPath: /terminus/rootfs/middleware-backup - name: pgbackup-dir mountPath: /backup + - name: dbdata-dir + mountPath: /dbdata diff --git a/frameworks/tapr/config/cluster/deploy/nats_deployment.yaml b/frameworks/tapr/config/cluster/deploy/nats_deployment.yaml new file mode 100644 index 00000000..3c7c83a9 --- /dev/null +++ b/frameworks/tapr/config/cluster/deploy/nats_deployment.yaml @@ -0,0 +1,350 @@ + +{{ $nats_rootpath := "/terminus/userdata/dbdata" }} +{{- $namespace := printf "%s" "os-system" -}} +{{- $nats_secret := (lookup "v1" "Secret" $namespace "nats-secrets") -}} +{{- $nats_password := "" -}} +{{ if $nats_secret -}} +{{ $nats_password = (index $nats_secret "data" "nats_password") }} +{{ else -}} +{{ $nats_password = randAlphaNum 64 | b64enc }} +{{- end -}} + +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: nats-data-pv +spec: + accessModes: + - ReadWriteOnce + capacity: + storage: '50Gi' + hostPath: + path: {{ $nats_rootpath }}/nats_data + type: DirectoryOrCreate + persistentVolumeReclaimPolicy: Delete + volumeMode: Filesystem +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nats-data-pvc + namespace: {{ .Release.Namespace }} +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: '50Gi' + volumeMode: Filesystem + volumeName: nats-data-pv + + +--- +apiVersion: v1 +kind: Secret +metadata: + name: nats-secrets + namespace: os-system +type: Opaque +data: + nats_password: {{ $nats_password }} + +--- +# Source: nats/templates/nats-box/contexts-secret.yaml +apiVersion: v1 +kind: Secret +metadata: + labels: + app.kubernetes.io/name: nats + app.kubernetes.io/instance: nats + app.kubernetes.io/component: nats + name: nats-box-contexts +stringData: + default.json: | + { + "url": "nats://nats" + } +type: Opaque +--- +# Source: nats/templates/config-map.yaml +apiVersion: v1 +data: + nats.conf: | + { + "http_port": 8222, + "jetstream": { + "max_file_store": 10102410241024, + "max_memory_store": 0, + "store_dir": "/data" + }, + "accounts": { + "terminus": { + "jetstream": enabled, + "users": [ + { + "user": "admin", + "password": $ADMIN_PASSWORD, + "permissions": { + "publish": { + "allow": [">"] + }, + "subscribe": { + "allow": [">"] + } + } + } + ] + } + }, + "port": 4222, + "pid_file": "/var/run/nats/nats.pid", + "server_name": "nats-0" + } +kind: ConfigMap +metadata: + labels: + app.kubernetes.io/name: nats + app.kubernetes.io/instance: nats + app.kubernetes.io/component: nats + name: nats-config + namespace: {{ .Release.Namespace }} +--- +# Source: nats/templates/headless-service.yaml +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/name: nats + app.kubernetes.io/instance: nats + app.kubernetes.io/component: nats + name: nats-headless +spec: + clusterIP: None + ports: + - appProtocol: tcp + name: nats + port: 4222 + targetPort: nats + - appProtocol: http + name: monitor + port: 8222 + targetPort: monitor + publishNotReadyAddresses: true + selector: + app.kubernetes.io/name: nats + app.kubernetes.io/instance: nats + app.kubernetes.io/component: nats +--- +# Source: nats/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/name: nats + app.kubernetes.io/instance: nats + app.kubernetes.io/component: nats + name: nats +spec: + ports: + - appProtocol: tcp + name: nats + port: 4222 + targetPort: nats + selector: + app.kubernetes.io/name: nats + app.kubernetes.io/instance: nats + app.kubernetes.io/component: nats +--- +# Source: nats/templates/nats-box/deployment.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/component: nats-box + app.kubernetes.io/name: nats + app.kubernetes.io/instance: nats + applications.app.bytetrade.io/author: bytetrade.io + name: nats-box +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/component: nats-box + app.kubernetes.io/name: nats + app.kubernetes.io/instance: nats + template: + metadata: + labels: + app.kubernetes.io/component: nats-box + app.kubernetes.io/name: nats + app.kubernetes.io/instance: nats + spec: + containers: + - args: + - sh + - -ec + - trap true INT TERM; sleep infinity & wait + command: + - sh + - -ec + - | + work_dir="$(pwd)" + mkdir -p "$XDG_CONFIG_HOME/nats" + cd "$XDG_CONFIG_HOME/nats" + if ! [ -s context ]; then + ln -s /etc/nats-contexts context + fi + if ! [ -f context.txt ]; then + echo -n "default" > context.txt + fi + cd "$work_dir" + exec /entrypoint.sh "$@" + - -- + image: natsio/nats-box:0.14.3 + name: nats-box + volumeMounts: + - mountPath: /etc/nats-contexts + name: contexts + - mountPath: /data + name: nats-data + enableServiceLinks: false + volumes: + - name: contexts + secret: + secretName: nats-box-contexts + - hostPath: + path: /terminus/userdata/dbdata/nats_data + type: DirectoryOrCreate + name: nats-data +--- +# Source: nats/templates/stateful-set.yaml +apiVersion: apps/v1 +kind: StatefulSet +metadata: + labels: + app.kubernetes.io/component: nats + app.kubernetes.io/name: nats + app.kubernetes.io/instance: nats + applications.app.bytetrade.io/author: bytetrade.io + name: nats +spec: + podManagementPolicy: Parallel + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/component: nats + app.kubernetes.io/name: nats + app.kubernetes.io/instance: nats + serviceName: {{ .Release.Name}}-headless + template: + metadata: + annotations: + checksum/config: e37e733aab5e99b5d785f54115b3c34dfb02b80d350b62e5b211794a2ad060ec + labels: + app.kubernetes.io/component: nats + app.kubernetes.io/name: nats + app.kubernetes.io/instance: nats + spec: + containers: + - args: + - --config + - /data/config/nats.conf + env: + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: SERVER_NAME + value: $(POD_NAME) + - name: ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: nats-secrets + key: nats_password + image: nats:2.10.17-alpine + lifecycle: + preStop: + exec: + command: + - nats-server + - -sl=ldm=/var/run/nats/nats.pid + livenessProbe: + failureThreshold: 3 + httpGet: + path: /healthz?js-enabled-only=true + port: monitor + initialDelaySeconds: 10 + periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 5 + name: nats + ports: + - containerPort: 4222 + name: nats + - containerPort: 8222 + name: monitor + readinessProbe: + failureThreshold: 3 + httpGet: + path: /healthz?js-server-only=true + port: monitor + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + startupProbe: + failureThreshold: 90 + httpGet: + path: /healthz + port: monitor + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + volumeMounts: + - mountPath: /var/run/nats + name: pid + - mountPath: /etc/nats-config + name: config + readOnly: false + - mountPath: /data + name: nats-data + - args: + - -pid + - /var/run/nats/nats.pid + - -config + - /data/config/nats.conf + image: beclab/nats-server-config-reloader:v1 + name: reloader + env: + - name: ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: nats-secrets + key: nats_password + imagePullPolicy: Always + securityContext: + capabilities: + add: + - SYS_PTRACE + volumeMounts: + - mountPath: /var/run/nats + name: pid + - mountPath: /etc/nats-config + name: config + readOnly: false + - mountPath: /data + name: nats-data + enableServiceLinks: false + shareProcessNamespace: true + volumes: + - configMap: + name: nats-config + name: config + - emptyDir: {} + name: pid + - hostPath: + path: /terminus/userdata/dbdata/nats_data + type: DirectoryOrCreate + name: nats-data diff --git a/frameworks/tapr/config/user/helm-charts/nats/.helmignore b/frameworks/tapr/config/user/helm-charts/nats/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/frameworks/tapr/config/user/helm-charts/nats/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/frameworks/tapr/config/user/helm-charts/nats/Chart.yaml b/frameworks/tapr/config/user/helm-charts/nats/Chart.yaml new file mode 100644 index 00000000..51e7cca2 --- /dev/null +++ b/frameworks/tapr/config/user/helm-charts/nats/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: nats +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/frameworks/tapr/config/user/helm-charts/nats/templates/NOTES.txt b/frameworks/tapr/config/user/helm-charts/nats/templates/NOTES.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/frameworks/tapr/config/user/helm-charts/nats/templates/NOTES.txt @@ -0,0 +1 @@ + diff --git a/frameworks/tapr/config/user/helm-charts/nats/templates/_helpers.tpl b/frameworks/tapr/config/user/helm-charts/nats/templates/_helpers.tpl new file mode 100644 index 00000000..78e900d3 --- /dev/null +++ b/frameworks/tapr/config/user/helm-charts/nats/templates/_helpers.tpl @@ -0,0 +1,52 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "nats.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "nats.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "nats.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "nats.labels" -}} +helm.sh/chart: {{ include "nats.chart" . }} +{{ include "nats.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "nats.selectorLabels" -}} +app.kubernetes.io/name: {{ include "nats.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + diff --git a/frameworks/tapr/config/user/helm-charts/nats/templates/deployment.yaml b/frameworks/tapr/config/user/helm-charts/nats/templates/deployment.yaml new file mode 100644 index 00000000..da142b64 --- /dev/null +++ b/frameworks/tapr/config/user/helm-charts/nats/templates/deployment.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: nats + namespace: user-system-{{ .Values.bfl.username }} +spec: + type: ClusterIP + selector: + app: systemserver + ports: + - protocol: TCP + name: nats + port: 4222 + targetPort: 4222 \ No newline at end of file diff --git a/frameworks/tapr/config/user/helm-charts/nats/values.yaml b/frameworks/tapr/config/user/helm-charts/nats/values.yaml new file mode 100644 index 00000000..e69de29b