抱怨“扩展名/v1beta1入口已过时"的日志 [英] Logs complaining "extensions/v1beta1 Ingress is deprecated"
问题描述
Kubernetes的新手.
Very new to Kubernetes.
我要添加一个Ingres,如下所示:
I'm adding an Ingres as follows:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: cheddar
spec:
rules:
- host: cheddar.213.215.191.78.nip.io
http:
paths:
- backend:
service:
name: cheddar
port:
number: 80
path: /
pathType: ImplementationSpecific
但是日志抱怨:
W0205 15:14:07.482439 1 warnings.go:67] extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
time="2021-02-05T15:14:07Z" level=info msg="Updated ingress status" namespace=default ingress=cheddar
W0205 15:18:19.104225 1 warnings.go:67] networking.k8s.io/v1beta1 IngressClass is deprecated in v1.19+, unavailable in v1.22+; use networking.k8s.io/v1 IngressClassList
为什么?正确使用的Yaml是什么?我目前正在使用microk8s 1.20
Why? What's the correct yaml to use? I'm currently on microk8s 1.20
推荐答案
我已经分析了您的问题,并得出以下结论:
I have analyzed you issue and came to the following conclusions:
- Ingress将正常运行,您看到的这些警告只是为了通知您可用的api版本.您不必为此担心.我也看到了相同的警告:
@microk8s:~$ kubectl describe ing
Warning: extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
- As for the "why" this is happening even when you use
apiVersion: networking.k8s.io/v1
, I have found the following explanation:
这按预期工作.创建入口对象时,它可以可以通过任何版本进行读取(服务器会处理将其转换为要求的版本).
kubectl获取入口
是一个模糊的请求,因为它并不表示需要读取哪个版本.
This is working as expected. When you create an ingress object, it can be read via any version (the server handles converting into the requested version).
kubectl get ingress
is an ambiguous request, since it does not indicate what version is desired to be read.
发出模棱两可的请求时,kubectl搜索发现文档服务器返回以查找包含以下内容的第一个组/版本指定的资源.
When an ambiguous request is made, kubectl searches the discovery docs returned by the server to find the first group/version that contains the specified resource.
出于兼容性原因, extensions/v1beta1
一直以来都是优于所有其他API版本.现在,只有入口该组中剩余的资源,已弃用,并具有GA替换,1.20将优先处理,以便从 networking.k8s.io/v1
中读取 kubectl get ingress
,但从1.19服务器上读取仍将遵循历史优先级.
For compatibility reasons, extensions/v1beta1
has historically been
preferred over all other api versions. Now that ingress is the only
resource remaining in that group, and is deprecated and has a GA
replacement, 1.20 will drop it in priority so that kubectl get ingress
would read from networking.k8s.io/v1
, but a 1.19 server
will still follow the historical priority.
如果您想阅读特定版本,则可以获取请求(例如 kubectl get ingresses.v1.networking.k8s.io
...)或可以传递清单文件以请求与文件( kubectl get -f ing.yaml -o yaml
)
If you want to read a specific version, you can qualify the get
request (like kubectl get ingresses.v1.networking.k8s.io
...) or can
pass in a manifest file to request the same version specified in the
file (kubectl get -f ing.yaml -o yaml
)
长话短说:尽管使用了正确的 apiVersion
事实,但已弃用的版本仍被视为默认版本,因此会生成您遇到的警告.
Long story short: despite the fact of using the proper apiVersion
, the deprecated one is still being seen as the the default one and thus generating the Warning you experience.
我还看到最近仍在进行更改,所以我认为仍在进行中.
I also see that changes are still being made recently so I assume that it is still being worked on.
这篇关于抱怨“扩展名/v1beta1入口已过时"的日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!