kubeshere部署devops-java-sample报错404

newnew 1月前 ⋅ 125 阅读 ⋅ 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

    Java如何返回多个值

    我有一个方法,需要返回多个对象。可是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然后重新拖进

    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不断重启 为什么会磁盘空间突然不足?一般是项目

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

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

    ...jar中没有主清单属性, spring boot或者spring cloud的maven项目 java -jar test.jar 方式启动:...jar中没有主清单属性

    1.spring boot或者spring cloud的maven项目老是遇到问题...jar中没有主清单属性 2.解决方法:在pom.xml中添加如下代码 <build> <plugins> <plugin>...

    我向20k+以上的java高级开发工程师提了那些面试问题

    公司需要一位java高级开发工程师,找到我去面试。我回忆了一下,记录部分我的提问,如果大家刚兴趣可以给我留言,我视情况看是否继续补充,或者是否提供答案。 1.聊聊您对spring Boot一些见解

    javaweb常用命令

    1.创建mvn javaweb工程命令 mvn archetype:generate -DgroupId=cn.tiankonglan.seckill -DartifactId=seckill -Dpackage=cn.tiankonglan.s...

    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

    java实现判断是手机端还是pc端访问, nginx实现判断是手机端还是pc端访问

    1.编写工具类 /** * @author 缘分哥 * @description 判断是否移动端工具 */ public class ClientUtils { public static String[] mobileAgents = { "i...

    加入公众号
    加入公众号