Skip to content

Commit 9739ab8

Browse files
committed
Checkpoint. GWAPI resources are created successfully
1 parent 2c236a0 commit 9739ab8

File tree

9 files changed

+119
-24
lines changed

9 files changed

+119
-24
lines changed

Makefile.local

Lines changed: 80 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ wait-ready-external-dns-test:
4343
until kubectl wait pods -l app.kubernetes.io/instance=external-dns --for condition=Ready --timeout=120s ; do echo "."; sleep 1; done
4444

4545
#################
46-
ifeq ($(GATEWAY_API_VERSION),)
47-
GATEWAY_API_VERSION=v0.6.0
48-
endif
46+
GATEWAY_API_VERSION ?= v0.6.0
4947

5048
.PHONY: gateway-api-upstream-get
5149
gateway-api-upstream-get:
@@ -72,10 +70,16 @@ delete-cluster:
7270
kind delete cluster --name kind-gwc-dev-cluster
7371

7472
#################
73+
ISTIO_VERSION ?= 1.16.1
74+
7575
.PHONY: deploy-istio
7676
deploy-istio:
77-
helm upgrade -i --repo https://istio-release.storage.googleapis.com/charts base base --version 1.16.1 -n istio-system --create-namespace
78-
helm upgrade -i --repo https://istio-release.storage.googleapis.com/charts istiod istiod --version 1.16.1 -n istio-system
77+
helm upgrade -i --repo https://istio-release.storage.googleapis.com/charts base base --version ${ISTIO_VERSION} -n istio-system --create-namespace
78+
helm upgrade -i --repo https://istio-release.storage.googleapis.com/charts istiod istiod --version ${ISTIO_VERSION} -n istio-system
79+
80+
.PHONY: undeploy-istio
81+
undeploy-istio:
82+
helm uninstall -n istio-system istiod
7983

8084
#################
8185
.PHONY: cluster-load-controller-image
@@ -143,25 +147,55 @@ ca-cert-secret-create:
143147
kubectl -n cert-manager create secret tls ca-key-pair --cert=foo-example-com.crt --key=foo-example-com.key
144148

145149
#################
150+
AWS_LOAD_BALANCER_CONTROLLER_VERSION ?= v2.4.5
151+
AWS_LOAD_BALANCER_CONTROLLER_CHART_VERSION ?= v1.4.6
152+
# Note, template also require CLUSTERNAME and AWS_LOAD_BALANCER_CONTROLLER_IAM_ROLE_ARN
153+
146154
.PHONY: deploy-aws-load-balancer-controller-crds
147155
deploy-aws-load-balancer-controller-crds:
148-
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.5/helm/aws-load-balancer-controller/crds/crds.yaml
156+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/${AWS_LOAD_BALANCER_CONTROLLER_VERSION}/helm/aws-load-balancer-controller/crds/crds.yaml
157+
158+
.PHONY: deploy-aws-load-balancer-controller
159+
deploy-aws-load-balancer-controller:
160+
cat test-data/aws-load-balancer-controller-values.yaml_tpl | envsubst > aws-load-balancer-controller-values.yaml
161+
helm upgrade -i --repo https://aws.github.io/eks-charts aws-load-balancer-controller aws-load-balancer-controller --version ${AWS_LOAD_BALANCER_CONTROLLER_CHART_VERSION} -n kube-system --set installCRDs=false --values aws-load-balancer-controller-values.yaml
162+
163+
.PHONY: undeploy-aws-load-balancer-controller
164+
undeploy-aws-load-balancer-controller:
165+
helm uninstall -n kube-system aws-load-balancer-controller
149166

150167
#################
168+
CROSSPLANE_VERSION ?= v1.11.0
169+
151170
.PHONY: deploy-crossplane
152171
deploy-crossplane:
153-
helm upgrade -i --repo https://charts.crossplane.io/stable crossplane crossplane --version v1.11.0 -n crossplane-system --create-namespace
172+
helm upgrade -i --repo https://charts.crossplane.io/stable crossplane crossplane --version ${CROSSPLANE_VERSION} -n crossplane-system --create-namespace
173+
174+
.PHONY: undeploy-crossplane
175+
undeploy-crossplane:
176+
helm uninstall crossplane -n crossplane-system
177+
178+
CROSSPLANE_AWS_PROVIDER_VERSION ?= v0.28.0
179+
# Note, templates also require CROSSPLANE_INITIAL_IAM_ROLE_ARN and CROSSPLANE_IAM_ROLE_ARN
154180

155181
.PHONY: deploy-crossplane-aws-provider
156182
deploy-crossplane-aws-provider:
157-
kubectl apply -f test-data/crossplane-aws-provider.yaml
183+
cat test-data/crossplane-aws-provider.yaml_tpl | CROSSPLANE_AWS_PROVIDER_VERSION=${CROSSPLANE_AWS_PROVIDER_VERSION} CROSSPLANE_INITIAL_IAM_ROLE_ARN=${CROSSPLANE_INITIAL_IAM_ROLE_ARN} envsubst > crossplane-aws-provider.yaml
184+
cat test-data/crossplane-aws-provider-config.yaml_tpl | CROSSPLANE_IAM_ROLE_ARN=${CROSSPLANE_IAM_ROLE_ARN} envsubst > crossplane-aws-provider-config.yaml
185+
kubectl apply -f crossplane-aws-provider.yaml
158186
kubectl wait "providers.pkg.crossplane.io/provider-aws" --for=condition=Installed --timeout=180s
159187
kubectl wait "providers.pkg.crossplane.io/provider-aws" --for=condition=Healthy --timeout=180s
188+
kubectl apply -f crossplane-aws-provider-config.yaml
189+
190+
.PHONY: undeploy-crossplane-aws-provider
191+
undeploy-crossplane-aws-provider:
192+
kubectl delete -f crossplane-aws-provider-config.yaml
193+
kubectl delete -f crossplane-aws-provider.yaml
160194

161195
#################
162196
# See 'doc/getting-started.md'
163197
.PHONY: setup-getting-started
164-
setup-getting-started: setup-getting-started-cluster setup-getting-started-controller setup-getting-started-usecase
198+
setup-getting-started: setup-getting-started-cluster setup-getting-started-controller setup-getting-started-controller-blueprint setup-getting-started-usecase
165199

166200
.PHONY: setup-getting-started-cluster
167201
setup-getting-started-cluster:
@@ -179,17 +213,51 @@ setup-getting-started-controller:
179213
make docker-build
180214
make cluster-load-controller-image
181215
make deploy
182-
kubectl apply -f blueprints/gatewayclassblueprint-contour-istio-cert.yaml -f blueprints/gatewayclass-contour-istio-cert.yaml
216+
217+
BIFROST_VERSION ?= 0.1.6
183218

184219
.PHONY: setup-getting-started-controller-helm
185220
setup-getting-started-controller-helm:
186-
helm upgrade -i bifrost-gateway-controller-helm oci://ghcr.io/tv2-oss/bifrost-gateway-controller-helm --version 0.1.6 --values charts/bifrost-gateway-controller/ci/gatewayclassblueprint-contour-istio-values.yaml -n bifrost-gateway-controller-system --create-namespace
221+
helm upgrade -i bifrost-gateway-controller-helm oci://ghcr.io/tv2-oss/bifrost-gateway-controller-helm --version ${BIFROST_VERSION} --values charts/bifrost-gateway-controller/ci/gatewayclassblueprint-contour-istio-values.yaml -n bifrost-gateway-controller-system --create-namespace
222+
223+
.PHONY: setup-getting-started-controller-aws-helm
224+
setup-getting-started-controller-aws-helm:
225+
helm upgrade -i bifrost-gateway-controller-helm oci://ghcr.io/tv2-oss/bifrost-gateway-controller-helm --version ${BIFROST_VERSION} --values charts/bifrost-gateway-controller/ci/gatewayclassblueprint-crossplane-aws-alb-values.yaml -n bifrost-gateway-controller-system --create-namespace
226+
227+
.PHONY: undeploy-controller
228+
undeploy-controller:
229+
helm uninstall -n bifrost-gateway-controller-system bifrost-gateway-controller-helm
230+
231+
.PHONY: setup-getting-started-controller-blueprint
232+
setup-getting-started-controller-blueprint:
187233
kubectl apply -f blueprints/gatewayclassblueprint-contour-istio-cert.yaml -f blueprints/gatewayclass-contour-istio-cert.yaml
188234

235+
BIFROST_BLUEPRINTS_VERSION ?= 0.0.18
236+
237+
.PHONY: deploy-aws-istio-blueprint
238+
deploy-aws-istio-blueprint:
239+
kubectl apply -f https://github.com/tv2-oss/bifrost-gateway-controller/releases/download/${BIFROST_BLUEPRINTS_VERSION}/gatewayclassblueprint-aws-alb-crossplane.yaml
240+
kubectl apply -f https://github.com/tv2-oss/bifrost-gateway-controller/releases/download/${BIFROST_BLUEPRINTS_VERSION}/gatewayclass-aws-alb-crossplane.yaml
241+
242+
.PHONY: undeploy-aws-istio-blueprint
243+
undeploy-aws-istio-blueprint:
244+
kubectl delete -f https://github.com/tv2-oss/bifrost-gateway-controller/releases/download/${BIFROST_BLUEPRINTS_VERSION}/gatewayclassblueprint-aws-alb-crossplane.yaml
245+
kubectl delete -f https://github.com/tv2-oss/bifrost-gateway-controller/releases/download/${BIFROST_BLUEPRINTS_VERSION}/gatewayclass-aws-alb-crossplane.yaml
246+
247+
.PHONY: deploy-aws-istio-blueprint-local
248+
deploy-aws-istio-blueprint-local:
249+
kubectl apply -f blueprints/gatewayclassblueprint-aws-alb-crossplane.yaml -f blueprints/gatewayclass-aws-alb-crossplane.yaml
250+
251+
.PHONY: undeploy-aws-istio-blueprint-local
252+
undeploy-aws-istio-blueprint-local:
253+
kubectl delete -f blueprints/gatewayclassblueprint-aws-alb-crossplane.yaml -f blueprints/gatewayclass-aws-alb-crossplane.yaml
254+
255+
GATEWAY_CLASS_NAME ?= contour-istio-cert
256+
189257
.PHONY: setup-getting-started-usecase
190258
setup-getting-started-usecase:
191259
kubectl apply -f test-data/getting-started/foo-namespaces.yaml
192-
kubectl apply -f test-data/getting-started/foo-gateway.yaml
260+
cat test-data/getting-started/foo-gateway.yaml | GATEWAY_CLASS_NAME=${GATEWAY_CLASS_NAME} envsubst | kubectl apply -f -
193261
kubectl -n foo-site apply -f test-data/getting-started/app-foo-site.yaml
194262
kubectl -n foo-site apply -f test-data/getting-started/foo-site-httproute.yaml
195263
kubectl -n foo-store apply -f test-data/getting-started/app-foo-store-v1.yaml

