Created
April 3, 2025 08:07
-
-
Save bittrance/cb6c43d1f759d70b4613983d483098e2 to your computer and use it in GitHub Desktop.
Istio waypoint proxy with (almost) pure Gateway API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: gateway.networking.k8s.io/v1 | |
kind: HTTPRoute | |
metadata: | |
name: hello-backend | |
namespace: waypoint-test | |
spec: | |
parentRefs: | |
- name: hello-upstream | |
port: 8082 | |
kind: Service | |
group: "" | |
rules: | |
- backendRefs: | |
- name: hello-backend | |
port: 8083 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: hello-backend | |
namespace: waypoint-test | |
spec: | |
selector: | |
app: caddy-backend | |
ports: | |
- name: http | |
port: 8083 | |
targetPort: 8084 | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello-backend | |
namespace: waypoint-test | |
labels: | |
app: caddy-backend | |
spec: | |
selector: | |
matchLabels: | |
app: caddy-backend | |
template: | |
metadata: | |
labels: | |
app: caddy-backend | |
spec: | |
containers: | |
- name: caddy | |
image: caddy:2.9.1-alpine | |
command: | |
- caddy | |
- respond | |
- --listen | |
- :8084 | |
- --body | |
- Hello this! | |
- --access-log | |
ports: | |
- containerPort: 8084 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: waypoint-test | |
labels: | |
istio.io/use-waypoint: hello-waypoint | |
--- | |
apiVersion: gateway.networking.k8s.io/v1beta1 | |
kind: Gateway | |
metadata: | |
name: hello-gateway | |
namespace: waypoint-test | |
spec: | |
gatewayClassName: istio | |
listeners: | |
- name: http | |
protocol: HTTP | |
port: 80 | |
--- | |
apiVersion: gateway.networking.k8s.io/v1 | |
kind: HTTPRoute | |
metadata: | |
name: hello-waypoint | |
namespace: waypoint-test | |
spec: | |
parentRefs: | |
- name: hello-gateway | |
rules: | |
- backendRefs: | |
- name: hello-waypoint | |
port: 8080 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: hello-waypoint | |
namespace: waypoint-test | |
spec: | |
selector: | |
app: caddy-waypoint | |
ports: | |
- name: http | |
port: 8080 | |
targetPort: 8081 | |
--- | |
apiVersion: apps/v1 | |
kind: DaemonSet | |
metadata: | |
name: hello-waypoint | |
namespace: waypoint-test | |
labels: | |
app: caddy-waypoint | |
spec: | |
selector: | |
matchLabels: | |
app: caddy-waypoint | |
template: | |
metadata: | |
labels: | |
app: caddy-waypoint | |
spec: | |
containers: | |
- name: caddy | |
image: caddy:2.9.1-alpine | |
command: | |
- caddy | |
- reverse-proxy | |
- --from | |
- :8081 | |
- --to | |
- hello-upstream:8082 | |
- --header-down | |
- "X-Greeting: Hello waypoint!" | |
- --access-log | |
ports: | |
- containerPort: 8081 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: hello-upstream | |
namespace: waypoint-test | |
spec: | |
ports: | |
- name: http | |
port: 8082 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment