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

Unable to update externalTrafficPolicy #832

Open
rkuccf opened this issue Oct 30, 2024 · 1 comment
Open

Unable to update externalTrafficPolicy #832

rkuccf opened this issue Oct 30, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@rkuccf
Copy link

rkuccf commented Oct 30, 2024

Current Behavior

The change is applied on DataPlane object but isn't transferred to Service.

Expected Behavior

Update of externalTrafficPolicy will be possible

Steps To Reproduce

  1. Install operator using helm package
helm repo add kong https://charts.konghq.com
helm repo update
helm install kong-gtw-operator kong/gateway-operator --version 0.2.3
  1. Create a gateway_objects.yaml file with the following definitions:
---
kind: Gateway
apiVersion: gateway.networking.k8s.io/v1
metadata:
  name: kong
spec:
  gatewayClassName: kong
  listeners:
    - allowedRoutes:
        namespaces:
          from: All
      name: http
      port: 80
      protocol: HTTP

---

kind: GatewayClass
apiVersion: gateway.networking.k8s.io/v1
metadata:
  name: kong
spec:
  controllerName: konghq.com/gateway-operator
  parametersRef:
    group: gateway-operator.konghq.com
    kind: GatewayConfiguration
    name: kong
    namespace: "default"
---
apiVersion: gateway-operator.konghq.com/v1beta1
kind: GatewayConfiguration
metadata:
  name: kong
spec:
  dataPlaneOptions:
    deployment:
      podTemplateSpec:
        spec:
          containers:
            - name: proxy
              imagePullPolicy: Always
              readinessProbe:
                initialDelaySeconds: 1
                periodSeconds: 1
              env:
                - name: KONG_NGINX_ADMIN_SSL_VERIFY_CLIENT
                  value: "off"
                - name: KONG_ADMIN_LISTEN
                  value: "0.0.0.0:8001, 0.0.0.0:8444 http2 ssl reuseport backlog=16384"
                - name: KONG_LOG_LEVEL
                  value: "debug"
                - name: KONG_NGINX_HTTP_LOG_FORMAT
                  value: "custom_format '$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $sent_http_HUB_Correlation_ID'"
                - name: KONG_NGINX_HTTP_PROXY_BUFFER_SIZE
                  value: "256k"
                - name: KONG_NGINX_HTTP_PROXY_BUFFERS
                  value: "16 128k"
                - name: KONG_NGINX_HTTP_PROXY_BUSY_BUFFERS_SIZE
                  value: "256k"
                - name: KONG_NGINX_WORKER_PROCESSES
                  value: "2"
                - name: KONG_OPENTELEMETRY_TRACING
                  value: "all"
                - name: KONG_PLUGINS
                  value: "bundled,session"
                - name: KONG_PROXY_ACCESS_LOG
                  value: "/dev/stdout custom_format"
                - name: KONG_PROXY_LISTEN
                  value: "0.0.0.0:8000, 0.0.0.0:8443 http2 ssl"
                - name: KONG_TRACING_SAMPLING_RATE
                  value: "1"
              ports:
                - containerPort: 8001
                  name: admin
                  protocol: TCP
      replicas: 1
    network:
      services:
        ingress:
          externalTrafficPolicy: Cluster
          type: LoadBalancer
  controlPlaneOptions:
    deployment:
      replicas: 1
      podTemplateSpec:
        spec:
          containers:
            - name: controller
              env:
                - name: CONTROLLER_LOG_LEVEL
                  value: info
  1. Deploy kong gateway using
kubectl apply -f gateway_objects.yaml
  1. Both of below commands should return "Cluster"
kubectl get dataplane -o template --template="{{ (index .items 0).spec.network.services.ingress.externalTrafficPolicy }}"
kubectl get service --selector=gateway-operator.konghq.com/dataplane-service-type=ingress -o template --template '{{ (index .items 0).spec.externalTrafficPolicy }}'
  1. Modify gateway_objects.yaml by changing:
kind: GatewayConfiguration
spec:
  dataPlaneOptions:
    network:
      services:
        ingress:
          externalTrafficPolicy: Local
 
  1. First command should return "Local" and second one should return "Cluster". It shows that update doesn't work.
kubectl get dataplane -o template --template="{{ (index .items 0).spec.network.services.ingress.externalTrafficPolicy }}"
kubectl get service --selector=gateway-operator.konghq.com/dataplane-service-type=ingress -o template --template '{{ (index .items 0).spec.externalTrafficPolicy }}'

Operator Version

Operator: 1.3
Helm package: 0.2.3

kubectl version

Client Version: v1.28.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.2

@rkuccf rkuccf added the bug Something isn't working label Oct 30, 2024
@pmalek
Copy link
Member

pmalek commented Oct 30, 2024

Hi @rkuccf 👋

This should be fixed in main via #750. You can try running nightly or 1.4 https://github.com/Kong/gateway-operator/releases/tag/v1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants