dongwuzun4630 2018-10-24 07:27
浏览 66

我们如何使用kubernetes api进行kubernetes集群信息转储

Does kubernetes provide an API in its client library to get the cluster-info dump. I went through its API documentation and could find any api which could actually do this.

What i do now: kubectl cluster-info dump --output-directory="dumpdir"

What i want: Using client-go/kubernetes api libraries, make an API call to get this dump from a golang application. Is it possible?

What i know: There are individual API's for each resource which can provide all the information provided by the cluster-info dump, but i want to do it will a single API call.

For example: golang code:

coreClient := kubernetesapi.CoreV1()
nodeList, err := coreClient.Nodes().List(metav1.ListOptions{})

This will give me a list of nodes.

Is there an API which returns what "kubectl cluster-info dump" would give. So i can get all the details Programmatically.

  • 写回答

3条回答 默认 最新

  • dongsao8279 2018-10-24 09:27
    关注

    Backup and restore cluster resources:

    https://medium.com/@marekbartik/kubernetes-in-production-snapshotting-cluster-state-41bd767ef14

    Use ark for cluster backup and resotre:

    ark schedule create <SCHEDULE NAME> --schedule "0 7 * * *"
    
    ark restore create --from-backup <BACKUP-NAME>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100