Skip to content

feat(nodeclass): add agentList to enable OCI agent plugins on launched instances#23

Merged
arindam-bandyopadhyay merged 1 commit into
oracle:mainfrom
p2pdkivenko:feat/agent-list-22
Jun 19, 2026
Merged

feat(nodeclass): add agentList to enable OCI agent plugins on launched instances#23
arindam-bandyopadhyay merged 1 commit into
oracle:mainfrom
p2pdkivenko:feat/agent-list-22

Conversation

@p2pdkivenko

Copy link
Copy Markdown
Contributor

Description

Adds a new agentList field to OCINodeClassSpec so users can enable Oracle Cloud Agent plugins (Bastion, Block Volume Management, Compute Instance Monitoring, OS Management Service Agent, etc.) on Karpenter-launched instances without having to ship custom cloud-init.

Each entry in the list is forwarded to LaunchInstanceDetails.AgentConfig.PluginsConfig with DesiredState=ENABLED. When the field is empty or unset, AgentConfig stays nil and behavior is unchanged from today (image defaults apply). The same shape is already used by the sibling project zoom/karpenter-oci, so existing user manifests transfer over directly.

Example:

apiVersion: oci.oraclecloud.com/v1beta1
kind: OCINodeClass
metadata:
  name: example
spec:
  # ...existing fields...
  agentList:
    - Bastion
    - Block Volume Management

Fixes #22

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • New unit test TestProvider_BuildAgentConfig in pkg/providers/instance/provider_test.go covering nil, empty, single-plugin, and multi-plugin cases.

  • Existing instance provider test suite (go test ./pkg/providers/instance/...) passes locally.

  • make gogen regenerates CRD YAML and zz_generated.deepcopy.go cleanly; both regenerated artifacts are included in the diff.

  • go build ./... succeeds for all packages touched by this change. (The pre-existing test/e2e/utils.go: undefined: NodePoolLabel build failure on main is unrelated to this change.)

  • Kubernetes version: 1.30

  • OKE version: n/a (provider built locally)

  • Karpenter Provider OCI version: built from this branch

  • Installation method: local run (go test)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas (godoc on the new agentList field documenting accepted plugin names and ENABLED-only semantics)
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label May 13, 2026
@p2pdkivenko p2pdkivenko force-pushed the feat/agent-list-22 branch from 57fdb44 to fb9b390 Compare May 13, 2026 22:45
@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for signing the OCA.

@oracle-contributor-agreement oracle-contributor-agreement Bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels May 20, 2026
Comment thread pkg/providers/instance/provider.go
Comment thread pkg/apis/v1beta1/ocinodeclass_types.go
Comment thread pkg/apis/crds/oci.oraclecloud.com_ocinodeclasses.yaml
p2pdkivenko added a commit to p2pdkivenko/karpenter-provider-oci that referenced this pull request Jun 17, 2026
…rage

Address PR oracle#23 review feedback:

- Include Spec.AgentList in HashNodeClassSpec via createStaticFieldsClone so
  that changes to the agent plugin list are detected as node-class drift and
  trigger node replacement (agentList is launch-time-only config, like
  SshAuthorizedKeys/PreBootstrapInitScript). Add a unit assertion verifying
  the hash changes when AgentList is mutated.
- Add an e2e test (TestAgentConfig/verifyAgentConfig) that patches the
  OCINodeClass with an agentList, waits for a node, fetches the OCI instance
  and asserts each plugin is present with DesiredState=ENABLED. Wire it into
  the flannel and NPN end-to-end flows, and expose AgentList on the e2e
  OCINodeClass config.

@arindam-bandyopadhyay arindam-bandyopadhyay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please run make verify and fix the findings, please squash the commits to a single commit. Also, make your changes on top of the current main

Comment thread pkg/apis/crds/oci.oraclecloud.com_ocinodeclasses.yaml
Comment thread pkg/providers/instance/provider_test.go
Comment thread test/e2e/e2e_test.go Outdated
Comment thread test/e2e/e2e_test.go
…d instances

Add an `agentList` field to OCINodeClass that enables the named Oracle Cloud
Agent plugins on launched instances via LaunchInstanceAgentConfigDetails. Each
listed plugin is set to ENABLED at launch time; plugins not listed keep their
image default.

The field is included in HashNodeClassSpec so changing agentList produces a new
nodeclass hash and triggers drift -> node replacement. Adds unit coverage for
buildAgentConfig and the hash behavior, plus e2e coverage (TestAgentConfig) on
the Flannel flow.

@arindam-bandyopadhyay arindam-bandyopadhyay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@arindam-bandyopadhyay arindam-bandyopadhyay merged commit 7e99af6 into oracle:main Jun 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add ability enable OCI agents on nodes

2 participants