forked from openshift/hypershift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move image registry operator to control plane
Stops CVO from reconciling the cluster image registry operator into the guest cluster and enables the control plane operator to reconcile it on the management cluster side. This change is needed to make it possible to clean up resources created by the guest cluster. Having the image registry operator on the control plane side allows it to keep running after worker nodes have been removed from the cluster. On the guest cluster, changing the operator config state to "Removed" tells the operator to remove the S3 bucket (or other cloud storage) it created when starting up.
- Loading branch information
Showing
9 changed files
with
858 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
control-plane-operator/controllers/hostedcontrolplane/manifests/registryoperator.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package manifests | ||
|
||
import ( | ||
prometheusoperatorv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" | ||
appsv1 "k8s.io/api/apps/v1" | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
func ImageRegistryOperatorDeployment(ns string) *appsv1.Deployment { | ||
return &appsv1.Deployment{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: "cluster-image-registry-operator", | ||
Namespace: ns, | ||
}, | ||
} | ||
} | ||
|
||
func ImageRegistryOperatorServingCert(ns string) *corev1.Secret { | ||
return &corev1.Secret{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: "cluster-image-registry-operator", | ||
Namespace: ns, | ||
}, | ||
} | ||
} | ||
|
||
func ImageRegistryOperatorPodMonitor(ns string) *prometheusoperatorv1.PodMonitor { | ||
return &prometheusoperatorv1.PodMonitor{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: "cluster-image-registry-operator", | ||
Namespace: ns, | ||
}, | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
control-plane-operator/controllers/hostedcontrolplane/pki/registryoperator.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package pki | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
|
||
"github.com/openshift/hypershift/support/config" | ||
) | ||
|
||
const metricsHostname = "cluster-image-registry-operator" | ||
|
||
func ReconcileRegistryOperatorServingCert(secret, ca *corev1.Secret, ownerRef config.OwnerRef) error { | ||
dnsNames := []string{ | ||
metricsHostname, | ||
"localhost", | ||
} | ||
return reconcileSignedCertWithAddresses(secret, ca, ownerRef, metricsHostname, []string{"openshift"}, X509UsageClientServerAuth, dnsNames, nil) | ||
} |
Oops, something went wrong.