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

[DOC] Update external configuration to include DirectoryConfigProvider #4841

Merged
merged 3 commits into from
May 11, 2021

Conversation

PaulRMellor
Copy link
Contributor

@PaulRMellor PaulRMellor commented Apr 28, 2021

Signed-off-by: prmellor pmellor@redhat.com

Type of change

Documentation

Updates the ExternalConfiguration schema reference section in the Using guide to describe how DirectoryConfigProvider can be used instead of FileConfigProvider

Checklist

Please go through this checklist and make sure all applicable tasks have been done

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Check RBAC rights for Kubernetes / OpenShift roles
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md
  • Supply screenshots for visual changes, such as Grafana dashboards

@strimzi-ci
Copy link

Can one of the admins verify this patch?

Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is nothing wrong per-se with the changes. I just wonder if readers will really understand the difference.

Comment on lines +89 to +90
* `FileConfigProvider` loads configuration values from properties in a file.
* `DirectoryConfigProvider` loads configuration values from separate files within a directory structure.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this would make it clear to the readers ... should we have an example for both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scholzj Yes. We can add examples for both.
Something like this?

Secret:

apiVersion: v1
kind: Secret
metadata:
  name: mysecret
  labels:
    strimzi.io/kind: KafkaUser
    strimzi.io/cluster: my-cluster
type: Opaque
data:
  ca.crt: # Public key of the client CA
  user.crt: # User certificate that contains the public key of the user
  user.key: # Private key of the user
  user.p12: # PKCS #12 archive file for storing certificates and keys
  user.password: # Password for protecting the PKCS #12 archive file

Config for Kafka Connect:

  config:
    config.providers: directory
    config.providers.directory.class: org.apache.kafka.common.config.provider.DirectoryConfigProvider
  #...
  externalConfiguration:
    volumes:
      - name: connector-config
        secret:
          secretName: mysecret

Connector:

kind: KafkaConnector
metadata:
  name: my-source-connector
  labels:
    strimzi.io/cluster: my-connect-cluster
spec:
  class: io.debezium.connector.mysql.MySqlConnector
  tasksMax: 2
  config:
    security.protocol: SSL
    ssl.truststore.type: PEM
    ssl.truststore.location: "${directory:/opt/kafka/external-configuration/connector-config/ca.crt}"
    ssl.keystore.type: PEM
    ssl.keystore.location: ${directory:/opt/kafka/external-configuration/connector-config/user.key}"
    #...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PaulRMellor your ${directory:...} should looks like directory:dir:file, so I think you need to change the last / to a :. See the example in https://cwiki.apache.org/confluence/display/KAFKA/KIP-632%3A+Add+DirectoryConfigProvider

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tombentley Thanks Tom

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that is a nice example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I've added the new example, so we have examples for both providers now. I'v shown the connector config for both.

@scholzj scholzj modified the milestones: 0.23.0, 0.24.0 May 6, 2021
Signed-off-by: prmellor <pmellor@redhat.com>
Copy link
Member

@tombentley tombentley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of nits, but LGTM.

Signed-off-by: prmellor <pmellor@redhat.com>
@scholzj scholzj modified the milestones: 0.24.0, 0.23.0 May 11, 2021
@scholzj scholzj merged commit 89d8a4e into strimzi:main May 11, 2021
scholzj pushed a commit that referenced this pull request May 11, 2021
#4841)

* [DOC] Update external configuration to include DirectoryConfigProvider

Signed-off-by: prmellor <pmellor@redhat.com>

* new example, connector configs, and split for provider types

Signed-off-by: prmellor <pmellor@redhat.com>

* review edits TB

Signed-off-by: prmellor <pmellor@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation peer-review-done ready for merge Label for PRs which are ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants