microcks / microcks-ansible-operator

Kubernetes Operator for easy setup and management of Microcks installs
Apache License 2.0
24 stars 5 forks source link

Resources not applied in mongodb #97

Closed xacobecm closed 9 months ago

xacobecm commented 1 year ago

Describe the bug

When creating a MicrocksInstall resource with the following YAML:

apiVersion: microcks.github.io/v1alpha1
kind: MicrocksInstall
metadata:
  name: microcks
  namespace: microcks
spec:
  keycloak:
    install: true
    persistent: true
    resources:
      limits:
        cpu: 300m
        memory: 512Mi
      requests:
        cpu: 100m
        memory: 128Mi
    volumeSize: 1Gi
  microcks:
    replicas: 1
    resources:
      limits:
        cpu: 300m
        memory: 512Mi
      requests:
        cpu: 100m
        memory: 128Mi
  mongodb:
    install: true
    persistent: true
    resources:
      limits:
        cpu: 250m
        memory: 512Mi
      requests:
        cpu: 100m
        memory: 128Mi
    volumeSize: 2Gi
  name: microcks
  postman:
    replicas: 1
    resources:
      limits:
        cpu: 250m
        memory: 512Mi
      requests:
        cpu: 100m
        memory: 128Mi
  version: 1.7.0

All the pods came up with the limits and requests specified unless mongodb, which has the following resources:

- resources:
        limits:
          memory: 512Mi

Expected behavior

MongoDB having the limits and requests I specified in the MicrocksInstall

Actual behavior

All the pods came up with the limits and requests specified unless mongodb, which has the following resources:

- resources:
        limits:
          memory: 512Mi

How to Reproduce?

  1. Install Microcks 1.7.0 operator via OperatorHub in Openshift 4.
  2. Create a MicrocksInstall resource with the YAML specified above.

Microcks version or git rev

1.7.0

Install method (docker-compose, helm chart, operator, docker-desktop extension,...)

openshift operator

Additional information

Openshift cluster version 4.11.26

lbroudoux commented 1 year ago

Hello! Thanks for raising this issue. Looks like there's maybe an indentation issue when producing MongoDB deployment YAML... Planning investigation for next 1.7.1. Is it a blocker for you?

xacobecm commented 1 year ago

I just updated the resources manually in the Deployment, not a blocker at all. Just wanted to let you guys know 👍🏻

lbroudoux commented 1 year ago

Thanks for the hint! Just did a quick unit test (of YAML templating) and I'm not able to reproduce it at the moment.. I will have to go through a real "cluster test" to check it out.

lbroudoux commented 9 months ago

I succeeded in reproducing it on a real cluster deployment. It appears that resources appear twice in the YAML and the controller then removes the first one that matches the custom ones

lbroudoux commented 9 months ago

Now available in quay.io/microcks/microcks-ansible-operator:nightly container image