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

feat(additional containers): add node-level additional containers #91

Merged

Conversation

itamar-marom
Copy link
Collaborator

@itamar-marom itamar-marom commented Aug 13, 2023

Fixes #84

Description

This PR will add the ability to add additional containers at the node level in addition to cluster-level additional containers. It also will validate duplicate container names in the spec.

An example use case is described in the related issue.
Example use:

apiVersion: druid.apache.org/v1alpha1
kind: Druid
metadata:
  name: additional-containers
spec:
  additionalContainer:
    - command:
        - /bin/sh echo hello
      containerName: cluster-level
      image: hello-world
...
  nodes:
    brokers:
      additionalContainer:
        - command:
            - /bin/sh echo hello
          containerName: node-level
          image: hello-world

This PR has:

  • been tested on a real K8S cluster to ensure creation of a brand new Druid cluster works.
  • been tested for backward compatibility on a real K*S cluster by applying the changes introduced here on an existing Druid cluster. If there are any backward incompatible changes then they have been noted in the PR description.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added documentation for new or modified features or behaviors.

Key changed/added files in this PR
  • apis/druid/v1alpha1/druid_types.go
  • controllers/druid/handler.go
  • controllers/druid/additional_containers.go

@itamar-marom itamar-marom marked this pull request as ready for review August 14, 2023 14:28
@itamar-marom itamar-marom marked this pull request as draft August 14, 2023 14:49
@itamar-marom itamar-marom marked this pull request as ready for review August 14, 2023 14:59
Copy link
Contributor

@AdheipSingh AdheipSingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !!

)
}
}
mainContainer := v1.Container{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: mainContainer to container

@AdheipSingh
Copy link
Contributor

cc @cyril-corbon

@itamar-marom itamar-marom merged commit cb2447f into datainfrahq:master Aug 20, 2023
@itamar-marom itamar-marom deleted the feature/druid-node-level-sidecars branch August 20, 2023 06:04
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

Successfully merging this pull request may close these issues.

Supports deploying sidecars to individual druid service's pod rather than to all pods
2 participants