-
-
Save InAnimaTe/9aa4838fe8f18822aa17a8b23750b541 to your computer and use it in GitHub Desktop.
| apiVersion: networking.k8s.io/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: engage-ingress | |
| annotations: | |
| kubernetes.io/ingress.class: nginx-external | |
| spec: | |
| rules: | |
| - host: engage.staging.example.com | |
| http: | |
| paths: | |
| - path: / | |
| backend: | |
| serviceName: engage | |
| servicePort: 80 | |
| tls: | |
| - hosts: | |
| - engage.staging.example.com |
| apiVersion: extensions/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| annotations: | |
| kubectl.kubernetes.io/last-applied-configuration: | | |
| {"apiVersion":"networking.k8s.io/v1beta1","kind":"Ingress","metadata":{"annotations":{"kubernetes.io/ingress.class":"nginx-external"},"name":"engage-ingress","namespace":"default"},"spec":{"rules":[{"host":"engage.playground.example.com","http":{"paths":[{"backend":{"serviceName":"engage","servicePort":80},"path":"/"}]}}],"tls":[{"hosts":["engage.playground.example.com"}]}} | |
| kubernetes.io/ingress.class: nginx-external | |
| creationTimestamp: "2020-05-06T00:56:19Z" | |
| generation: 1 | |
| name: engage-ingress | |
| namespace: default | |
| resourceVersion: "145130300" | |
| selfLink: /apis/extensions/v1beta1/namespaces/default/ingresses/engage-ingress | |
| uid: 488bca0c-34cf-4122-a350-2bde500d0f3a | |
| spec: | |
| rules: | |
| - host: engage.playground.example.com | |
| http: | |
| paths: | |
| - backend: | |
| serviceName: engage | |
| servicePort: 80 | |
| path: / | |
| tls: | |
| - hosts: | |
| - engage.playground.example.com | |
| status: | |
| loadBalancer: | |
| ingress: | |
| - hostname: a0901a268b2281examplee2ffbd16e2-7baadc2e29c1d5ab.elb.us-east-1.amazonaws.com |
Amazing answers can be seen here: https://kubernetes.slack.com/archives/C09QYUH5W/p1588728259459200
Thanks to Liggit and others on Sig-Network!!
From Liggit in slack linked conversation above (for those who don't like to click on "one-weird-trick" links to slack conversations:
kubectl get ingressis ambiguous and prefers the first ingress resource found in APIs listed in discovery, which isextensions/v1beta1for backwards compatibility
kubectl get ingress.v1beta1.networking.k8s.iofetches the same resource in the new API group
the API server can translate any persisted ingress resource into either version and returns it in the version you request
you can add--v=6to the kubectl invocation you see the actual URLs being requesteddiscovery is dynamic
so as soon as the server is not serving extensions/v1beta1 ingress, kubectl will prefer thenetworking.k8s.ioversion
and since the extensions/v1beta1 days, we now put the most stable version first in discovery
so unqualifiedkubectl get ingresskubectl invocations will get v1 ingress (onceextensions/v1beta1is gone)
extensions/v1beta1was the exception where a beta version had higher priority, because people hadn't started writing version-aware kubectl invocations yet (because we hadn't given them a way to at that point)
See also: https://github.com/FairwindsOps/pluto#purpose
- API dynamic nature explained: kubernetes/kubernetes#58131 (comment)
- k8s Deprecation policy: https://kubernetes.io/docs/reference/using-api/deprecation-policy/
kubectl apply -f engage-ing.yamlkubectl get ing/engage-ingress -o yamlWhy is
apiVersion: extensions/v1beta1when what I imported isnetworking.k8s.io/v1beta1??