kore3lab / dashboard Goto Github PK
View Code? Open in Web Editor NEWKubernetes multi-clusters dashboard
License: Apache License 2.0
Kubernetes multi-clusters dashboard
License: Apache License 2.0
namespace 선택 후 all namespace로 변경시 적용되지 않는 bug 발생.
ex) all namespace -> kube-system -> all namespace 이후 다른 리소스 페이지 로딩시 all namespace가 아닌 kube-system이 등록되어있음.
cluster 추가(kubeconfig 편집) 기능 구현
Alpha Release
프로젝트에서 "kubernetes-dashboard" 대체 및 "service mesh" 제거
ingress route 설정을 dashboard에 적용 할 경우 (ex. example.com/kore-board)
js 파일을 불러 올 수 없어서 페이지 로딩이 되지 않습니다.
현재 로그인 validation 은 토큰 문자열을 사용자 입력값과 단순 비교하는 방식
비교 되는 토큰 생성 기준 (backend)
--token
환경 변수 TOKEN
에 지정되어 있는 파일경로에서 토큰값 read생성된 토큰은 파일로 저장 (/var/run/kore-board-token)
이슈
Ingress 등록화면
query parameter 받아 ListOptions에 parsing 되어야함.
분리방식 검토필요
2.client-go API 이용
... req := k8sClient.CoreV1().RESTClient().Post(). Resource("pods"). Name(podName). Namespace(namespace). SubResource("exec") ...
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 가 올바르게 동작하지 않는 클러스터의 경우 발생되는 것으로 예상
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
클러스터 연결 목록 페이지 개발
kic-iam-auth
설치 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"
화면에서 최소 설치 후 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)
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: .........................................
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?
현재 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 로 전환
대안2 - rest 호출 방식
Custom resource 의 Additinal printer columns 에 있는 값 테이블에 추가
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.