Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation about jetstreamexotic and authentication of the components #2980

Open
jorgelon opened this issue Jan 19, 2024 · 5 comments
Labels
documentation enhancement New feature or request good first issue Good for newcomers

Comments

@jorgelon
Copy link

Description
I am trying to use argo events with my nats/jetstream instance but i cannot understand how to authenticate the eventbus jetstream exotic definition of the eventbus.

In https://argoproj.github.io/argo-events/eventbus/jetstream/ i can see how to reference a secret and a key
Also the eventsource pod mounts the defined secret and key

What that key should contain? ¿a token? ¿a natslike authorization config file?

@jorgelon jorgelon added the enhancement New feature or request label Jan 19, 2024
@jorgelon
Copy link
Author

I am not 100% sure but I will try to create a secret with this content and try
username: whatever
password: whatever

@jorgelon
Copy link
Author

jorgelon commented Jan 22, 2024

Ok, thats the workround.
There is another problem related with TLS. How can I use argo events exotic feature and the "verify" certificates option in nats
Is there any way to pass Argo events a client certificate? I have to use verify=false to make it work

TLS handshake error: tls: client didn't provide a certificate

My intention is to have a jetstream nats cluster for Argo events and another clients

@ospiegel91
Copy link

ospiegel91 commented Jan 30, 2024

@jorgelon could you please share the external secret yaml format which you used to inject the username/password combo

apiVersion: argoproj.io/v1alpha1
kind: EventBus
metadata:
  name: default
spec:
  jetstreamExotic:
      url: nats://eventbus-default-js-svc.argo
      accessSecret:
        name: example-eventbus-secret
        key: secret-key. ((((( how do I point both my username and password keys below???)))))
---
apiVersion: "external-secrets.io/v1beta1"
kind: ExternalSecret
metadata:
  name: example-eventbus-secret
  annotations:
    argocd.argoproj.io/sync-wave: "-1"
spec:
  refreshInterval: "1h"
  secretStoreRef:
    name: vault-env-path
    kind: ClusterSecretStore
  data:
    - secretKey: username
      remoteRef:
        key: path/data/to/eventbus
        property: username
    - secretKey: password
      remoteRef:
        key: path/data/to/eventbus
        property: password
  target:
    template:
      engineVersion: v2
      data:
        username: >-
          {{ printf "{{ .username | toString }}" }}
        password: >-
          {{ printf "{{ .password | toString }}" }}

@ospiegel91
Copy link

+1 on please improve documentation on using and passing basic auth credentials from secret onto eventbus

@jorgelon
Copy link
Author

jorgelon commented Feb 2, 2024

apiVersion: v1
data:
  client-auth: <base64 encoded string>
kind: Secret
metadata:
  name: whatever
type: Opaque

The base64 encoded string is basically
username: whatever
password: whatever

My eventbus

apiVersion: argoproj.io/v1alpha1
kind: EventBus
metadata:
  name: nats
spec:
  jetstreamExotic:
      url: nats://nats:4222
      accessSecret:
        name: events
        key: client-auth

@whynowy whynowy added the good first issue Good for newcomers label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants