Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Deployment configuration and v1alpha2 version #388

Merged
merged 15 commits into from
Jul 15, 2024

Conversation

gazarenkov
Copy link
Member

@gazarenkov gazarenkov commented Jun 20, 2024

Description

This PR includes new way to configure Backstage deployment, now (in contrary to raw config) it is possible to add the changes as a and valid "fragment" of appsv1.deployment object inside Backstage CR and those fields will be merged with default (+raw) configuration, like:

apiVersion: rhdh.redhat.com/v1alpha2
kind: Backstage
metadata:
  name: my-backstage
spec:
  deployment:
    patch:
      spec:
        template:
          metadata:
             labels:
                label1: value1
          spec:
            containers:
              - name: backstage-backend
                 resources:
                    requests:
                        cpu: 250m
                        memory: 256Mi
             - name: my-sidecar
                image: my-sidecar
            volumes:
              - ephemeral:
                  volumeClaimTemplate:
                    spec:
                      storageClassName: "my-special-class"
                name: dynamic-plugins-root

Also, since this addition causes changes in the API, new API version v1alpha2 was added. So, as for Operator versions 0.3.x and 0.4.x (if we consider 3 months release cadency and 6 months API maintain) it will support as minimum both v1alpha1 and v1alpha2 (which become a storage version). After upgrading Operator to 0.3.x the following behaviour expected:

  • existed v1alpha1 CRs are working and shown as v1alpha2
  • both v1alpha1 and v1alpha2 CRs can be added/updated, all shown as v1alpha2

NOTE: v1alpha2 is backward compatible with v1alpha1 w/o data conversion

Openshift NOTE: deployment.patch field won't show up in the "Form view" when creating a CR from the OCP Web. To be able to edit it with ODC use "YAML view".

Which issue(s) does this PR fix or relate to

#352

PR acceptance criteria

How to test changes / Special notes to the reviewer

  • Create v1alpha2 Backstage resource as mentioned above
  • Create resource on 0.2.0 version, then upgrade operator and try to update old and create new resource

Signed-off-by: gazarenkov <gazarenkov@gmail.com>
Signed-off-by: gazarenkov <gazarenkov@gmail.com>
# Conflicts:
#	bundle/manifests/backstage-operator.clusterserviceversion.yaml
#	config/manifests/bases/backstage-operator.clusterserviceversion.yaml
#	integration_tests/db_test.go
#	integration_tests/default-config_test.go
#	pkg/model/secretfiles_test.go
Signed-off-by: gazarenkov <gazarenkov@gmail.com>
Signed-off-by: gazarenkov <gazarenkov@gmail.com>
Signed-off-by: gazarenkov <gazarenkov@gmail.com>
Copy link

openshift-ci bot commented Jun 20, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from gazarenkov. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Co-authored-by: gazarenkov <gazarenkov@users.noreply.github.com>
Copy link
Contributor

⚠️ Files changed in bundle generation!

Those changes to the operator bundle manifests should have been pushed automatically to your PR branch.
You might also need to manually update the .rhdh/bundle/manifests/rhdh-operator.csv.yaml CSV file accordingly.

.rhdh/bundle/manifests/rhdh-operator.csv.yaml Show resolved Hide resolved
api/v1alpha2/backstage_types.go Show resolved Hide resolved
api/v1alpha2/backstage_types.go Show resolved Hide resolved
api/v1alpha2/backstage_types.go Show resolved Hide resolved
pkg/model/deployment.go Outdated Show resolved Hide resolved
pkg/model/deployment.go Outdated Show resolved Hide resolved
pkg/model/deployment.go Outdated Show resolved Hide resolved
pkg/model/db-statefulset.go Outdated Show resolved Hide resolved
# Conflicts:
#	bundle/manifests/backstage-operator.clusterserviceversion.yaml
Signed-off-by: gazarenkov <gazarenkov@gmail.com>
…t_patch

# Conflicts:
#	bundle/manifests/backstage-operator.clusterserviceversion.yaml
Co-authored-by: gazarenkov <gazarenkov@users.noreply.github.com>
Copy link
Contributor

github-actions bot commented Jul 8, 2024

⚠️ Files changed in bundle generation!

Those changes to the operator bundle manifests should have been pushed automatically to your PR branch.
You might also need to manually update the .rhdh/bundle/manifests/rhdh-operator.csv.yaml CSV file accordingly.

Signed-off-by: gazarenkov <gazarenkov@gmail.com>
@gazarenkov gazarenkov merged commit 72f81ae into janus-idp:main Jul 15, 2024
6 of 7 checks passed
@gazarenkov gazarenkov deleted the deployment_patch branch August 6, 2024 12:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants