From e97ed605b7c0a85fb7c9a40528e18bd2c4953071 Mon Sep 17 00:00:00 2001 From: Riccardo Forina Date: Tue, 16 Apr 2024 11:25:46 +0200 Subject: [PATCH] Add CRs to quickly deploy the console on a local development environment --- quickstart/01-kafka.yaml | 29 ++++++++++ quickstart/02-console.yaml | 109 +++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 quickstart/01-kafka.yaml create mode 100644 quickstart/02-console.yaml diff --git a/quickstart/01-kafka.yaml b/quickstart/01-kafka.yaml new file mode 100644 index 000000000..a2fa0e18d --- /dev/null +++ b/quickstart/01-kafka.yaml @@ -0,0 +1,29 @@ +apiVersion: kafka.strimzi.io/v1beta2 +kind: Kafka +metadata: + name: my-cluster +spec: + kafka: + version: 3.7.0 + replicas: 1 + listeners: + - name: plain + port: 9092 + type: internal + tls: false + config: + offsets.topic.replication.factor: 1 + transaction.state.log.replication.factor: 1 + transaction.state.log.min.isr: 1 + default.replication.factor: 1 + min.insync.replicas: 1 + inter.broker.protocol.version: "3.7" + storage: + type: ephemeral + zookeeper: + replicas: 3 + storage: + type: ephemeral + entityOperator: + topicOperator: {} + userOperator: {} diff --git a/quickstart/02-console.yaml b/quickstart/02-console.yaml new file mode 100644 index 000000000..063d8c3d2 --- /dev/null +++ b/quickstart/02-console.yaml @@ -0,0 +1,109 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: console-api +spec: + replicas: 1 + selector: + matchLabels: + app: console-api + template: + metadata: + labels: + app: console-api + spec: + containers: + - name: console-api + image: quay.io/eyefloaters/console-api:latest + ports: + - containerPort: 8080 + env: + - name: CONSOLE_KAFKA_MC + value: kafka/my-cluster + - name: CONSOLE_KAFKA_MC_BOOTSTRAP_SERVERS + value: my-cluster-kafka-0.my-cluster-kafka-brokers.kafka.svc:9092 +--- +apiVersion: v1 +kind: Service +metadata: + name: console-api +spec: + selector: + app: console-api + type: NodePort + ports: + - protocol: TCP + port: 8080 + name: api +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ui +spec: + replicas: 1 + selector: + matchLabels: + app: ui + template: + metadata: + labels: + app: ui + spec: + containers: + - name: ui + image: quay.io/eyefloaters/console-ui:latest + ports: + - containerPort: 3000 + env: + - name: HOSTNAME + value: 0.0.0.0 + - name: NEXTAUTH_URL + value: http://localhost:3000 + - name: NEXTAUTH_URL_INTERNAL + value: http://console-ui:3000 + - name: NEXTAUTH_SECRET + value: changeme + - name: BACKEND_URL + value: "http://console-api:8080" +--- +apiVersion: v1 +kind: Service +metadata: + name: ui +spec: + selector: + app: ui + type: NodePort + ports: + - protocol: TCP + port: 3000 + name: web +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: console-api-kafka-watch-all +rules: + - verbs: + - get + - watch + - list + apiGroups: + - kafka.strimzi.io + resources: + - kafkas + - kafkatopics +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: console-api-kafka-watch-all +subjects: + - kind: ServiceAccount + name: default + namespace: console +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: console-api-kafka-watch-all