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

bug: ingress-controller crash when a HTTPRoute is created #2037

Closed
gigi206 opened this issue Nov 7, 2023 · 2 comments
Closed

bug: ingress-controller crash when a HTTPRoute is created #2037

gigi206 opened this issue Nov 7, 2023 · 2 comments

Comments

@gigi206
Copy link

gigi206 commented Nov 7, 2023

Current Behavior

ingress-controller crash when I create a HTTPRoute

Expected Behavior

No response

Error Logs

W1107 16:25:24.909294       1 warnings.go:70] unknown field "status.conditions[0].lastTransitionTime"
2023-11-07T16:25:24+08:00	error	apisix/upstream.go:142	failed to reflect upstreamService create to cache: wrong upstream name , must contains namespace_name
W1107 16:25:24.930468       1 warnings.go:70] unknown field "status.conditions[0].lastTransitionTime"
panic: interface conversion: interface {} is nil, not *v1beta1.HTTPRoute

goroutine 557 [running]:
github.com/apache/apisix-ingress-controller/pkg/providers/gateway.(*gatewayHTTPRouteController).sync(0xc000a979e0, {0x1f424b0, 0xc0002da080}, 0xc001b22540)
	/build/controller/pkg/providers/gateway/gateway_httproute.go:157 +0x13da
github.com/apache/apisix-ingress-controller/pkg/providers/gateway.(*gatewayHTTPRouteController).runWorker(0xc000a979e0, {0x1f424b0, 0xc0002da080})
	/build/controller/pkg/providers/gateway/gateway_httproute.go:76 +0x4a
created by github.com/apache/apisix-ingress-controller/pkg/providers/gateway.(*gatewayHTTPRouteController).run
	/build/controller/pkg/providers/gateway/gateway_httproute.go:65 +0x265

Steps to Reproduce

Just apply this:

apiVersion: v1
kind: Namespace
metadata:
  labels:
    kubernetes.io/metadata.name: demo
  name: demo
spec:
  finalizers:
  - kubernetes
---
apiVersion: v1
kind: Service
metadata:
  name: httpbin
  namespace: demo
  labels:
    app: httpbin
    service: httpbin
spec:
  ports:
  - name: http
    port: 8000
    targetPort: 80
  selector:
    app: httpbin
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: httpbin
  namespace: demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: httpbin
      version: v1
  template:
    metadata:
      labels:
        app: httpbin
        version: v1
    spec:
      containers:
      - image: docker.io/kong/httpbin
        imagePullPolicy: IfNotPresent
        name: httpbin
        ports:
        - containerPort: 80
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
  name: httpbin-gateway
  namespace: demo
  annotations:
    cert-manager.io/cluster-issuer: selfsigned-cluster-issuer
spec:
  gatewayClassName: apisix
  listeners:
  - name: http
    protocol: HTTP
    port: 80
    allowedRoutes:
      namespaces:
        from: Same
  - protocol: HTTPS
    name: https
    port: 443
    hostname: httpbin.gigix
    tls:
      mode: Terminate
      certificateRefs:
        - name: httpbin-tls
          kind: Secret
          group: core
    allowedRoutes:
      namespaces:
        from: Same
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: httpbin-route
  namespace: demo
spec:
  hostnames:
  - httpbin.gigix
  parentRefs:
  - name: httpbin-gateway
    namespace: demo
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /
    backendRefs:
    - name: httpbin
      port: 8000

Environment

apisix deployed with helm chart 2.3.0

kubectl version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.25.13+rke2r1
Kustomize Version: v4.5.7
Server Version: v1.25.13+rke2r1
@karl-chanel
Copy link

mark

@Revolyssup
Copy link
Contributor

@gigi206 This bug has been fixed here #1825 and is available in release 1.7>=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants