Skip to content

Commit

Permalink
feat: add support for nats (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
hysyeah authored Aug 1, 2024
1 parent df4bef2 commit bdd4346
Show file tree
Hide file tree
Showing 13 changed files with 634 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frameworks/bfl/config/launcher/templates/bfl_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion frameworks/tapr/config/cluster/deploy/middleware_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -116,3 +116,5 @@ spec:
mountPath: /terminus/rootfs/middleware-backup
- name: pgbackup-dir
mountPath: /backup
- name: dbdata-dir
mountPath: /dbdata
Loading

0 comments on commit bdd4346

Please sign in to comment.