Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

[Rest Server] kubernetes pods/nodes list api #4037

Merged
merged 9 commits into from
Dec 25, 2019

Conversation

sunqinzheng
Copy link
Contributor

@sunqinzheng sunqinzheng commented Dec 19, 2019

Changes

Kubernetes request model

  • All components now use the axios client generated by src/model/kubernetes.js
  • Use k8s official nodejs client lib to initialize the kubernetes config
  • Developer can use a single .kubeconfig file to connect the remote cluster
    • Pass the file path to K8S_KUBECONFIG_PATH environment variable

Kubernetes pods/nodes list api

  • Remove old kubernetes proxy
  • Add two new apis to fetch the nodes/pods list
    • Admin permission neeeded
  • Documents and test cases

Web portal service page

  • Rewrite the fetch(ajax) function to improve performance

Miscs

@sunqinzheng sunqinzheng force-pushed the qinsu/rest-server/k8sinit branch from a654d3d to 4811718 Compare December 19, 2019 12:40
Copy link
Member

@abuccts abuccts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

job and vc parts look fine to me

@Binyang2014
Copy link
Contributor

Storage part looks fine to me

src/rest-server/src/config/kubernetes.js Show resolved Hide resolved
src/rest-server/src/config/kubernetes.js Show resolved Hide resolved
src/rest-server/src/config/kubernetes.js Show resolved Hide resolved
src/rest-server/src/config/kubernetes.js Show resolved Hide resolved
const user = kc.getCurrentUser();
apiserverConfig.uri = cluster.server;
if (cluster.caFile) {
apiserverConfig.ca = readFileSync(cluster.caFile);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's relative between this line and the line 77

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I forgot to remove those redundant lines. Thanks.

@ydye
Copy link
Contributor

ydye commented Dec 24, 2019

BTW, do we need so complicated logic to init a config? I think the function loadFromCluster is enough

@sunqinzheng
Copy link
Contributor Author

sunqinzheng commented Dec 24, 2019

BTW, do we need so complicated logic to init a config? I think the function loadFromYaml is enough

  1. Sorry, I can not find the loadFromYaml function. Could you provide a link?

  2. I think the current logic is not that complicated. Only two official libraries' method are called. And other changes are used to retrieve information from kubeConfig structure (referenced from godaddy's kubernetes client) and to be compatible with old env vars.

@sunqinzheng sunqinzheng merged commit 0bea9d1 into master Dec 25, 2019
@sunqinzheng sunqinzheng deleted the qinsu/rest-server/k8sinit branch December 25, 2019 06:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants