# Kafka Notes

Following: https://medium.com/@prasanta.mohanty/deploy-kafka-cluster-on-microk8s-in-15-mins-f3d5081991e8

```
# k8s1 only:
microk8s enable helm
# microk8s helm init # removed in 2019

# All 3:
sudo apt-get install kafkacat

# back on just k8s1
mkdir src
cd src
git clone https://github.com/confluentinc/cp-helm-charts.git
cp cp-helm-charts/values.yaml .
```

Edit values.yaml, and add the following to the end of `cp-kafka`
```
  nodeport:
    enabled: true
    servicePort: 19092
    firstListenerPort: 31090
  configurationOverrides:
    "offsets.topic.replication.factor": "3"
    # "default.replication.factor": 3
    # "min.insync.replicas": 2
    # "auto.create.topics.enable": false## Options required for external access via NodePort
    ## ref:
    ## - http://kafka.apache.org/documentation/#security_configbroker
    ## - https://cwiki.apache.org/confluence/display/KAFKA/KIP-103%3A+Separation+of+Internal+and+External+traffic
    ##
    ## Advertised listeners will use the firstListenerPort value as it's default unless overridden here.
    ## Setting "advertised.listeners" here appends to "PLAINTEXT://${POD_IP}:9092,"
    "advertised.listeners": |-
     EXTERNAL://localhost:$((31090 + ${KAFKA_BROKER_ID}))
    "listener.security.protocol.map": |-
     PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT
```
Set `cp-schema-registry` and `cp-control-center` to `enabled: false`

Back to shell:
```
microk8s helm install my-confluent cp-helm-charts -f ./values.yaml

