Skip to content

Commit

Permalink
WIP: Corrected multiple issues found during testing (#114)
Browse files Browse the repository at this point in the history
* Corrected multiple issues found during testing

* Added instructions around customizing images

* Corrected image version
  • Loading branch information
sabre1041 authored Dec 16, 2019
1 parent 3593810 commit 7c2688f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,22 @@ Each of the following components expose a set of similar properties that can be

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`.

### 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 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
```

### Compute Resources

[Compute Resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) 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`.
Expand Down Expand Up @@ -510,7 +526,7 @@ spec:
quay:
imagePullSecretName: redhat-pull-secret
nodeSelector:
node-role.kubernetes.io/infra=true
node-role.kubernetes.io/infra: true
```

### Deployment Strategy
Expand Down Expand Up @@ -597,4 +613,4 @@ image: quay.io/redhat/quay:vX.X.X

Once saved, the operator will automatically apply the upgrade.

_Note_: If you used a different name than `QuayEcosystem` for the custom resource to deploy your Quay ecosystem, you will have to replace the name to fit the proper value
_Note_: If you used a different name than `QuayEcosystem` for the custom resource to deploy your Quay ecosystem, you will have to replace the name to fit the proper value
2 changes: 1 addition & 1 deletion docs/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ spec:
quay:
imagePullSecretName: redhat-pull-secret
registryStorage:
persistentVolumeAccessMode:
persistentVolumeAccessModes:
- ReadWriteOnce
persistentVolumeSize: 10Gi
```
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/redhatcop/v1alpha1/quayecosystem_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ type RegistryBackendSource struct {
// RegistryStorage defines the configurations to support persistent storage
// +k8s:openapi-gen=true
type RegistryStorage struct {
// +listType=atomic
// +listType=set
PersistentVolumeAccessModes []corev1.PersistentVolumeAccessMode `json:"persistentVolumeAccessModes,omitempty,name=persistentVolumeAccessModes"`
PersistentVolumeSize string `json:"persistentVolumeSize,omitempty,name=volumeSize"`
PersistentVolumeStorageClassName string `json:"persistentVolumeStorageClassName,omitempty,name=storageClassName"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/redhatcop/v1alpha1/zz_generated.openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ func schema_pkg_apis_redhatcop_v1alpha1_RegistryStorage(ref common.ReferenceCall
"persistentVolumeAccessModes": {
VendorExtensible: spec.VendorExtensible{
Extensions: spec.Extensions{
"x-kubernetes-list-type": "atomic",
"x-kubernetes-list-type": "set",
},
},
SchemaProps: spec.SchemaProps{
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/quayecosystem/provisioning/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func (r *ReconcileQuayEcosystemConfiguration) coreClairResourceDeployment(metaOb
}

// Database (PostgreSQL/MySQL)
if utils.IsZeroOfUnderlyingType(r.quayConfiguration.QuayEcosystem.Spec.Quay.Database.Server) {
if utils.IsZeroOfUnderlyingType(r.quayConfiguration.QuayEcosystem.Spec.Clair.Database.Server) {

createClairDatabaseResult, err := r.createClairDatabase(metaObject)

Expand Down Expand Up @@ -475,7 +475,7 @@ func (r *ReconcileQuayEcosystemConfiguration) configurePostgreSQL(meta metav1.Ob

podName = postgresqlPodsItems[0].Name

success, stdout, stderr := k8sutils.ExecIntoPod(r.k8sclient, podName, fmt.Sprintf("echo \"SELECT * FROM pg_available_extensions\" | /opt/rh/rh-postgresql96/root/usr/bin/psql -d %s", r.quayConfiguration.QuayDatabase.Database), "", r.quayConfiguration.QuayEcosystem.Namespace)
success, stdout, stderr := k8sutils.ExecIntoPod(r.k8sclient, podName, fmt.Sprintf("echo \"SELECT * FROM pg_available_extensions\" | $(which psql) -d %s", r.quayConfiguration.QuayDatabase.Database), "", r.quayConfiguration.QuayEcosystem.Namespace)

if !success {
return fmt.Errorf("Failed to Exec into Postgresql Pod: %s", stderr)
Expand All @@ -485,7 +485,7 @@ func (r *ReconcileQuayEcosystemConfiguration) configurePostgreSQL(meta metav1.Ob
return nil
}

success, stdout, stderr = k8sutils.ExecIntoPod(r.k8sclient, podName, fmt.Sprintf("echo \"CREATE EXTENSION pg_trgm\" | /opt/rh/rh-postgresql96/root/usr/bin/psql -d %s", r.quayConfiguration.QuayDatabase.Database), "", r.quayConfiguration.QuayEcosystem.Namespace)
success, stdout, stderr = k8sutils.ExecIntoPod(r.k8sclient, podName, fmt.Sprintf("echo \"CREATE EXTENSION pg_trgm\" | $(which psql) -d %s", r.quayConfiguration.QuayDatabase.Database), "", r.quayConfiguration.QuayEcosystem.Namespace)

if !success {
return fmt.Errorf("Failed to add pg_trim extension: %s", stderr)
Expand Down

0 comments on commit 7c2688f

Please sign in to comment.