Pārlūkot izejas kodu

New documentation for building and running without docker (#2574)

* New documentation for building and running without docker and some doc fixes and additions.

* Improvements in docs

* spell fix

* improvements in docs

* minor modification

* improvements
Jibin Philipose 2 gadi atpakaļ
vecāks
revīzija
9f32abcd09

+ 35 - 21
README.md

@@ -12,12 +12,12 @@
 Looking for the help of Kafka experts? Provectus can help you design, build, deploy, and manage Apache Kafka clusters and streaming applications. Discover [Professional Services for Apache Kafka](https://provectus.com/professional-services-apache-kafka/), to unlock the full potential of Kafka in your enteprise! </em>
 
 
-#### UI for Apache Kafka is a free, open-source web UI to monitor and manage Apache Kafka clusters. 
+#### UI for Apache Kafka is a free, open-source web UI to monitor and manage Apache Kafka clusters.
 
-UI for Apache Kafka is a simple tool that makes your data flows observable, helps find and troubleshoot issues faster and deliver optimal performance. Its lightweight dashboard makes it easy to track key metrics of your Kafka clusters - Brokers, Topics, Partitions, Production, and Consumption. 
+UI for Apache Kafka is a simple tool that makes your data flows observable, helps find and troubleshoot issues faster and deliver optimal performance. Its lightweight dashboard makes it easy to track key metrics of your Kafka clusters - Brokers, Topics, Partitions, Production, and Consumption.
 
-Set up UI for Apache Kafka with just a couple of easy commands to visualize your Kafka data in a comprehensible way. You can run the tool locally or in 
-the cloud. 
+Set up UI for Apache Kafka with just a couple of easy commands to visualize your Kafka data in a comprehensible way. You can run the tool locally or in
+the cloud.
 
 ![Interface](documentation/images/Interface.gif)
 
@@ -30,20 +30,20 @@ the cloud.
 * **Browse Messages** — browse messages with JSON, plain text, and Avro encoding
 * **Dynamic Topic Configuration** — create and configure new topics with dynamic configuration
 * **Configurable Authentification** — secure your installation with optional Github/Gitlab/Google OAuth 2.0
- 
+
 # The Interface
 UI for Apache Kafka wraps major functions of Apache Kafka with an intuitive user interface.
 
 ![Interface](documentation/images/Interface.gif)
 
 ## Topics
-UI for Apache Kafka makes it easy for you to create topics in your browser by several clicks, 
+UI for Apache Kafka makes it easy for you to create topics in your browser by several clicks,
 pasting your own parameters, and viewing topics in the list.
 
 ![Create Topic](documentation/images/Create_topic_kafka-ui.gif)
 
 It's possible to jump from connectors view to corresponding topics and from a topic to consumers (back and forth) for more convenient navigation.
-connectors, overview topic settings. 
+connectors, overview topic settings.
 
 ![Connector_Topic_Consumer](documentation/images/Connector_Topic_Consumer.gif)
 
@@ -57,14 +57,14 @@ There are 3 supported types of schemas: Avro®, JSON Schema, and Protobuf schema
 
 ![Create Schema Registry](documentation/images/Create_schema.gif)
 
-Before producing avro-encoded messages, you have to add an avro schema for the topic in Schema Registry. Now all these steps are easy to do 
+Before producing avro-encoded messages, you have to add an avro schema for the topic in Schema Registry. Now all these steps are easy to do
 with a few clicks in a user-friendly interface.
 
 ![Avro Schema Topic](documentation/images/Schema_Topic.gif)
 
 # Getting Started
 
-To run UI for Apache Kafka, you can use a pre-built Docker image or build it locally.  
+To run UI for Apache Kafka, you can use a pre-built Docker image or build it locally.
 
 ## Configuration
 
@@ -94,7 +94,7 @@ kafka:
 #     schemaNameTemplate: "%s-value"
       jmxPort: 9997
     -
-```    
+```
 
 * `name`: cluster name
 * `bootstrapServers`: where to connect
@@ -116,12 +116,12 @@ Launch Docker container in the background:
 docker run -p 8080:8080 \
 	-e KAFKA_CLUSTERS_0_NAME=local \
 	-e KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=kafka:9092 \
-	-d provectuslabs/kafka-ui:latest 
+	-d provectuslabs/kafka-ui:latest
 
 ```
-Then access the web UI at [http://localhost:8080](http://localhost:8080).  
-Further configuration with environment variables - [see environment variables](#env_variables)  
- 
+Then access the web UI at [http://localhost:8080](http://localhost:8080).
+Further configuration with environment variables - [see environment variables](#env_variables)
+
 ### Docker Compose
 
 If you prefer to use `docker-compose` please refer to the [documentation](docker-compose.md).
@@ -135,19 +135,33 @@ Quick-start instruction [here](helm_chart.md)
 
 ### Prerequisites
 
-Check [software-required.md](documentation/project/contributing/software-required.md)
+Check [prerequisites.md](documentation/project/contributing/prerequisites.md)
 
 ### Building and Running
 
 Check [building.md](documentation/project/contributing/building.md)
 
+## Building Without Docker
+
+### Prerequisites
+
+[Prerequisites](documentation/project/contributing/prerequisites.md) will mostly remain the same with the exception of docker.
+
+### Running without Building
+
+[How to run quickly without building](documentation/project/contributing/building-and-running-without-docker.md#run_without_docker_quickly)
+
+### Building and Running
+
+[How to build and run](documentation/project/contributing/building-and-running-without-docker.md#build_and_run_without_docker)
+
 ## Liveliness and readiness probes
 Liveliness and readiness endpoint is at `/actuator/health`.
 Info endpoint (build info) is located at `/actuator/info`.
 
 ## <a name="env_variables"></a> Environment Variables
 
-Alternatively, each variable of the .yml file can be set with an environment variable. 
+Alternatively, each variable of the .yml file can be set with an environment variable.
 For example, if you want to use an environment variable to set the `name` parameter, you can write it like this: `KAFKA_CLUSTERS_2_NAME`
 
 |Name               	|Description
@@ -158,10 +172,10 @@ For example, if you want to use an environment variable to set the `name` parame
 |`SERVER_PORT` |Port for the embedded server. Default: `8080`
 |`KAFKA_ADMIN-CLIENT-TIMEOUT` | Kafka API timeout in ms. Default: `30000`
 |`KAFKA_CLUSTERS_0_NAME` | Cluster name
-|`KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS` 	|Address where to connect 
-|`KAFKA_CLUSTERS_0_KSQLDBSERVER` 	| KSQL DB server address 
-|`KAFKA_CLUSTERS_0_KSQLDBSERVERAUTH_USERNAME` 	| KSQL DB server's basic authentication username 
-|`KAFKA_CLUSTERS_0_KSQLDBSERVERAUTH_PASSWORD` 	| KSQL DB server's basic authentication password 
+|`KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS` 	|Address where to connect
+|`KAFKA_CLUSTERS_0_KSQLDBSERVER` 	| KSQL DB server address
+|`KAFKA_CLUSTERS_0_KSQLDBSERVERAUTH_USERNAME` 	| KSQL DB server's basic authentication username
+|`KAFKA_CLUSTERS_0_KSQLDBSERVERAUTH_PASSWORD` 	| KSQL DB server's basic authentication password
 |`KAFKA_CLUSTERS_0_PROPERTIES_SECURITY_PROTOCOL` 	|Security protocol to connect to the brokers. For SSL connection use "SSL", for plaintext connection don't set this environment variable
 |`KAFKA_CLUSTERS_0_SCHEMAREGISTRY`   	|SchemaRegistry's address
 |`KAFKA_CLUSTERS_0_SCHEMAREGISTRYAUTH_USERNAME`   	|SchemaRegistry's basic authentication username
@@ -171,7 +185,7 @@ For example, if you want to use an environment variable to set the `name` parame
 |`KAFKA_CLUSTERS_0_READONLY`        	|Enable read-only mode. Default: false
 |`KAFKA_CLUSTERS_0_DISABLELOGDIRSCOLLECTION`        	|Disable collecting segments information. It should be true for confluent cloud. Default: false
 |`KAFKA_CLUSTERS_0_KAFKACONNECT_0_NAME` |Given name for the Kafka Connect cluster
-|`KAFKA_CLUSTERS_0_KAFKACONNECT_0_ADDRESS` |Address of the Kafka Connect service endpoint 
+|`KAFKA_CLUSTERS_0_KAFKACONNECT_0_ADDRESS` |Address of the Kafka Connect service endpoint
 |`KAFKA_CLUSTERS_0_KAFKACONNECT_0_USERNAME`| Kafka Connect cluster's basic authentication username
 |`KAFKA_CLUSTERS_0_KAFKACONNECT_0_PASSWORD`| Kafka Connect cluster's basic authentication password
 |`KAFKA_CLUSTERS_0_JMXSSL` |Enable SSL for JMX? `true` or `false`. For advanced setup, see `kafka-ui-jmx-secured.yml`

+ 5 - 3
documentation/compose/kafka-ssl.yml

@@ -1,7 +1,6 @@
 ---
 version: '3.4'
 services:
-
   kafka-ui:
     container_name: kafka-ui
     image: provectuslabs/kafka-ui:latest
@@ -17,9 +16,12 @@ services:
       KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper0:2181
       KAFKA_CLUSTERS_0_PROPERTIES_SSL_TRUSTSTORE_LOCATION: /kafka.truststore.jks
       KAFKA_CLUSTERS_0_PROPERTIES_SSL_TRUSTSTORE_PASSWORD: secret
-      KAFKA_CLUSTERS_0_PROPERTIES_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: "" # DISABLE COMMON NAME VERIFICATION
+      KAFKA_CLUSTERS_0_PROPERTIES_SSL_KEYSTORE_LOCATION: /kafka.keystore.jks
+      KAFKA_CLUSTERS_0_PROPERTIES_SSL_KEYSTORE_PASSWORD: secret
+      KAFKA_CLUSTERS_0_PROPERTIES_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: '' # DISABLE COMMON NAME VERIFICATION
     volumes:
       - ./ssl/kafka.truststore.jks:/kafka.truststore.jks
+      - ./ssl/kafka.keystore.jks:/kafka.keystore.jks
 
   zookeeper0:
     image: confluentinc/cp-zookeeper:6.0.1
@@ -51,7 +53,7 @@ services:
       KAFKA_SSL_TRUSTSTORE_FILENAME: kafka.truststore.jks
       KAFKA_SSL_TRUSTSTORE_CREDENTIALS: creds
       #KAFKA_SSL_CLIENT_AUTH: 'required'
-      KAFKA_SSL_CLIENT_AUTH: "requested"
+      KAFKA_SSL_CLIENT_AUTH: 'requested'
       KAFKA_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: '' # COMMON NAME VERIFICATION IS DISABLED SERVER-SIDE
     volumes:
       - ./ssl/creds:/etc/kafka/secrets/creds

+ 24 - 0
documentation/project/contributing/building-and-running-without-docker.md

@@ -0,0 +1,24 @@
+# Build & Run Without Docker
+
+Once you installed the prerequisites and cloned the repository, run the following steps in your project directory:
+
+## <a name="run_without_docker_quickly"></a> Running Without Docker Quickly
+
+- [Download the latest kafka-ui jar file](https://github.com/provectus/kafka-ui/releases)
+#### <a name="run_kafkaui_jar_file"></a> Execute the jar
+```sh
+java -Dspring.config.additional-location=<path-to-application-local.yml> -jar <path-to-kafka-ui-jar>
+```
+- Example of how to configure clusters in the [application-local.yml](https://github.com/provectus/kafka-ui/blob/master/kafka-ui-api/src/main/resources/application-local.yml) configuration file.
+
+## <a name="build_and_run_without_docker"></a> Building And Running Without Docker
+
+> **_NOTE:_**  If you want to get kafka-ui up and running locally quickly without building the jar file manually, then just follow [Running Without Docker Quickly](#run_without_docker_quickly)
+
+> Comment out `com.spotify` plugin in `kafka-ui-api` pom.xml
+
+- [Command to build the jar](./building.md#cmd_to_build_kafkaui_without_docker)
+
+> Once your build is successful and the jar file named kafka-ui-api-0.0.1-SNAPSHOT.jar is generated inside `kafka-ui-api/target`.
+
+- [Execute the jar](#run_kafkaui_jar_file)

+ 7 - 8
documentation/project/contributing/building.md

@@ -15,19 +15,18 @@ Once you installed the prerequisites and cloned the repository, run the followin
 
 > ```docker build --platform linux/arm64 -t provectuslabs/kafka-ui:latest --build-arg JAR_FILE=kafka-ui-api-0.0.1-SNAPSHOT.jar .```
 
-
-- if you need to build the frontend `kafka-ui-react-app`, go here
-     - [kafka-ui-react-app-build-documentation](../../../kafka-ui-react-app/README.md)
-
 - Build a docker image with the app
 ```sh
 ./mvnw clean install -Pprod
 ```
+- if you need to build the frontend `kafka-ui-react-app`, go here
+     - [kafka-ui-react-app-build-documentation](../../../kafka-ui-react-app/README.md)
 
+<a name="cmd_to_build_kafkaui_without_docker"></a>
 - In case you want to build `kafka-ui-api` by skipping the tests
 ```sh
 ./mvnw clean install -Dmaven.test.skip=true -Pprod
-``` 
+```
 
 - To build only the `kafka-ui-api` you can use this command:
 ```sh
@@ -48,7 +47,7 @@ docker-compose -f ./documentation/compose/kafka-ui.yaml up -d
  - If you want to start only kafka clusters (to run the `kafka-ui` app via `spring-boot:run`):
 ```sh
 docker-compose -f ./documentation/compose/kafka-clusters-only.yaml up -d
-``` 
+```
 - Then start the app.
 ```sh
 ./mvnw spring-boot:run -Pprod
@@ -65,6 +64,6 @@ helm repo add kafka-ui https://provectus.github.io/kafka-ui
 helm install kafka-ui kafka-ui/kafka-ui
 ```
 To read more please follow to [chart documentation](../../../charts/kafka-ui/README.md).
- 
-## Step 4 : Access Kafka-UI
+
+## Step 3 : Access Kafka-UI
  - To see the `kafka-ui` app running, navigate to http://localhost:8080.

+ 5 - 3
documentation/project/contributing/prerequisites.md

@@ -1,7 +1,7 @@
 ### Prerequisites
 
 This page explains how to get the software you need to use a Linux or macOS
-machine for local development. 
+machine for local development.
 
 Before you begin contributing you must have:
 
@@ -11,11 +11,12 @@ Before you begin contributing you must have:
 * `Docker`
 
 ### Installing prerequisites on macOS
+
 1. Install [brew](https://brew.sh/).
 2. Install brew cask:
 ```sh
 brew cask
-``` 
+```
 3. Install JDK 13 via Homebrew cask:
 ```sh
 brew tap adoptopenjdk/openjdk
@@ -29,9 +30,10 @@ Note : In case JAVA13 is not set as your default Java then you can consider to i
 ```sh
 export PATH="/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/bin:$PATH
 ```
+
 ## Tips
 
-Consider allocating not less than 4GB of memory for your docker. 
+Consider allocating not less than 4GB of memory for your docker.
 Otherwise, some apps within a stack (e.g. `kafka-ui.yaml`) might crash.
 
 ## Where to go next

+ 2 - 0
kafka-ui-api/src/main/resources/application-local.yml

@@ -32,3 +32,5 @@ spring:
     enabled: true
 auth:
   type: DISABLED
+#server:
+#  port: 8080 #- Port in which kafka-ui will run.