此内容没有您所选择的语言版本。
Chapter 6. Configuration deployment after initial setup
In order to conserve resources, the configuration deployment of Red Hat Quay is removed after the initial setup. In certain cases, there may be a need to further configure the Red Hat Quay environment. To specify that the configuration deployment should be retained, the keepConfigDeployment property within the quay object can be set as true as shown below:
apiVersion: redhatcop.redhat.io/v1alpha1
kind: QuayEcosystem
metadata:
name: example-quayecosystem
spec:
quay:
imagePullSecretName: redhat-pull-secret
keepConfigDeployment: true
6.1. Setting Redis password 复制链接链接已复制到粘贴板!
By default, the operator managed Redis instance is deployed without a password. A password can be specified by creating a secret containing the password in the key password. The following command can be used to create the secret:
$ oc create secret generic <secret_name> \
--from-literal=password=<password>
The secret can then be specified within the redis section using the credentialsSecretName as shown below:
apiVersion: redhatcop.redhat.io/v1alpha1
kind: QuayEcosystem
metadata:
name: example-quayecosystem
spec:
redis:
credentialsSecretName: <secret_name>
imagePullSecretName: redhat-pull-secret
6.2. Enabling Clair image scanning 复制链接链接已复制到粘贴板!
Clair is a vulnerability assessment tool for application containers. Support is available to automatically provision and configure both Clair and its integration with Red Hat Quay. A property called clair can be specified in the QuayEcosystem object along with enabled: true within this field in order to deploy Clair. An example is shown below:
apiVersion: redhatcop.redhat.io/v1alpha1
kind: QuayEcosystem
metadata:
name: example-quayecosystem
spec:
quay:
imagePullSecretName: redhat-pull-secret
clair:
enabled: true
imagePullSecretName: redhat-pull-secret
6.2.1. Clair update interval 复制链接链接已复制到粘贴板!
Clair routinely queries CVE databases in order to build its own internal database. By default, this value is set at 500m. You can modify the time interval between checks by setting the updateInterval property as shown below:
apiVersion: redhatcop.redhat.io/v1alpha1
kind: QuayEcosystem
metadata:
name: example-quayecosystem
spec:
quay:
imagePullSecretName: redhat-pull-secret
clair:
enabled: true
imagePullSecretName: redhat-pull-secret
updateInterval: "60m"
The above configuration would have Clair update every 60 minutes.
6.3. Setting common attributes 复制链接链接已复制到粘贴板!
Each of the following components expose a set of similar properties that can be specified in order to customize the runtime execution:
- Red Hat Quay
- Red Hat Quay Configuration
- Red Hat Quay PostgreSQL
- Redis
- Clair
- Clair PostgreSQL
6.3.1. Image pull secret 复制链接链接已复制到粘贴板!
As referenced in prior sections, an Image Pull Secret can specify the name of the secret containing credentials to an image from a protected registry using the property imagePullSecret.
6.3.2. Image 复制链接链接已复制到粘贴板!
There may be a desire to make use of an alternate image or source location for each of the components in the Quay ecosystem. The most common use case is to make use of an image registry that contains all of the needed images instead of being sourced from the public internet. Each component has a property called image where the location of the related image can be referenced from.
The following is an example of how a customized image location can be specified:
apiVersion: redhatcop.redhat.io/v1alpha1
kind: QuayEcosystem
metadata:
name: example-quayecosystem
spec:
quay:
image: myregistry.example.com/quay/quay:v3.1.0
6.3.3. Compute resources 复制链接链接已复制到粘贴板!
Compute Resources such as memory and CPU can be specified in the same form as any other value in a PodTemplate. CPU and Memory values for requests and limits can be specified under a property called resources.
In the case of the QuayConfiguration deployment, configResources is the property which should be referenced underneath the quay property.
The following is an example of how compute resources can be specified:
apiVersion: redhatcop.redhat.io/v1alpha1
kind: QuayEcosystem
metadata:
name: example-quayecosystem
spec:
quay:
imagePullSecretName: redhat-pull-secret
resources:
requests:
memory: 512Mi
6.3.4. Probes 复制链接链接已复制到粘贴板!
Readiness and Liveness Probes can be specified in the same form as any other value in a PodTemplate.
The following is how a readinessProbe and livenessProbe can be specified:
apiVersion: redhatcop.redhat.io/v1alpha1
kind: QuayEcosystem
metadata:
name: example-quayecosystem
spec:
quay:
imagePullSecretName: redhat-pull-secret
livenessProbe:
initialDelaySeconds: 120
httpGet:
path: /health/instance
port: 8443
scheme: HTTPS
readinessProbe:
initialDelaySeconds: 10
httpGet:
path: /health/instance
port: 8443
scheme: HTTPS
If a value for either property is not specified, an opinionated default value is applied.
6.3.5. Node Selector 复制链接链接已复制到粘贴板!
Components of the QuayEcosystem may need to be deployed to only a subset of available nodes in a Kubernetes cluster. This functionality can be set on each of the resources using the nodeSelector property as shown below:
apiVersion: redhatcop.redhat.io/v1alpha1
kind: QuayEcosystem
metadata:
name: example-quayecosystem
spec:
quay:
imagePullSecretName: redhat-pull-secret
nodeSelector:
node-role.kubernetes.io/infra: true
6.3.6. Deployment strategy 复制链接链接已复制到粘贴板!
Each of the core components consist of Kubernetes Deployments. This resource supports the method in which new versions are released. This operator supports making use of the RollingUpdate and Recreate strategies. Either value can be defined by using the deploymentStrategy property on the desired resource as shown below:
apiVersion: redhatcop.redhat.io/v1alpha1
kind: QuayEcosystem
metadata:
name: example-quayecosystem
spec:
quay:
imagePullSecretName: redhat-pull-secret
deploymentStrategy: RollingUpdate
The absence of a defined value will make use of the RollingUpdate strategy.
6.3.7. Environment Variables 复制链接链接已复制到粘贴板!
In addition to environment variables that are automatically configured by the operator, users can define their own set of environment variables in order to customize the managed resources. Each core component includes a property called envVars where environment variables can be defined. An example is shown below:
apiVersion: redhatcop.redhat.io/v1alpha1
kind: QuayEcosystem
metadata:
name: example-quayecosystem
spec:
quay:
imagePullSecretName: redhat-pull-secret
envVars:
- name: FOO
value: bar
Environment variables for the Quay configuration pod can be managed by specifying the configEnvVars property on the quay resource.
User defined environment variables are given precedence over those managed by the operator. Undesirable results may occur if conflicting keys are used.