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

Enable Operator for restricted network environments #86

Merged
merged 4 commits into from
Dec 20, 2023

Conversation

jianrongzhang89
Copy link
Contributor

@jianrongzhang89 jianrongzhang89 commented Dec 20, 2023

Description

Use environment variables POSTGRESQL_IMAGE and BACKSTAGE_IMAGE to the operator container to indicate the default images used by the operator to deploy psql db and backstage application, respectively.
Note that:
a) If the psql db statefulset has image unset, or set to the special string {POSTGRESQL_IMAGE}, the operator will replace it with the value of the environment variable POSTGRESQL_IMAGE. Similarly BACKSTAGE_IMAGE is introdiced for the backstage deployment object.
b) The user can still override the backstage image using the Backstage CR spec.application.image field.

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

PR acceptance criteria

  • Tests
  • Documentation

How to test changes / Special notes to the reviewer

Deploy the operator and the examples CRs. Check that the backstage app and psql db pods are running successfully.

@@ -198,6 +201,11 @@ spec:
- --leader-elect
command:
- /manager
env:
- name: POSTGRESQL_IMAGE
Copy link
Member

Choose a reason for hiding this comment

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

we might need to prefix these variables with RELATED_IMAGE_ so that the downstream build can automatically collect them into spec.relatedImages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. Updated the PR.

Copy link
Member

@nickboldt nickboldt left a comment

Choose a reason for hiding this comment

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

Generally +1, but with one adjustment idea (which maybe makes more sense in the downstream version) and one question about the name of the env vars, which can be tested and fixed in a followup PR if needed.

@nickboldt nickboldt mentioned this pull request Dec 20, 2023
Scheme: k8sClient.Scheme(),
Namespace: ns,
OwnsRuntime: true,
PsqlImage: "quay.io/fedora/postgresql-15:latest",
Copy link
Member

@gazarenkov gazarenkov Dec 20, 2023

Choose a reason for hiding this comment

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

Could you please specify how it was tested with restricted network environment?
As I understand (according to previous discussion) we specifically interested in testing SCV based installation.
Can you provide this information please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The automated test cases do not actually pull images from external resources. Changed to use dummy values.

@nickboldt Could you let us know how the test can be done on the restricted network environment?

Copy link
Member

@nickboldt nickboldt Dec 20, 2023

Choose a reason for hiding this comment

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

controllers/backstage_deployment.go Outdated Show resolved Hide resolved
controllers/local_db_statefulset.go Outdated Show resolved Hide resolved
@jianrongzhang89 jianrongzhang89 merged commit 19e79b6 into janus-idp:main Dec 20, 2023
3 checks passed
@jianrongzhang89 jianrongzhang89 deleted the psql-image branch December 20, 2023 16:12
@nickboldt
Copy link
Member

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.

Enable Operator for restricted network (air-gapped or proxied) environments
4 participants