Message - Manage Quay Container Registry global messages
The Message custom resource relies on a Secret resource to provide the connection parameters to the Quay instance. This Secret resource must include the following data:
host
: URL for accessing the Quay API, such ashttps://quay.example.com:8443
for example.validateCerts
: Whether to allow insecure connections to the API. By default, insecure connections are refused.token
: OAuth access token for authenticating against the API. To create such a token see the Creating an OAuth Access Token documentation. You can also use the ApiToken custom resource to create this token.username
: The username to use for authenticating against the API. Iftoken
is set, thenusername
is ignored.password
: The password to use for authenticating against the API. Iftoken
is set, thenpassword
is ignored.
You can create the secret by using the kubectl create secret
command:
kubectl create secret generic quay-credentials --from-literal host=https://quay.example.com:8443 --from-literal validateCerts=false --from-literal token=vFYyU2D0fHYXvcA3Y5TYfMrIMyVIH9YmxoVLsmku
Or you can create the secret from a resource file:
---
apiVersion: v1
kind: Secret
metadata:
name: quay-credentials
stringData:
host: https://quay.example.com:8443
validateCerts: "false"
token: vFYyU2D0fHYXvcA3Y5TYfMrIMyVIH9YmxoVLsmku
You refer to this secret in your Message custom resource by using the connSecretRef
property.
See the usage example.
Warning
Do not delete the Secret resource if a Quay custom resource still references it. If you delete the Secret resource, then the Operator cannot connect to the Quay API anymore, and cannot synchronize the Quay custom resource with its corresponding object in Quay. In addition, deleting the Quay custom resource does not complete because the Operator cannot delete the corresponding object in Quay.
If you face this issue, then edit the custom resource (kubectl edit
), and set the .spec.preserveInQuayOnDeletion property to true
.
Alternatively, you can remove the .metadata.finalizers
section.
In both case, you must manually delete the corresponding object in Quay.
Usage Example
---
apiVersion: quay.herve4m.github.io/v1alpha1
kind: Message
metadata:
name: message-sample
spec:
# Connection parameters in a Secret resource
connSecretRef:
name: quay-credentials
# By default, the operator looks for the secret in the same namespace as
# the message resource, but you can specify a different namespace.
# namespace: mynamespace
# Whether to preserve the corresponding Quay object when you
# delete the Message resource.
preserveInQuayOnDeletion: false
content: |
# Information message
Lorem **ipsum** dolor sit amet, `consectetur` adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua:
* Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat.
* Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur
format: markdown
severity: warning
Properties
connSecretRef
Reference to the secret resource that stores the connection parameters to the Quay Container Registry API.
The secret must include the host
, token
(or username
and password
), and optionally the validateCerts
keys.
Type: object (see the following properties)
Required: True
Default value: None
connSecretRef.name
Name of the secret resource.
Type: string
Required: True
Default value: None
connSecretRef.namespace
Namespace of the secret resource. By default, the secret resource is retrieved from the same namespace as the current Message resource.
Type: string
Required: False
Default value: None
content
Text of the message to display on each web UI page.
Type: string
Required: False
Default value: None
format
Format of the text in content
. If you do not set this parameter, then the resource uses the plain
format.
Type: string
Required: False
Default value: None
preserveInQuayOnDeletion
Whether to preserve the corresponding Quay object when you delete the Message resource. When set to false
(the default), the object is deleted from Quay.
Type: boolean
Required: False
Default value: False
regexp
The regular expression to look for in the existing messages. This does not have to match an entire line. For state=present
, if several messages match, then the resource updates one and deletes the others. For state=absent
, the resource deletes all the messages that match. Uses Python regular expressions. See https://docs.python.org/3/library/re.html. Mutually exclusive with searchString
.
Type: string
Required: False
Default value: None
searchSeverity
Search messages by their severity level. If you also set searchString
, regexp
, or content
, messages must match all those criteria.
Type: string
Required: False
Default value: None
searchString
The literal string to look for in the existing messages. This does not have to match an entire line. For state=present
, if several messages match, then the resource updates one and deletes the others. For state=absent
, the resource deletes all the messages that match. Mutually exclusive with regexp
.
Type: string
Required: False
Default value: None
severity
Severity of the message. If you do not set this parameter, then the resource creates the message with the info
severity.
Type: string
Required: False
Default value: None
Listing the Message Resources
You can retrieve the list of the Message custom resources in a namespace by using the kubectl get
command:
kubectl get messages.quay.herve4m.github.io -n <namespace>