6-6 kubectl apply -f mandatory.yaml

来源:6-6 部署ingress-nginx(下)

yl_testimooc3804939

2021-12-25


[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 "执行完为什么只显示一条?

写回答

2回答

刘果国

2021-12-29

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

0
0

刘果国

2021-12-26

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

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

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

0
9
刘果国
回复
yl_testimooc3804939
我刚更新了https://git.imooc.com/coding-335/course-docs/src/master/6/ingress-nginx-mandatory.yaml,加上了hostnetwork和nodeselector,以最新的为准就行
2021-12-29
共9条回复

Kubernetes生产落地全程实践

一个互联网公司落地Kubernetes全过程点点滴滴

2293 学习 · 2211 问题

查看课程