fmdlc / ISP-Checker

Kubernetes and Docker Compose files to run ISP checks on a Raspberry Pi. 📊
https://www.youtube.com/watch?v=BnQDnCNG1Bs
Apache License 2.0
130 stars 32 forks source link

Improvement code for Kubernetes #29

Open ionutz89 opened 3 years ago

ionutz89 commented 3 years ago

Hello,

You should remove this line clusterIP: 10.43.37.100 from your ISP-Checker-deploy.yaml

Not everyone is using the same network address.

Also, you can add ingress and service for grafana like:

---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: grafana
  name: grafana
  namespace: isp-checker
spec:
  type: ClusterIP
  ports:
    - name: grafana
      port: 3000
      protocol: TCP
      targetPort: 3000
  selector:
    app: grafana
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: grafana
  namespace: isp-checker
  annotations:
    kubernetes.io/ingress.class: "nginx"
spec:
  rules:
    - host: grafana.com
      http:
        paths:
          - backend:
              service:
                name: grafana
                port:
                  number: 3000
            path: /
            pathType: Prefix
  tls:
    - hosts:
      - grafana.com
      secretName: grafana-cert
villasenor commented 2 years ago

Agreed, not everyone has the same IP range in their cluster so that line for the influxdb-svc should be removed. Yes, and a LoadBalancer block should be added as well (can be commented out by default until you get Helm going):

apiVersion: v1
kind: Service
metadata:
  labels:
    app: grafana
    app.kubernetes.io/app: grafana
    app.kubernetes.io/project: isp-checker
  name: grafana-svc
  namespace: monitoring
spec:
  ports:
  - port: 3000
    protocol: TCP
    targetPort: 3000
  selector:
    app: grafana
  sessionAffinity: None
  type: LoadBalancer