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

MON-1955: apis: add thanos querier CRD #52

Merged
merged 1 commit into from
Oct 29, 2021

Conversation

jan--f
Copy link
Collaborator

@jan--f jan--f commented Oct 26, 2021

This only contains a CRD proposal yet. I'd like to discuss it before adding the operator code

@jan--f jan--f requested a review from fpetkovski October 26, 2021 13:23
pkg/apis/v1alpha1/types.go Show resolved Hide resolved
// Selector to select Monitoring stacks to unify
Selector metav1.LabelSelector `json:"selector"`
// Selector to select which namespaces the Monitoring Stack objects are discovered from.
NamespaceSelector NamespaceSelector `json:"namespaceSelector,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if it is better to user *metav1.LabelSelector for selecting namespaces like the rest of the k8s api ?

So we can run label query for over the namespaces and allows for a new namespace can be added without changing the spec.


nit: same as above *NamespaceSelector

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess a *metav1.LabelSelector cannot select all namespaces, but we could embed it into a NamespaceSelector like

type NamespaceSelector struct {
        *metav1.LabelSelector
	Any bool `json:"any,omitempty"`
}

or something along those lines

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure though I wonder if we actually want that.

If we just observe labels on a namespace, doesn't that mean that an owner of a namespace can add themselves to any thanos query instance, if they know the label to set?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a good point. I think that addon namespaces just have a special redhat- prefix and don't have any labels on them, so having a label selector will not be useful for us. Let's stick with the simpler approach and we can change things later

@fpetkovski
Copy link
Contributor

I think this looks good as a first iteration and we can even merge it. Would you mind running make lint to get the CI to pass?

@jan--f
Copy link
Collaborator Author

jan--f commented Oct 27, 2021

Sounds good, not sure what's up with the CI jobs. locally they all succeed.

@jan--f jan--f marked this pull request as ready for review October 27, 2021 14:10
@jan--f jan--f requested a review from a team October 27, 2021 14:10
@jan--f
Copy link
Collaborator Author

jan--f commented Oct 28, 2021

The CI implicitly assumes things are run with go1.16, I have 1.17 installed which creates the lint error here.

Do we really want to lint (and track) generated files? The build target depends on the controller-gen target anyway, so the autogenerated file is created when the operator is build. I'm not sure what the impact on development is, if that file isn't present from the get go.

@fpetkovski
Copy link
Contributor

We have to have the zz_generated.deepcopy.go in the repository, otherwise the code won't compile. However, we can exclude it from the diff here: https://github.com/rhobs/monitoring-stack-operator/blob/main/.github/workflows/pr-checks.yaml#L41

@fpetkovski
Copy link
Contributor

On second thought, we shouldn't be ignoring that file because it is part of the codebase. Let me see how we handle this in other projects.

@fpetkovski
Copy link
Contributor

I'd say let's bump go to 1.17 in the CI and we can make it a requirement for local development too.

The problem seems to be caused when controller-gen is go installed with different go versions. Eventually we'll want to update to go 1.17 so why not just do it sooner rather than later.

@jan--f
Copy link
Collaborator Author

jan--f commented Oct 28, 2021

I'd say let's bump go to 1.17 in the CI and we can make it a requirement for local development too.

That's my favorite solution.

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
@jan--f jan--f force-pushed the thanos-querier-crd branch from 578e64f to d221607 Compare October 29, 2021 08:47
@jan--f jan--f changed the title [RFC] MON-1955: apis: add thanos querier CRD MON-1955: apis: add thanos querier CRD Oct 29, 2021
Copy link
Contributor

@fpetkovski fpetkovski left a comment

Choose a reason for hiding this comment

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

lgtm

@fpetkovski
Copy link
Contributor

lgtm, feel free to merge it when you wish

@jan--f jan--f merged commit 0dd9499 into rhobs:main Oct 29, 2021
@jan--f jan--f deleted the thanos-querier-crd branch October 29, 2021 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants