请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

6-6 kubectl apply -f mandatory.yaml


[root@node-1 ~]# wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml
--2021-12-25 18:09:34--  https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 0.0.0.0, ::
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|0.0.0.0|:443... failed: Connection refused.
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|::|:443... failed: Connection refused.

[root@node-1 ingress-nginx]# kubectl apply -f mandatory.yaml 
namespace/ingress-nginx created
service/default-http-backend created
configmap/nginx-configuration created
configmap/tcp-services created
configmap/udp-services created
serviceaccount/nginx-ingress-serviceaccount created
Warning: rbac.authorization.k8s.io/v1beta1 ClusterRole is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 ClusterRole
clusterrole.rbac.authorization.k8s.io/nginx-ingress-clusterrole created
**Warning**: rbac.authorization.k8s.io/v1beta1 Role is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 Role
role.rbac.authorization.k8s.io/nginx-ingress-role created
**Warning**: rbac.authorization.k8s.io/v1beta1 RoleBinding is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 RoleBinding
rolebinding.rbac.authorization.k8s.io/nginx-ingress-role-nisa-binding created
Warning: rbac.authorization.k8s.io/v1beta1 ClusterRoleBinding is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 ClusterRoleBinding
clusterrolebinding.rbac.authorization.k8s.io/nginx-ingress-clusterrole-nisa-binding created
**unable to recognize "mandatory.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"
unable to recognize "mandatory.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"**


[root@node-1 ingress-nginx]# kubectl get all -n ingress-nginx 
NAME                           TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
service/default-http-backend   ClusterIP   10.233.60.159   <none>        80/TCP    15m

上述在执行"kubectl apply -f mandatory.yaml "中警告和错误,这是合理的吗?
"kubectl get all -n ingress-nginx "执行完为什么只显示一条?

正在回答 回答被采纳积分+3

2回答

刘果国 2021-12-29 11:02:50

旧版本的也跟新了,也可以使用:https://git.imooc.com/coding-335/course-docs/src/master/5/mandatory.yaml

0 回复 有任何疑惑可以回复我~
刘果国 2021-12-26 22:02:30

警告可以忽略,错误不行,问题在于k8s的版本过高,不支持配置文件的版本了。推荐两种解决方法:

1、去ingress-nginx官网下载新版本的配置

2、修改课程中的配置文件(根据错误提示进行修改即可,主要是api版本问题)

0 回复 有任何疑惑可以回复我~
  • 提问者 yl_testimooc3804939 #1
    我一直用的您提供的版本,没出入啊。kubernetes-v1.20.2.tar.gz。我需要提供哪些信息才能知道我版本跟您的有出入?
    回复 有任何疑惑可以回复我~ 2021-12-27 22:23:20
  • 提问者 yl_testimooc3804939 #2
    而且在https://github.com/kubernetes/ingress-nginx中已经找不到这个文件mandatory.yaml了。
    回复 有任何疑惑可以回复我~ 2021-12-27 22:36:28
  • 刘果国 回复 提问者 yl_testimooc3804939 #3
    刚看了一下,课程里是直接从官方下载的了,没有提供配置文件。现在我把最新的配置加到课程文档中了,可以试一下:https://git.imooc.com/coding-335/course-docs/src/master/6/ingress-nginx-mandatory.yaml
    另外你的mandatory.yaml是从哪里获取的呢?
    回复 有任何疑惑可以回复我~ 2021-12-28 10:09:43
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信