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

Improve hosted docs with 'gotemplate' example to make configuring the deployment.yaml less tedious #234

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

squizzi
Copy link

@squizzi squizzi commented Aug 27, 2024

No description provided.

@squizzi squizzi force-pushed the hosted-docs branch 3 times, most recently from c8c6d01 to 28a027e Compare August 27, 2024 14:00
slysunkin
slysunkin previously approved these changes Aug 27, 2024
Copy link
Contributor

@slysunkin slysunkin left a comment

Choose a reason for hiding this comment

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

Looks good

kylewuolle
kylewuolle previously approved these changes Aug 27, 2024
a13x5
a13x5 previously requested changes Aug 27, 2024
Copy link
Contributor

@a13x5 a13x5 left a comment

Choose a reason for hiding this comment

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

IMO this makes docs more obscure. My intention was to actually show an example of the object without variables.

If you want to make fast/smart example I suggest to just add gotemplate and add it below the full object example.

Go template example:

apiVersion: hmc.mirantis.com/v1alpha1
kind: Deployment
metadata:
  name: aws-hosted-cp
spec:
  template: aws-hosted-cp
  config:
    vpcID: "{{.spec.network.vpc.id}}"
    region: us-west-1
    subnets:
      - id: "{{(index .spec.network.subnets 0).resourceID}}"
        availabilityZone: "{{(index .spec.network.subnets 0).availabilityZone}}"
    amiID: ami-0bf2d31c356e4cb25
    instanceType: t3.medium
    securityGroupIDs:
      - "{{.status.networkStatus.securityGroups.node.id}}"

Then it can just be evaluated with:

kubectl get awscluster cluster -o go-template="$(cat template)" > deployment.yaml

I believe it looks cleaner than bunch exports and envsubst.

@squizzi
Copy link
Author

squizzi commented Aug 28, 2024

IMO this makes docs more obscure. My intention was to actually show an example of the object without variables.

@a13x5 We can go with go template, that's fine, but you're comment makes me think perhaps their should just be a hosted subsection in the dev doc which includes the fast way of doing this. I think most instances of hosted setup for someone that isn't a dev aren't going to reuse standalone resources anyways. Thoughts?

@a13x5
Copy link
Contributor

a13x5 commented Aug 28, 2024

@squizzi I think it's better to add convenient shortcuts in this doc and not in the dev doc, since it's provider specific. We will have other quirks for other providers described in their respective docs. For example I will add the same section for Azure as well.

@squizzi squizzi changed the title Improve hosted docs with 'envsubst' example to make configuring the deployment.yaml less tedious Improve hosted docs with 'gotemplate' example to make configuring the deployment.yaml less tedious Aug 29, 2024
@squizzi squizzi merged commit 3c842b4 into Mirantis:main Sep 4, 2024
@squizzi squizzi deleted the hosted-docs branch September 4, 2024 21:40
bnallapeta pushed a commit to bnallapeta/hmc that referenced this pull request Nov 15, 2024
Improve hosted docs with 'gotemplate' example to make configuring the deployment.yaml less tedious
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants