hjacobs / kube-ops-view

Kubernetes Operational View - read-only system dashboard for multiple K8s clusters
https://kubernetes-operational-view.readthedocs.io/
GNU General Public License v3.0
1.83k stars 256 forks source link

In multiple-cluster setup gui does not show anything #142

Open hosseinsalahi opened 7 years ago

hosseinsalahi commented 7 years ago

I've deployed Kubeopsview via Helm chart. I followed 'Static List of API Server URLs' procedure as I passed a list of API servers in CLUSTERS environment variable. I also passed required ssl certs via kubeconfig:

apiVersion: v1
clusters:
- cluster:
    certificate-authority: /etc/sec/ca.pem
    server: https://master.01.test.com
  name: 01
- cluster:
    certificate-authority: /etc/sec/ca.pem
    server: https://master.02.test.com
  name: 02
- cluster:
    certificate-authority: /etc/sec/ca.pem
    server: https://master.03.test.com
  name: 03
contexts:
- context:
    cluster: 01
    namespace: default
    user: 01
  name: 01
- context:
    cluster: 02
    namespace: default
    user: 02
  name: 02
- context:
    cluster: 03
    namespace: default
    user: 03
  name: 03
current-context: 01
kind: Config
preferences: {}
users:
- name: 01
  user:
    client-certificate: /etc/sec/01.pem
    client-key: /etc/sec/01-key.pem
- name: 02
  user:
    client-certificate: /etc/sec/02.pem
    client-key: /etc/sec/02-key.pem
- name: 03
  user:
    client-certificate: /etc/sec/03.pem
    client-key: /etc/sec/03-key.pem

After deployment I looked into pod logs:

INFO:kube_ops_view.main:Listening on :8080..
INFO:kube_ops_view.update:Discovered new cluster 01 (https://master.01.test.com).
INFO:kube_ops_view.update:Discovered new cluster 02 (https://master.02.test.com).
INFO:kube_ops_view.update:Discovered new cluster 03 (https://master.03.test.com).

It seems fine, however kubeopsview gui shows nothing. Any idea why it does not work? Thanks.

hjacobs commented 7 years ago

@arasmax: can you run it with --debug flag to see more log output?

hosseinsalahi commented 7 years ago
CHART: kubeopsview
USER-SUPPLIED VALUES:
env:
  CLUSTERS: 'https://master.01.test.com:12345 https://master.02.test.com:12345
    https://master.03.test.com:12345 '
  KUBECONFIG_PATH: /etc/config/kubeconfig

COMPUTED VALUES:
env:
  CLUSTERS: 'https://master.01.test.com:12345 https://master.02.test.com:12345
    https://master.03.test.com:12345 '
  KUBECONFIG_PATH: /etc/config/kubeconfig
image:
  pullPolicy: IfNotPresent
  repository: hjacobs/kube-ops-view
  tag: latest
replicaCount: 1
resources:
  limits:
    cpu: 100m
    memory: 128Mi
  requests:
    cpu: 80m
    memory: 64Mi
service:
  externalPort: 80
  internalPort: 8080
  type: NodePort

HOOKS:
MANIFEST:

---
Source: kubeopsview/templates/secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: kubeopsview
  labels:
    heritage: Tiller
    release: kubeopsview
    chart: kubeopsview
    app: kubeopsview

type: Opaque
data:
  ca.pem: <>
  01.pem: <>
  01-key.pem: <>
  02.pem: <> 
  02-key.pem: <>
  03.pem: <> 
  03-key.pem: <> 

---
Source: kubeopsview/tempplate/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: kubeopsview
  labels:
    heritage: Tiller
    release: kubeopsview
    chart: kubeopsview
    app: kubeopsview

data:
  kubeconfig: |
    apiVersion: v1
    clusters:
    - cluster:
        certificate-authority: /etc/sec/ca.pem
        server: https://master.01.test.com:12345
      name: 01
    - cluster:
        certificate-authority: /etc/sec/ca.pem
        server: https://master.02.test.com:12345
      name: 02
    - cluster:
        certificate-authority: /etc/sec/ca.pem
        server: https://master.02.test.com:12345
      name: 03
    contexts:
    - context:
        cluster: 03
        namespace: default
        user: 01
      name: 01
    - context:
        cluster: 02
        namespace: default
        user: 02
      name: 02
    - context:
        cluster: 03
        namespace: default
        user: 03
      name: 03
    current-context: 01
    kind: Config
    preferences: {}
    users:
    - name: 01
      user:
        client-certificate: /etc/sec/01.pem
        client-key: /etc/sec/01-key.pem
    - name: 02
      user:
        client-certificate: /etc/sec/02.pem
        client-key: /etc/sec/02-key.pem
    - name: 03
      user:
        client-certificate: /etc/sec/03.pem
        client-key: /etc/sec/03-key.pem

---
Source: kubeopsview/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  name: kubeopsview
  labels:
    app: kubeopsview
    chart: "kubeopsview
    release: "kubeopsview"
    heritage: "Tiller"
spec:
  type: NodePort
  ports:
  - port: 80
    targetPort: 8080
    protocol: TCP
  selector:
    app: kubeopsview

---
Source: kubeopsview/templates/deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: kubeopsview
  labels:
    chart: "kubeopsview"
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: kubeopsview
    spec:
      containers:
      - name: kubeopsview
        image: "hjacobs/kube-ops-view:latest"
        imagePullPolicy: IfNotPresent
        env: 
        - name: CLUSTERS
          value: "https://master.01.test.com:12345 https://master.01.test.com:12345 https://master.01.test.com:12345"
        - name: KUBECONFIG_PATH
          value: "/etc/config/kubeconfig"
        volumeMounts: 
        - name: vol-kubeopsview-secret
          mountPath: /etc/sec
          readOnly: true
        - name: vol-kubeopsview-config
          mountPath: /etc/config
          readOnly: true
        ports:
        - containerPort: 8080
        livenessProbe:
          httpGet:
            path: /health
            port: 8080
        readinessProbe:
          httpGet:
            path: /health
            port: 8080
        resources:
            limits:
              cpu: 100m
              memory: 128Mi
            requests:
              cpu: 80m
              memory: 64Mi

      volumes:
        - name: vol-kubeopsview-secret
          secret:
            secretName: kubeopsview
        - name: vol-kubeopsview-config
          configMap:
            name: kubeopsview

Release "kubeopsview" has been upgraded. Happy Helming!
LAST DEPLOYED: 
NAMESPACE: kubeopsview
STATUS: DEPLOYED

RESOURCES:
==> extensions/v1beta1/Deployment
NAME                         DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE
kubeopsview                    1                1                    1                    0            0s

==> v1/Secret
NAME                         TYPE    DATA  AGE
kubeopsview                   Opaque  10    0s

==> v1/ConfigMap
NAME                         DATA  AGE
kubeopsview                   1     0s

==> v1/Service
NAME                         CLUSTER-IP  EXTERNAL-IP  PORT(S)       AGE
kubeopsview                  x.x.x.x       <nodes>        80:30714/TCP  0s

NOTES:
To access the Kubernetes Operational View UI:

1. First start the kubectl proxy:

   kubectl proxy

2. Now open the following URL in your browser:

   http://localhost:8001/api/v1/proxy/namespaces/kubeopsview/services/kubeopsview/

Please try reloading the page if you see "ServiceUnavailable / no endpoints available for service", pod creation might take a moment.