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

Spike: Investigate what is needed for registry operator and helm chart consistency #1193

Closed
6 tasks done
michael-valdron opened this issue Jul 17, 2023 · 22 comments
Closed
6 tasks done
Assignees
Labels
area/registry Devfile registry for stacks and infrastructure severity/blocker Issues that prevent developers from working

Comments

@michael-valdron
Copy link
Member

michael-valdron commented Jul 17, 2023

Which area/kind this issue is related to?

/area registry

Issue Description

The setup for the devfile registry helm chart and devfile registry operator are currently inconsistent. We need to ensure that the registry helm chart and registry operator setups are in sync before we can provide official releases #410.

First, we need to investigate what we need to change to ensure consistency of these setups.

#1028 is a bug which only exists in the registry operator and needs to be fixed in order to close this issue.

Related to #1260.

Outcome

To obtain details needed for implementing the changes needed to make the registry operator and registry helm chart consistent #1274.

Acceptance Criteria

  • Investigate specifications under registry operator and registry helm chart
    • Deployment specifications
    • Service specifications
    • Route specifications
    • Ingress specifications
    • Configmap specifications
    • Persistent Volume Claim (PVC) specifications
  • Investigate DevfileRegistry CR and helm chart parameters
  • Investigate registry operator cluster service version (CSV) and the Chart.yaml
  • Investigate hostname setup on both
  • Investigate app name setup on both
  • Investigate the helm chart requirements to check if it supports the same requirements as the registry operator
@michael-valdron michael-valdron self-assigned this Jul 17, 2023
@openshift-ci openshift-ci bot added the area/registry Devfile registry for stacks and infrastructure label Jul 17, 2023
@michael-valdron
Copy link
Member Author

blocked by #1028 changes to the deployment setup.

@michael-valdron
Copy link
Member Author

#1211 is blocking this issue from starting and will be no longer be a blocker once the pre-release is cut.

@michael-valdron michael-valdron removed their assignment Sep 8, 2023
@michael-valdron
Copy link
Member Author

Investigating how to split this up for both epics, #410 and #1009.

@michael-valdron michael-valdron changed the title Ensure helm chart and operator are consistent Ensure registry operator is consistent with helm chart Sep 20, 2023
@michael-valdron
Copy link
Member Author

Investigating how to split this up for both epics, #410 and #1009.

Created #1260 to track changes to the helm chart and will be under #1009 epic. This issue will remain tracking changes to the registry operator and will still be under #410 epic.

@michael-valdron
Copy link
Member Author

#1211 is blocking this issue from starting and will be no longer be a blocker once the pre-release is cut.

These changes will no longer be included in the pre-release to cut in #410, therefore no longer blocked by this and will be unblocked by the merge of #1028.

@michael-valdron
Copy link
Member Author

Updated acceptance criteria to include additional PR acceptance criteria for the operator, setting for next refinement call.

@michael-valdron
Copy link
Member Author

Further refinement is needed between this issue and #1260.

@michael-valdron
Copy link
Member Author

Deciding to convert this into a spike story, an investigation to what needs to be changed between the helm chart and the registry operator. Investigation will cover all the area currently documented as the acceptance criteria.

@michael-valdron michael-valdron changed the title Ensure registry operator is consistent with helm chart Investigate what is needed for registry operator and helm chart consistency Sep 29, 2023
@michael-valdron
Copy link
Member Author

#1028 is closed and so this issue is unblocked now.

@michael-valdron
Copy link
Member Author

Deciding to convert this into a spike story, an investigation to what needs to be changed between the helm chart and the registry operator. Investigation will cover all the area currently documented as the acceptance criteria.

Conversion is completed.

@michael-valdron michael-valdron added the severity/blocker Issues that prevent developers from working label Sep 29, 2023
@maysunfaisal maysunfaisal changed the title Investigate what is needed for registry operator and helm chart consistency Spike: Investigate what is needed for registry operator and helm chart consistency Jan 10, 2024
@michael-valdron
Copy link
Member Author

Deployment Specification

Pod Level securityContext

The devfile registry operator sets the UIDs and non root flag at the pod level if storage is enabled: https://github.com/devfile/registry-operator/blob/f55ab8e7c8061934547c7d55bd67d81d509a8752/pkg/registry/deployment.go#L294

Index Server

startupProbe

Timeouts on the helm chart should be updated to the timeouts on the registry operator:

initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 20

resources

Helm chart uses devfileIndex.memoryLimit parameter to override the memory limit: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/deployment.yaml#L95

The registry operator should do this as well.

Registry Viewer

livenessProbe

Timeouts on the helm chart should be updated to the timeouts on the registry operator:

initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 20

readinessProbe

Timeouts on the helm chart should be updated to the timeouts on the registry operator:

initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 20

volumeMounts

The registry operator no longer uses a mounted .env file for defining environment variables needed by the registry viewer, this mounted file should be removed from the helm chart: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/deployment.yaml#L150-L154

resources

Helm chart uses registryViewer.memoryLimit parameter to override the memory limit: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/deployment.yaml#L135

The registry operator should do this as well.

OCI Registry

resources

Helm chart uses ociRegistry.memoryLimit parameter to override the memory limit: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/deployment.yaml#L185

The registry operator should do this as well.

@michael-valdron
Copy link
Member Author

Ingress Specification

Helm chart uses full hostname with the ingress domain to define the host of the ingress: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/ingress.yaml#L29

Registry operator uses CR field DevfileRegistry.name with ingress domain to define the host of the ingress: https://github.com/devfile/registry-operator/blob/f55ab8e7c8061934547c7d55bd67d81d509a8752/pkg/registry/ingress.go#L73

This would result in a difference in host address between the registry operator and the helm chart when deploying to a k8s cluster.

@michael-valdron
Copy link
Member Author

michael-valdron commented Jan 26, 2024

Configmap Specification

metadata

Registry operator sets a namespace in the metadata object: https://github.com/devfile/registry-operator/blob/f55ab8e7c8061934547c7d55bd67d81d509a8752/pkg/registry/configmap.go#L62

Helm chart does not set a namespace under metadata object: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/configmap.yaml#L18

Namespace should be set on both.

DEVFILE_REGISTRIES name

Registry operator sets the devfile registry entry name to the name of the DevfileRegistry CR: https://github.com/devfile/registry-operator/blob/f55ab8e7c8061934547c7d55bd67d81d509a8752/pkg/registry/configmap.go#L55

Helm chart sets the devfile registry entry name to 'Community': https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/configmap.yaml#L47

For the local index server deployment, the app name should be used for the helm chart.

@michael-valdron
Copy link
Member Author

michael-valdron commented Jan 26, 2024

Persistent Volume Claim (PVC) Specification

Registry operator sets a namespace in the metadata object: https://github.com/devfile/registry-operator/blob/f55ab8e7c8061934547c7d55bd67d81d509a8752/pkg/registry/volume.go#L31

Helm chart does not set a namespace under metadata object: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/pvc.yaml#L19

Namespace should be set on both.

@michael-valdron
Copy link
Member Author

DevfileRegistry CRD Fields & Helm Chart Value Parameters

Devfile Registry Container Specs - Missing MemoryLimit

The DevfileRegistryContainer spec under the DevfileRegistry CRD of the registry operator is missing the MemoryLimit field that the helm chart has: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/values.yaml#L29

Devfile Registry Container Specs - Image Fields

Registry operator Image field handles the whole container image string, e.g. quay.io/devfile/devfile-index:next: https://github.com/devfile/registry-operator/blob/f55ab8e7c8061934547c7d55bd67d81d509a8752/api/v1alpha1/devfileregistry_types.go#L80

Helm chart has two fields, image and tag, which handles the image name reference and the tag reference respectively.

Consistency should be added between these two, either handle the whole image string or handle the two parts in two fields.

Missing ingress class name

The registry operator is missing a field to set the ingress class name https://github.com/devfile/registry-operator/blob/f55ab8e7c8061934547c7d55bd67d81d509a8752/api/v1alpha1/devfileregistry_types.go#L117, which is what the helm chart has: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/values.yaml#L18

@michael-valdron
Copy link
Member Author

CSV & Chart Definition Differences

Outdated Maintainers List

The list of maintainers under the Chart.yaml file should be updated to sync with the list of maintainers under the registry operator CSV. Maintainers list under Chart.yaml should also include emails.

Missing Fields

The helm chart Chart.yaml is missing the following fields to sync with the registry operator CSV:

Incorrect Home Field

home under Chart.yaml should be set to the devfile project homepage: https://devfile.io/

This is included as one of the entries under links in the registry operator CSV.

@michael-valdron
Copy link
Member Author

michael-valdron commented Jan 29, 2024

Hostname Setups

Hostname Format

As mentioned in #1193 (comment), the registry operator hostname setup only uses the CR name value for the hostname part, for openshift deployments and how the helm chart sets up the hostname _template.tpl#L16, the CR name is coupled with the namespace name to create the hostname.

The registry operator source should be changed to something of the following:

GetDevfileRegistryIngress

func GetDevfileRegistryIngress(cr *registryv1alpha1.DevfileRegistry) string {
	return GetHostname(cr) + "." + cr.Spec.K8s.IngressDomain
}

GetHostname

func GetHostname(cr *registryv1alpha1.DevfileRegistry) string {
	return fmt.Sprintf("%s-%s", cr.Name, cr.Namespace)
}

Hostname Override

Using the helm chart, one can use hostnameOverride parameter to override the entire ingress hostname and domain.

For example, the following will set the ingress address for the devfile registry deployment to https://dr.192.168.x.x.nip.io:

helm install devfile-registry deploy/chart/devfile-registry ... --set hostnameOverride='dr.192.168.x.x.nip.io' ...

Currently, the registry operator does not have this feature.

@michael-valdron
Copy link
Member Author

Requirements

Prerequisites for the helm chart should be revised to better sync with the requirements for the registry operator along with a commonly shared CLUSTER_SUPPORT.md document.

@michael-valdron
Copy link
Member Author

App Name Setups

Full App Name

The registry operator currently only has an app name that is used across the operator specifications: https://github.com/devfile/registry-operator/blob/f55ab8e7c8061934547c7d55bd67d81d509a8752/pkg/registry/naming.go

The helm chart uses both an app name and a fully qualified app name which a combo of the app name and release name by default: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/_template.tpl#L20-L39

The registry operator should implement a fully qualified app name as well and use this field in the same places as the helm chart does.

App Name Overrides

Using the helm chart, one can use nameOverride and fullnameOverride parameters to override the app name and full app name respectively.

For example, the following will set the app name for the devfile registry deployment to dr and full app name to devfile-registry:

helm install devfile-registry deploy/chart/devfile-registry ... --set nameOverride='dr' --set fullnameOverride='devfile-registry' ...

Currently, the registry operator does not have this feature.

Name Truncating

When setting the app names, the helm chart truncates strings used for the names to be 63 characters in length:

This is because some Kubernetes name fields are limited to this (by the DNS naming spec).

Currently, the registry operator does not truncate the app name to suite this limitation.

Deployment Specification

The helm chart will use app name for the metadata.labels.app field and the full app name for the metadata.name field: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/deployment.yaml#L18

The full app name is also used for the following:

Configmap Specification

The helm chart will use app name for the metadata.labels.app field and the full app name for the metadata.name field: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/configmap.yaml#L18

Service Specification

The helm chart will use app name for the metadata.labels.app field and the full app name for the metadata.name field: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/service.yaml#L18

Persistent Volume Claim (PVC) Specification

The helm chart will use app name for the metadata.labels.app field and the full app name for the metadata.name field: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/pvc.yaml#L19

Ingress Specification

The helm chart will use app name for the metadata.labels.app field and the full app name for the metadata.name field: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/ingress.yaml#L18

The full app name is also used for the following:

Route Specification

The helm chart will use app name for the metadata.labels.app field and the full app name for the metadata.name field: https://github.com/devfile/registry-support/blob/f66264f22310c3c93bf0c77db5f4cd4b560aba5e/deploy/chart/devfile-registry/templates/route.yaml#L18

The full app name is also used for the following:

@michael-valdron
Copy link
Member Author

Full findings document is accessible here: https://gist.github.com/michael-valdron/5d8ec297a93e7c8cd1691c4842332529

This document is under review.

@michael-valdron
Copy link
Member Author

Seeing the wide range of changes needed to be made, it might be best to break these down into different issues and convert #1274 into an epic.

@michael-valdron
Copy link
Member Author

Review has concluded, findings looks good for next steps, opting to convert #1274 into an epic due to the scope of the changes and setting milestones to suite bigger feature changes needed.

Seeing the wide range of changes needed to be made, it might be best to break these down into different issues and convert #1274 into an epic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/registry Devfile registry for stacks and infrastructure severity/blocker Issues that prevent developers from working
Projects
Status: Done ✅
Development

No branches or pull requests

1 participant