-
Notifications
You must be signed in to change notification settings - Fork 62
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
Log the kind config file generated by our IDP builder #63
Conversation
cmoulliard
commented
Oct 25, 2023
- Issue: Ability to dump Kind cluster configuration #58
- Log the kind config file generated by the IDP builder
Signed-off-by: cmoulliard <[email protected]>
To be reviewed @greghaynes @nabuskey |
Sorry I don't think I was not specific at all in the issue. What I was thinking is to introduce a new subcommand like I think printing kind config during build is useful for debugging purposes, but being able to do it without invoking build would be ideal. |
I like this idea but what could be the interest to export ArgoCD or Gitea manifest EXCEPT if we propose a mechanism to export/import ? Without such export/import command a user could get the argocd resources using "kubectl get applications, etc" @nabuskey |
You are correct that the mechanism doesn't exist, but I am proposing such mechanism for Gitea here: idpbuilder/docs/pluggable-packages.md Lines 66 to 70 in 33ca6c7
Main use case to me is to allow for direct manifest manipulation to make small changes without rendering mechanisms. So the workflow I am thinking is something like:
For making small changes, it makes a lot easier to work from a known working configuration. This applies to the initialization phase (the |
Why do you want to only export/import the git server manifest AND not all the core components (= git + argocd + ingress + etc) OR a specific Remark: What you would like to do could break the IDP cluster if you change the service, ports, ingress host and dont change the king cfg, etc. |
What do you think about the following commands ? Remark: The manifest exported , should be "cleaned" to avoid to get uid, annotations generated, etc and when we create an idp cluster =>
|
Like you pointed out, the absolute minimum packages we need for idpbuilder to function are:
I agree that we should allow for ArgoCD and ingress configurations in a similar way. It just wasn't pointed out in the section since it talks about Git server. I'll add it to the doc.
Agreed. I think we can document that in the readme as well as in the manifest we print to warn users about these potential pitfalls. We can of course attempt to correct these in code but I am a bit hesitant without a concrete ask. I like the
I think we should export with yaml format only. Primary reason is that YAML allows for comments natively. Our comments in the document around potentially breaking fields, like ports you mentioned above, is very useful for end users to protect themselves. I am assume you meant to allow for JSON format here. If not, please clarify.
I don't think this is explicit enough. If we are to bundle everything (manifests for Argo, Gittea, and Ingresses) in a single file, It's hard to figure out which manifest belongs to which package. So to be more specific, we could do something like:
Then use stringslice to receive flag values. Let me know what you think! What we are talking about here is definitely out of scope for this issue though. Once we have a good way forward, let's open another issue to track this part. |
Have we considered adding this as a flag to the build command? I'd worry that if we create a second command it would also need to be invoked with the same parameters as the corresponding build command otherwise it may not be able to print out matching configuration. Alternatively, we could inject enough state in to k8s at build time that we could read it back out to print... |
Not quite following. Can you elaborate a bit more? Are you worried about duplicating flags / logic for |
Imagine we have some of the flags for configuration mentioned here like |
Oh I see, you are talking about exporting run time configuration. I was thinking about exporting embedded default configuration that we know will work with the binary. So the output of My intention was to allow for users to edit the known working configuration, then create a cluster off of it. Since we are using kind clusters, re-creating a cluster is fast. Now you mentioned it, wonder if we will confuse users. They might take it as exporting the current running configuration. |
yeah i think this feature probably makes a lot of sense in the context of a build log, personally |
one more thought about manipulating the manifests - if we are using gitea would you be able to do this for most things with git clone/edit/push? |
Yeah once we bootstrap, we can hand off management of everything to ArgoCD. |
Remark: ingress is needed for ALL the deployment (and not only for ArgoCD, Gitea) where a UI or URL will be exposed outside of the cluster (= to be able to access it from the local, laptop machine) |
+100 |
What about such command ?
|
Signed-off-by: cmoulliard <[email protected]>
As this PR is relevant as it logs the kind config generated, can we merge it and create a separate issue concerning the discussion around export/import core packages YAML resources ? @nabuskey |
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 working on this! Left a couple of comments.
@cmoulliard We had a discussion about the issue during the technical meeting today. I have put a summary here: #58 (comment)
@@ -90,6 +90,10 @@ func (c *Cluster) Reconcile(ctx context.Context, recreate bool) error { | |||
return err | |||
} | |||
|
|||
fmt.Print("########################### Our kind config ############################\n") |
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.
Any objections to using a logger? I know it uses fmt
here and other places, but I feel like it's nicer to consolidate logging stuff to one way. We currently use mix of fmt and logger and we should consolidate to one.
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.
I agree with you. concerning this point, I commented this ticket #15 to propose a better way to log.
We will fix that in a separate PR
Signed-off-by: cmoulliard <[email protected]>
Could be merged now :-) @nabuskey |
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.
LGTM