k8s使用kubectl创建tomcat访问页面出现404页面

出现页面404,发布目录出问题,最新版的Tomcat镜像,webapps里是空的

1、进入容器中
[root@k8s-master prome]# kubectl  exec -it tomcat-deployment-795d745898-fvswl /bin/bash
root@tomcat-deployment-795d745898-fvswl:/usr/local/tomcat# ls
BUILDING.txt	 NOTICE		RUNNING.txt  lib	     temp	   work
CONTRIBUTING.md  README.md	bin	     logs	     webapps
LICENSE		 RELEASE-NOTES	conf	     native-jni-lib  webapps.dist
2、修改目录名
root@tomcat-deployment-795d745898-fvswl:/usr/local/tomcat# mv webapps webapps2
root@tomcat-deployment-795d745898-fvswl:/usr/local/tomcat# mv webapps.dist/ webapps
root@tomcat-deployment-795d745898-fvswl:/usr/local/tomcat# ls webapps
ROOT  docs  examples  host-manager  manager
3、一切正常,可以访问

你可能感兴趣的:(k8s,tomcat,k8s,kubernetes)