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/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 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