-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update to use new event handling (#109)
* update to use new event handling This adds the new x/events handling. Note: There are some issues with detecting Ack/Nack's on messages. Which has resulted in some tests not being able to be done that check for Nacked messages. Signed-off-by: Mike Mason <[email protected]> * update chart Signed-off-by: Mike Mason <[email protected]> * update eventtools to support waiting for acks This enables us to run all tests which check for specific acks. Signed-off-by: Mike Mason <[email protected]> * work through review feedback Signed-off-by: Mike Mason <[email protected]> * ignore unrelated ids This ignores unrelated ids instead of failing if an id is found that isn't part of the schema. Signed-off-by: Mike Mason <[email protected]> * cache prefix id map for quicker lookups Signed-off-by: Mike Mason <[email protected]> * no longer tenant specific Signed-off-by: Mike Mason <[email protected]> * ensure consistent logging field names Signed-off-by: Mike Mason <[email protected]> * use latest x package with updated events testing Signed-off-by: Mike Mason <[email protected]> --------- Signed-off-by: Mike Mason <[email protected]>
- Loading branch information
Showing
16 changed files
with
661 additions
and
641 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "common.names.fullname" . }}-worker | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
service: worker | ||
{{- include "common.labels.standard" . | nindent 4 }} | ||
{{- with .Values.deployment.extraLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.deployment.annotations }} | ||
annotations: | ||
{{ toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
replicas: {{ .Values.deployment.workerReplicas }} | ||
revisionHistoryLimit: 3 | ||
selector: | ||
matchLabels: | ||
service: worker | ||
{{- include "common.labels.matchLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
service: worker | ||
{{- include "common.labels.standard" . | nindent 8 }} | ||
{{- with .Values.deployment.extraLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.deployment.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
restartPolicy: Always | ||
terminationGracePeriodSeconds: 30 | ||
{{- with .Values.deployment.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- if .Values.deployment.podSecurityContext }} | ||
securityContext: | ||
{{- toYaml .Values.deployment.podSecurityContext | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ include "common.names.name" . }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
args: | ||
- worker | ||
env: | ||
- name: PERMISSIONSAPI_SERVER_LISTEN | ||
value: ":{{ include "permapi.listenPort" . }}" | ||
- name: PERMISSIONSAPI_SERVER_SHUTDOWN_GRACE_PERIOD | ||
value: "{{ .Values.config.server.shutdownGracePeriod }}" | ||
{{- with .Values.config.server.trustedProxies }} | ||
- name: PERMISSIONSAPI_SERVER_TRUSTED_PROXIES | ||
value: "{{ join " " . }}" | ||
{{- end }} | ||
- name: PERMISSIONSAPI_EVENTS_SUBSCRIBER_URL | ||
value: "{{ .Values.config.events.url }}" | ||
- name: PERMISSIONSAPI_EVENTS_SUBSCRIBER_TIMEOUT | ||
value: "{{ .Values.config.events.timeout }}" | ||
- name: PERMISSIONSAPI_EVENTS_SUBSCRIBER_PREFIX | ||
value: "{{ .Values.config.events.prefix }}" | ||
- name: PERMISSIONSAPI_EVENTS_SUBSCRIBER_QUEUEGROUP | ||
value: "{{ .Values.config.events.queueGroup }}" | ||
{{- with .Values.config.events.topics }} | ||
- name: PERMISSIONSAPI_EVENTS_TOPICS | ||
value: "{{ join " " . }}" | ||
{{- end }} | ||
{{- if .Values.config.events.nats.credsSecretName }} | ||
- name: PERMISSIONSAPI_EVENTS_SUBSCRIBER_NATS_CREDSFILE | ||
value: "{{ .Values.config.events.nats.credsFile }}" | ||
{{- end }} | ||
{{- if .Values.config.events.nats.token }} | ||
- name: PERMISSIONSAPI_EVENTS_SUBSCRIBER_NATS_TOKEN | ||
value: "{{ .Values.config.events.token }}" | ||
{{- end }} | ||
{{- if .Values.config.oidc.issuer }} | ||
{{- with .Values.config.oidc.audience }} | ||
- name: PERMISSIONSAPI_OIDC_AUDIENCE | ||
value: "{{ . }}" | ||
{{- end }} | ||
{{- with .Values.config.oidc.issuer }} | ||
- name: PERMISSIONSAPI_OIDC_ISSUER | ||
value: "{{ . }}" | ||
{{- end }} | ||
{{- with .Values.config.oidc.refreshTimeout }} | ||
- name: PERMISSIONSAPI_OIDC_REFRESH_TIMEOUT | ||
value: "{{ . }}" | ||
{{- end }} | ||
{{- end }} | ||
- name: PERMISSIONSAPI_SPICEDB_ENDPOINT | ||
value: "{{ .Values.config.spicedb.endpoint }}" | ||
- name: PERMISSIONSAPI_SPICEDB_INSECURE | ||
value: "{{ .Values.config.spicedb.insecure }}" | ||
- name: PERMISSIONSAPI_SPICEDB_VERIFYCA | ||
value: "{{ .Values.config.spicedb.verifyCA }}" | ||
- name: PERMISSIONSAPI_TRACING_ENABLED | ||
value: "{{ .Values.config.tracing.enabled }}" | ||
- name: PERMISSIONSAPI_TRACING_PROVIDER | ||
value: "{{ .Values.config.tracing.provider }}" | ||
- name: PERMISSIONSAPI_TRACING_ENVIRONMENT | ||
value: "{{ .Values.config.tracing.environment }}" | ||
{{- if .Values.config.spicedb.caSecretName }} | ||
- name: SSL_CERT_DIR | ||
value: "/etc/ssl/spicedb" | ||
{{- end }} | ||
{{- if eq .Values.config.tracing.provider "jaeger" }} | ||
- name: PERMISSIONSAPI_TRACING_JAEGER_ENDPOINT | ||
value: "{{ .Values.config.tracing.jaeger.endpoint }}" | ||
- name: PERMISSIONSAPI_TRACING_JAEGER_USER | ||
value: "{{ .Values.config.tracing.jaeger.user }}" | ||
- name: PERMISSIONSAPI_TRACING_JAEGER_PASSWORD | ||
value: "{{ .Values.config.tracing.jaeger.password }}" | ||
{{- end }} | ||
{{- if eq .Values.config.tracing.provider "otlp" }} | ||
- name: PERMISSIONSAPI_TRACING_OTLP_ENDPOINT | ||
value: "{{ .Values.config.tracing.otlp.endpoint }}" | ||
- name: PERMISSIONSAPI_TRACING_OTLP_INSECURE | ||
value: "{{ .Values.config.tracing.otlp.insecure }}" | ||
- name: PERMISSIONSAPI_TRACING_OTLP_CERTIFICATE | ||
value: "{{ .Values.config.tracing.otlp.certificate }}" | ||
{{- end }} | ||
envFrom: | ||
- secretRef: | ||
name: "{{ .Values.config.spicedb.pskSecretName }}" | ||
ports: | ||
- name: http | ||
containerPort: {{ include "permapi.listenPort" . }} | ||
protocol: TCP | ||
livenessProbe: | ||
httpGet: | ||
path: /livez | ||
port: http | ||
readinessProbe: | ||
httpGet: | ||
path: /readyz | ||
port: http | ||
{{- with .Values.deployment.resources }} | ||
resources: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.deployment.nodeSelector }} | ||
volumeMounts: | ||
- name: spicedb-ca | ||
mountPath: /etc/ssl/spicedb/ | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.deployment.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.deployment.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.config.spicedb.caSecretName }} | ||
volumes: | ||
- name: spicedb-ca | ||
secret: | ||
secretName: {{ . }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.