From 56770d2669eecf72dc4666ca0cb01626dfb64cd0 Mon Sep 17 00:00:00 2001 From: Michael Weibel Date: Mon, 8 Dec 2025 09:05:46 +0100 Subject: [PATCH 1/2] examples: images add `docker.io/` prefix Starting in Kubernetes 1.34 (when using cri-o), the short form is no longer supported. To ensure maximum compatibility, the referenced image names have been adjusted in our examples. --- examples/dns-dual-protocol.yaml | 2 +- examples/external-traffic-policy-local.yml | 2 +- examples/ingress.yaml | 6 +++--- examples/nginx-hello.yml | 4 ++-- examples/proxy-v2-protocol.yml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/dns-dual-protocol.yaml b/examples/dns-dual-protocol.yaml index 21b97c4..af0094a 100644 --- a/examples/dns-dual-protocol.yaml +++ b/examples/dns-dual-protocol.yaml @@ -51,7 +51,7 @@ spec: spec: containers: - name: coredns - image: coredns/coredns:1.11.1 + image: docker.io/coredns/coredns:1.11.1 args: - -conf - /etc/coredns/Corefile diff --git a/examples/external-traffic-policy-local.yml b/examples/external-traffic-policy-local.yml index 8f4e271..86ffc14 100644 --- a/examples/external-traffic-policy-local.yml +++ b/examples/external-traffic-policy-local.yml @@ -41,7 +41,7 @@ spec: spec: containers: - name: hello - image: nginxdemos/hello:plain-text + image: docker.io/nginxdemos/hello:plain-text --- apiVersion: v1 kind: Service diff --git a/examples/ingress.yaml b/examples/ingress.yaml index 25b1bbb..873f072 100644 --- a/examples/ingress.yaml +++ b/examples/ingress.yaml @@ -1,4 +1,4 @@ -# Deploys two nginxdemos/hello:plain-text containers ("blue" and "red") +# Deploys two docker.io/nginxdemos/hello:plain-text containers ("blue" and "red") # and creates ClusterIP services named "blue-svc" and "red-svc" for the # deployments. Additionally, an Ingress resource named "simple" is set # up to route requests for "/red" to "red-svc" service and @@ -37,7 +37,7 @@ spec: app: blue spec: containers: - - image: nginxdemos/hello:plain-text + - image: docker.io/nginxdemos/hello:plain-text name: hello --- apiVersion: v1 @@ -71,7 +71,7 @@ spec: app: red spec: containers: - - image: nginxdemos/hello:plain-text + - image: docker.io/nginxdemos/hello:plain-text name: hello resources: { } --- diff --git a/examples/nginx-hello.yml b/examples/nginx-hello.yml index 306a9fb..36338fe 100644 --- a/examples/nginx-hello.yml +++ b/examples/nginx-hello.yml @@ -1,4 +1,4 @@ -# Deploys the nginxdemos/hello:plain-text container and creates a +# Deploys the docker.io/nginxdemos/hello:plain-text container and creates a # loadbalancer service for it: # # export KUBECONFIG=path/to/kubeconfig @@ -34,7 +34,7 @@ spec: spec: containers: - name: hello - image: nginxdemos/hello:plain-text + image: docker.io/nginxdemos/hello:plain-text --- apiVersion: v1 kind: Service diff --git a/examples/proxy-v2-protocol.yml b/examples/proxy-v2-protocol.yml index b824bba..eec737d 100644 --- a/examples/proxy-v2-protocol.yml +++ b/examples/proxy-v2-protocol.yml @@ -40,7 +40,7 @@ spec: spec: containers: - name: proxy-hello - image: nginxdemos/hello:plain-text + image: docker.io/nginxdemos/hello:plain-text volumeMounts: - name: nginx-config-volume mountPath: /etc/nginx/nginx.conf From e3b3349109df91092c9476ad94948ef5bf4f16bb Mon Sep 17 00:00:00 2001 From: Michael Weibel Date: Mon, 8 Dec 2025 09:06:50 +0100 Subject: [PATCH 2/2] examples: add gateway-api Adds an example using the new gateway-api (backed by cilium), similar to the ingress example. Cilium is used because our test cluster (k8test) already installs cilium. --- examples/gateway-api.yaml | 132 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 examples/gateway-api.yaml diff --git a/examples/gateway-api.yaml b/examples/gateway-api.yaml new file mode 100644 index 0000000..5d8a4e7 --- /dev/null +++ b/examples/gateway-api.yaml @@ -0,0 +1,132 @@ +# Deploys two docker.io/nginxdemos/hello:plain-text containers ("blue" and "red") +# and creates ClusterIP services named "blue-svc" and "red-svc" for the +# deployments. +# Additionally: +# - a Gateway resource named "my-gateway" using Cilium Gateway-API is set up +# - a HTTPRoute named "simple" using "my-gateway" is used to route requests for "/red" to "red-svc" service and +# requests for "/blue" to the "blue-svc" service. +# +# This examples needs cilium with Gateway-API support to be installed, see: +# https://docs.cilium.io/en/stable/network/servicemesh/gateway-api/gateway-api/#gs-gateway-api +# https://gateway-api.sigs.k8s.io/guides/ +# +# Setup using k8test (https://github.com/cloudscale-ch/k8test): +# $ export KUBECONFIG=k8test/cluster/admin.conf +# $ kubectl apply --server-side -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.4.1/experimental-install.yaml +# $ cilium upgrade --set kubeProxyReplacement=true --set gatewayAPI.enabled=true +# $ kubectl apply -f examples/gateway-api.yaml +# +# Wait for `kubectl get gateway my-gateway` to +# show "PROGRAMMED: True", then use the IP address found under "ADDRESS" to connect to the service. +# +# You can also use the following shortcut: +# +# curl http://$(kubectl get gateway my-gateway -o jsonpath='{.status.addresses[0].value}')/blue +# curl http://$(kubectl get gateway my-gateway -o jsonpath='{.status.addresses[0].value}')/red +# +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: blue + name: blue +spec: + replicas: 1 + selector: + matchLabels: + app: blue + template: + metadata: + labels: + app: blue + spec: + containers: + - image: docker.io/nginxdemos/hello:plain-text + name: hello +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: blue + name: blue-svc +spec: + ports: + - port: 80 + protocol: TCP + targetPort: 80 + selector: + app: blue +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: red + name: red +spec: + replicas: 1 + selector: + matchLabels: + app: red + template: + metadata: + labels: + app: red + spec: + containers: + - image: docker.io/nginxdemos/hello:plain-text + name: hello + resources: { } +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: red + name: red-svc +spec: + ports: + - port: 80 + protocol: TCP + targetPort: 80 + selector: + app: red +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: Gateway +metadata: + name: my-gateway +spec: + gatewayClassName: cilium + listeners: + - protocol: HTTP + port: 80 + name: web-gw + allowedRoutes: + namespaces: + from: Same +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: simple +spec: + parentRefs: + - name: my-gateway + rules: + - matches: + - path: + type: Exact + value: /red + backendRefs: + - name: red-svc + port: 80 + - matches: + - path: + type: Exact + value: /blue + backendRefs: + - name: blue-svc + port: 80 \ No newline at end of file