Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiproject example #115

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added images/multi-cluster-ingress-projects.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
417 changes: 417 additions & 0 deletions ingress/multi-cluster/mci-multi-projects/README.md

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions ingress/multi-cluster/mci-multi-projects/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: whereami
namespace: whereami
spec:
replicas: 2
selector:
matchLabels:
app: whereami
version: v1
template:
metadata:
labels:
app: whereami
spec:
containers:
- name: whereami
image: us-docker.pkg.dev/google-samples/containers/gke/whereami:v1.2.11
ports:
- containerPort: 8080
87 changes: 87 additions & 0 deletions ingress/multi-cluster/mci-multi-projects/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
apiVersion: networking.gke.io/v1
kind: MultiClusterIngress
metadata:
name: foobar-ingress
namespace: multi-cluster-demo
spec:
template:
spec:
backend:
serviceName: default-backend
servicePort: 8080
rules:
- host: foo.example.com
http:
paths:
- backend:
serviceName: foo
servicePort: 8080
- host: bar.example.com
http:
paths:
- backend:
serviceName: bar
servicePort: 8080
---
apiVersion: networking.gke.io/v1
kind: MultiClusterService
metadata:
name: foo
namespace: multi-cluster-demo
spec:
template:
spec:
selector:
app: foo
ports:
- name: http
protocol: TCP
port: 8080
targetPort: 8080
---
apiVersion: networking.gke.io/v1
kind: MultiClusterService
metadata:
name: bar
namespace: multi-cluster-demo
annotations:
beta.cloud.google.com/backend-config: '{"ports": {"8080":"backend-health-check"}}'
spec:
template:
spec:
selector:
app: bar
ports:
- name: http
protocol: TCP
port: 8080
targetPort: 8080
---
apiVersion: networking.gke.io/v1
kind: MultiClusterService
metadata:
name: default-backend
namespace: multi-cluster-demo
annotations:
beta.cloud.google.com/backend-config: '{"default": "backend-health-check"}'
spec:
template:
spec:
selector:
app: default-backend
ports:
- name: http
protocol: TCP
port: 8080
targetPort: 8080
---
apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
name: backend-health-check
namespace: multi-cluster-demo
spec:
healthCheck:
requestPath: /healthz
port: 8080
type: HTTP
6 changes: 6 additions & 0 deletions ingress/multi-cluster/mci-multi-projects/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
istio.io/rev: asm-managed-stable
name: whereami
11 changes: 11 additions & 0 deletions ingress/multi-cluster/mci-multi-projects/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: whereami
namespace: whereami
spec:
selector:
app: whereami
ports:
- port: 80
targetPort: 8080
16 changes: 16 additions & 0 deletions ingress/multi-cluster/mci-multi-projects/virtual_service_app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: frontend
namespace: whereami
spec:
hosts:
- "whereami.example.com"
gateways:
- mesh
http:
- route:
- destination:
host: whereami
port:
number: 80
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: frontend
namespace: whereami
spec:
hosts:
- "whereami.example.com"
gateways:
- asmingress/ingressgateway
http:
- route:
- destination:
host: whereami
port:
number: 80