Giter VIP home page Giter VIP logo

dashboard's People

Contributors

dongmook-lee avatar hjonghyun avatar itnpeople avatar joowons avatar okpiri26 avatar seyunpark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dashboard's Issues

Add a cluster configuration (kubeconfig)

cluster 추가(kubeconfig 편집) 기능 구현

  • 파일(kubeconfig) 업로드
  • 편집(추가, 수정,삭제) 화면 및 기능
  • 수정 결과 backend, metrics-scraper frontend 반영

Release v0.1.1

Alpha Release

  • 리스트 화면 페이징 처리
  • Yaml 화면 적용 기능
  • 매트릭 스크랩퍼 멀티 컨텍스트 지원
  • 라벨/어노테이션 수정화면

Discuss improvements to authentication practices

  • 현재 로그인 validation 은 토큰 문자열을 사용자 입력값과 단순 비교하는 방식

  • 비교 되는 토큰 생성 기준 (backend)

    • 1순위 : 시작 파라메터 --token 환경 변수 TOKEN 에 지정되어 있는 파일경로에서 토큰값 read
    • 2순위: in-cluster 가 있는 경우 지정된 namespace 의 serviceaccount secret 토큰값 read
    • 3순위: in-cluster 가 없는 경우 default cluster 에서 지정된 namespace 의 serviceaccount secret 토큰값 read
    • 4순위 : 자동생성
  • 생성된 토큰은 파일로 저장 (/var/run/kore-board-token)

  • 이슈

    • 지금의 방식이 보편 타당하게 인정 받을 수 있는 방식인지
    • OSS 에서 일반적으로 사용할 수 있는 인증 방식 검토
    • 다른 연동 방식 검토 (ldap, oauth 외)
    • @nuxt/auth 적용 검토
    • 기타...

웹터미널 컨테이너 분리

backend 에서 terminal 관련 기능 분리

  • 신규 소스로 관리 /src/app/terminal
  • backend는 alpine 이미지 적용
  • kubernetes kubeconfig 관련 로직은 backend 참조
  • docker build 및 github workflow build 추가
  • 배포 configmap 수정 (yaml, docker-compose, helm-chart)

분리방식 검토필요

  1. gotty서비스
  • 호출방식? front->terminal? front->backend->terminal?
  • kubeconfig 전달? backend 와 동일 볼륨마운트? backend 호출을 통한 획득?
  • 단점? 터미널서비스 정보를 구동시 설정해야 됨
    호출 구조가 복잡해 질 수 있음 api->api->api... 구간장애시 원인확인 힘듦
  • 장점? backend 이미지 경량화 및 빌드시간 단축(웹터미널 이미지화)
    기존 구축소스 활용

2.client-go API 이용

  • 호출방식? front->backend
    -- kubectl 터미널접속: client-go API 접근
    설치 yaml로 미리 deploy한 kubectl 전용 pod사용 내부 멀티유저 처리는 unshare를 사용하여 기존과 동일하게 처리)
    -- 일반pod 터미널접속: client-go API 접근
  • kubeconfig 전달? backend내부 config 참조
  • 단점? front/backend 전면 수정필요
  • 장점? backend 이미지 경량화 및 빌드시간 단축
    kubeconfig 참조방식이 변경돼도 영향이 없음(직접참조 안함)
    전체 kubeconfig를 이미지에 마운트 하지 않아도 되므로 보안성 향상
    client-go 사용으로 코드 간략화
    아래 한줄로 gotty 소스 대체가능
          ...	
          req := k8sClient.CoreV1().RESTClient().Post().
  Resource("pods").
  Name(podName).
  Namespace(namespace).
  SubResource("exec")
          ...

터미널서비스분리방안 001

Metrics Chart 개선

  • memory 그래프 표시에 K,M,G 등 단위 기입 또는 천단위 구분자 필요.
  • cpu, memory 차트에 request, limit 표시
  • metric 값과 request, limit 값의 차이가 클 경우 중간 생략(보류)

ServerPreferredResources - Unable to retrieve the complete list of server APIs

http://{{HOST}}:{{BACKEND_PORT}}/api/contexts/{{CLUSTER}}
아래와 같은 에러 발생
{"message":"unable to retrieve the complete list of server APIs: controlplane.antrea.io/v1beta2: the server is currently unable to handle the request, controlplane.antrea.tanzu.vmware.com/v1beta1: the server is currently unable to handle the request, controlplane.antrea.tanzu.vmware.com/v1beta2: the server is currently unable to handle the request, data.packaging.carvel.dev/v1alpha1: the server is currently unable to handle the request, stats.antrea.io/v1alpha1: the server is currently unable to handle the request, stats.antrea.tanzu.vmware.com/v1alpha1: the server is currently unable to handle the request, system.antrea.io/v1beta1: the server is currently unable to handle the request, system.antrea.tanzu.vmware.com/v1beta1: the server is currently unable to handle the request"}

discoveryClient.ServerPreferredResources() 함수 실행 오류

apiresource 가 올바르게 동작하지 않는 클러스터의 경우 발생되는 것으로 예상

화면 공통 사용성 개선

  • namespace store 처리하여 화면간 유지
  • namespace 선택 위치 GNB로 이동
  • 보기 화면에서 링크 이동 후 다시 클릭시 최초 보기화면으로 이동
  • 로그인 화면 클립보드 처리
  • 메인화면 그래프 숫자 포멧 수정

Support user auth-provider on kubeconfig

kubeconfig auth-provider 지원

  • GKE 경우 예

gcloud container clusters get-credentials cluster-1 --region asia-northeast3 --project project-1

users:
- name: apps-06-user
  user:
    client-certificate-data:  ....
    client-key-data:  ...
- name: gke_kore3-etri-cloudbarista_asia-northeast3_certificate-cluster
  user:
    auth-provider:
      config:
        access-token: ....
        cmd-args: config config-helper --format=json
        cmd-path: /usr/local/google-cloud-sdk/bin/gcloud
        expiry: "2022-11-02T02:37:29Z"
        expiry-key: '{.credential.token_expiry}'
        token-key: '{.credential.access_token}'
      name: gcp

Support to manage connected-cluster

클러스터 연결 목록 페이지 개발

  • 연결 목록
  • 연결 보기
  • 연결 삭제
  • 순서 변경
  • 클러스터 연결(신규추가) 페이지 링크

KIC(Kakao i Cloud) connection support

KIC를 위한 KUBECONFIG 지정 기능 구현

  users:
      - name: {클러스터 이름}-admin
        user:
          exec:
            apiVersion: client.authentication.k8s.io/v1beta1
            args: null
            command: kic-iam-auth
            env:
            - name: "OS_AUTH_URL"
              value: "https://iam.kakaoi.io/identity/v3"
            - name: "OS_AUTH_TYPE"
              value: "v3applicationcredential"
            - name: "OS_APPLICATION_CREDENTIAL_ID"
              value: "{사용자 액세스 키 ID 입력}"
            - name: "OS_APPLICATION_CREDENTIAL_SECRET"
              value: "{사용자 API 액세스 보안 키 입력}"
            - name: "OS_REGION_NAME"
              value: "kr-central-1"

upload file for kubeconfig is not working (add a cluster)

  • 화면에서 최소 설치 후 kubeconfig 파일 업로드 후 500 에러 발생

  • configmap에 정상적으로 데이터는 입력되어 있음 kuibectl get cm kore-board-kubeconfig -o yaml

  • 등록실패한 context 명으로 재 업로드하면 Already exist a context 'xxxxx' 와 같은 warning 메시지 발생하고 등록되지 않음

  • backend 로그를 보면 panic 에러 발생
    2022/10/27 05:10:40 [Recovery] 2022/10/27 - 05:10:40 panic recovered: runtime error: invalid memory address or nil pointer dereference /usr/local/go/src/runtime/panic.go:260 (0x44b555) /usr/local/go/src/runtime/signal_unix.go:835 (0x44b525) /go/pkg/mod/github.com/modern-go/[email protected]/reflect2.go:157 (0x989f0a) /go/pkg/mod/github.com/modern-go/[email protected]/unsafe_map.go:53 (0x98eb68) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect_map.go:14 (0x9cd104) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:182 (0x9c7167) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:142 (0x9c6e3e) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:124 (0x9c6c04) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect_extension.go:380 (0x9ca9fd) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect_struct_decoder.go:14 (0x9d5f73) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:176 (0x9c72af) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:142 (0x9c6e3e) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:124 (0x9c6c04) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect_extension.go:380 (0x9ca9fd) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect_struct_decoder.go:14 (0x9d5f73) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:176 (0x9c72af) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:142 (0x9c6e3e) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:124 (0x9c6c04) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect_slice.go:12 (0x9d4fcc) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:180 (0x9c72d0) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:142 (0x9c6e3e) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:124 (0x9c6c04) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect_extension.go:380 (0x9ca9fd) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect_struct_decoder.go:14 (0x9d5f73) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:176 (0x9c72af) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:142 (0x9c6e3e) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:124 (0x9c6c04) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:114 (0x9c6b07) /go/pkg/mod/github.com/json-iterator/[email protected]/reflect.go:72 (0x9c67aa) /go/pkg/mod/github.com/json-iterator/[email protected]/config.go:348 (0x9be324) /go/pkg/mod/k8s.io/[email protected]/pkg/runtime/serializer/json/json.go:264 (0xafb44b) /go/pkg/mod/k8s.io/[email protected]/pkg/runtime/serializer/versioning/versioning.go:136 (0xb08b18) /go/pkg/mod/k8s.io/[email protected]/tools/clientcmd/loader.go:409 (0x125e3ae) /go/pkg/mod/k8s.io/[email protected]/tools/clientcmd/client_config.go:111 (0x1256c64) /usr/src/app/pkg/config/kubeconfig.go:283 (0x12831ea) /usr/src/app/pkg/config/kubeconfig.go:154 (0x1281ddc) /usr/src/app/pkg/config/config.go:99 (0x1280644) /usr/src/app/router/apis/context.go:262 (0x134d653) /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x1230ccc) /usr/src/app/pkg/auth/authenticator.go:73 (0x1230cb9) /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x137fde3) /usr/src/app/router/router.go:160 (0x137fdcf) /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x9132a1) /go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:99 (0x91328c) /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x9123e6) /go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241 (0x9123c9) /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x91149d) /go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:489 (0x911125) /go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:445 (0x910c84) /usr/local/go/src/net/http/server.go:2947 (0x6d282b) /usr/local/go/src/net/http/server.go:1991 (0x6cda46) /usr/local/go/src/runtime/asm_amd64.s:1594 (0x466140)

EKS connection support

EKS 연결 지원

  • EKS 는 KUBECONFIG 'client-certificate' , 'client-certificate' 을 허용하지 않고 15m 만기 token 지원
  • 검토 개선 필요

aws eks update-kubeconfig --region ap-northeast-1 --name certificate-cluster

# kubeconfig

users:
- name: arn:aws:eks:ap-northeast-1:741408023868:cluster/certificate-cluster
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      args:
      - --region
      - ap-northeast-1
      - eks
      - get-token
      - --cluster-name
      - certificate-cluster
      command: aws

aws eks get-token --region ap-northeast-1 --cluster-name certificate-cluster

# kubeconfig

users:
- name: arn:aws:eks:ap-northeast-1:741408023868:cluster/certificate-cluster
  user:
    token: .........................................

Support for cross-cluster resource retrieval and retrieving of multiple resource types

Hi, I found this multi-cluster dashboard project, I really like the functionality and interface of this dashboard, I think clusterpedia can extend this project to support cross-cluster resource retrieval, and can retrieve multiple resource types simultaneously.

Clusterpedia is a cncf sandbox project for complex retrieval of resources across clusters.
The clusterpedia is compatible with Kubernetes OpenAPI, everyone can get a quick overview of clusterpedia’s basic functionality through https://github.com/clusterpedia-io/clusterpedia#usage-samples

Clusterpedia upport for importing Kubernetes 1.10+, and use Collection Resource to retrieve different types of resources, such as Deployment, DaemonSet, StatefulSet

$ kubectl get collectionresources
NAME            RESOURCES
any             *
workloads       deployments.apps,daemonsets.apps,statefulsets.apps
kuberesources   .*,*.admission.k8s.io,*.admissionregistration.k8s.io,*.apiextensions.k8s.io,*.apps,*.authentication.k8s.io,*.authorization.k8s.io,*.autoscaling,*.batch,*.certificates.k8s.io,*.coordination.k8s.io,*.discovery.k8s.io,*.events.k8s.io,*.extensions,*.flowcontrol.apiserver.k8s.io,*.imagepolicy.k8s.io,*.internal.apiserver.k8s.io,*.networking.k8s.io,*.node.k8s.io,*.policy,*.rbac.authorization.k8s.io,*.scheduling.k8s.io,*.storage.k8s.io

Would you like kore-dashboard to provide cross-cluster resource retrieval and retrieval of multiple resource types through Clusterpedia?

kubernetes 런타임 환경에서 kubeconfig 배포 방안 (read-only file system)

  • 현재 kuberntes 배포 시 kuberconfig 를 configmap 에 지정하고 metrics-scraper, backend 워크로드에서 volumeMount 하여 사용

  • configMap volumeMount are always mounted readOnly

  • unable to modify kubeconfig (cause=open /app/.kube/config: read-only file system)

  • 현재는 kubeconfig 를 configmap 에서 pv로 수동 대체하여 운영 가능 (docker run 기반은 관련 없음)

  • 대안 1 - pv 로 전환

    • 사용자 입장에서 kubernetes 배포 시 configmap 방식보다 복잡
  • 대안2 - rest 호출 방식

    • backend가 kubeconfig 수정 요청을 받았을 때 client 라이브러리로 kubeconfig configmap을 업데이트하고 metrics-scraper, backend 에서 kubeconfig 를 리로드하도록 함
    • 리로드 로직은 현재도 존재
    • docker 런타임 환경과 구별 필요
  • 참조 : kubernetes/kubernetes#62099

Support for terminal on in-cluster

  • 클러스터가 "in-cluster" 모드일 경우에도 터미널 기능 제원
  • 현재는 클러스터 터미널, 파드 터미널 모두 미 지원

이벤트 조회 화면

  • 이벤트 페이지
    • 메뉴: cluster > Events
    • 목록, 보기 페이지
    • k get ev --all-namespaces
  • GNB 이벤트 아이콘
    • 최근 5개 조회
    • "See All Events" 클릭 시 이벤트 조회 페이지로 이동

List page 테이블 정리

  • column에 따라 width 조정
  • table max-width or media query 이용 크기에 따라 table overflow 및 text ellipsis 구현

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.