Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

(cleanup): Reconfigure the manifests & manifest generation#16

Merged
grokspawn merged 4 commits intooperator-framework:mainfrom
everettraven:cleanup/manifests
Mar 31, 2023
Merged

(cleanup): Reconfigure the manifests & manifest generation#16
grokspawn merged 4 commits intooperator-framework:mainfrom
everettraven:cleanup/manifests

Conversation

@everettraven
Copy link
Copy Markdown
Collaborator

Description

  • Update the config/ directory to be more similar to the standard put in place by the Operator-SDK and utilize kustomize for building the manifests for deploying catalogd on cluster
  • Update the make kustomize target to install Kustomize v5.0.1 under the bin/ directory
  • Update RBAC markers in controllers so that the proper permissions are generated under the config/rbac/role.yaml file

Motivation

  • Follow existing standards for operators/controllers to utilize kustomize for building manifests and the associated config/ directory structure
  • Enable manifest generation logic to actually populate changes in the correct locations
  • fixes Refactor manifests and manifest generation #10

to enable use of kustomize

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
@everettraven
Copy link
Copy Markdown
Collaborator Author

/cc @anik120

@openshift-ci openshift-ci Bot requested a review from anik120 March 29, 2023 19:47
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
@everettraven
Copy link
Copy Markdown
Collaborator Author

everettraven commented Mar 29, 2023

This PR could very well contain some manifest files that we don't care about (and aren't used by default), like webhook configurations, but I kept them in since I felt there could be an argument for keeping them for the future. If we feel it is better to remove them completely I am happy to do so.

Comment thread config/etcd/etcd.yaml Outdated
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
@joelanford
Copy link
Copy Markdown
Member

like webhook configurations

controller-gen generates those if we need them. So they're probably safe to delete if they aren't already being generated.

Comment thread config/apiserver/apiserver.yaml Outdated
name: catalogd
namespace: system
versionPriority: 10
caBundle: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUR6RENDQXJTZ0F3SUJBZ0lVT0t0RXJnS3pGMTl4ZXh6cUVXbExxcGlmN2lnd0RRWUpLb1pJaHZjTkFRRUwKQlFBd2RERUxNQWtHQTFVR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XJiOC9CKzkvYjhDZnFEb3dId1lEVlIwakJCZ3dGb0FVVmN5dDUvYXZFVzZJcmI4LwpCKzkvYjhDZnFEb3dFZ1lEVlIwVEFRSC9CQWd3QmdFQi93SUJBVEFOQmdrcWhraUc5dzBCQVFzRkFBT0NBUUVBClhFbU15L0tnMUZnVFdnL244ajcrak5aSFhHcWs2ZnZQMzNVbTZMaTdVL0JSOWZyQ05rQk9GSU9ZV21BWUlBQksKbEhSMStDQkJ5NncwSjFVMjZ4VEVaTnVPQVhOSHdPQVlNaURia2xRamlIMEdtcWpNUGxDQlhoUGpHTEhBK2h0dwpXd3JTL2h1bkJlU2RmbERtYThUbm9OMDUzTHZBanFNN3cwU3JOaWw3ZzhtM2k2djFmdGxNNkNJU1N0M05wRTZNCllnU2pMRTRLNmxCVFI0VU81K0hsanBVK2JWUCtHcDRMWHBGaEZJMU9jZjAxTC9iRGF3elhmYXNoNm8yVS9lOE8KOUZTa1Q2TzFlVW5COFRyRVMrZDlaKzBQS2dqZXAzU0NmV1N5WDFSdzZKZGM3SmNYY0I0ZmdLQ3FMNWtIbHNXUgpNcXErQ3UycVlZbnNiclo4ZVZaUGtRPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo="
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where does this CA bundle come from? Should we use cert-manager to generate and inject this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Should be resolved in 7a347fb

spec:
serviceAccountName: apiserver
containers:
- name: apiserver
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For follow-up: we should setup the security context to make sure this can run under restricted PSA.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yea I just remembered, there's already some pending work to make this compatible with restricted PSA : ref
I'll create an issue so that we can track this.

Comment thread config/apiserver/kustomization.yaml Outdated
kind: Kustomization
images:
- name: apiserver
newName: docker.io/anik120/rukpak-packageserver
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume this needs to change in some way?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm guessing this PR was opened before the image hosting was changed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

should be fixed in 7a347fb

Comment thread config/crd/kustomization.yaml Outdated
Comment on lines +13 to +14
#- patches/webhook_in_bundlemetadata.yaml
#- patches/webhook_in_packages.yaml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since these are served by an apiserver, I assume these comments are fully obsolete, and they'll never make sense in this context?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

removed in 7a347fb

Comment thread config/crd/kustomizeconfig.yaml Outdated
- kind: CustomResourceDefinition
version: v1
group: apiextensions.k8s.io
path: spec/conversion/webhook/clientConfig/service/name
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this present by default in kubebuilder/sdk scaffolding? I assume we're not actually using conversion webhooks, so my instinct would be to remove. But if this is there, but inert, by default I guess no harm in keeping it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It was included by default, but seemed to be inert. I removed it anyways in 7a347fb

Comment thread config/rbac/role.yaml Outdated
- list
- watch
- apiGroups:
- core.catalogd.io
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this domain related to this discussion?
Did anyone register that domain? Do we want to start using it until that has been done?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My vote is that for now we go with catalogd.operatorframework.io. And we continue the debate. This could be done in a follow-up as far as I'm concerned though.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't know if we reached any concrete conclusion from those discussions. But does feel like follow up PR concern though.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Since I have to make a few changes anyways I can update the domain as well

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Changed the domain in 7a347fb

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
Copy link
Copy Markdown
Member

@anik120 anik120 left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 31, 2023
images:
- name: apiserver
newName: quay.io/operator-framework/catalogd-server
newTag: latest
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Based on discussion in the other PR?

Suggested change
newTag: latest
newTag: devel

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I was going to wait and make the necessary changes based on whichever PR gets in first

@@ -0,0 +1,98 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wait, I'm confused. If the Package and BundleMetadata APIs are CRDs what are we getting out of the apiservice and our separate etcd? Seems like I need to go read code.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

My understanding is we are offloading the storage of those resources to the custom apiservice to handle and it was storing them in the separate etcd instance. That being said, I have extremely limited knowledge on custom apiservices and have no idea if this one is working as expected.

cc @anik120

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If that were true, there would be no CRDs for Package and BundleMetadata.

@grokspawn grokspawn merged commit 72bf6c0 into operator-framework:main Mar 31, 2023
everettraven added a commit to everettraven/catalogd that referenced this pull request Mar 31, 2023
…framework#16)

* refactor manifests

to enable use of kustomize

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>

* fix incorrect tag

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>

* revert storage-class

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>

* address review comments

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>

---------

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
Copy link
Copy Markdown
Member

@anik120 anik120 left a comment

Choose a reason for hiding this comment

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

Some post merge thoughts.

Comment thread Makefile

KUSTOMIZE = $(shell pwd)/bin/kustomize
## Tool Binaries
KUSTOMIZE ?= $(LOCALBIN)/kustomize
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The deploy target is broken
(KUSTOMIZE) edit set image controller=${IMG}

That should be CONTROLLER_IMG

Comment on lines +66 to +67
# seccompProfile:
# type: RuntimeDefault
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This needs to be uncommented

Comment on lines +39 to +58
# TODO(user): Uncomment the following code to configure the nodeAffinity expression
# according to the platforms which are supported by your solution.
# It is considered best practice to support multiple architectures. You can
# build your manager image using the makefile target docker-buildx.
# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: kubernetes.io/arch
# operator: In
# values:
# - amd64
# - arm64
# - ppc64le
# - s390x
# - key: kubernetes.io/os
# operator: In
# values:
# - linux
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can get rid of these lines instead of keeping them commented.

everettraven added a commit to everettraven/catalogd that referenced this pull request Apr 7, 2023
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
everettraven added a commit to everettraven/catalogd that referenced this pull request Apr 10, 2023
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor manifests and manifest generation

4 participants