giantswarm / roadmap

Giant Swarm Product Roadmap
https://github.com/orgs/giantswarm/projects/273
Apache License 2.0
3 stars 0 forks source link

Protect resources which are managed via GitOps from edits in the UI #624

Closed gianfranco-l closed 2 years ago

gianfranco-l commented 2 years ago

User Story

- As a Giant Swarm user, I want to Protect resources which are managed via GitOps from edits in the UI so that I can prevent unwanted user edits and errors.

Background

A growing amount of Giant Swarm customers wants to manage resources like organizations, workload clusters, and apps via Gitops. Meaning that the definition for these resources is maintained in a git repository, and changes are reconciled automatically to the management cluster and workload clusters.

Tasks

web UI

marians commented 2 years ago

Copying from an internal issue: the label indicating that a resource is managed by GitOps is

giantswarm.io/managed-by: flux
kuosandys commented 2 years ago

Some notes from 20th June, 2022 refinement can be found here

marians commented 2 years ago

@ljakimczuk Our own cluster gollum/c68pn does not carry the label giantswarm.io/managed-by: flux on the main cluster resource. Is that a mistake in that cluster, or is the label not reliably found on gitops managed WCs?

ljakimczuk commented 2 years ago

@marians the problem with this label is that it is not set by any operator in terms of GitOps, it must be set manually on resources kept in the repository. So if you need an indicator of something being managed with GitOps, I would rather depend on the Flux labels, for example:

kustomize.toolkit.fluxcd.io/name: ...
kustomize.toolkit.fluxcd.io/namespace: ...
marians commented 2 years ago

@gianfranco-l There is a spec now in https://github.com/giantswarm/roadmap/issues/1176#issuecomment-1226878342 on how we intend to treat gitops-managed resources in the web UI. Would be great if honey badgers could give is some feedback on this. Implementation is not going to start before September 5.

gianfranco-l commented 2 years ago

@giantswarm/team-honeybadger pls have a look at this and provide feedback. more context here

ljakimczuk commented 2 years ago

@marians I checked the flux docs and according to it we can safely rely on these two labels:

uvegla commented 2 years ago

Those labels from Flux might be useful to display for example which Kustomization manages the resource (maybe there we could link to it and from there we could link to the source and there to the repository). For example:

kustomize.toolkit.fluxcd.io/name: gorilla-clusters-rfjh2
kustomize.toolkit.fluxcd.io/namespace: default

And from the kustomization:

sourceRef:
  kind: GitRepository
  name: workload-clusters-fleet

And from the source:

url: https://github.com/giantswarm/workload-clusters-fleet

Could also lead to displaying the status of these Flux resources like if they are suspended. The status as well but honestly that changes very often for the the UI to keep pulling it, but maybe.

(Copied over relevant parts from: https://github.com/giantswarm/roadmap/issues/1176#issuecomment-1230050398)

+ You can also get the path from them to the exact path in the repo that is being reconciled.

marians commented 2 years ago

FYI @gusevda The icon is available in Fortawesome under the name gitops.

image

marians commented 2 years ago

@gusevda just made me aware of some details which weren't covered, or were't consistent in the spec. Some notes.

Future improvements

In this milestone we leave some cases that are not covered in an ideal way.