Coder Social home page Coder Social logo

cluster-samples-operator's Introduction

Overview

The samples operator manages the sample imagestreams and templates stored in the openshift namespace, and any docker credentials, stored as a secret, needed for the imagestreams to import the images they reference.

On initial startup, the operator will create the default samples resource to initiate the creation of the imagestreams and templates. The imagestreams are the RHEL based OCP imagestreams pointing to images on registry.redhat.io. Similarly the templates are those categorized as OCP templates. When details for obtaining the credentials for registry.redhat.io are finalized, we will begin defaulting to that registry for the imagestreams.

The samples operator, along with it's configuration resources, are contained within the openshift-cluster-samples-operator namespace. With releases before 4.5, the samples operator would copy the install pull secret into the openshift namespace to facilitate API Server's imagestream import from registry.redhat.io. Starting with 4.5 that is no longer required, as the API Server's imagestream import can access the install pull secret for imagestreams in any namespace.
Otherwise, an admin can create any additional secret(s) in the openshift namespace as needed (where those secrets contain the content of a docker config.json) needed to facilitate image import, if say they override the registry to something other than registry.redhat.io.

The image for the samples operator contains imagestream and template definitions for the associated OpenShift release. Each sample includes an annotation that denotes the OpenShift version that it is compatible with. The operator uses this annotation to ensure that each sample matches it's release version. Samples outside of its inventory are ignored, as are skipped samples (see below). Modifications to any samples that are managed by the operator will be reverted automatically. The jenkins images are actually part of the image payload from the install and are tagged into the image streams in question directly.

The samples resource includes a finalizer which will clean up the following upon its deletion:

  • Operator managed imagestreams
  • Operator managed templates
  • Operator generated configuration resources
  • Cluster status resources

Upon deletion of the samples resource, the samples operator will recreate the resource using the default configuration.

Configuration

The samples resource offers the following configuration fields:

  • ManagementState
    • Managed: the operator will update the samples as the configuration dictates
    • Unmanaged: the operator will ignore updates to the samples resource object and any imagestreams or templates in the openshift namespace
    • Removed: the operator will remove the set of managed imagestreams and templates in the openshift namespace. It will ignore new samples created by the cluster admin or any samples in the skipped lists. After the removals are complete, the operator will work like it is in the 'Unmanaged' state and ignore any watch events on the sample resources, imagestreams, or templates. There are some caveats around concurrent creates and removal (see Config behaviors section).
  • Samples Registry: Override the registry that images are imported from
  • Architecture: The currently supported values are x86_64, amd64, arm64, ppc64le, s390x. This field was originally made an array during the early, pre-release days of 4.x because the possibility of installing multiple archtiectures was being considered. However, that has never come to fruition, nor is it likely to come to fruition. Instead, the operator looks at Go's runtime.GOARCH package / variable at its initial startup to determine which architecture's set of sample imagestreams and templates to install. And you are not allowed to change it after that.
  • Skipped Imagestreams: Imagestreams that are in the operator’s inventory, but that the cluster admin wants the operator to ignore / not manage
  • Skipped Templates: Templates that are in the operator’s inventory, but that the cluster admin wants the operator to ignore / not manage

Config restrictions

You cannot change the Architecture field at this time.

Config behaviors

  • Neither deletion nor setting the ManagementState to Removed will be complete while imagestream imports are still in progress. Once progress has completed (either in success or in error), then delete/remove will commence. Details on progress tracking can be found in the Conditions section.
  • imagestream/template watch events are ignored once deletion or removal has started
  • imagestream and templates watch events can come in before the initial samples resource object is created … the operator will detect and requeue the event

Conditions

The samples resource maintains the following conditions in its status:

  • SamplesExists: Indicates the samples have been created in the openshift namespace
  • ImageChangesInProgress:
    • This condition is deprecated as of the 4.7 branch of this repository. ImageStream image imports are no longer tracked in real time via conditions on the samples config resource, nor do in progress ImageStreams directly affect updates to the ClusterOperator instance openshift-samples. Prolonged errors with ImageStreams are reported now by Prometheus alerts.
    • Also, the list of pending imagestreams will be represented by a configmap for each imagestream in the samples operator's namespace (where the imagestream name is the configmap name). When the imagestream has completed imports, the respective configmap for the imagestream is deleted.
  • ImportCredentialsExist: Credentials for pulling from registry.redhat.io exist in the pull-secret Secret in the openshift-config namespace ... i.e. the install pull secret
  • ConfigurationValid: True or false based on whether any of the restricted changes noted above have been submitted
  • RemovePending: Indicator that we have a management state removed setting pending, resulting in deletion of all the resources the operator manages. Note that deletions do not start while are waiting for any in progress imagestreams to complete. This is set to true just prior to executing the deletions, and set to false when the deletions are completed. The associated ClusterOperator object for the Samples Operator will have its Progressing condition set to true when this Condition is true (though typically the deletions occur fairly quickly).
  • ImportImageErrorsExist:
    • Indicator of which imagestreams had errors during the image import phase for one of their tags
    • True when an error has occurred
    • The configmap associated with the imagestream will remain in the samples operator's namespace. There will be a key in the configmap's data map for each imagestreamtag, where the value of the entry will be the error message reported in the imagestream status.
  • MigrationInProgress: This condition is deprecated as of the 4.7 branch of this repository. Upgrade tracking is now achieved via the other conditions and both the per imagestream configmaps and the imagestream-to-image configmap.

CVO Cluster Operator Status

  • Available
  • Failing
  • Progressing

See https://github.com/openshift/cluster-version-operator/blob/master/docs/dev/clusteroperator.md#conditions for how these Cluster Operator status conditions are managed.

Disconnected mirroring assistance

A ConfigMap named imagestreamtag-to-image is created in the Samples Operator's namespace that contains an entry for each ImageStreamTag, where the value of the entry is the image used to populate that ImageStreamTag.

The format of the key for each entry in the data field in the ConfigMap is <imagestreamname>_<imagestreamtagname>.

Samples Operator will come up as Removed for a disconnected OCP install. If you choose to change it to Managed, override the registry to a mirror registry available in your disconnected environment, you can use this ConfigMap as a reference for which images need to be mirrored for your ImageStreams of interest to properly import.

IPv6

Samples Operator will bootstrap as Removed if it detects it is running on ipv6, since at last check, registry.redhat.io does not support ipv6.

Troubleshooting

CRD instance for the samples operator config: oc get configs.samples.operator.openshift.io cluster -o yaml

You can also use configs.samples for short.

Check the status of the conditions. (See above for details on those conditions)

While imagestream import failures no longer affect the state Samples reports to the CVO (that changes occurred in 4.6), the samples operator will fire Prometheus alerts per the rules defined in https://github.com/openshift/cluster-samples-operator/blob/master/manifests/010-prometheus-rules.yaml

The samples operator will also attempt to re-import the imagestreams on approximate 15 minute intervals. Otherwise, a cluster admin can:

  • Retry the import whenever they like via oc import-image <imagestream name> -n openshift --all; if successful, the operator will detect the success and clear that imagestream from the failure list
  • Add the failing imagestream(s) to the skippedImagestreams list; the operator will also clear the imagestream(s) specified from the failure list

Deployment, Events in operator’s namespace (openshift-cluster-samples-operator): basic oc get pods, oc get events, oc logs of the operator pod

If any configmaps persist in the samples operator's namespace, the data maps for those configmaps will have information on which import failed: oc get configmaps -n openshift-cluster-samples-operator -o yaml

Samples: oc get is -n openshift, oc get templates -n openshift … use of -o yaml on any given imagestream should show the status, and import errors will be noted there as well

Deletion of the CRD instance will reset the samples operator to the default configuration, but leave the current revision of the samples operator pod running.

You can also set the management state of the samples operator to Removed if you do not need samples running in your cluster:

apiVersion: samples.operator.openshift.io/v1
kind: Config
metadata:
  name: cluster
spec:
  architectures:
  - x86_64
  managementState: Removed

"In-payload" imagestreams

The imagestreams defined at (https://github.com/openshift/cluster-samples-operator/blob/master/manifests/08-openshift-imagestreams.yaml)[https://github.com/openshift/cluster-samples-operator/blob/master/manifests/08-openshift-imagestreams.yaml] are not managed by the samples operator. These are special imagestreams that point to images in the install payload, and their creation and updates are handled by the Cluster Version Operator

Development

NOTE: this next step violates your cluster support contract if you are an OCP customer. But if your are using a cluster for development, and you wish to experiment with and update the samples operator code itself, you can reset the image used for the samples operator via the following steps:

  • Run oc edit clusterversion version and add an override entry to the spec for the Deployment of the samples operator so it is unmanaged:
spec:
  overrides:
  - kind: Deployment
    group: apps/v1
    name: cluster-samples-operator
    namespace: openshift-cluster-samples-operator
    unmanaged: true
  • Scale down the deployment via oc scale deploy cluster-samples-operator --replicas=0
  • Edit the samples resource, oc edit config.samples cluster, remove the finalizer
  • Delete the samples resource, oc delete config.samples cluster, config map/secrets in operator namespace, imagestreams and templates in openshift namespace
  • Scale up the deployment via oc scale deploy cluster-samples-operator --replicas=1

Update the content in this repository from https://github.com/openshift/library

  • Create a git branch in your local copy of this repository
  • ./library-sync.sh
  • Commit the changes and create a PR

cluster-samples-operator's People

Contributors

abhinavdahiya avatar adambkaplan avatar aerdei avatar bparees avatar coreydaley avatar csrwng avatar deads2k avatar dperaza4dustbit avatar fbm3307 avatar gabemontero avatar lorbuschris avatar openshift-bot avatar openshift-ci-robot avatar openshift-ci[bot] avatar openshift-merge-bot[bot] avatar openshift-merge-robot avatar osherdp avatar prashanth684 avatar ravisantoshgudimetla avatar sanchezl avatar sherine-k avatar smarterclayton avatar stbenjam avatar stevekuznetsov avatar vrutkovs avatar waveywaves avatar wking avatar xiuwang avatar xueqzhan avatar yselkowitz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cluster-samples-operator's Issues

Cluster operator openshift-samples has not yet successfully rolled out during upgrade on s390x

When I upgrade OCP from 4.2.x to 4.3.22 for s390x. I got an error on the dashboard described below.

Unable to apply 4.3.22: the cluster operator openshift-samples has not yet successfully rolled out

Checked the cluster operator, I saw below messages.

Conditions:
    Last Transition Time:  2020-02-11T08:45:58Z
    Reason:                NonX86Platform
    Status:                False
    Type:                  Progressing
    Last Transition Time:  2020-02-11T08:45:58Z
    Reason:                NonX86Platform
    Status:                False
    Type:                  Degraded
    Last Transition Time:  2020-06-01T14:38:13Z
    Reason:                NonX86Platform
    Status:                True
    Type:                  Available
  Extension:               <nil>
  Related Objects:
    Group:     samples.operator.openshift.io
    Name:      cluster
    Resource:  configs
    Group:
    Name:      openshift-cluster-samples-operator
    Resource:  namespaces
    Group:
    Name:      openshift
    Resource:  namespaces
  Versions:
    Name:     operator
    Version:  4.2.33

RFE - Add feature to switch ImageStream source registries.

I'm working with Openshift 4.2 pre-release. I performed a disconnected installation where i mirror images locally and then install from there. I use the 'oc adm release mirror' feature to mirror the platform's images. I also have a python script that mirrors the various non-platform (application specific) images. Additionally, i have a python script that is run post-install that patches all the ImageStream specs to point to the local registry. It would seem that it would be more elegant if this patching of imagestreams could be done by this particular operator (openshift-samples).

My request is to provide a feature where i can easily change the source registry for all image streams that are deployed during the install process. Similar to OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE for the platform images.

-Nick

status/processing of changing installtype is incorrect

  1. starting from a default CR w/ installtype: centos

  2. change the installtype to rhel8, status correctly reports:

 message: trying to change installtype, which is not allowed, but also specificed
      an unsupported installtype rhel8
  1. change the installtype to rhel. Status message does not change, I would expect it to just say "changing the install type is not allowed", it shouldn't be complaining about "rhel8" anymore.

  2. change the installtype to "centos". Status message does not change. I would expect it to be back to a valid/non-error state.

@gabemontero

Using Jenkins in an offline-installation scenario

We are currently tying to get the Samples-Operator Jenkins-Template working in a air-gapped/offline Installation scenario. We set the samplesRegistry value to our on-site mirror-registry and all Imagestreams, except the Jenkins and Jenkins-Agent ones are mapped correctly.

Can someone please give a hint how to fix this?
I tried to set the jenkins-image env-vars on the operator deployment manually without any luck (resets after some minutes).

Thank you!

[api-freeze] Verify operator API is frozen

Backwards compatibility of GA APIs

What constitutes a backwards compatible API?

  1. Fields can not be removed (this also means you can’t rename a field)
  2. Serialized defaults can not change. Unserialized defaults in operators can change over time.
  3. Behavior (meaning) of a field can not change. This means that old fields must be maintained even if new fields supercede them.
  4. New fields can be introduced that supercede existing fields, but values in the existing fields must be respected when present.

Other things that should be considered “API”

  1. Names of singleton CRs in openshift-config (user-provided) and openshift-config-managed (operator-provided) namespaces that are used for cross-communication of components
  2. Names / namespaces of Services used for cross-communication of components
  3. Annotations and labels used for cross-communication of components

/assign @gabemontero

Samples Bump for OCP 4.4?

Hi team,

What's the deals with samples bumps with relation to release-versions for OpenShift?

I can see that there has been a samples-bump for OpenShift 4.5 resulting in OpenJDK18:1.8 tag being present and managed by the Samples Operator in OpenShift 4.5[0] but is not present in OCP 4.4[1].

Is it expected that I need to upgrade to OpenShift 4.5 to get the samples-bump, or is there some other process that results in bringing the Samples Operator desired image-streams more inline with the library repo?[2]

[0] https://github.com/openshift/cluster-samples-operator/blob/release-4.4/tmp/build/assets/operator/ocp-x86_64/java/imagestreams/redhat-openjdk18-openshift-rhel7.json
[1] https://github.com/openshift/cluster-samples-operator/blob/release-4.5/tmp/build/assets/operator/ocp-x86_64/java/imagestreams/redhat-openjdk18-openshift-rhel7.json
[2] https://github.com/openshift/library/

Red Hat registry credentials seem to be required for OKD4

(opening an issue as requested on Slack https://kubernetes.slack.com/archives/C6AD6JM17/p1637833592421600)

In my OKD4 cluster the SamplesMissingTBRCredential alert is always firing, with the message

The samples operator cannot find credentials for 'registry.redhat.io'. Many of the sample ImageStreams will fail to import unless the 'samplesRegistry' in the operator configuration is changed.

While I understand why this alert would be firing in an OCP cluster, in an OKD cluster a typical user would not have a contract with Red Hat and thus would have no means to obtain the needed credentials (apart from missing licenses for the products inside the registry). Is this somehow expected and if not, could it be fixed? Is this possibly a configuration problem on my side?

Issue valid for at least for cluster-samples-operator version 4.9.0-0.okd-2021-11-28-035710 and certainly several versions before that.

cluster-samples-operator and stuck upgrade from 4.6 to 4.7 with restricted networks

Hi

we had set cluster-samples-operator to unmanaged and we have limited registries to our own (quay which ist not pull-thru-able) with allowedRegistriesForImport in the "images.config cluster" in our network restricted environment.

As we startet upgrade from 4.6.latest to 4.7.22. the whole upgrade got stuck with the creation of the is/hello-openshift. The only way we were able to finish upgrade was adding quay.io, registry.redhat.io and registry.access.redhat.com to the allowedRegistriesForImport and set cluster-samples-operator to Managed. i'm not sure if the steps described at https://github.com/openshift/cluster-samples-operator#troubleshooting helped us anything at all. nevertheless i had to remove the override in the clusterversion as otherwise openshift had always a warning hanging around (sorry forgot which).

to be honest this took us almost 1 day to figure out, which is way to much for just samples, we're not even interested. i hope the whole removal of the cluster-samples-operator would be possible in future... so its off and stays off without breaking my cluster.

regards,ivo

ImageStreamTags are not updated

Hello,

I have a question regarding the cluster-sample-operator: I understand the cluster-sample-operator is maintaining the ImageStreams and Templates in the project openshift. I had a look at an older test OpenShift cluster and noticed that the ImageStreamTag were created but are never been updated since. From my point of view, the ImageStreamTags are created when a tag attribute is "added" in an ImageStream. If a tag is removed from an ImageStream, the Adminstration Consol will display ImageStreamTag in the ImageStream with the text "pushed image" in the from column. From my point of view, ImageStreamTags are containing no reference to ImageStreams. Any modification (besides the creation) of tags in the ImageStreams seem to be not reflected in ImageStreamTags.

Is this on purpose that ImageStreamTags are not updated (replaced with a new version), if the associated ImageStream is modified?

Thank you very much in advance,

Olaf

report error if registry is registry.redhat.io and no secret provided

If the configuration is to install rhel imagestreams, and no override registry is provided (or the override registry is registry.redhat.io), and there is no imageimport secret available, we should report an error and refuse to proceed.

Otherwise we're going to create the imagestreams and they're going to fail to import and then the user has to manually re-import them after creating the secret.

Database templates have broken links to documentation

If you go to an OpenShift cluster and attempt to instantiate a postgres or mysql template, the Documentation links

https://docs.okd.io/latest/using_images/db_images/mysql.html
https://docs.okd.io/latest/using_images/db_images/postgresql.html

The MariaDB link is valid:

https://github.com/sclorg/mariadb-container/blob/master/10.3/root/usr/share/container-scripts/mysql/README.md

If the docs.okd.io links will not be restored, perhaps all the database templates need to be made consistent and functional.

Update Jenkins templates to include trusted-ca-bundle fixes

openshift/jenkins#1045 updates the Jenkins templates to make use of network operator's injected certificate trust bundle.

These changes haven't made it into the templates managed by the samples operator yet. In particular:

release-4.3

Fixes not present

$ find '(' -path './assets/operator/ocp-*/jenkins/templates/*' -o -path './tmp/build/assets/operator/ocp-*/jenkins/templates/*' ')' -name '*.json' -exec grep -c trusted-ca-bundle {} +
./tmp/build/assets/operator/ocp-x86_64/jenkins/templates/jenkins-persistent-monitored.json:0
./tmp/build/assets/operator/ocp-x86_64/jenkins/templates/jenkins-persistent.json:0
./tmp/build/assets/operator/ocp-x86_64/jenkins/templates/jenkins-ephemeral.json:0
./tmp/build/assets/operator/ocp-x86_64/jenkins/templates/jenkins-ephemeral-monitored.json:0
release-4.4

Fixes missing for x86_64:

$ find '(' -path './assets/operator/ocp-*/jenkins/templates/*' -o -path './tmp/build/assets/operator/ocp-*/jenkins/templates/*' ')' -name '*.json' -exec grep -c trusted-ca-bundle {} +
./tmp/build/assets/operator/ocp-s390x/jenkins/templates/jenkins-persistent-monitored.json:4
./tmp/build/assets/operator/ocp-s390x/jenkins/templates/jenkins-persistent.json:4
./tmp/build/assets/operator/ocp-s390x/jenkins/templates/jenkins-ephemeral.json:4
./tmp/build/assets/operator/ocp-s390x/jenkins/templates/jenkins-ephemeral-monitored.json:4
./tmp/build/assets/operator/ocp-ppc64le/jenkins/templates/jenkins-persistent-monitored.json:4
./tmp/build/assets/operator/ocp-ppc64le/jenkins/templates/jenkins-persistent.json:4
./tmp/build/assets/operator/ocp-ppc64le/jenkins/templates/jenkins-ephemeral.json:4
./tmp/build/assets/operator/ocp-ppc64le/jenkins/templates/jenkins-ephemeral-monitored.json:4
./tmp/build/assets/operator/ocp-x86_64/jenkins/templates/jenkins-persistent-monitored.json:0
./tmp/build/assets/operator/ocp-x86_64/jenkins/templates/jenkins-persistent.json:0
./tmp/build/assets/operator/ocp-x86_64/jenkins/templates/jenkins-ephemeral.json:0
./tmp/build/assets/operator/ocp-x86_64/jenkins/templates/jenkins-ephemeral-monitored.json:0
release-4.5

Fixes missing for x86_64:

$ find '(' -path './assets/operator/ocp-*/jenkins/templates/*' -o -path './tmp/build/assets/operator/ocp-*/jenkins/templates/*' ')' -name '*.json' -exec grep -c trusted-ca-bundle {} +
./tmp/build/assets/operator/ocp-s390x/jenkins/templates/jenkins-persistent-monitored.json:4
./tmp/build/assets/operator/ocp-s390x/jenkins/templates/jenkins-persistent.json:4
./tmp/build/assets/operator/ocp-s390x/jenkins/templates/jenkins-ephemeral.json:4
./tmp/build/assets/operator/ocp-s390x/jenkins/templates/jenkins-ephemeral-monitored.json:4
./tmp/build/assets/operator/ocp-ppc64le/jenkins/templates/jenkins-persistent-monitored.json:4
./tmp/build/assets/operator/ocp-ppc64le/jenkins/templates/jenkins-persistent.json:4
./tmp/build/assets/operator/ocp-ppc64le/jenkins/templates/jenkins-ephemeral.json:4
./tmp/build/assets/operator/ocp-ppc64le/jenkins/templates/jenkins-ephemeral-monitored.json:4
./tmp/build/assets/operator/ocp-x86_64/jenkins/templates/jenkins-persistent-monitored.json:0
./tmp/build/assets/operator/ocp-x86_64/jenkins/templates/jenkins-persistent.json:0
./tmp/build/assets/operator/ocp-x86_64/jenkins/templates/jenkins-ephemeral.json:0
./tmp/build/assets/operator/ocp-x86_64/jenkins/templates/jenkins-ephemeral-monitored.json:0
release-4.6, release-4.7, master

Fixes missing for x86_64 in the templates for non-monitored service:

$ find '(' -path './assets/operator/ocp-*/jenkins/templates/*' -o -path './tmp/build/assets/operator/ocp-*/jenkins/templates/*' ')' -name '*.json' -exec grep -c trusted-ca-bundle {} +
./assets/operator/ocp-s390x/jenkins/templates/jenkins-persistent-monitored.json:4
./assets/operator/ocp-s390x/jenkins/templates/jenkins-persistent.json:4
./assets/operator/ocp-s390x/jenkins/templates/jenkins-ephemeral.json:4
./assets/operator/ocp-s390x/jenkins/templates/jenkins-ephemeral-monitored.json:4
./assets/operator/ocp-ppc64le/jenkins/templates/jenkins-persistent-monitored.json:4
./assets/operator/ocp-ppc64le/jenkins/templates/jenkins-persistent.json:4
./assets/operator/ocp-ppc64le/jenkins/templates/jenkins-ephemeral.json:4
./assets/operator/ocp-ppc64le/jenkins/templates/jenkins-ephemeral-monitored.json:4
./assets/operator/ocp-x86_64/jenkins/templates/jenkins-persistent-monitored.json:4
./assets/operator/ocp-x86_64/jenkins/templates/jenkins-persistent.json:0
./assets/operator/ocp-x86_64/jenkins/templates/jenkins-ephemeral.json:0
./assets/operator/ocp-x86_64/jenkins/templates/jenkins-ephemeral-monitored.json:4

move samples custom resource to be cluster scoped

Since we only want one set of samples per cluster anyway and because finalizers deadlock themselves when the finalizer and the resource being finalized run in the same namespace, we need to switch the samples resource CRD to be cluster scoped instead of namespace scoped.

/cc @deads2k

/assign @gabemontero

samples operator should wait for registry to exist

for complex reasons i can explain in person, it would be best if the samples operator did not install the samples until after we know the registry has been installed.

Unfortunately this means checking at least two places for the registry:

  1. the default namespace (3.11 and earlier)
  2. the openshift-image-registry namespace (4.0 and beyond, assuming migration has happened or a clean install)

There may be other things we can block the installation on, fundamentally we need to ensure that the openshift apiserver knows what the internalRegistryHostname is before we install the imagestreams, and the registry operator will be responsible for providing that value to the apiserver. (We may be able to just check for the value directly, in the same way the apiserver picks up the value..that might be better than looking for a registry to be running).

s390x - OpenShift installer does not detect cluster-samples-operator readiness

On the latest commit on s390x, the cluster samples operator is reporting that it is available and finished progressing, however the openshift installer is not detecting that the operator has finished updating, and ends up timing out.

DEBUG Built from commit 6ed04f65b0f6a1e11f10afe658465ba8195ac459 
INFO Waiting up to 30m0s for the cluster at https://api.test.example.com:6443 to initialize... 
DEBUG Still waiting for the cluster to initialize: Cluster operator openshift-samples is still updating```

types.go should not contain utility/helper functions

We shouldn't have things like this:
https://github.com/openshift/cluster-samples-operator/blob/master/pkg/apis/samples/v1/types.go#L367

types.go should only define structs for external apis, not functions.

I think it's even undesirable to have functions attached to the api structs at all (instead helper functions should be created that take the api object as an argument), but if you can find another example of someone attaching functions to api structs i'll stand corrected.

So my suggestion would be to create a helper/utility package (not part of the apis pkg) and move those functions there as first class helper functions.

Not urgent, but worthwhile cleanup.

pkg/stub is not descriptive

I think this is leftover from what the operator sdk generated, but we should really refactor "pkg/stub" to a more meaningful package name. (and whether everything in there should stay where it is should be evaluated too).

clusteroperator condition message improvements

slack exchange:

i’d like to get some style cleanups in both the devex team operators on the progressing message
this is your primary communication channel and the intended receiver is the admin
right now it’s “The samples operator configuration is valid” and for registry it’s something slightly more machine oriented
i’d like the message to be something more affirmative like “The latest sample images and templates are installed” or something
or even shorter “All sample resources are up to date”
the style is sentence without punctuation
upper case leading, no punctution, human intended receipient
try to avoid kube-isms and overly technical explanations
Gabe Montero [1:41 PM]
the available condition is the one that says "Samples exist in the openshift project"
Clayton Coleman [1:42 PM]
Progressing is the generic condition
Gabe Montero [1:42 PM]
the failing condition is the one that says ""The samples operator configuration is valid""
Clayton Coleman [1:43 PM]
that’s where you put your human focused summary message
Progressing must represent a summary of the other conditions
so it’s fine to have the same message on progressing as available
(it’s fine to have the same messages on available)
but available and failed should explain the details as necessary, while progressing should explain to a human what the current state is

@bparees FYI in general

@dmage @legionus @coreydaley FYI re: @smarterclayton wants tweaks to the image-registry messages as well

Operator does not seems to be using the cluster-wide proxy setting

The proxy/cluster configuration is as follows:

apiVersion: config.openshift.io/v1
kind: Proxy
metadata:
  creationTimestamp: "2022-04-27T15:25:53Z"
  generation: 10
  name: cluster
  resourceVersion: "13304816"
  uid: 88fc90e8-eae6-4641-8175-3c9b1f4e303e
spec:
  httpProxy: http://xxx.xxx.xxx.xxx:80
  httpsProxy: http://xxx.xxx.xxx.xxx:80
  noProxy: [some domains/host here]

This proxy variables are inherited by openshift pods, such as cluster-image-registry-operator, but they aren't by cluster-samples-operator, so that we are not able to access registry.redhat.io for images updates.

[oddd@dfdsd]$ oc rsh cluster-samples-operator-7dffb458cd-phsdx
Defaulted container "cluster-samples-operator" out of: cluster-samples-operator, cluster-samples-operator-watch
sh-4.4$ curl -v -k https://registry.redhat.io
* Rebuilt URL to: https://registry.redhat.io/
*   Trying 184.24.69.179...
* TCP_NODELAY set

Nevertheless, if we export the proxy environment variables inside the pod:

sh-4.4$ export HTTP_PROXY=http://proxy.host:80
sh-4.4$ export HTTPS_PROXY=http://proxy.host:80
sh-4.4$ curl -v -k https://registry.redhat.io
* Rebuilt URL to: https://registry.redhat.io/
* Uses proxy env variable HTTPS_PROXY == 'http://proxy.host:80'
*   Trying 165.225.92.13...
* TCP_NODELAY set

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.