-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
rework configuration using custom resources #164
Conversation
59554d7
to
83bfbf9
Compare
47da7a4
to
44a8887
Compare
One way to give this a test using the Helm charts is to generate the images, copy and import them to the test node (podman or ctr depending on your runtime), then use a Helm override like this with the name/tag matching your build and how you imported the image... # Test overrides for TA Helm Chart. You can use an almost identical one for balloons.
# - assume/use pre-imported plugin image
# - never try to pull
# - turn on full debugging
---
image:
name: localhost/nri-resource-policy-topology-aware
tag: v0.1.0-138-g0c402fe
pullPolicy: Never
policyConfig:
reservedResources:
cpu: 750m
commonConfig:
control:
enable:
- cpu
log:
debug:
"*": true
logSource: true
klog:
skip_headers: true
instrumentation:
reportPeriod: 60s
samplingRatePerMillion: 0
hostPort: 8891
resources:
cpu: 500m
memory: 512Mi
nri:
patchRuntimeConfig: false
initContainerImage:
name: ghcr.io/containers/nri-plugins/nri-config-manager
# If not defined Chart.AppVersion will be used
#tag: unstable
pullPolicy: Always
tolerations: [] |
44a8887
to
09db8f0
Compare
bd58e42
to
43e33d8
Compare
8a2f1cf
to
cd821ab
Compare
Implement bootstrapping and configuration using custom resources. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Remove old ConfigMap-based configuration infra. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Add updated sample configuration for the balloons and topology-aware policy plugins. Remove old ConfigMaps. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Update Helm chart for custom resource based configuration. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Update Helm chart for custom resource based configuration. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Add a helm chart for the template policy plugin. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Use a generic 'nri-plugin' template variable instead of the per chart '$PLUGIN_NAME[-plugin]' multiple variants, which AFAICT are neither necessary nor useful. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
bfc5408
to
6c77937
Compare
Update playbooks and e2e test infra to use helm for launching and terminating test plugins. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Update topology-aware tests for helm-based deployment and configuration by custom resources. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Update balloons tests for helm-based deployment and configuration by custom resources. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Remove old launch and terminate script API functions which were used to start/stop test plugins using daemonset deployment files. These are obsoleted by the recently introduced helm versions and should be unused. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Vagrant automatically configures sudo with !requiretty, so it should be safe to enable ansible pipelining by default. Additionally, enable persistent connections for ssh. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Remove obsolete deployment templates and related Makefile rules. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Do minimal editorial updates to the documentation. Remove references to ConfigMap-based common configuration. Refer to configuration custom resources instead. Remove a few other obsolete bits spotted and add a single- paragraph description about the template policy. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Fix the easiest bunch of complaints ansible-lint gave for playbook/provision.yaml. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
6c77937
to
3a6704b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @klihub for this huge effort 👏 I think the CRD API now looks nice and clean. And everything else (if we find something) we can easily change later without touching the UI (I hope) 😇
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this huge work, @klihub!
LGTM.
Follow the same group name as the new CRDs that are introduced by Krisztian Litkey in containers/nri-plugins#164. Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
Follow the same group name as the new CRDs that are introduced by Krisztian Litkey in containers/nri-plugins#164. Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
Also follow the same group name config.nri as the new CRDs that are introduced by Krisztian Litkey in containers/nri-plugins#164. Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
Also follow the same group name config.nri as the new CRDs that are introduced by Krisztian Litkey in containers/nri-plugins#164. Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
This commit adds the following improvments on CRD: 1. Add a finalizer to the Custom Resource to prevent its deletion until the associated Helm chart of the plugin has been removed. 2. Prevent mutation of the spec.pluginName field to ensure proper handling of plugin updates. If a user intends to deploy a different plugin than the one currently deployed, they must follow a two-step process: - Delete the existing Custom Resource (CR) instance. - Deploy a new CR instance with the updated plugin name. This restriction is necessary because the controller reconciliation process cannot distinguish between object creation and editing events. Allowing mutation could lead to reconciliation issues, where the controller may not recognize the need to uninstall the current plugin before installing the new one. This could potentially result in attempting to install two plugins in the same namespace, leading to errors. 3. Follow the same group name config.nri as the new CRDs that are introduced by Krisztian Litkey in containers/nri-plugins#164. Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
This commit adds the following improvments on CRD: 1. Add a finalizer to the Custom Resource to prevent its deletion until the associated Helm chart of the plugin has been removed. 2. Prevent mutation of the spec.pluginName field to ensure propely handling of plugin updates. If a user intends to deploy a different plugin than the one currently deployed, they must follow a two-step process: - Delete the existing Custom Resource (CR) instance. - Deploy a new CR instance with the updated plugin name. This restriction is necessary because the controller reconciliation process cannot distinguish between object creation and editing events. Allowing mutation could lead to reconciliation issues, where the controller may not recognize the need to uninstall the current plugin before installing the new one. This could potentially result in attempting to install two plugins in the same namespace, leading to errors. 3. Follows the same group name config.nri as the new CRDs that are introduced by Krisztian Litkey in containers/nri-plugins#164. 4. Tightens RBAC rules for better security 5. Cleanups auto-generated comments and boiler plate code 6. Allow users to customize Helm charts by extending the CR with spec.values. This field is optional (omitempty), and when specified, the values are passed to the Helm chart during plugin installation 7. Introduce an enumeration with predefined values for the 'spec.pluginName' and 'spec.state' fields, preventing users from setting incorrect values. Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
This patch set reworks how configuration is handled, switching from a single dynamically constructed map[string]interface{}/ConfigMap to multiple/per-plugin statically defined custom resources. In particular the patch set,
Note: Although already due to its mere size this is still work in progress, I've given up the idea that we'd be able to get this in final shape in a single go.
TODO: