This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor to kafkaclient interface * test add new topic * tests for change replication factor * Tests for partitions * generic config tests * the rest of configs tests * rename * Move test data to separate file * test address * test adding/removing config options * scaffold e2e tests * increase timeout * don't run controller tests twice in e2e * fix kustomization * offset * wait logs * ns * order * 1 rec * setup kafka * Remove tests that are too flaky in CI environments * 5.5.0 * 0.5.0 * add create-topic test * describe * more logs * lowercase * fix kubebuilder annotations * change svc * kafka-client * assert * fix * fix2 * remove echo * wait for kafka pods to be up * fix * add partitions * fix * 5m * requeue on conn error * fix * assert * assert * echo * remove tail * log * fix log * remove log * test change cleanup policy * fix * test delete topic * catch error code * fix * Dk 2795 testcontainers (#7) * replace mocks for kafka server with testcontainers * remove unneeded ns * Reorder steps * revert * cleanup * go 16 * fixes (#9) * try again without waiting for pods to be up * disable uneeded kafka components * fix break line * longer timeout * two timeouts * move e2e tests * fix paths * path * bash * remove tty * remove * various * go version * go 17 * remove branch * 17
- Loading branch information
Showing
38 changed files
with
2,406 additions
and
171 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: e2e | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
kind: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Restore Go cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.x | ||
- name: Setup Kubernetes | ||
uses: engineerd/setup-kind@v0.5.0 | ||
with: | ||
version: v0.11.1 | ||
image: kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6 | ||
- name: Setup Kustomize | ||
uses: fluxcd/pkg/actions/kustomize@main | ||
- name: Setup envtest | ||
uses: fluxcd/pkg/actions/envtest@main | ||
with: | ||
version: "1.19.2" | ||
- name: Setup Helm | ||
uses: fluxcd/pkg/actions/helm@main | ||
- name: Run controller tests | ||
run: make test | ||
- name: Check if working tree is dirty | ||
run: | | ||
go version | ||
if [[ $(git diff --stat) != '' ]]; then | ||
git --no-pager diff | ||
echo 'run make test and commit changes' | ||
exit 1 | ||
fi | ||
- name: Build container image | ||
run: make docker-build-without-tests IMG=test/k8skafka-controller:latest BUILD_PLATFORMS=linux/amd64 BUILD_ARGS=--load | ||
- name: Load test image | ||
run: kind load docker-image test/k8skafka-controller:latest | ||
- name: Deploy controller | ||
run: make deploy IMG=test/k8skafka-controller:latest | ||
- name: Setup Kafka | ||
env: | ||
KAFKA_VERSION: ${{ '0.5.0' }} | ||
run: | | ||
kubectl create ns kafka | ||
helm repo add confluentinc https://confluentinc.github.io/cp-helm-charts/ | ||
helm upgrade --wait -i kafka confluentinc/cp-helm-charts \ | ||
--version $KAFKA_VERSION \ | ||
--namespace kafka \ | ||
--set cp-schema-registry.enabled=false \ | ||
--set cp-kafka-rest.enabled=false \ | ||
--set cp-kafka-connect.enabled=false \ | ||
--set cp-ksql-server.enabled=false \ | ||
--set cp-control-center.enabled=false | ||
- name: Setup Kafka client | ||
run: | | ||
kubectl -n kafka apply -f ./config/testdata/test-kafka-client.yaml | ||
kubectl -n kafka wait --for=condition=ready pod -l app=kafka-client | ||
- name: Run Kafka e2e tests | ||
run: ./scripts/tests/e2e/test_suite.sh | ||
shell: bash | ||
- name: Logs | ||
run: | | ||
kubectl -n k8skafka-system wait --for=condition=ready pod -l app=k8skafka-controller && kubectl -n k8skafka-system logs deploy/k8skafka-controller | ||
- name: Debug failure | ||
if: failure() | ||
run: | | ||
kubectl -n kube-system describe pods | ||
kubectl -n k8skafka-system describe pods | ||
kubectl -n k8skafka-system get kafkatopic -oyaml | ||
kubectl -n k8skafka-system describe kafkatopic | ||
kubectl -n k8skafka-system get all | ||
kubectl -n k8skafka-system logs deploy/k8skafka-controller | ||
kubectl -n kafka get all |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,5 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- bases/kafka.infra.doodle.com_kafkatopics.yaml | ||
# +kubebuilder:scaffold:crdkustomizeresource |
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,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
namespace: k8skafka-system | ||
bases: | ||
- ../crd | ||
- ../rbac | ||
- ../manager | ||
- namespace.yaml |
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,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
labels: | ||
control-plane: controller | ||
name: k8skafka-system |
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,8 @@ | ||
resources: | ||
- manager.yaml | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
images: | ||
- name: controller | ||
newName: test/k8skafka-controller | ||
newTag: latest |
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,32 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: k8skafka-controller | ||
labels: | ||
control-plane: controller | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: k8skafka-controller | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: k8skafka-controller | ||
spec: | ||
containers: | ||
- command: | ||
- /manager | ||
# args: | ||
# - --enable-leader-election | ||
image: controller:latest | ||
imagePullPolicy: IfNotPresent | ||
name: manager | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 500Mi | ||
requests: | ||
cpu: 100m | ||
memory: 200Mi | ||
terminationGracePeriodSeconds: 10 |
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,5 @@ | ||
resources: | ||
- role.yaml | ||
- role_binding.yaml | ||
- leader_election_role.yaml | ||
- leader_election_role_binding.yaml |
Oops, something went wrong.