Description:
I’m working on integrating an external database into my Kubernetes cluster using a Headless Service (without selectors). I manually created the Service and Endpoints. Here’s an example:
apiVersion: v1
kind: Service
metadata:
name: cassandra-service
namespace: example
spec:
clusterIP: None
ports:
- name: tcp-cassandra
port: 9042
protocol: TCP
targetPort: 9042
type: ClusterIP
apiVersion: v1
kind: Endpoints
metadata:
name: cassandra-service
namespace: example
subsets:
- addresses:
- ip: #my cassandra EC2 ip
ports:
- name: tcp-cassandra
port: 9042
protocol: TCP
- name: tcp-prometheus
port: 8081
protocol: TCP
Current Findings:
- Clients can access the database on port 9042 without any issues.
- Prometheus can scrape Cassandra metrics from port 8081.
Objective: The idea behind this setup is to avoid generating Istio configuration for monitoring ports, which helps save Istio proxy memory.
Questions:
Are there any potential risks with using the database this way, like security or performance issues?