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

Clarify how k8s.yaml.ConfigFile.resourcePrefix works #2837

Open
Tracked by #10302
jkodroff opened this issue Feb 19, 2024 · 4 comments
Open
Tracked by #10302

Clarify how k8s.yaml.ConfigFile.resourcePrefix works #2837

jkodroff opened this issue Feb 19, 2024 · 4 comments
Labels
area/docs Improvements or additions to documentation impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec

Comments

@jkodroff
Copy link
Member

jkodroff commented Feb 19, 2024

File: themes/default/content/registry/packages/kubernetes/api-docs/yaml/configfile/_index.md

We should add a little note for clarity that explained that resourcePrefix applies to the names of the Pulumi child resources of the ConfigGroup, not the metadata.name of the K8s resources.

I would also maybe add some text to the description that explain a little more explicitly how the resource works (i.e. that it creates a Pulumi resource for each K8s resource in the target file).

@github-actions github-actions bot added the needs-triage Needs attention from the triage team label Feb 19, 2024
@jkodroff
Copy link
Member Author

This should be moved to pulumi/kubernetes - my bad for clicking the "Request a Change" link.

@jkodroff
Copy link
Member Author

@lblackstone If you can confirm that I just need to hand-edit the schema (or whatever the way to fix is), I can fix this.

@lblackstone lblackstone transferred this issue from pulumi/pulumi-hugo Feb 20, 2024
@lblackstone
Copy link
Member

I transferred the issue for you. You're correct about needing to edit the schema, but I can't recall if it's directly in the pulumi-kubernetes repo, or if there was a separate place for overlay docs. @rquitales or @EronWright should be able to point you in the right direction.

@mjeffryes mjeffryes added kind/bug Some behavior is incorrect or out of spec area/docs Improvements or additions to documentation impact/usability Something that impacts users' ability to use the product easily and intuitively and removed needs-triage Needs attention from the triage team labels Feb 21, 2024
@EronWright
Copy link
Contributor

EronWright commented Feb 26, 2024

To add some background, the ConfigGroup resource is implemented separately for each language SDK, and the behavior of resourcePrefix seems to vary across the SDKs. I believe that in the dotnet SDK, the resourcePrefix is indeed applied to the object name, but not in the other SDKs.

I think we should provide the following guidance:

  1. Users should set resourcePrefix to the component name, as recommended in the docs:

In general, the name of the component resource instance itself (the name parameter passed into the component resource constructor) should be used as part of the name of the child resources.

  1. The resourcePrefix property should be considered immutable. If a change to the prefix is necessary, be sure to apply aliases to the new resources.

A good default:

const configGroup = new kubernetes.yaml.ConfigGroup("my-config-group", {
    resourcePrefix: "my-config-group",
});

I'm currently developing a "v2" of the ConfigGroup resource, that is MLC-based and will be available side-by-side with the current implementations. I don't plan to apply the prefix to the object name in this implementation.
#2844

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Improvements or additions to documentation impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

4 participants