Disconnected clusters¶
Run oc-mirror v2 yourself. PolicyStack applies its output:
- The
disconnectedelement applies the mirror sets, catalogs and CA trust. global.catalogSourcespoints every operator at the mirrored catalog (Global keys).
Not covered
- Image mirroring. oc-mirror's job.
- The chart repo. Argo CD on the hub pulls
policy-libraryfrompolicystack.github.io, directly or through a proxy. Or mirror the chart and repoint everyChart.yaml. - Update Service. The
upgradeelement waits for the target inavailableUpdates. Setstack.upgrade.config.upstreamto your own OSUS.
Site layer¶
One datacenter layer holds the site data. List it in every fleet file at the site.
# values/datacenters/dc2.yaml
global:
catalogSources:
redhat-operators: cs-redhat-operator-index-v4-20 # (1)!
stack:
disconnected:
config:
clusterResources: # (2)!
- apiVersion: config.openshift.io/v1
kind: ImageDigestMirrorSet
metadata:
name: idms-operator-0
spec:
imageDigestMirrors:
- mirrors: [mirror.dc2.example.com:8443/redhat]
source: registry.redhat.io/redhat
- apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: cs-redhat-operator-index-v4-20
namespace: openshift-marketplace
spec:
image: mirror.dc2.example.com:8443/redhat/redhat-operator-index:v4.20
sourceType: grpc
registryCAs:
mirror.dc2.example.com..8443: | # (3)!
-----BEGIN CERTIFICATE-----
...
trustedCA: | # (4)!
-----BEGIN CERTIFICATE-----
...
remediations:
config:
allowedRegistries: # (5)!
- mirror.dc2.example.com:8443
- quay.io
- registry.redhat.io
- image-registry.openshift-image-registry.svc:5000
- A
subscription.sourcethe elements use, mapped to a CatalogSource inclusterResources. - oc-mirror's
working-dir/cluster-resources, unchanged. - Registry host, with
..before a port. - CAs of internal Git and Helm servers.
- Only with
remediationsenabled. Lists replace, so restate the defaults.
Enable it per cluster (Values cascade):
Release signatures
Each oc-mirror run adds release signature ConfigMaps to cluster-resources. Add them to clusterResources, or the cluster rejects that upgrade.
What the element applies¶
All toggles default to true. Empty input renders nothing.
| Toggle | Applies |
|---|---|
resources |
config.clusterResources, as is. |
registry-ca |
ConfigMap openshift-config/registry-cas from config.registryCAs, and additionalTrustedCA on image.config.openshift.io/cluster. |
trusted-ca |
ConfigMap openshift-config/trusted-cas, with the Proxy's trustedCA pointing at it. Lands in every injected trust bundle, including the one the gitops element mounts into Argo CD's repo server. |
operatorhub |
OperatorHub disableAllDefaultSources: true. |
trusted-cas¶
Existing Proxy trustedCA
A Proxy pointing at a ConfigMap other than user-ca-bundle is repointed, and its CAs leave the trust bundle. Copy them into config.trustedCA first.
trusted-cas = user-ca-bundle (the installer's additionalTrustBundle) + config.trustedCA. user-ca-bundle is read on the cluster, never written.
Turning trusted-ca off
Turning the toggle off or emptying config.trustedCA leaves the Proxy on a stale trusted-cas, still trusted. Clean up by hand:
oc patch proxy/cluster --type merge -p '{"spec":{"trustedCA":{"name":"user-ca-bundle"}}}' # (1)!
oc delete configmap trusted-cas -n openshift-config
- Use
"name":""ifuser-ca-bundledoes not exist.
Hosted clusters¶
The HostedCluster owns mirrors, image config and proxy. Set them in the fleet file; the element keeps only the catalog.
# fleet/hcp-agent.yaml
install:
hostedCluster:
spec: # (1)!
imageContentSources:
- source: registry.redhat.io/redhat
mirrors: [mirror.dc2.example.com:8443/redhat]
additionalTrustBundle:
name: mirror-ca # (2)!
configuration(image, proxy) goes here too (Cluster lifecycle).- Hub ConfigMap with key
ca-bundle.crtin the HostedCluster's namespace. Create it withinstall.manifests(Install keys).
The hub¶
The hub needs the mirrored catalogs before PolicyStack runs.
-
Apply oc-mirror's output by hand:
-
Install the operators with the site layer:
-
List
datacenters/dc2.yamlinfleet/hubs/<hubName>.yamland setstack.disconnected.enabled: trueinvalues/clusters/<hubName>.yaml. The element takes over those objects.