blueprints/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ This definition is provided in the following files:
5555
- [`gatewayclassblueprint-aws-alb-crossplane.yaml`](gatewayclassblueprint-aws-alb-crossplane.yaml) blueprint for infrastructure implementation
5656
- [`gatewayclass-aws-alb-crossplane.yaml`](gatewayclass-aws-alb-crossplane.yaml) definitions of `GatewayClass`es referencing the above `GatewayClassBlueprint`. Two `GatewayClass`es are created, one that is intended for internet exposed gateways, and one for non internet exposed gateways.
5757
- [`gatewayclassconfig-aws-alb-crossplane-dev-env.yaml`](../test-data/gatewayclassconfig-aws-alb-crossplane-dev-env.yaml) example settings for the two `GatewayClass`es defined in `gatewayclass-aws-alb-crossplane.yaml`, i.e. with different subnet settings for the internet-exposed and non internet-exposed `GatewayClass'es.
58-
[`gatewayclassblueprint-crossplane-aws-alb-values.yaml`](../charts/bifrost-gateway-controller/ci/gatewayclassblueprint-crossplane-aws-alb-values.yaml)
59-
(RBAC for bifrost-gateway-controller Helm deployment suited for the `aws-alb-crossplane` blueprint).
58+
- [`gatewayclassblueprint-crossplane-aws-alb-values.yaml`](../charts/bifrost-gateway-controller/ci/gatewayclassblueprint-crossplane-aws-alb-values.yaml)
59+
RBAC for bifrost-gateway-controller Helm deployment suited for the `aws-alb-crossplane` blueprint.

doc/getting-started.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,11 @@ that is out out-of-scope for this guide):
125125
kubectl apply -f test-data/getting-started/foo-namespaces.yaml
126126
```
127127

128-
The cluster-operator/SRE also creates the common `Gateway`:
128+
The cluster-operator/SRE also creates the common `Gateway` using the
129+
`GatewayClass` created previously:
129130

130131
```
131-
kubectl apply -f test-data/getting-started/foo-gateway.yaml
132+
cat test-data/getting-started/foo-gateway.yaml | GATEWAY_CLASS_NAME=contour-istio-cert envsubst | kubectl apply -f -
132133
```
133134

134135
### Developer of 'Site' Application

hack/demo/show-resources.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#! /bin/bash
22

3-
kubectl get gateway,lbs,lbtargetgroups -A | sed -E 's#(arn:aws:elasticloadbalancing:eu-central-1:)[0-9]+(:[-0-9a-z\/]+)#\11234567890\2#'
3+
kubectl get gateway,lbs,lbtargetgroups,lblisteners,securitygroups,securitygrouprules -A | sed -E 's#(arn:aws:elasticloadbalancing:eu-central-1:)[0-9]+(:[-0-9a-z\/]+)#\11234567890\2#'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
clusterName: $CLUSTERNAME
2+
serviceAccount:
3+
name: aws-load-balancer-controller
4+
annotations:
5+
eks.amazonaws.com/role-arn: $AWS_LOAD_BALANCER_CONTROLLER_IAM_ROLE_ARN
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: aws.upbound.io/v1beta1
2+
kind: ProviderConfig
3+
metadata:
4+
name: admin
5+
spec:
6+
credentials:
7+
source: WebIdentity
8+
webIdentity:
9+
roleARN: $CROSSPLANE_IAM_ROLE_ARN

test-data/crossplane-aws-provider.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: pkg.crossplane.io/v1alpha1
2+
kind: ControllerConfig
3+
metadata:
4+
name: aws-config
5+
annotations:
6+
eks.amazonaws.com/role-arn: $CROSSPLANE_INITIAL_IAM_ROLE_ARN
7+
spec:
8+
podSecurityContext:
9+
fsGroup: 2000
10+
---
11+
apiVersion: pkg.crossplane.io/v1
12+
kind: Provider
13+
metadata:
14+
name: provider-aws
15+
spec:
16+
package: xpkg.upbound.io/upbound/provider-aws:$CROSSPLANE_AWS_PROVIDER_VERSION
17+
controllerConfigRef:
18+
name: aws-config

test-data/getting-started/foo-gateway.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: foo-gateway
55
namespace: foo-infra
66
spec:
7-
gatewayClassName: contour-istio-cert
7+
gatewayClassName: $GATEWAY_CLASS_NAME
88
listeners:
99
- name: web
1010
port: 80

0 commit comments

Comments
 (0)