首页 > 其他分享 >安装metrics

安装metrics

时间:2023-06-12 22:37:45浏览次数:38  
标签:name system server metrics io k8s 安装

 

components.yaml如下,改了image和认证,直接复制之后执行 kubectl  create -f  components.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    k8s-app: metrics-server
  name: metrics-server
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    k8s-app: metrics-server
    rbac.authorization.k8s.io/aggregate-to-admin: "true"
    rbac.authorization.k8s.io/aggregate-to-edit: "true"
    rbac.authorization.k8s.io/aggregate-to-view: "true"
  name: system:aggregated-metrics-reader
rules:
- apiGroups:
  - metrics.k8s.io
  resources:
  - pods
  - nodes
  verbs:
  - get
  - list
  - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    k8s-app: metrics-server
  name: system:metrics-server
rules:
- apiGroups:
  - ""
  resources:
  - nodes/metrics
  verbs:
  - get
- apiGroups:
  - ""
  resources:
  - pods
  - nodes
  verbs:
  - get
  - list
  - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  labels:
    k8s-app: metrics-server
  name: metrics-server-auth-reader
  namespace: kube-system
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: extension-apiserver-authentication-reader
subjects:
- kind: ServiceAccount
  name: metrics-server
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    k8s-app: metrics-server
  name: metrics-server:system:auth-delegator
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:auth-delegator
subjects:
- kind: ServiceAccount
  name: metrics-server
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    k8s-app: metrics-server
  name: system:metrics-server
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:metrics-server
subjects:
- kind: ServiceAccount
  name: metrics-server
  namespace: kube-system
---
apiVersion: v1
kind: Service
metadata:
  labels:
    k8s-app: metrics-server
  name: metrics-server
  namespace: kube-system
spec:
  ports:
  - name: https
    port: 443
    protocol: TCP
    targetPort: https
  selector:
    k8s-app: metrics-server
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    k8s-app: metrics-server
  name: metrics-server
  namespace: kube-system
spec:
  selector:
    matchLabels:
      k8s-app: metrics-server
  strategy:
    rollingUpdate:
      maxUnavailable: 0
  template:
    metadata:
      labels:
        k8s-app: metrics-server
    spec:
      containers:
      - args:
        - --cert-dir=/tmp
        - --secure-port=4443
        - --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
        - --kubelet-use-node-status-port
        - --metric-resolution=15s
        - --kubelet-insecure-tls
        image: registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-server:v0.6.1
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /livez
            port: https
            scheme: HTTPS
          periodSeconds: 10
        name: metrics-server
        ports:
        - containerPort: 4443
          name: https
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /readyz
            port: https
            scheme: HTTPS
          initialDelaySeconds: 20
          periodSeconds: 10
        resources:
          requests:
            cpu: 100m
            memory: 200Mi
        securityContext:
          allowPrivilegeEscalation: false
          readOnlyRootFilesystem: true
          runAsNonRoot: true
          runAsUser: 1000
        volumeMounts:
        - mountPath: /tmp
          name: tmp-dir
      nodeSelector:
        kubernetes.io/os: linux
      priorityClassName: system-cluster-critical
      serviceAccountName: metrics-server
      volumes:
      - emptyDir: {}
        name: tmp-dir
---
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
  labels:
    k8s-app: metrics-server
  name: v1beta1.metrics.k8s.io
spec:
  group: metrics.k8s.io
  groupPriorityMinimum: 100
  insecureSkipTLSVerify: true
  service:
    name: metrics-server
    namespace: kube-system
  version: v1beta1
  versionPriority: 100
View Code

 查看

 使用:

 

标签:name,system,server,metrics,io,k8s,安装
From: https://www.cnblogs.com/xiangyu5945/p/17476259.html

相关文章

  • Ubuntu-20.04.6-server安装MySQL实现远程连接
    Ubuntu-20.04.6-server安装MySQL,修改密码安装MySQL一、查看是否安装数据库mysql--version二、更新系统中的所有软件包和存储库sudoaptupdate三、安装Mysql最新版(我这里已经安装好了)sudoaptinstallmysql-server四、安装成功后,mysql--version查看版本五、查......
  • 【Linux】——安装Anaconda后默认不进入conda环境方法
    1安装conda后取消命令行前出现的base,取消每次启动自动激活conda的基础环境。通过将auto_activate_base参数设置为false实现:condaconfig--setauto_activate_basefalse那要进入的话通过condaactivatebase如果反悔了还是希望base一直留着的话通过condaconfig--setau......
  • 关于Digispark安装驱动后插入在设备管理器的“通用串行总线设备”分类下显示为“micro
    依据micronucleus的github和查询到的另一些资料解决了该问题,在此处备份防止遗忘。前往https://zadig.akeo.ie/下载Zadig,然后从micronucleus的github下载micronucleus.cfg。打开Zadig,在菜单栏中选择Device-LoadPresetDevice,选择刚刚下载的cfg,然后在下方点击小箭头选择libusb-w......
  • 达梦数据库最新版安装过程
    达梦数据库最新版安装过程背景好久不用达梦数据库了.都是用的两年前安装好的数据库一直在跑(比较稳定,没太宕机)今天有一个新的机器,里面的达梦数据库版本实在是太低了.想着升级一下版本.本地删除重新搭建.但是没想到,两年没用全都忘记了.之前记录的文档也是各种零散.......
  • Docker 安装 MySQL8 数据库
    创建数据卷mkdir-p/usr/mysql/conf/usr/mysql/datachmod-R755/usr/mysql/创建配置文件vim/usr/mysql/conf/my.cnf:[client]#socket=/usr/mysql/mysqld.sockdefault-character-set=utf8mb4[mysqld]#pid-file=/var/run/mysqld/mysqld.pid#sock......
  • Docker 安装与升级
    卸载旧版本sudoyumremovedocker\docker-client\docker-client-latest\docker-common\docker-latest\docker-latest-logrotate\docker-logrotate\docker-engine/var/lib/docker/的内容,包括image、container、volumes,andnetworks,将被保留。Docker引擎包现......
  • k8s Metrics Server 0.6.x
    资源监控指标Kubernetes系统上的关键指标大体可以分为两个主要组成部分:集群系统本身的指标和容器应用相关的指标。对于集群系统本身相关的监控层面而言,监控整个Kubernetes集群的健康状况是最核心的需求,包括所有工作节点是否运行正常、系统资源容量大小、每个工作节点上运行的容......
  • 【Ubuntu22.04】安装MySQL数据库,修改root用户密码,实现远程访问,
    预备条件本次实验使用静态IP的地址192.168.1.81作为mysql-001服务器地址,并配置为本地域名mysql-001:打开Powershell(Window自带)使用SSH方式连接服务器,用户名test,密码:123456:安装Mysql:更新软件源aptupdate安装MySQL8.0,因为Ubuntu22.04不支持MySQL5.7sudoaptinst......
  • docker安装hbase
    1.拉去镜像拉去前可以使用dockersearchhbase所有你需要的镜像dockerpullharisekhon/hbase2.然后在进行启动dockerrun-d-hhbase\-p2181:2181-p8080:8080-p8085:8085\-p9090:9090-p9095:9095-p16000:16000\-p16010:16010-p16020:16020-p16201:1620......
  • sekiro RPC框架的安装与简单使用(转)
    前言上篇介绍了下平头哥的安装使用,这篇再来介绍下渣总的只狼(sekiro)框架然后再简单讲下如何通过平头哥注入sekiro,实现RPC调用一、sekiro是什么1.简介sekiro是由邓维佳(渣总)写的一个基于长链接和代码注入的API服务暴露框架sekiro即可以用于app逆向,又可以用在js逆向找好注入位......