oracle / oci-native-ingress-controller

OCI Native Ingress Controller
https://blogs.oracle.com/cloud-infrastructure/post/oracle-cloud-native-ingress-controller-kubernetes
Universal Permissive License v1.0
17 stars 19 forks source link

Unable to create backend sets #78

Open joelp172 opened 2 weeks ago

joelp172 commented 2 weeks ago

After successfully deploying the native ingress controller on a cluster and created the IngressClass & IngressClassParameters resources. I have annotated the ingress I would like to use, in this case Loki, via the helm chart for which is its deployed.

However when the controller attempts to create the Load Balancer Backend Sets i get the error message:

Error syncing backends for ingress class observability-lb: service loki/loki-gateway has non-integer ports: http-metrics

Is there a reason why the controller cannot create the backend sets when these port types are defined?

nirpai commented 1 week ago

Can you please provide ingress/ingress class definitions and description for service loki/loki-gateway?

joelp172 commented 1 week ago

Yes sure thing.

Ingress Class & Parameters

apiVersion: "ingress.oraclecloud.com/v1beta1"
kind: IngressClassParameters
metadata:
  name: observability-ic-params
  namespace: native-ingress-controller-system
spec:
  compartmentId: xxx
  subnetId: xxx
  loadBalancerName: "observability-lb"
  isPrivate: false
  maxBandwidthMbps: 400
  minBandwidthMbps: 100
---
# https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengsettingupnativeingresscontroller-createresources.htm#contengsettingupnativeingresscontroller-createresources__section_ingressclass
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
  name: observability-lb
  annotations:
    ingressclass.kubernetes.io/is-default-class: "false"
spec:
  controller: oci.oraclecloud.com/native-ingress-controller
  parameters:
    scope: Namespace
    namespace: native-ingress-controller-system
    apiGroup: ingress.oraclecloud.com
    kind: ingressclassparameters
    name: observability-ic-params

Ingress

This is created via the Loki Helm Chart

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
  name: loki-gateway
  namespace: loki
spec:
  ingressClassName: observability-lb
  rules:
    - host: loki.xxx.com
      http:
        paths:
          - backend:
              service:
                name: loki-gateway
                port:
                  number: 80
            path: /
            pathType: Prefix
  tls:
    - hosts:
        - loki.xxx.com
      secretName: loki-gateway-tls

This is the loki-gateway svc, again as created by the Helm Chart. This is where the http-metrics port in question is

Name:              loki-gateway
Namespace:         loki
Labels:            app.kubernetes.io/component=gateway
                   app.kubernetes.io/instance=loki
                   app.kubernetes.io/managed-by=Helm
                   app.kubernetes.io/name=loki
                   app.kubernetes.io/version=3.0.0
                   argocd.argoproj.io/instance=prod-mt-03-loki
                   helm.sh/chart=loki-6.4.1
Annotations:       <none>
Selector:          app.kubernetes.io/component=gateway,app.kubernetes.io/instance=loki,app.kubernetes.io/name=loki
Type:              ClusterIP
IP Family Policy:  SingleStack
IP Families:       IPv4
IP:                10.96.226.117
IPs:               10.96.226.117
Port:              http-metrics  80/TCP
TargetPort:        http-metrics/TCP
Endpoints:         10.0.65.47:8080
Session Affinity:  None
Events:            <none>
nirpai commented 1 week ago

Have you tried giving a port name in your ingress?

              service:
                name: loki-gateway
                port:
                  name: http-metrics
joelp172 commented 1 week ago

I have tried that and get the same error message:

Error syncing backends for ingress class observability-lb: service loki/loki-gateway has non-integer ports: http-metrics
nirpai commented 1 week ago

Ok. Thanks of the detail. This possibly needs a fix. Will keep you posted once we release the fix changes.