Skip to content

Commit 434af67

Browse files
authored
Merge pull request #12 from osodevops/monitoring
Monitoring
2 parents dcd2040 + 1b3f8dc commit 434af67

File tree

89 files changed

+8999
-870
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+8999
-870
lines changed

examples/monitoring/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Monitoring (JMX/Prometheus/Grafana)
2+
In this example, we deploy an RBAC enabled Confluent cluster with Prometheus/Grafana integration.
3+
4+
## Deploy Stack
5+
From within this present directory(./examples/monitoring), run the following command:
6+
7+
```shell
8+
kubectl apply -k ../../kustomize/crds && sleep 1 && kubectl apply -k .
9+
```
10+
11+
Once all the the pods are in a 'Running' status, we can start to investigate the rest of the stack.
12+
13+
## Prometheus
14+
Prometheus has a UI you can view by forwarding port 9090 with the following command, and then accessing `http://127.0.0.1:9090` from a local browser.
15+
```shell
16+
kubectl port-forward \
17+
$(kubectl get pods -n sandbox -l app=prometheus -l component=server -o name) \
18+
9090 --namespace sandbox
19+
```
20+
21+
If you navigate to `http://localhost:9090/targets` you should hopefully see a screen such as this which indicates that Prometheus is successfully scraping from the Confluent Services
22+
![](../../resources/images/prometheus_targets.png)0
23+
24+
The configuration file for Prometheus can be found at `./examples/monitoring/prometheus/server/cm.yaml`
25+
26+
## Grafana
27+
Grafana's Web UI runs on port 3000. Similar to Prometheus, forward that port to your local machines with the following command:
28+
```shell
29+
kubectl port-forward \
30+
$(kubectl get pods -n sandbox kubectl get pods -n sandbox -l app.kubernetes.io/component=grafana -o name) \
31+
3000 --namespace sandbox
32+
```
33+
34+
Navigate to http://localhost:3000
35+
36+
You will need to login with the username 'admin' and the password 'password'. At the home screen you will see a dashboard called 'Confluent Platform'. Click on this
37+
![](../../resources/images/grafana-dashboard.png)
38+
39+
This dashboard will display various metrics/alerts for the various Confluent services. This dashboard has been captured in code, and can be edited at `./examples/grafana/dashboards.yaml`
40+
![](../../resources/images/grafana-dashboard2.png)
41+
42+
43+
44+
45+
46+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
apiVersion: platform.confluent.io/v1beta1
2+
kind: ControlCenter
3+
metadata:
4+
name: controlcenter
5+
spec:
6+
authorization:
7+
type: rbac
8+
tls:
9+
secretRef: tls-group1
10+
dependencies:
11+
kafka:
12+
bootstrapEndpoint: kafka.sandbox.svc.cluster.local:9071
13+
authentication:
14+
type: plain
15+
jaasConfig:
16+
secretRef: mds-client-connect
17+
tls:
18+
enabled: true
19+
mds:
20+
endpoint: https://kafka.sandbox.svc.cluster.local:8090
21+
tokenKeyPair:
22+
secretRef: mds-public
23+
authentication:
24+
type: bearer
25+
bearer:
26+
secretRef: mds-client-c3
27+
tls:
28+
enabled: true
29+
connect:
30+
- name: connect
31+
url: https://connect.sandbox.svc.cluster.local:8083
32+
tls:
33+
enabled: true
34+
ksqldb:
35+
- name: ksqldb
36+
url: https://ksqldb.sandbox.svc.cluster.local:8088
37+
tls:
38+
enabled: true
39+
schemaRegistry:
40+
url: https://schemaregistry.sandbox.svc.cluster.local:8081
41+
tls:
42+
enabled: true
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
apiVersion: platform.confluent.io/v1beta1
3+
kind: Connect
4+
metadata:
5+
name: connect
6+
spec:
7+
tls:
8+
secretRef: tls-group1
9+
authorization:
10+
type: rbac
11+
dependencies:
12+
kafka:
13+
bootstrapEndpoint: kafka.sandbox.svc.cluster.local:9071
14+
authentication:
15+
type: plain
16+
jaasConfig:
17+
secretRef: mds-client-connect
18+
tls:
19+
enabled: true
20+
mds:
21+
endpoint: https://kafka.sandbox.svc.cluster.local:8090
22+
tokenKeyPair:
23+
secretRef: mds-public
24+
authentication:
25+
type: bearer
26+
bearer:
27+
secretRef: mds-client-connect
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
apiVersion: platform.confluent.io/v1beta1
3+
kind: Kafka
4+
metadata:
5+
name: kafka
6+
spec:
7+
configOverrides:
8+
server:
9+
- confluent.schema.registry.url=https://schemaregistry.sandbox.svc.cluster.local:8081
10+
- listener.name.internal.plain.sasl.server.callback.handler.class=io.confluent.security.auth.provider.ldap.LdapAuthenticateCallbackHandler
11+
- listener.name.external.plain.sasl.server.callback.handler.class=io.confluent.security.auth.provider.ldap.LdapAuthenticateCallbackHandler
12+
- listener.name.replication.plain.sasl.server.callback.handler.class=io.confluent.security.auth.provider.ldap.LdapAuthenticateCallbackHandler
13+
tls:
14+
secretRef: tls-group1
15+
metricReporter:
16+
enabled: true
17+
authentication:
18+
type: plain
19+
jaasConfigPassThrough:
20+
secretRef: broker-credential
21+
tls:
22+
enabled: true
23+
listeners:
24+
internal:
25+
authentication:
26+
type: plain
27+
jaasConfigPassThrough:
28+
secretRef: broker-credential
29+
tls:
30+
enabled: true
31+
external:
32+
authentication:
33+
type: plain
34+
jaasConfigPassThrough:
35+
secretRef: broker-credential
36+
tls:
37+
enabled: true
38+
authorization:
39+
type: rbac
40+
superUsers:
41+
- User:kafka
42+
services:
43+
mds:
44+
tls:
45+
enabled: true
46+
tokenKeyPair:
47+
secretRef: broker-credential
48+
provider:
49+
type: ldap
50+
ldap:
51+
address: ldap://ldap.sandbox.svc.cluster.local:389
52+
authentication:
53+
type: simple
54+
simple:
55+
secretRef: broker-credential
56+
tls:
57+
enabled: true
58+
configurations:
59+
groupNameAttribute: cn
60+
groupObjectClass: groupOfNames
61+
groupMemberAttribute: member
62+
groupMemberAttributePattern: cn=(.*),ou=users,dc=test,dc=com
63+
groupSearchBase: ou=groups,dc=test,dc=com
64+
userNameAttribute: cn
65+
userMemberOfAttributePattern: cn=(.*),ou=users,dc=test,dc=com
66+
userObjectClass: organizationalRole
67+
userSearchBase: ou=users,dc=test,dc=com
68+
dependencies:
69+
kafkaRest:
70+
authentication:
71+
type: bearer
72+
bearer:
73+
secretRef: broker-credential
74+
zookeeper:
75+
endpoint: zookeeper.sandbox.svc.cluster.local:2182
76+
authentication:
77+
type: digest
78+
jaasConfig:
79+
secretRef: broker-credential
80+
tls:
81+
enabled: true
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
apiVersion: platform.confluent.io/v1beta1
3+
kind: KsqlDB
4+
metadata:
5+
name: ksqldb
6+
spec:
7+
authorization:
8+
type: rbac
9+
tls:
10+
secretRef: tls-group1
11+
dependencies:
12+
kafka:
13+
bootstrapEndpoint: kafka.sandbox.svc.cluster.local:9071
14+
authentication:
15+
type: plain
16+
jaasConfig:
17+
secretRef: mds-client-connect
18+
tls:
19+
enabled: true
20+
mds:
21+
endpoint: https://kafka.sandbox.svc.cluster.local:8090
22+
tokenKeyPair:
23+
secretRef: mds-public
24+
authentication:
25+
type: bearer
26+
bearer:
27+
secretRef: mds-client-ksqldb
28+
tls:
29+
enabled: true
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
namespace: sandbox
4+
resources:
5+
- ldap.yaml
6+
- namespace.yaml
7+
- ../../../kustomize/base/confluent
8+
- ../../../kustomize/base/secrets-tls
9+
- ../../../kustomize/base/secrets-user
10+
patchesStrategicMerge:
11+
- zookeeper.yaml
12+
- kafka.yaml
13+
- rest-class.yaml
14+
- control-centre.yaml
15+
- kafka-connect.yaml
16+
- ksqldb.yaml
17+
- schema-registry.yaml

0 commit comments

Comments
 (0)