kubeshere创建mysql发生FailedCreate requested: requests.cpu=500m,requests.memory=2000Mi, used: requests.cpu=0,requests.memory=0, limi

newnew 1月前 ⋅ 126 阅读 ⋅ 0 个赞

1.错误日志

create Pod mysql-master-v1-0 in StatefulSet mysql-master-v1 failed error: pods "mysql-master-v1-0" is forbidden: exceeded quota: demo-project, 
requested: requests.cpu=500m,requests.memory=2000Mi, used: requests.cpu=0,requests.memory=0, limited: requests.cpu=10m,requests.memory=1Gi

2.观察关键日志

通过日志看出:需要的StatefulSet mysql-master-v1资源超过了所在namespace的资源上限

requested: requests.cpu=500m,requests.memory=2000Mi, used:
requests.cpu=0,requests.memory=0, limited: requests.cpu=10m,requests.memory=1Gi

3.查看配置文件

3.1关键代码片段

        limits:
          cpu: 10m
          memory: 1000Mi
        requests:
          cpu: 10m
          memory: 1000Mi

3.2 shell重点

shell 注意:requests的cpu和memory的值不能超过requests的的cpu和memory的值

3.3修改后的完整配置文件代码如下:

kind: Pod
apiVersion: v1
metadata:
  name: mysql-master-v1-0
  generateName: mysql-master-v1-
  namespace: demo-project
  labels:
    app: mysql-master
    controller-revision-hash: mysql-master-v1-54fb44d7cc
    statefulset.kubernetes.io/pod-name: mysql-master-v1-0
    version: v1
  annotations:
    cni.projectcalico.org/podIP: 10.233.81.241/32
    cni.projectcalico.org/podIPs: 10.233.81.241/32
    kubesphere.io/containerSecrets: ''
    logging.kubesphere.io/logsidecar-config: '{}'
spec:
  volumes:
    - name: volume-jc02z4
      configMap:
        name: mysql-master-cnf
        items:
          - key: my.cnf
            path: my.cnf
        defaultMode: 420
    - name: volume-anhcvf
      persistentVolumeClaim:
        claimName: mysql-master-pvc
    - name: default-token-6kxfm
      secret:
        secretName: default-token-6kxfm
        defaultMode: 420
  containers:
    - name: mysql-master
      image: 'mysql:5.7'
      ports:
        - name: tcp-3306
          containerPort: 3306
          protocol: TCP
        - name: tcp-33060
          containerPort: 33060
          protocol: TCP
      env:
        - name: MYSQL_ROOT_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mysql-secret
              key: MYSQL_ROOT_PASSWORD
      resources:
        limits:
          cpu: 10m
          memory: 1000Mi
        requests:
          cpu: 10m
          memory: 1000Mi
      volumeMounts:
        - name: volume-jc02z4
          readOnly: true
          mountPath: /etc/mysql
        - name: volume-anhcvf
          mountPath: /var/lib/mysql
        - name: default-token-6kxfm
          readOnly: true
          mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      terminationMessagePath: /dev/termination-log
      terminationMessagePolicy: File
      imagePullPolicy: IfNotPresent
  restartPolicy: Always
  terminationGracePeriodSeconds: 30
  dnsPolicy: ClusterFirst
  serviceAccountName: default
  serviceAccount: default
  nodeName: k8s-node1
  securityContext: {}
  hostname: mysql-master-v1-0
  subdomain: mysql-master
  affinity: {}
  schedulerName: default-scheduler
  tolerations:
    - key: node.kubernetes.io/not-ready
      operator: Exists
      effect: NoExecute
      tolerationSeconds: 300
    - key: node.kubernetes.io/unreachable
      operator: Exists
      effect: NoExecute
      tolerationSeconds: 300
  priority: 0
  enableServiceLinks: true


全部评论: 0

    我有话说:

    微信小程序报错request:fail url not in domain list

    微信小程序报错request:fail url not in domain list 登录小程序后台 https://mp.weixin.qq.com/ 选择开发--开发设置--服务器域名--服务器

    elasticsearch在不断的重启造成的cpu飙升

    有一天测试环境的服务器卡的要死 看看cup已经飙升到了190% 瞬间蒙圈了 我做了这些步骤发现是因为elasticsearch造成的 1.通过top查询cpu占有率最高的进程编号(pid) ps

    java.sql.SQLException: Access denied for user ''@'localhost' (using password: YES)

    今天连接数据库老是报这个错误 java.sql.SQLException: Access denied for user ''@'localhost' (using password: YES

    转 IntelliJ IDEA2020最新注册码

    说一下激活方法: 使用方法: 1、修改host(C:\Windows\System32\drivers\etc\hosts),在hosts文件中,添加以下映射关系: 0.0.0.0 account

    docker笔记7-docker-compose搭建mysql主从复制

    1.配置docker-compose 1.1.上传主docker-compose.yml,主要配置server-id=1,read-only=0,端口号为3306 docker-compose

    送您一个最高2000元的阿里云大礼包,快来领取吧~

    送您一个最高2000元的阿里云大礼包,快来领取吧~ ----> 点击领取阿里云大礼包<----

    kubeshere部署devops-java-sample报错404

    1.错误日志 Starting Kubernetes deployment Loading configuration: /home/jenkins/agent/workspace/demo-devops4hw44/devops-java-sam...

    mysql 批量kill多个进程

    查看进程 show PROCESSLIST; +--------+--------+---------------------+------+---------+------+- | Id     | User  ...

    mysql function生成指定位数且不重复数字

    1.生成指定位数且不重复数字 2.函数结构 CREATE DEFINER=`root`@`%` FUNCTION `fun_sn`(number BIGINT) RETURNS bigint(20) BEGIN DECLARE v_flag TI...

    Spring Boot系列7-SpringBoot+mybatis+druid+TypeHandler

    介绍在SpringBoot中集成mybatis和druid以及自定义TypeHandler 创建数据库表 SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- --------------------...

    时间格式HH:mm:ss或者HH:mm另一种计算思路

    前言:今天看视频每个视频的播放时间格式为mm:ss我想看看这些视频累计起来要多少时间? 分析:这些播放时间是由分钟,秒构成,将批量数据放入集合遍历时通过split将其拆分,再将分钟转化为秒相加则

    mysql GROUP BY去重报错,可以外面在套一层查询

    SELECT * FROM ( SELECT s.id, c.NAME FROM tbl_stu s, tbl_city c WHERE s.id = c.stu ) aa GROUP BY s.id, c.NAME

    mysql循环cursor游标模板

    此模板避免了,cursor循环遍历时候出现最后一次的重复 CREATE DEFINER=`root`@`%` PROCEDURE `proce_test`() BEGIN DECLARE v_col1 VARCHAR(32); DECLARE v...

    土味情话--520准备好了吗?

    1.你知道你和星星有什么区别吗?星星在天上,而你在我心里。 2.来者何人?你的人 4.你累不累啊? 不累啊,可是你都在我脑子里跑了一整天了。 5.莫文蔚的阴天,孙燕姿的雨天,周杰伦的晴天,都不如你和我聊天。 6.我是九,你是三,除了你还是你。 ...

    React安装(用npm或者cnpm)

    1.确保你电脑上有nodeJS,直接下载安装下一步下一步就可以了。 2.打开git或者cmd,如下: ​ 3.创建项目 ​ 4.打开项目运行 ​ 5.在浏览器打开,一般都是

    加入公众号
    加入公众号