知识改变命运! kubeshere部署devops-java-sample报错404_newnew-lskyf博客社区

kubeshere部署devops-java-sample报错404

newnew 1年前 ⋅ 1430 阅读 ⋅ 0 个赞

1.错误日志

Starting Kubernetes deployment
Loading configuration: /home/jenkins/agent/workspace/demo-devops4hw44/devops-java-sample/deploy/dev-ol/devops-sample-svc.yaml
ERROR: ERROR: java.lang.RuntimeException: io.kubernetes.client.openapi.ApiException: Not Found
hudson.remoting.ProxyException: java.lang.RuntimeException: io.kubernetes.client.openapi.ApiException: Not Found
	at com.microsoft.jenkins.kubernetes.wrapper.ResourceManager.handleApiException(ResourceManager.java:193)
	at com.microsoft.jenkins.kubernetes.wrapper.V1ResourceManager$ServiceUpdater.createResource(V1ResourceManager.java:461)
	at com.microsoft.jenkins.kubernetes.wrapper.V1ResourceManager$ServiceUpdater.createResource(V1ResourceManager.java:379)
	at com.microsoft.jenkins.kubernetes.wrapper.ResourceManager$ResourceUpdater.createOrApply(ResourceManager.java:100)
	at com.microsoft.jenkins.kubernetes.wrapper.KubernetesClientWrapper.handleResource(KubernetesClientWrapper.java:289)
	at com.microsoft.jenkins.kubernetes.wrapper.KubernetesClientWrapper.apply(KubernetesClientWrapper.java:256)
	at com.microsoft.jenkins.kubernetes.command.DeploymentCommand$DeploymentTask.doCall(DeploymentCommand.java:172)
	at com.microsoft.jenkins.kubernetes.command.DeploymentCommand$DeploymentTask.call(DeploymentCommand.java:124)
	at com.microsoft.jenkins.kubernetes.command.DeploymentCommand$DeploymentTask.call(DeploymentCommand.java:106)
	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
	at java.lang.Thread.run(Thread.java:748)
	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 10.233.111.64/10.233.111.64:55032
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
		at hudson.remoting.Channel.call(Channel.java:957)
		at hudson.FilePath.act(FilePath.java:1160)
		at com.microsoft.jenkins.kubernetes.command.DeploymentCommand.execute(DeploymentCommand.java:68)
		at com.microsoft.jenkins.kubernetes.command.DeploymentCommand.execute(DeploymentCommand.java:45)
		at com.microsoft.jenkins.azurecommons.command.CommandService.runCommand(CommandService.java:88)
		at com.microsoft.jenkins.azurecommons.command.CommandService.execute(CommandService.java:96)
		at com.microsoft.jenkins.azurecommons.command.CommandService.executeCommands(CommandService.java:75)
		at com.microsoft.jenkins.azurecommons.command.BaseCommandContext.executeCommands(BaseCommandContext.java:77)
		at com.microsoft.jenkins.kubernetes.KubernetesDeploy.perform(KubernetesDeploy.java:42)
		at com.microsoft.jenkins.azurecommons.command.SimpleBuildStepExecution.run(SimpleBuildStepExecution.java:54)
		at com.microsoft.jenkins.azurecommons.command.SimpleBuildStepExecution.run(SimpleBuildStepExecution.java:35)
		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
		at java.util.concurrent.FutureTask.run(FutureTask.java:266)
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
		... 1 more
Caused by: hudson.remoting.ProxyException: io.kubernetes.client.openapi.ApiException: Not Found
	at io.kubernetes.client.openapi.ApiClient.handleResponse(ApiClient.java:979)
	at io.kubernetes.client.openapi.ApiClient.execute(ApiClient.java:895)
	at io.kubernetes.client.openapi.apis.CoreV1Api.createNamespacedServiceWithHttpInfo(CoreV1Api.java:9012)
	at io.kubernetes.client.openapi.apis.CoreV1Api.createNamespacedService(CoreV1Api.java:8986)
	at com.microsoft.jenkins.kubernetes.wrapper.V1ResourceManager$ServiceUpdater.createResource(V1ResourceManager.java:458)
	... 16 more
Api call failed with code 404, detailed message: {
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {
    
  },
  "status": "Failure",
  "message": "namespaces \"kubesphere-sample-dev\" not found",
  "reason": "NotFound",
  "details": {
    "name": "kubesphere-sample-dev",
    "kind": "namespaces"
  },
  "code": 404
}
Kubernetes deployment ended with HasError

2.观察关键日志

通过 "message": "namespaces "kubesphere-sample-dev" not found"日志看出大概意思是kubesphere-sample-dev命名空间没有找到

3.确认是否有kubesphere-sample-dev

执行命令shell kubectl get namespaces得到如下命名空间

NAME                           STATUS   AGE
default                        Active   3d14h
demo-devops4hw44               Active   38h
demo-project                   Active   3d12h
kube-node-lease                Active   3d14h
kube-public                    Active   3d14h
kube-system                    Active   3d14h
kubesphere-controls-system     Active   3d14h
kubesphere-devops-system       Active   3d12h
kubesphere-monitoring-system   Active   3d14h
kubesphere-system              Active   3d14h

3.1 可以确定确实没有kubesphere-sample-dev

4.解决问题:创建kubesphere-sample-dev 命名空间

既然没有那我们就创建一个试试

4.1 执行如下命令


cat <<EOF > kubesphere-sample-dev.yaml
apiVersion: v1
kind: Namespace
metadata:
   name: kubesphere-sample-dev2
   labels:
     name: kubesphere-sample-dev2
EOF
kubectl create -f kubesphere-sample-dev.yaml

4.2 如果namespace创建有问题可以使用如下删除命令重新创建

kubectl delete namespace  kubesphere-sample-dev

全部评论: 0

    我有话说:

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

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

    win10升级后vitrulbox虚拟机启动:Failed to open/create the internal network 'HostInterfaceNetworking

    win10升级后虚拟机启动: Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox

    spring boot项目本地没问题,部署到服务器mysql:errorCode 0, state 08S01

    错误现象: 在开发的时候没有,能正常运行并且能连接服务器。但是部署到服务器。 错误如下: 2023-04-07 11:54:40.617 ERROR 7 --- [reate

    Java 平台标准版文档

    您在台式机和服务器上开发和部署 Java 应用程...

    jenkins 执行maven命令 Caused by: java.io.FileNotFoundException: /var/jenkins_home/jdk/lib/tzdb.dat

    执行jenkins使用maven命令打包的时候: Caused by: java.io.FileNotFoundException: /var/jenkins_home/jdk/lib/tzdb

    Java如何返回多个值

      我有一个方法,需要返回多个对象。可是Java只能返回一个值,请问如何才能返回多个值呢?

    Stable Diffusion|安装过程中常见解决方法

    转自:https://openai.wiki/stable-diffusion-error.html 如何查看 在你安装时可能经常遇到各种各样的问题,但是对于一堆陌生的英文和各种各样的错误,大家

    java高频面试题-java类加载需要经历哪些过程?

    本篇文章是基于JDK 8及以上版本的Java类加载过程。 Java类加载过程 Java类加载是Java虚拟机(JVM)执行过程中的关键步骤。它涉及Java类的动态加载、链接和初始化。在本文中,我们将

    java程序员必须知道的网站

    sping官网 spring的各种框架给java开发带来的便利至今无法撼动 github 有各种语言的项目都有托管在上面,各种demo使用起来省心省力 stackoverflow 各种程序所遇到的

    springboot项目运行在docker中 file.exists()返回false没有

      springboot项目运行在docker中 file.exists()返回false没有   表现:在windows运行正确,但是打包后运行在docker容器中找不到

    chrome 离线扩展程序安装 程序包无效:"CRX_HEADER_INVALID"

    安装chrome离线扩展程序时候:程序包无效:"CRX_HEADER_INVALID"导致crx扩展程序无法正常安装。 怎么办呢? 解决方法:将crx文件后缀.crx改为.zip然后重新拖进

    java高频面试题-Spring中Bean的生命周期

    Spring中Bean的生命周期有如下过程: 1.Bean容器找到配置文件中Spring Bean的定义。 2.Bean容器利用Java Reflection API创建一个Bean的实例。 3

    mybatis 映射属性部分值为null的另一种特殊情况

    今天遇到一个问题mybatis映射到Java属性部分数据没有值为null 表现其他Integer类型都有值,唯独String类型没有值 疑问一个简单的映射为什么没有值呢?平时都是这样干的。都没有问题

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

    1.错误日志 create Pod mysql-master-v1-0 in StatefulSet mysql-master-v1 failed error: pods "mysql-master-v1-0" is forbidden: exc...

    docker部署的zookeeper连接超时不断重启

    经常发现docker部署的zookeeper连接超时 登上服务器发现zookeeper总是不断的启动: 一般原因是磁盘空间不足了会造成zookeeper不断重启 为什么会磁盘空间突然不足?一般是项目

    加入公众号
    加入公众号