前后端分离的k8s管理系统-后端部分
功能:预计提供k8s资源的增删改查。
workload
命名空间
服务发现
配置文件
➜ k8s-Management-System git:(main) ls -a | grep config
config
config文件示例(部分...)
apiVersion: v1
clusters:
- cluster:
server: https://xxxxxxxxx:6443
name: kubernetes
contexts:
.......
k8s:
nodes:
- name: xxxxxxx
ip: xxxxxxx
user: xxxxx
pass: xxxxxx
- name: xxxxxxx
ip: xxxxxxx
user: xxxxxxx
pass: xxxxxxx
- name: xxxxxxx
ip: xxxxxxx
user: xxxxxxx
pass: xxxxxxx
➜ k8s-Management-System git:(main) ✗ go run main.go
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
- using env: export GIN_MODE=release
- using code: gin.SetMode(gin.ReleaseMode)
2022/12/03 20:27:16 open /Users/zhenyu.jiang/go/src/golanglearning/new_project/k8s-Management-System/application.yaml: no such file or directory
[GIN-debug] GET /deployments --> github.com/shenyisyn/goft-gin/goft.JsonResponder.RespondTo.func1 (3 handlers)
[GIN-debug] GET /pods --> github.com/shenyisyn/goft-gin/goft.JsonResponder.RespondTo.func1 (3 handlers)
[GIN-debug] GET /jobs --> github.com/shenyisyn/goft-gin/goft.JsonResponder.RespondTo.func1 (3 handlers)
[GIN-debug] GET /services --> github.com/shenyisyn/goft-gin/goft.JsonResponder.RespondTo.func1 (3 handlers)
[GIN-debug] GET /namespaces --> github.com/shenyisyn/goft-gin/goft.JsonResponder.RespondTo.func1 (3 handlers)
[GIN-debug] POST /vue-admin-template/user/login --> github.com/shenyisyn/goft-gin/goft.JsonResponder.RespondTo.func1 (3 handlers)
[GIN-debug] POST /vue-admin-template/user/logout --> github.com/shenyisyn/goft-gin/goft.JsonResponder.RespondTo.func1 (3 handlers)
[GIN-debug] GET /vue-admin-template/user/info --> github.com/shenyisyn/goft-gin/goft.StringResponder.RespondTo.func1 (3 handlers)
[GIN-debug] GET /ws --> github.com/shenyisyn/goft-gin/goft.StringResponder.RespondTo.func1 (3 handlers)
[GIN-debug] GET /statefulsets --> github.com/shenyisyn/goft-gin/goft.JsonResponder.RespondTo.func1 (3 handlers)
[GIN-debug] GET /cronjobs --> github.com/shenyisyn/goft-gin/goft.JsonResponder.RespondTo.func1 (3 handlers)
[GIN-debug] Listening and serving HTTP on :8080
查询列表接口
http://localhost:8080/deployments
http://localhost:8080/pods
http://localhost:8080/services
http://localhost:8080/jobs
http://localhost:8080/cronjobs
http://localhost:8080/configmaps
http://localhost:8080/statefulsets
...