|
| 1 | + |
| 2 | +[id="creating-registry-infra-node"] |
| 3 | += Creating the {productname} registry |
| 4 | + |
| 5 | +After you have downloaded the {productname} Operator, you must create the {productname} registry. The registry's components, for example, `clair`, `postgres`, `redis`, and so on, must be patched with the `toleration` annotation so that they can schedule onto the `infra` worker nodes. |
| 6 | + |
| 7 | +The following procedure shows you how to create a {productname} registry that runs on infrastructure nodes. |
| 8 | + |
| 9 | +.Procedure |
| 10 | + |
| 11 | +. On the {ocp} web console, click *Operators* -> *Installed Operators* -> *Red Hat Quay*. |
| 12 | + |
| 13 | +. On the *{productname} Operator details* page, click *Quay Registry* -> *Create QuayRegistry*. |
| 14 | + |
| 15 | +. On the *Create QuayRegistry* page, set the `monitoring` and `objectstorage` fields to `false`. The monitoring component cannot be enabled when {productname} is installed in a single namespace. For example: |
| 16 | ++ |
| 17 | +[source,yaml] |
| 18 | +---- |
| 19 | +# ... |
| 20 | + - kind: monitoring |
| 21 | + managed: false |
| 22 | + - kind: objectstorage |
| 23 | + managed: false |
| 24 | +# ... |
| 25 | +---- |
| 26 | + |
| 27 | +. Click *Create*. |
| 28 | + |
| 29 | +//// |
| 30 | +. The following condition is reported: `Condition: RolloutBlocked`. This occurs because all pods for the registry must include the `node-role.kubernetes.io/infra` nodeSelector and toleration. Apply the `node-role.kubernetes.io/infra` nodeSelector and toleration to all pods by entering the following command: |
| 31 | ++ |
| 32 | +[source,terminal] |
| 33 | +---- |
| 34 | +$ for deploy in $(oc get deployments -n <annotated_namespace> -o name | grep -E 'example-registry-(clair|quay)'); do |
| 35 | + oc patch $deploy -n annotated_namespace --type='strategic' -p '{ |
| 36 | + "spec": { |
| 37 | + "template": { |
| 38 | + "spec": { |
| 39 | + "nodeSelector": { |
| 40 | + "node-role.kubernetes.io/infra": "" |
| 41 | + }, |
| 42 | + "tolerations": [ |
| 43 | + { |
| 44 | + "key": "node-role.kubernetes.io/infra", |
| 45 | + "operator": "Exists", |
| 46 | + "effect": "NoSchedule" |
| 47 | + } |
| 48 | + ] |
| 49 | + } |
| 50 | + } |
| 51 | + } |
| 52 | + }' |
| 53 | +done |
| 54 | +---- |
| 55 | ++ |
| 56 | +.Example output |
| 57 | ++ |
| 58 | +[source,terminal] |
| 59 | +---- |
| 60 | +deployment.apps/example-registry-clair-app patched |
| 61 | +deployment.apps/example-registry-clair-postgres patched |
| 62 | +deployment.apps/example-registry-quay-app patched |
| 63 | +deployment.apps/example-registry-quay-database patched |
| 64 | +deployment.apps/example-registry-quay-mirror patched |
| 65 | +deployment.apps/example-registry-quay-redis patched |
| 66 | +---- |
| 67 | +
|
| 68 | +. Ensure that all pods include the `node-role.kubernetes.io/infra` nodeSelector and toleration by entering the following command: |
| 69 | ++ |
| 70 | +[source,terminal] |
| 71 | +---- |
| 72 | +$ for deploy in $(oc get deployments -n <annotated_namespace> -o name | grep example-registry); do |
| 73 | + echo $deploy |
| 74 | + oc get -n <annotated_namespace> $deploy -o yaml | grep -A5 nodeSelector |
| 75 | + oc get -n <annotated_namespace> $deploy -o yaml | grep -A5 tolerations |
| 76 | +done |
| 77 | +---- |
| 78 | ++ |
| 79 | +.Example output |
| 80 | ++ |
| 81 | +[source,terminal] |
| 82 | +---- |
| 83 | +... |
| 84 | +example-registry-clair-app |
| 85 | + nodeSelector: |
| 86 | + node-role.kubernetes.io/infra: "" |
| 87 | + restartPolicy: Always |
| 88 | + schedulerName: default-scheduler |
| 89 | + securityContext: {} |
| 90 | + serviceAccount: example-registry-clair-app |
| 91 | + tolerations: |
| 92 | + - effect: NoSchedule |
| 93 | + key: node-role.kubernetes.io/infra |
| 94 | + operator: Exists |
| 95 | + volumes: |
| 96 | + - configMap: |
| 97 | +... |
| 98 | +---- |
| 99 | +//// |
| 100 | + |
| 101 | +. Optional: Confirm that the pods are running on infra nodes. |
| 102 | + |
| 103 | +.. List all `Quay`-related pods along with the nodes that they are scheduled on by entering the following command: |
| 104 | ++ |
| 105 | +[source,terminal] |
| 106 | +---- |
| 107 | +$ oc get pods -n <annotated_namespace> -o wide | grep example-registry |
| 108 | +---- |
| 109 | ++ |
| 110 | +.Example output |
| 111 | ++ |
| 112 | +[source,terminal] |
| 113 | +---- |
| 114 | +... |
| 115 | +NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES |
| 116 | +example-registry-clair-app-5f95d685bd-dgjf6 1/1 Running 0 52m 10.128.4.12 example-cluster-new-c5qqp-worker-b-wrhw4.c.quay-devel.internal <none> <none> |
| 117 | +... |
| 118 | +---- |
| 119 | + |
| 120 | +.. Confirm that the nodes listed include only nodes labeled `infra` by running the following command: |
| 121 | ++ |
| 122 | +[source,terminal] |
| 123 | +---- |
| 124 | +$ oc get nodes -l node-role.kubernetes.io/infra -o name |
| 125 | +---- |
| 126 | ++ |
| 127 | +.Example output |
| 128 | ++ |
| 129 | +[source,terminal] |
| 130 | +---- |
| 131 | +node/example-cluster-new-c5qqp-worker-b-4zxx5.c.quay-devel.internal modified |
| 132 | +node/example-cluster-new-c5qqp-worker-b-kz6jn.c.quay-devel.internal modified |
| 133 | +node/example-cluster-new-c5qqp-worker-b-wrhw4.c.quay-devel.internal modified |
| 134 | +---- |
| 135 | ++ |
| 136 | +[NOTE] |
| 137 | +==== |
| 138 | +If any pod appears on a non-infra node, revisit your namespace annotations and deployment patching. |
| 139 | +==== |
| 140 | + |
| 141 | +. Restart all pods for the {productname} registry by entering the following command: |
| 142 | ++ |
| 143 | +[source,terminal] |
| 144 | +---- |
| 145 | +$ oc delete pod -n <annotated_namespace> --all |
| 146 | +---- |
| 147 | + |
| 148 | +. Check the status of the pods by entering the following command: |
| 149 | ++ |
| 150 | +[source,terminal] |
| 151 | +---- |
| 152 | +$ oc get pods -n <annotated_namespace> |
| 153 | +---- |
| 154 | ++ |
| 155 | +.Example output |
| 156 | ++ |
| 157 | +[source,terminal] |
| 158 | +---- |
| 159 | +... |
| 160 | +NAME READY STATUS RESTARTS AGE |
| 161 | +example-registry-clair-app-5f95d685bd-dgjf6 1/1 Running 0 5m4s |
| 162 | +... |
| 163 | +---- |
0 commit comments