k8s restful api 访问
curl -u admin:admin "https://localhost:6443/api/v1/nodes/{nodename}" -k
curl -u admin:admin "https://localhost:6443/api/v1/nodes/tensorflow1" -k..."status": {"capacity": {"cpu": "4","memory": "7970316Ki","pods": "110"},"allocatable": {"cpu": "4","memory": "7867916Ki","pods": "110"},
...
curl -u {username}:{password} "https://{k8s_master_ip}:6443/api/v1/namespaces/{namespace}/resourcequotas/" -k
[root@tensorflow1 info]# curl -u admin:admin "https://localhost:6443/api/v1/namespaces/default/resourcequotas/" -k...
"status": {"hard": {"limits.cpu": "2","limits.memory": "6Gi","pods": "20","requests.cpu": "1","requests.memory": "1Gi"},"used": {"limits.cpu": "400m","limits.memory": "1Gi","pods": "2","requests.cpu": "200m","requests.memory": "512Mi"}
}
...
curl -u {username}:{password} "https://{k8s_master_ip}:6443/apis/metrics.k8s.io/v1beta1/nodes" -k
curl -u admin:admin "https://192.168.1.138:6443/apis/metrics.k8s.io/v1beta1/nodes" -k{"kind": "NodeMetricsList","apiVersion": "metrics.k8s.io/v1beta1","metadata": {"selfLink": "/apis/metrics.k8s.io/v1beta1/nodes"},"items": [
...{"metadata": {"name": "tensorflow1","selfLink": "/apis/metrics.k8s.io/v1beta1/nodes/tensorflow1","creationTimestamp": "2018-04-09T08:44:17Z"},"timestamp": "2018-04-09T08:44:00Z","window": "1m0s","usage": {"cpu": "265m","memory": "3448228Ki"}}
...]
}
curl -u {username}:{password} "https://{k8s_master_ip}:6443/apis/metrics.k8s.io/v1beta1/namespaces/{namespace}/pods" -k
curl -u admin:admin "https://192.168.1.138:6443/apis/metrics.k8s.io/v1beta1/namespaces/default/pods" -k{"kind": "PodMetricsList","apiVersion": "metrics.k8s.io/v1beta1","metadata": {"selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/default/pods"},"items": [
...{"metadata": {"name": "tensorflow-worker-rc-998wf","namespace": "default","selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/default/pods/tensorflow-worker-rc-998wf","creationTimestamp": "2018-04-09T08:52:38Z"},"timestamp": "2018-04-09T08:52:00Z","window": "1m0s","containers": [{"name": "worker","usage": {"cpu": "0","memory": "39964Ki"}}]}
...]
}
[root@tensorflow1 ~]# kubectl top
Display Resource (CPU/Memory/Storage) usage.The top command allows you to see the resource consumption for nodes or pods.This command requires Heapster to be correctly configured and working on the server.Available Commands:node Display Resource (CPU/Memory/Storage) usage of nodespod Display Resource (CPU/Memory/Storage) usage of podsUsage:kubectl top [options]Use "kubectl <command> --help" for more information about a given command.
Use "kubectl options" for a list of global command-line options (applies to all commands).
[root@tensorflow1 ~]# kubectl top pod --help
Display Resource (CPU/Memory/Storage) usage of pods.The 'top pod' command allows you to see the resource consumption of pods.Due to the metrics pipeline delay, they may be unavailable for a few minutes since pod creation.Aliases:
pod, pods, poExamples:# Show metrics for all pods in the default namespacekubectl top pod# Show metrics for all pods in the given namespacekubectl top pod --namespace=NAMESPACE# Show metrics for a given pod and its containerskubectl top pod POD_NAME --containers# Show metrics for the pods defined by label name=myLabelkubectl top pod -l name=myLabelOptions:--all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current
context is ignored even if specified with --namespace.--containers=false: If present, print usage of containers within a pod.--heapster-namespace='kube-system': Namespace Heapster service is located in--heapster-port='': Port name in service to use--heapster-scheme='http': Scheme (http or https) to connect to Heapster as--heapster-service='heapster': Name of Heapster service-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)Usage:kubectl top pod [NAME | -l label] [options]Use "kubectl options" for a list of global command-line options (applies to all commands).
[root@tensorflow1 influxdb]kubectl cluster-info
Kubernetes master is running at https://192.168.1.138:6443
Heapster is running at https://192.168.1.138:6443/api/v1/namespaces/kube-system/services/heapster/proxy
KubeDNS is running at https://192.168.1.138:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
monitoring-grafana is running at https://192.168.1.138:6443/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
monitoring-influxdb is running at https://192.168.1.138:6443/api/v1/namespaces/kube-system/services/monitoring-influxdb/proxycurl -u admin:admin "https://192.168.1.138:6443/api/v1/namespaces/kube-system/services/heapster/proxy/api/v1/model/namespaces/" -kcurl -u admin:admin "https://192.168.1.138:6443/api/v1/namespaces/kube-system/services/heapster/proxy/api/v1/model/namespaces/default/metrics" -k
["memory/request","memory/limit","cpu/usage_rate","memory/usage","cpu/request","cpu/limit"
]
[root@tensorflow1 influxdb]# curl -u admin:admin "https://192.168.1.138:6443/api/v1/namespaces/kube-system/services/heapster/proxy/api/v1/model/namespaces/default/metrics/memory/usage" -k
{"metrics": [...{"timestamp": "2018-04-09T07:45:00Z","value": 81121280},{"timestamp": "2018-04-09T07:46:00Z","value": 81121280}...],"latestTimestamp": "2018-04-09T07:46:00Z"
}
k8s restful api 访问相关推荐
- api k8s restful 创建pods_k8s restful api 访问-阿里云开发者社区
restful api访问k8s集群,增删改 查信息,做界面二次开发. 需要预先创建访问权限的配置. 下面罗列部分api curl -u admin:admin "https://local ...
- 使用Postman访问k8s RESTful API
使用Postman 访问 Kubernetes RESTful API 创建ServiceAccount chinw@master:sudo kubectl create sa apiviewer c ...
- MongoDB最简单的入门教程之五-通过Restful API访问MongoDB
通过前面四篇的学习,我们已经在本地安装了一个MongoDB数据库,并且通过一个简单的Spring boot应用的单元测试,插入了几条记录到MongoDB中,并通过MongoDB Compass查看到了 ...
- 容器化单页面应用中RESTful API的访问
最近在工作中,需要让运行在容器中的单页面应用程序能够访问外部的RESTful API.这个需求看起来并不困难,不过实现起来还是有些曲折的.在此,我就将这部分内容总结一下. 在入正题之前,有个一问题,就 ...
- 访问页面升级访问_容器化单页面应用中RESTful API的访问
最近在工作中,需要让运行在容器中的单页面应用程序能够访问外部的RESTful API.这个需求看起来并不困难,不过实现起来还是有些曲折的.在此,我就将这部分内容总结一下. 在入正题之前,有个一问题,就 ...
- dubbo2.5-spring4-mybastis3.2-springmvc4-mongodb3.4-redis3(十)之Spring MVC中使用 Swagger2 构建Restful API...
版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/u010046908/article/details/55047193 1.Swagger2是什么? ...
- Spring MVC中使用 Swagger2 构建Restful API
0.Spring MVC配置文件中的配置 [java] view plain copy <!-- 设置使用注解的类所在的jar包,只加载controller类 --> <span s ...
- react 访问后端_react前端用nginx怎么配置跨域访问后端restful api?
开发机器是windows,windows中安装了centos虚拟机做restful api服务器,在浏览器中可以正常访问该api服务器: http://192.168.33.3:8080/articl ...
- springMvc接口开发--对访问的restful api接口进行拦截实现功能扩展
1.视频参加Spring Security开发安全的REST服务\PART1\PART1 3-7 使用切片拦截REST服务三通it学院-www.santongit.com-.mp4 讲的比较的经典,后 ...
最新文章
- python中 str.strip()用法
- 模型验证的常用“武器”—ROC和AUC peiyang
- oracle查看被锁的表以及解锁表
- mysql错误码 1045_MySql 错误代码 1045
- 用手动创建新的script标签的方式,实现JavaScript脚本的异步加载
- 今天的几点感悟_20160429
- 安卓第一阶段实训项目:基于存储卡音乐播放器(更新中……)
- 局域网ip冲突检测工具_软考网络工程师之局域网与城域网(无线局域网,网桥,VLAN)...
- android 图库分析,Android开发之ImageSwitcher相册功能实例分析
- 蓝牙耳机哪个牌子好?国庆出游蓝牙耳机推荐
- TBtools:基因家族分析简单流程
- The following signatures couldn‘t be verified because the public key is not available: NO_PUBKEY
- 趋势判研:基于Web3.0的智能生态体——保险科技生态建设
- 2008年SP产业发展趋势
- pycharm学习第二章节
- 完整简单c语言程序代码,一些简单的C语言程序代码.docx
- Electron是什么以及可以做什么
- Esper学习笔记五:EPL语法(3)
- Echarts关于仪表盘
- 安卓pdf阅读器_电子书阅读器选购攻略:求求你,不要再问买哪一款了!