Skip to content

Commit 178660c

Browse files
committed
add gateway class logic
1 parent a1bbc29 commit 178660c

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

helm/values.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# Declare variables to be passed into your templates.
44

55
image:
6-
repository: public.ecr.aws/aws-application-networking-k8s/aws-gateway-controller
7-
tag: v1.1.0
8-
pullPolicy: IfNotPresent
6+
repository: 111815285043.dkr.ecr.ap-northeast-1.amazonaws.com/aws-gateway-controller
7+
tag: latest
8+
pullPolicy: Always
99
pullSecrets: []
1010

1111
nameOverride: ""
@@ -62,7 +62,7 @@ pdb:
6262

6363
# log level for the controller
6464
log:
65-
level: info
65+
level: debug
6666

6767
# Set to "namespace" to install the controller in a namespaced scope, will only
6868
# watch for object creation in the namespace. By default installScope is
@@ -71,16 +71,16 @@ installScope: cluster
7171

7272
serviceAccount:
7373
# Specifies whether a service account should be created
74-
create: true
74+
create: false
7575
# The name of the service account to use.
76-
name: gateway-api-controller
77-
annotations: {}
76+
annotations:
77+
{}
7878
# eks.amazonaws.com/role-arn: arn:aws:iam::AWS_ACCOUNT_ID:role/IAM_ROLE_NAME
7979

80-
awsRegion:
81-
awsAccountId:
82-
clusterVpcId:
83-
clusterName:
80+
awsRegion: ap-northeast-1
81+
awsAccountId: 111815285043
82+
clusterVpcId: vpc-0e24bd68af2259678
83+
clusterName: eks-auto-mode-sample
8484
defaultServiceNetwork:
8585
latticeEndpoint:
8686
webhookEnabled: true
@@ -91,4 +91,5 @@ routeMaxConcurrentReconciles:
9191
webhookTLS:
9292
caCert:
9393
cert:
94-
key:
94+
key:
95+

pkg/controllers/gateway_controller.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ func RegisterGatewayController(
7272
scheme := mgr.GetScheme()
7373
evtRec := mgr.GetEventRecorderFor("gateway")
7474

75+
ok, err := k8s.IsGVKSupported(mgr, gwv1.GroupVersion.String(), "GatewayClass")
76+
if err != nil {
77+
log.Infof(context.TODO(), "Failed to check if GatewayClass is supported: %s", err.Error())
78+
return fmt.Errorf("failed to check if GatewayClass is supported: %w", err)
79+
}
80+
if !ok {
81+
log.Infof(context.TODO(), "GatewayClass is not supported, skipping controller registration")
82+
return fmt.Errorf("GatewayClass is not supported, skipping controller registration")
83+
}
7584
r := &gatewayReconciler{
7685
log: log,
7786
client: mgrClient,

0 commit comments

Comments
 (0)