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

Allow child resources to be deployed before trench #378

Open
LionelJouin opened this issue Feb 22, 2023 · 1 comment
Open

Allow child resources to be deployed before trench #378

LionelJouin opened this issue Feb 22, 2023 · 1 comment

Comments

@LionelJouin
Copy link
Member

LionelJouin commented Feb 22, 2023

Is your feature request related to a problem? Please describe.

Currently, deploying an attractor, gateway, conduit, stream, flow and vip requires the user to specify an existing trench. If the trench is not existing, then the webhook will prevent the resource to be applied and will return an error message. Also, as of now, if a trench is removed, then the child custom resources will also be removed.

There is currently no official feature to specify the order the custom resources will be deployed with Helm, this means if a conduit is deployed before a trench via Helm Chart, then the deployment will fail. It would then be easier for the users to remove the restriction for the trench to exist before the other CRs.
With helm it could also be a problem if the trench is part of another helm chart, the helm chart with the trench will have to be installed before the other ones.

For solution with only helm chart and no new implementation, refer to alternative 3.

Describe the solution you'd like

Describe alternatives you've considered

1. Update of the child resources on the fly

a. For now, the only property of the trench CR is the ip-family. This will be applied to the resources deployed with the child CR. For instance, if a trench is deployed with IPv4, then the internal IPs assigned to stateless-lb-frontend, proxy and target will only be IPv4. If the user remove and re-add the trench, then the IPs must be updated:

  • Because the IPAM has been reset (IPAM is deployed with the trench)
  • Because user might have changed the IP family in the trench

b. The webhook must work in both direction, when deploying a flow, attractor, gateway, we might want to verify none is using a not supported IP family, and the same when applying a trench, we should verify none of the child is using non supported IP Family.

2. Not deploying resources if no trench

This solution solve 1.a. but not 2.b.
If the trench does not exist, then the resources of the child are not deployed. If a trench is removed, then the resources deployed with the child are removed.

3. Helm Chart support ordering of custom resources

helm/helm#8439
helm/helm#8448
https://helm.sh/docs/topics/charts_hooks/#the-available-hooks

For now, there is 2 possible solution with helm:
i. pre-install hook: https://helm.sh/docs/topics/charts_hooks/#the-available-hooks

---
apiVersion: meridio.nordix.org/v1
kind: Trench
metadata:
  name: trench-a
  namespace: red
  annotations:
    "helm.sh/hook": pre-install
spec:
  ip-family: dualstack

ii. List: https://kubernetes.io/docs/reference/using-api/api-concepts/#collections

apiVersion: v1
kind: List
items:
- apiVersion: meridio.nordix.org/v1
  kind: Trench
  ...

Here are examples showing the problem, and the 2 possible solutions: Examples.zip

Additional context
/

@LionelJouin
Copy link
Member Author

LionelJouin commented Mar 13, 2023

Here is another problem related to helm chart:

Install CRDs:

helm install meridio-crds https://artifactory.nordix.org/artifactory/cloud-native/meridio/Meridio-CRDs-v1.0.3.tgz --create-namespace --namespace red

Install CRs charts (called dependency) with Meridio as dependency chart:

helm install meridio-co dependency --create-namespace --namespace red

Result:

Error: INSTALLATION FAILED: Internal error occurred: failed calling webhook "vvip.kb.io": failed to call webhook: Post "https://meridio-operator-webhook-service.red.svc:443/validate-meridio-nordix-org-v1-vip?timeout=10s": dial tcp 10.96.50.143:443: connect: connection refused

Examples.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📋 To Do
Development

No branches or pull requests

1 participant