-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Question] How do I specify a KafkaUser that has access to all topics and is authorized to create new topics? #2141
Comments
I will need to look at what exacty is the problem here. In the meantime, you can configure the user as an super user: https://strimzi.io/docs/latest/full.html#super_users |
Ok, I had a look at this ... The YAML as you have it above doesn't work for me. It complains about the apiVersion: kafka.strimzi.io/v1beta1
kind: KafkaUser
metadata:
name: super-user
labels:
strimzi.io/cluster: my-cluster
spec:
type: allow
authentication:
type: tls
authorization:
type: simple
acls:
- resource:
type: topic
name: '*'
patternType: literal
operation: All But once I change that, it seems to work and I can create the topic:
I do not really use Faust for anything so I cannot try it with that. Maybe it triggers some other rights than the |
@scholzj Thanks for looking into this. Sorry for not being clear enough. I never used the '*' syntax. I just thought that it might be the way it should be used (Following kubernetes syntax). Thanks for pointing me to the right location in the docs. Could you please share your super user config. In the meantime, I will try following the description in the docs. |
Well, funny enough at least for creating the topic, it actually works as you described it there with the only exception off wrapping the |
hehe. Yeah I will probably create a superuser for all the faust applications just in case. Just to clarify, since I'm not sure that I follow the docs completely.
|
You do not have to specify the ACLs for the user when setting it as super user. I would do it like this:
apiVersion: kafka.strimzi.io/v1beta1
kind: Kafka
spec:
kafka:
# ...
authorization:
type: simple
superUsers:
- CN=super-user
# ...
zookeeper:
# ...
apiVersion: kafka.strimzi.io/v1beta1
kind: KafkaUser
metadata:
name: super-user
labels:
strimzi.io/cluster: my-cluster
spec:
authentication:
type: tls |
Thanks. It worked either way :) |
Yeah, the order doesn't matter so much. But the user needs to wait for the brokers to be updated, that is all. Can we close this issue? Or do you have something more? |
No we can close it Thank you for your help! much appreciated |
Am facing this error from using an external Camel Kafka app access onto Strimzi Topic running over Openshift. background :- here is my Kafka config -
--
--
|
So when you say that you have an external Apache Camel application ... that means it is running outside of OCP and connects using the routes? If that is the case the problem is that you have no authentication enabled for the external interface. So you configured listeners:
external:
overrides:
bootstrap:
host: bootstrap.apps.kafka.cluster42.openshift-abcd.com
brokers:
- broker: 0
host: broker-0.apps.kafka.cluster42.openshift-abcd.com
- broker: 1
host: broker-1.apps.kafka.cluster42.openshift-abcd.com
- broker: 2
host: broker-2.apps.kafka.cluster42.openshift-abcd.com
type: route
authentiation:
type: tls
plain:
authentiation:
type: scram-sha-512
tls:
authentiation:
type: tls |
yes - it means it is running outside of OCP and connects using the routes heres the output -
kafka pod logs
Kafka Topic
KafkaUser
Also a query:
there ? here is my camel-context.xml
i used to generate my stores like this: |
Actually, I didn't noticed it before and just copied it. But you have there |
oh what a typo on my end !!! 00:27:12.481 [Camel (MyCamel) thread #7 - KafkaProducer[my-topic]] INFO producer-route - producer >>> Hello World from camel-context.xml with ID ID-DESKTOP-72U4DSI-1598480825136-0-10 |
Can you tell me how it works ?
|
This time i took off the superUser from the Kafka config and applied KafkaUser ACL policies Authorization in the KafkaUser I ensured i used a groupID in the camel consumer as seen below:
And it worked like a charm.
Must thank for some real good user usecases. ! |
The TLS server authentication is the same as you do for example when you visit a website with HTTPS. it means that your client will verify the identity of the server, but the server (Kafka broker in this case) will not care about the identity of the client. So only when you enable the TLS client authentication (that is the |
Does anyone know how I could create a 'super' KafkaUser that is allowed to create topics and can operate on all topics?
I've been trying to get a faust worker (https://faust.readthedocs.io/en/latest/) up and running but it fails:
According to the strimzi config the creation of topics should be allowed. But i think the name of the topic that faust want to create is not very valid due to the underscores. Either way,I'm not really sure how to go about this but I would like to able to specify a user that has access to all topics. Any help is much appreciated.
The text was updated successfully, but these errors were encountered: