-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(test): Fix Kafka integration tests (#1878)
Kafka tests have been flaky lately and it seems to be due to two factors: - Redpanda RPK tries to create a temporary configuration file in the same location as the `redpanda.yaml` file. If we mount a volume containing `redpanda.yaml` this fails because the `redpanda` user (uid 101) doesn't have permission to chmod. - A manifestation of moby/moby#42442 This PR includes some refactoring to: - Skip the RPK and start redpanda directly using a templated config file - Combine the Kafka launch configuration to avoid repetition - Output the Kafka container logs if `CERBOS_DEBUG_KAFKA` is set Fixes #1875 Signed-off-by: Charith Ellawala <charith@cerbos.dev> --------- Signed-off-by: Charith Ellawala <charith@cerbos.dev>
- Loading branch information
Showing
10 changed files
with
154 additions
and
135 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
File renamed without changes.
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,25 @@ | ||
redpanda: | ||
data_directory: /var/lib/redpanda/data | ||
seed_servers: [] | ||
kafka_api: | ||
- address: 0.0.0.0 | ||
port: 9092 | ||
kafka_api_tls: | ||
- key_file: /var/lib/redpanda/.config/rpk/tls.key | ||
cert_file: /var/lib/redpanda/.config/rpk/tls.crt | ||
truststore_file: /var/lib/redpanda/.config/rpk/ca.crt | ||
enabled: true | ||
require_client_auth: true | ||
advertised_kafka_api: | ||
- address: localhost | ||
port: 65136 | ||
developer_mode: true | ||
auto_create_topics_enabled: true | ||
fetch_reads_debounce_timeout: 10 | ||
group_initial_rebalance_delay: 0 | ||
group_topic_partitions: 3 | ||
log_segment_size_min: 1 | ||
storage_min_free_bytes: 10485760 | ||
topic_partitions_per_shard: 1000 | ||
rpk: | ||
overprovisioned: true |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
internal/audit/kafka/testdata/valid/redpanda/redpanda.yaml.gotmpl
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,30 @@ | ||
redpanda: | ||
data_directory: /var/lib/redpanda/data | ||
kafka_api: | ||
- name: api_listener | ||
address: 0.0.0.0 | ||
port: 9092 | ||
{{- if .TLSEnabled }} | ||
kafka_api_tls: | ||
- name: api_listener | ||
key_file: /certs/tls.key | ||
cert_file: /certs/tls.crt | ||
truststore_file: /certs/ca.crt | ||
enabled: true | ||
require_client_auth: true | ||
{{- end }} | ||
advertised_kafka_api: | ||
- name: api_listener | ||
address: localhost | ||
port: {{ .Port }} | ||
developer_mode: true | ||
auto_create_topics_enabled: true | ||
fetch_reads_debounce_timeout: 10 | ||
group_initial_rebalance_delay: 0 | ||
group_topic_partitions: 3 | ||
log_segment_size_min: 1 | ||
storage_min_free_bytes: 10485760 | ||
topic_partitions_per_shard: 1000 | ||
rpk: | ||
coredump_dir: /var/lib/redpanda/coredump | ||
overprovisioned: true |
Oops, something went wrong.