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

Enable GitOps for existing, not AKS, Kubernetes cluster #17

Closed
RandomFractals opened this issue Aug 22, 2021 · 12 comments
Closed

Enable GitOps for existing, not AKS, Kubernetes cluster #17

RandomFractals opened this issue Aug 22, 2021 · 12 comments
Assignees
Labels
feature New feature request
Projects

Comments

@RandomFractals
Copy link
Collaborator

RandomFractals commented Aug 22, 2021

Create user interface to enable GitOps on an existing cluster already connected to the Kubernetes extension.

From the initial functional spec. by @murillodigital:

The platform operator should be able to enable GitOps in an existing cluster already connected to the Kubernetes extension by clicking a button. A repo should be created and opened as a folder automatically to represent the objects being synchronized with the cluster. The platform operator will be able to see at a glance when the cluster has reached a reconciled state.

As a user, I want to select a non-AKS Kubernetes cluster that does not have Flux installed and have the various Flux components automatically installed in it.

Present the user with a right-click option to "Enable GitOps", only available when the cluster does not have Flux installed (see #36).

The command to execute against the cluster is flux install and should generate output similar to the following:

flux install
✚ generating manifests
✔ manifests build completed
► installing components in flux-system namespace
◎ verifying installation
✔ source-controller: deployment ready
✔ kustomize-controller: deployment ready
✔ helm-controller: deployment ready
✔ notification-controller: deployment ready
✔ install finished

One the install is completed, the cluster should reload and, as per #36, display the version of flux and all its related components.

@RandomFractals RandomFractals added the feature New feature request label Aug 22, 2021
@RandomFractals RandomFractals added this to To do in VS Code Extension MVP via automation Aug 22, 2021
@RandomFractals RandomFractals self-assigned this Aug 27, 2021
@RandomFractals RandomFractals added this to Needs triage in Backlog via automation Aug 30, 2021
@murillodigital murillodigital changed the title Enable GitOps for existing Kubernetes cluster Enable GitOps for existing, non Azure, Kubernetes cluster Aug 31, 2021
@murillodigital murillodigital changed the title Enable GitOps for existing, non Azure, Kubernetes cluster Enable GitOps for existing, not AKS, Kubernetes cluster Aug 31, 2021
@murillodigital
Copy link
Contributor

@RandomFractals @usernamehw the development cluster is NOT an AKS cluster, however, since it already has Flux installed, you will not be able to satisfy the condition of the cluster being without it. I'm going to spin a second cluster without Flux, so that you can develop this ticket. We do not want to mess with the flux install on the current cluster cause that would break all the resources already in there. Will provide cluster access details over Slack. The idea here is for flux install to be executed by the Extension, and then you can manually flux uninstall from the terminal, making sure you are talking to the right cluster.

@RandomFractals RandomFractals removed this from Needs triage in Backlog Sep 8, 2021
@RandomFractals RandomFractals added this to To do in Sprint 3 via automation Sep 8, 2021
@RandomFractals
Copy link
Collaborator Author

RandomFractals commented Sep 8, 2021

@murillodigital to set up new cluster for us to test this.

@RandomFractals RandomFractals added the blocked Blocked task/issue label Sep 13, 2021
@RandomFractals RandomFractals removed their assignment Sep 13, 2021
@RandomFractals RandomFractals removed the blocked Blocked task/issue label Sep 13, 2021
@RandomFractals
Copy link
Collaborator Author

RandomFractals commented Sep 13, 2021

@usernamehw please test the config Leo shared in slack once you get flux system nodes and controllers loading done in #36

We should be able to run those flux install/uninstall commands and refresh our Clusters tree view to see extra flux sytem info loaded there.

We'll add the Enable GitOps menu option and command once we can confirm the above manual approach works.

@usernamehw
Copy link
Collaborator

usernamehw commented Sep 15, 2021

@RandomFractals I know that vscode supports passing objects/arrays for setting complex contexts with setContext, but tree view items can only have 1 string context.

Should we use a regex match in package.json and a string context of the type:
|cluster| or |cluster|clusterFluxEnabled| depending on the state
or until we hit the need for 3 contexts on 1 item we can use:
cluster or clusterFluxEnabled depending on the state.

@RandomFractals
Copy link
Collaborator Author

RandomFractals commented Sep 15, 2021

@usernamehw I think we should set cluster node contextValue to fluxCluster when we detect that flux-system namespace from #36 is present and we load those flux controllers.

Then we can simply enable GitOps: Uninstall Flux command for the fluxCluster and enable GitOps: Install Flux command for a regular cluster without flux controllers.

Have you tested the provided cluster without flux as I suggested above?

and do you see flux controllers loaded with that new cluster config when you run flux install and refresh our Clusters tree view?

@RandomFractals RandomFractals moved this from To do to In progress in Sprint 3 Sep 15, 2021
@RandomFractals RandomFractals removed this from In progress in Sprint 3 Sep 15, 2021
@RandomFractals RandomFractals added this to To do in Sprint 4 via automation Sep 15, 2021
@usernamehw
Copy link
Collaborator

Running flux install...

@RandomFractals RandomFractals moved this from To do to In progress in Sprint 4 Sep 15, 2021
@RandomFractals
Copy link
Collaborator Author

That looks good. Do you see them go away after you run flux uninstall and refresh the Clusters view?

You can wire those commands if that checks out.

@usernamehw
Copy link
Collaborator

They do go away.

@josefaworks
Copy link

Make sure ticket #71 is addressed as part of this ticket before closing

@RandomFractals
Copy link
Collaborator Author

RandomFractals commented Sep 18, 2021

@josefaworks This was created originally to enable GitOps on clusters.

We can use #71 to complete the clulsters view refresh story.

@usernamehw please wire enable gitops menu and commands to the tree view first as I described above.

We'll have to handle tree view updates and cluster node status/indicator updates in other places.

@usernamehw
Copy link
Collaborator

Not wired to the terminal yet (needs manual refresh), but commands are in place:

Animation

@RandomFractals
Copy link
Collaborator Author

RandomFractals commented Sep 20, 2021

this looks good. we'll handle clusters tree view refresh in #71.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
No open projects
Development

No branches or pull requests

4 participants