Copilot commented on code in PR #121:
URL: 
https://github.com/apache/dubbo-go-pixiu-samples/pull/121#discussion_r2724026507


##########
gateway/helloworld/http.yaml:
##########
@@ -0,0 +1,94 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  name: helloworld-http-route
+  namespace: default
+spec:
+  parentRefs:
+    - name: pixiu-listeners
+      namespace: pixiu-gateway-system
+      sectionName: http
+  rules:
+    - matches:
+        - path:
+            type: PathPrefix
+            value: /greet.GreetService
+      backendRefs:
+        - name: dubbo-go-server
+          namespace: helloworld
+          port: 20000
+          weight: 100

Review Comment:
   backendRefs references Service "dubbo-go-server" in namespace "helloworld" 
while the HTTPRoute is in namespace "default". With Gateway API v1, 
cross-namespace backendRefs require a ReferenceGrant in the backend namespace 
(or keep the route and Service in the same namespace). Add the appropriate 
ReferenceGrant or adjust namespaces.



##########
gateway/helloworld/http.yaml:
##########
@@ -0,0 +1,94 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  name: helloworld-http-route
+  namespace: default
+spec:
+  parentRefs:
+    - name: pixiu-listeners
+      namespace: pixiu-gateway-system
+      sectionName: http
+  rules:
+    - matches:
+        - path:
+            type: PathPrefix
+            value: /greet.GreetService
+      backendRefs:
+        - name: dubbo-go-server
+          namespace: helloworld
+          port: 20000
+          weight: 100
+---
+apiVersion: pixiu.apache.org/v1alpha1
+kind: PixiuClusterPolicy
+metadata:
+  name: helloworld-cluster
+  namespace: pixiu-gateway-system
+spec:
+  targetRef:
+    group: gateway.networking.k8s.io
+    kind: Gateway
+    name: pixiu-listeners
+  clusterRef:
+    - name: helloworld-dubbo-go-server
+      type: static
+      loadBalancerPolicy: "lb"
+      endpoints:
+        - address: dubbo-go-server.helloworld.svc.cluster.local
+          port: 20000
+---
+apiVersion: pixiu.apache.org/v1alpha1
+kind: PixiuFilterPolicy
+metadata:
+  name: helloworld-http-filter
+  namespace: pixiu-gateway-system
+spec:
+  targetRef:
+    group: gateway.networking.k8s.io
+    kind: Gateway
+    name: pixiu-listeners

Review Comment:
   PixiuFilterPolicy targetRef points to Gateway "pixiu-listeners", but the 
Gateway defined in this PR is named "pixiu" (and in a different namespace). 
Align the targetRef (and namespaces) so the filter policy can be reconciled 
against the Gateway.



##########
gateway/helloworld/http.yaml:
##########
@@ -0,0 +1,94 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  name: helloworld-http-route
+  namespace: default
+spec:
+  parentRefs:
+    - name: pixiu-listeners
+      namespace: pixiu-gateway-system
+      sectionName: http
+  rules:
+    - matches:
+        - path:
+            type: PathPrefix
+            value: /greet.GreetService
+      backendRefs:
+        - name: dubbo-go-server
+          namespace: helloworld
+          port: 20000
+          weight: 100
+---
+apiVersion: pixiu.apache.org/v1alpha1
+kind: PixiuClusterPolicy
+metadata:
+  name: helloworld-cluster
+  namespace: pixiu-gateway-system
+spec:
+  targetRef:
+    group: gateway.networking.k8s.io
+    kind: Gateway
+    name: pixiu-listeners
+  clusterRef:

Review Comment:
   PixiuClusterPolicy targetRef points to Gateway "pixiu-listeners", but the 
Gateway defined in this PR is named "pixiu" (and in a different namespace). 
This policy won’t apply to the intended Gateway until the targetRef is aligned 
with the Gateway resource.



##########
gateway/helloworld/deployment.yaml:
##########
@@ -0,0 +1,91 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+---
+apiVersion: v1
+kind: Namespace
+metadata:
+  name: helloworld
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: dubbo-go-server
+  namespace: helloworld
+  labels:
+    app: dubbo-go-server
+spec:
+  type: ClusterIP
+  ports:
+    - name: triple
+      protocol: TCP
+      port: 20000
+      targetPort: 20000
+  selector:
+    app: dubbo-go-server
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: dubbo-go-server
+  namespace: helloworld
+  labels:
+    app: dubbo-go-server
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: dubbo-go-server
+  template:
+    metadata:
+      labels:
+        app: dubbo-go-server
+    spec:
+      containers:
+        - name: server
+          image: mfordjody/dubbo-go-server:debug
+          imagePullPolicy: Always

Review Comment:
   This sample uses a "*:debug" image tag with imagePullPolicy: Always. That 
can break users who don’t have access to that registry/tag and makes the 
example non-reproducible; consider switching to a stable/pinned tag (or clearly 
documenting how to build/push the image) and using IfNotPresent by default.



##########
gateway/k8s/pixiu-gateway.yaml:
##########
@@ -0,0 +1,317 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+---
+# Source: pixiu-gateway/templates/serviceaccount.yaml
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: pixiu-gateway-sa
+  namespace: default
+  labels:
+    control-plane: pixiu-gateway
+---
+# Source: pixiu-gateway/templates/rbac.yaml
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: pixiu-gateway-role
+  labels:
+    control-plane: pixiu-gateway
+rules:
+  - apiGroups:
+      - ""
+    resources:
+      - events
+    verbs:
+      - create
+      - patch
+  - apiGroups:
+      - ""
+    resources:
+      - namespaces
+      - pods
+      - services
+      - configmaps
+    verbs:
+      - get
+      - list
+      - watch
+      - create
+      - update
+      - patch
+      - delete
+  - apiGroups:
+      - apps
+    resources:
+      - deployments
+    verbs:
+      - get
+      - list
+      - watch
+      - create
+      - update
+      - patch
+      - delete
+  - apiGroups:
+      - coordination.k8s.io
+    resources:
+      - leases
+    verbs:
+      - create
+      - delete
+      - get
+      - list
+      - patch
+      - update
+      - watch
+  - apiGroups:
+      - discovery.k8s.io
+    resources:
+      - endpointslices
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - gateway.networking.k8s.io
+    resources:
+      - gatewayclasses
+      - gateways
+    verbs:
+      - get
+      - list
+      - watch
+      - update
+      - patch
+  - apiGroups:
+      - gateway.networking.k8s.io
+    resources:
+      - gatewayclasses/status
+      - gateways/status
+      - httproutes/status
+      - referencegrants/status
+    verbs:
+      - get
+      - update
+      - patch
+  - apiGroups:
+      - gateway.networking.k8s.io
+    resources:
+      - httproutes
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - gateway.networking.k8s.io
+    resources:
+      - referencegrants
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - ""
+    resources:
+      - secrets
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiugatewaypolicies
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiugatewaypolicies/status
+    verbs:
+      - get
+      - update
+      - patch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiuclusterpolicies
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiuclusterpolicies/status
+    verbs:
+      - get
+      - update
+      - patch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiufilterpolicies
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiufilterpolicies/status
+    verbs:
+      - get
+      - update
+      - patch
+---
+# Source: pixiu-gateway/templates/rbac.yaml
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+  name: pixiu-gateway-rolebinding
+  labels:
+    control-plane: pixiu-gateway
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: pixiu-gateway-role
+subjects:
+  - kind: ServiceAccount
+    name: pixiu-gateway-sa
+    namespace: default
+---
+# Source: pixiu-gateway/templates/service.yaml
+apiVersion: v1
+kind: Service
+metadata:
+  name: pixiu-gateway
+  namespace: default
+  labels:
+    control-plane: pixiu-gateway
+spec:
+  selector:
+    control-plane: pixiu-gateway
+  ports:
+    - name: metrics
+      protocol: TCP
+      port: 8080
+      targetPort: 8080
+    - name: health
+      protocol: TCP
+      port: 8081
+      targetPort: 8081
+  type: ClusterIP
+---
+# Source: pixiu-gateway/templates/deployment.yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: pixiu-gateway
+  namespace: default
+  labels:
+    control-plane: pixiu-gateway
+    helm.sh/chart: pixiu-gateway-1.0.0
+    app.kubernetes.io/name: pixiu-gateway
+    app.kubernetes.io/instance: pixiu-gateway
+    app.kubernetes.io/version: "latest"
+    app.kubernetes.io/managed-by: Helm
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      control-plane: pixiu-gateway
+      app.kubernetes.io/name: pixiu-gateway
+      app.kubernetes.io/instance: pixiu-gateway
+  template:
+    metadata:
+      labels:
+        control-plane: pixiu-gateway
+        app.kubernetes.io/name: pixiu-gateway
+        app.kubernetes.io/instance: pixiu-gateway
+    spec:
+      serviceAccountName: pixiu-gateway-sa
+      containers:
+        - name: pixiu-gateway
+          image: mfordjody/pixiugateway-controller:debug
+          imagePullPolicy: Always
+          command:
+            - /usr/local/bin/pg-controller
+          args:
+            - --config-path=/config/pg.yaml
+            - --log-level=info
+          ports:
+            - containerPort: 8081
+              name: health
+              protocol: TCP
+            - containerPort: 8080
+              name: metrics
+              protocol: TCP
+          livenessProbe:
+            httpGet:
+              path: /healthz
+              port: 8081
+            initialDelaySeconds: 15
+            periodSeconds: 20
+          readinessProbe:
+            httpGet:
+              path: /readyz
+              port: 8081
+            initialDelaySeconds: 5
+            periodSeconds: 10
+          resources:
+            limits:
+              cpu: 500m
+              memory: 512Mi
+            requests:
+              cpu: 10m
+              memory: 64Mi
+---
+# Source: pixiu-gateway/templates/config.yaml
+apiVersion: gateway.networking.k8s.io/v1
+kind: Gateway
+metadata:
+  name: pixiu
+  namespace: default
+spec:
+  gatewayClassName: pg
+  listeners:
+    - name: http
+      protocol: HTTP
+      port: 8888
+    - name: dubbo
+      protocol: TCP
+      port: 8889
+    - name: triple
+      protocol: GRPC
+      port: 9999
+    - name: http2
+      protocol: HTTP2

Review Comment:
   Gateway listener protocols "GRPC" and "HTTP2" are not valid values for 
Gateway API (gateway.networking.k8s.io/v1). The CRD schema only allows 
protocols like HTTP/HTTPS/TCP/TLS/UDP, so this Gateway will be rejected by the 
API server. Use HTTP/HTTPS for gRPC/HTTP2 traffic (or TCP/TLS as appropriate) 
and adjust listener names/ports accordingly.
   ```suggestion
         protocol: HTTP
         port: 9999
       - name: http2
         protocol: HTTP
   ```



##########
gateway/k8s/pixiu-gateway.yaml:
##########
@@ -0,0 +1,317 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+---
+# Source: pixiu-gateway/templates/serviceaccount.yaml
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: pixiu-gateway-sa
+  namespace: default
+  labels:
+    control-plane: pixiu-gateway
+---
+# Source: pixiu-gateway/templates/rbac.yaml
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: pixiu-gateway-role
+  labels:
+    control-plane: pixiu-gateway
+rules:
+  - apiGroups:
+      - ""
+    resources:
+      - events
+    verbs:
+      - create
+      - patch
+  - apiGroups:
+      - ""
+    resources:
+      - namespaces
+      - pods
+      - services
+      - configmaps
+    verbs:
+      - get
+      - list
+      - watch
+      - create
+      - update
+      - patch
+      - delete
+  - apiGroups:
+      - apps
+    resources:
+      - deployments
+    verbs:
+      - get
+      - list
+      - watch
+      - create
+      - update
+      - patch
+      - delete
+  - apiGroups:
+      - coordination.k8s.io
+    resources:
+      - leases
+    verbs:
+      - create
+      - delete
+      - get
+      - list
+      - patch
+      - update
+      - watch
+  - apiGroups:
+      - discovery.k8s.io
+    resources:
+      - endpointslices
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - gateway.networking.k8s.io
+    resources:
+      - gatewayclasses
+      - gateways
+    verbs:
+      - get
+      - list
+      - watch
+      - update
+      - patch
+  - apiGroups:
+      - gateway.networking.k8s.io
+    resources:
+      - gatewayclasses/status
+      - gateways/status
+      - httproutes/status
+      - referencegrants/status
+    verbs:
+      - get
+      - update
+      - patch
+  - apiGroups:
+      - gateway.networking.k8s.io
+    resources:
+      - httproutes
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - gateway.networking.k8s.io
+    resources:
+      - referencegrants
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - ""
+    resources:
+      - secrets
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiugatewaypolicies
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiugatewaypolicies/status
+    verbs:
+      - get
+      - update
+      - patch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiuclusterpolicies
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiuclusterpolicies/status
+    verbs:
+      - get
+      - update
+      - patch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiufilterpolicies
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiufilterpolicies/status
+    verbs:
+      - get
+      - update
+      - patch
+---
+# Source: pixiu-gateway/templates/rbac.yaml
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+  name: pixiu-gateway-rolebinding
+  labels:
+    control-plane: pixiu-gateway
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: pixiu-gateway-role
+subjects:
+  - kind: ServiceAccount
+    name: pixiu-gateway-sa
+    namespace: default
+---
+# Source: pixiu-gateway/templates/service.yaml
+apiVersion: v1
+kind: Service
+metadata:
+  name: pixiu-gateway
+  namespace: default
+  labels:
+    control-plane: pixiu-gateway
+spec:
+  selector:
+    control-plane: pixiu-gateway
+  ports:
+    - name: metrics
+      protocol: TCP
+      port: 8080
+      targetPort: 8080
+    - name: health
+      protocol: TCP
+      port: 8081
+      targetPort: 8081
+  type: ClusterIP
+---
+# Source: pixiu-gateway/templates/deployment.yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: pixiu-gateway
+  namespace: default
+  labels:
+    control-plane: pixiu-gateway
+    helm.sh/chart: pixiu-gateway-1.0.0
+    app.kubernetes.io/name: pixiu-gateway
+    app.kubernetes.io/instance: pixiu-gateway
+    app.kubernetes.io/version: "latest"
+    app.kubernetes.io/managed-by: Helm
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      control-plane: pixiu-gateway
+      app.kubernetes.io/name: pixiu-gateway
+      app.kubernetes.io/instance: pixiu-gateway
+  template:
+    metadata:
+      labels:
+        control-plane: pixiu-gateway
+        app.kubernetes.io/name: pixiu-gateway
+        app.kubernetes.io/instance: pixiu-gateway
+    spec:
+      serviceAccountName: pixiu-gateway-sa
+      containers:
+        - name: pixiu-gateway
+          image: mfordjody/pixiugateway-controller:debug
+          imagePullPolicy: Always
+          command:
+            - /usr/local/bin/pg-controller
+          args:
+            - --config-path=/config/pg.yaml
+            - --log-level=info
+          ports:
+            - containerPort: 8081
+              name: health
+              protocol: TCP
+            - containerPort: 8080
+              name: metrics
+              protocol: TCP
+          livenessProbe:
+            httpGet:
+              path: /healthz
+              port: 8081
+            initialDelaySeconds: 15
+            periodSeconds: 20
+          readinessProbe:
+            httpGet:
+              path: /readyz
+              port: 8081
+            initialDelaySeconds: 5
+            periodSeconds: 10
+          resources:
+            limits:
+              cpu: 500m
+              memory: 512Mi
+            requests:
+              cpu: 10m
+              memory: 64Mi
+---
+# Source: pixiu-gateway/templates/config.yaml
+apiVersion: gateway.networking.k8s.io/v1
+kind: Gateway
+metadata:
+  name: pixiu
+  namespace: default
+spec:
+  gatewayClassName: pg
+  listeners:

Review Comment:
   This Gateway is created as name "pixiu" in namespace "default", but the 
accompanying sample route/policies in gateway/helloworld/http.yaml target a 
Gateway named "pixiu-listeners" in namespace "pixiu-gateway-system". The sample 
set is internally inconsistent and won’t work when applied together; make the 
Gateway name/namespace consistent across the manifests (and ensure any 
referenced namespace exists).



##########
gateway/k8s/pixiu-gateway.yaml:
##########
@@ -0,0 +1,317 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+---
+# Source: pixiu-gateway/templates/serviceaccount.yaml
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: pixiu-gateway-sa
+  namespace: default
+  labels:
+    control-plane: pixiu-gateway
+---
+# Source: pixiu-gateway/templates/rbac.yaml
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: pixiu-gateway-role
+  labels:
+    control-plane: pixiu-gateway
+rules:
+  - apiGroups:
+      - ""
+    resources:
+      - events
+    verbs:
+      - create
+      - patch
+  - apiGroups:
+      - ""
+    resources:
+      - namespaces
+      - pods
+      - services
+      - configmaps
+    verbs:
+      - get
+      - list
+      - watch
+      - create
+      - update
+      - patch
+      - delete
+  - apiGroups:
+      - apps
+    resources:
+      - deployments
+    verbs:
+      - get
+      - list
+      - watch
+      - create
+      - update
+      - patch
+      - delete
+  - apiGroups:
+      - coordination.k8s.io
+    resources:
+      - leases
+    verbs:
+      - create
+      - delete
+      - get
+      - list
+      - patch
+      - update
+      - watch
+  - apiGroups:
+      - discovery.k8s.io
+    resources:
+      - endpointslices
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - gateway.networking.k8s.io
+    resources:
+      - gatewayclasses
+      - gateways
+    verbs:
+      - get
+      - list
+      - watch
+      - update
+      - patch
+  - apiGroups:
+      - gateway.networking.k8s.io
+    resources:
+      - gatewayclasses/status
+      - gateways/status
+      - httproutes/status
+      - referencegrants/status
+    verbs:
+      - get
+      - update
+      - patch
+  - apiGroups:
+      - gateway.networking.k8s.io
+    resources:
+      - httproutes
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - gateway.networking.k8s.io
+    resources:
+      - referencegrants
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - ""
+    resources:
+      - secrets
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiugatewaypolicies
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiugatewaypolicies/status
+    verbs:
+      - get
+      - update
+      - patch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiuclusterpolicies
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiuclusterpolicies/status
+    verbs:
+      - get
+      - update
+      - patch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiufilterpolicies
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - pixiu.apache.org
+    resources:
+      - pixiufilterpolicies/status
+    verbs:
+      - get
+      - update
+      - patch
+---
+# Source: pixiu-gateway/templates/rbac.yaml
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+  name: pixiu-gateway-rolebinding
+  labels:
+    control-plane: pixiu-gateway
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: pixiu-gateway-role
+subjects:
+  - kind: ServiceAccount
+    name: pixiu-gateway-sa
+    namespace: default
+---
+# Source: pixiu-gateway/templates/service.yaml
+apiVersion: v1
+kind: Service
+metadata:
+  name: pixiu-gateway
+  namespace: default
+  labels:
+    control-plane: pixiu-gateway
+spec:
+  selector:
+    control-plane: pixiu-gateway
+  ports:
+    - name: metrics
+      protocol: TCP
+      port: 8080
+      targetPort: 8080
+    - name: health
+      protocol: TCP
+      port: 8081
+      targetPort: 8081
+  type: ClusterIP
+---
+# Source: pixiu-gateway/templates/deployment.yaml
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: pixiu-gateway
+  namespace: default
+  labels:
+    control-plane: pixiu-gateway
+    helm.sh/chart: pixiu-gateway-1.0.0
+    app.kubernetes.io/name: pixiu-gateway
+    app.kubernetes.io/instance: pixiu-gateway
+    app.kubernetes.io/version: "latest"
+    app.kubernetes.io/managed-by: Helm
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      control-plane: pixiu-gateway
+      app.kubernetes.io/name: pixiu-gateway
+      app.kubernetes.io/instance: pixiu-gateway
+  template:
+    metadata:
+      labels:
+        control-plane: pixiu-gateway
+        app.kubernetes.io/name: pixiu-gateway
+        app.kubernetes.io/instance: pixiu-gateway
+    spec:
+      serviceAccountName: pixiu-gateway-sa
+      containers:
+        - name: pixiu-gateway
+          image: mfordjody/pixiugateway-controller:debug
+          imagePullPolicy: Always

Review Comment:
   This sample uses a "*:debug" image tag with imagePullPolicy: Always. That 
makes the manifest non-reproducible and can unexpectedly change behavior over 
time; consider using a released/pinned tag (or documenting where to get this 
image) and using IfNotPresent unless there’s a specific reason to force pulls.



##########
gateway/helloworld/http.yaml:
##########
@@ -0,0 +1,94 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+---
+apiVersion: gateway.networking.k8s.io/v1
+kind: HTTPRoute
+metadata:
+  name: helloworld-http-route
+  namespace: default
+spec:
+  parentRefs:
+    - name: pixiu-listeners
+      namespace: pixiu-gateway-system

Review Comment:
   HTTPRoute parentRefs points to Gateway "pixiu-listeners" in namespace 
"pixiu-gateway-system", but this PR’s gateway manifest creates a Gateway named 
"pixiu" in namespace "default". As-is, the route won’t attach to any Gateway. 
Update the Gateway name/namespace to match, or move the HTTPRoute into the 
Gateway’s namespace and/or configure listener.allowedRoutes to permit 
cross-namespace attachment.
   ```suggestion
       - name: pixiu
         namespace: default
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to