kyma-project / api-gateway

Apache License 2.0
4 stars 27 forks source link

apigateway.operator.kyma-project.io/v1alpha1 has a hard requirement for CRD dnsentries.dns.gardener.cloud is not present in v2.5.0? #1231

Open tehret77 opened 2 months ago

tehret77 commented 2 months ago

Description

Installed the latest version 2.5.0 of the APIGateway manager module on a Azure Kubernetes cluster (Kyma OpenSource). Afterward applyied the default CR for a gateway. This gateway ras the status Error with the message:

  conditions:
  - lastTransitionTime: "2024-08-07T13:52:13Z"
    message: Module dependencies missing
    reason: DependenciesMissing
    status: "False"
    type: Ready
  description: CRD dnsentries.dns.gardener.cloud is not present. Make sure to install
    required dependencies for the component
  state: Error 

Expected result

As in version 2.4.0 there is no hard dependency to any Gardener CRD

Actual result

There is a hard requirement.

Steps to reproduce

Install the module on a blank Kubernetes cluster (non Gardener)

Troubleshooting

tehret77 commented 2 months ago

I think, I found the issue. The application-connector module require the configmap kube-system/shoot-info for some configuration with compass agent. Once this configmap is present during initial configuration or upgrade the info from that configmaps is used and require the dependency to the CRD dnsentries.dns.gardener.cloud.

Ressetkk commented 3 weeks ago

I have found the part of the code that handles it. https://github.com/kyma-project/api-gateway/blob/a100420678f106b00440bb3832290a0412465746/internal/reconciliations/gardener.go#L28 If the cluster contains the shoot-info config map, it assumes that controller is working on Gardener, even if you create this resource manually. I think we need to find other solution for expecting gardener cluster.

mluk-sap commented 3 weeks ago

Discussed today during the refinement.

The Product Owner vetoed the idea of changing the API to have an explicit attribute to control the behavior. The recommendation is to implement an implicit check (Gardener CRDs existence). This is a common practice in other Kyma modules and in the Istio.

mluk-sap commented 1 week ago

Steps to reproduce:

k3d cluster create kyma --api-port 127.0.0.1:6443

kubectl create ns kyma-system

kubectl create -n kube-system cm shoot-info

kubectl label namespace kyma-system istio-injection=enabled --overwrite
kubectl apply -f https://github.com/kyma-project/istio/releases/latest/download/istio-manager.yaml
kubectl apply -f https://github.com/kyma-project/istio/releases/latest/download/istio-default-cr.yaml

kubectl apply -f https://github.com/kyma-project/api-gateway/releases/latest/download/api-gateway-manager.yaml
kubectl apply -f https://github.com/kyma-project/api-gateway/releases/latest/download/apigateway-default-cr.yaml

kubectl wait --for='jsonpath={.status.state}=Error' apigateway/default

kubectl describe apigateways.operator.kyma-project.io default
Ressetkk commented 1 day ago

1341 should address this issue. Will be available with 2.8.0. You can test it now with main branch.