Skip to content

🌱 Move Registry YAML and remove use of namespace in kustomizations #2088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ e2e-metrics: #EXHELP Request metrics from prometheus; place in ARTIFACT_PATH if
http://localhost:30900/api/v1/query > $(if $(ARTIFACT_PATH),$(ARTIFACT_PATH),.)/metrics.out

.PHONY: extension-developer-e2e
extension-developer-e2e: SOURCE_MANIFEST := $(STANDARD_E2E_MANIFEST)
extension-developer-e2e: KIND_CLUSTER_NAME := operator-controller-ext-dev-e2e
extension-developer-e2e: export INSTALL_DEFAULT_CATALOGS := false
extension-developer-e2e: run image-registry test-ext-dev-e2e kind-clean #EXHELP Run extension-developer e2e on local kind cluster
Expand All @@ -308,6 +309,7 @@ post-upgrade-checks:
go test -count=1 -v ./test/upgrade-e2e/...

.PHONY: test-upgrade-e2e
test-upgrade-e2e: SOURCE_MANIFEST := $(STANDARD_E2E_MANIFEST)
test-upgrade-e2e: KIND_CLUSTER_NAME := operator-controller-upgrade-e2e
test-upgrade-e2e: export TEST_CLUSTER_CATALOG_NAME := test-catalog
test-upgrade-e2e: export TEST_CLUSTER_EXTENSION_NAME := test-package
Expand Down
1 change: 0 additions & 1 deletion config/base/catalogd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Does not include the CRD, which must be added separately (it's non-namespaced)
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: olmv1-system
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, if we need to change the name, do we have to update all the files after this change?
Also, I haven't checked, but in the downstream setup, are we using a shell script to make the change, or are we properly setting the Kustomize value and then building?

namePrefix: catalogd-
resources:
- rbac
Expand Down
2 changes: 1 addition & 1 deletion config/base/catalogd/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
namespace: olmv1-system
annotations:
kubectl.kubernetes.io/default-logs-container: manager
labels:
Expand Down
2 changes: 1 addition & 1 deletion config/base/catalogd/manager/network_policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: controller-manager
namespace: system
namespace: olmv1-system
spec:
podSelector:
matchLabels:
Expand Down
2 changes: 1 addition & 1 deletion config/base/catalogd/manager/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
app.kubernetes.io/part-of: olm
app.kubernetes.io/name: catalogd
name: service
namespace: system
namespace: olmv1-system
spec:
selector:
control-plane: catalogd-controller-manager
Expand Down
2 changes: 1 addition & 1 deletion config/base/catalogd/rbac/auth_proxy_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
namespace: olmv1-system
1 change: 1 addition & 0 deletions config/base/catalogd/rbac/leader_election_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
app.kubernetes.io/part-of: olm
app.kubernetes.io/name: catalogd
name: leader-election-role
namespace: olmv1-system
rules:
- apiGroups:
- ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ metadata:
app.kubernetes.io/part-of: olm
app.kubernetes.io/name: catalogd
name: leader-election-rolebinding
namespace: olmv1-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: leader-election-role
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
namespace: olmv1-system
2 changes: 1 addition & 1 deletion config/base/catalogd/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: manager-role
namespace: system
namespace: olmv1-system
rules:
- apiGroups:
- ""
Expand Down
6 changes: 3 additions & 3 deletions config/base/catalogd/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ roleRef:
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
namespace: olmv1-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand All @@ -21,12 +21,12 @@ metadata:
app.kubernetes.io/part-of: olm
app.kubernetes.io/name: catalogd
name: manager-rolebinding
namespace: system
namespace: olmv1-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: manager-role
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
namespace: olmv1-system
2 changes: 1 addition & 1 deletion config/base/catalogd/rbac/service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
app.kubernetes.io/part-of: olm
app.kubernetes.io/name: catalogd
name: controller-manager
namespace: system
namespace: olmv1-system
2 changes: 1 addition & 1 deletion config/base/common/namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
app.kubernetes.io/part-of: olm
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/enforce-version: latest
name: system
name: olmv1-system
2 changes: 1 addition & 1 deletion config/base/common/network_policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-all-traffic
namespace: system
namespace: olmv1-system
spec:
podSelector: { }
policyTypes:
Expand Down
1 change: 0 additions & 1 deletion config/base/operator-controller/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Does not include the CRD, which must be added separately (it's non-namespaced)
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: olmv1-system
namePrefix: operator-controller-
resources:
- rbac
Expand Down
2 changes: 1 addition & 1 deletion config/base/operator-controller/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
namespace: olmv1-system
annotations:
kubectl.kubernetes.io/default-logs-container: manager
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: controller-manager
namespace: system
namespace: olmv1-system
spec:
podSelector:
matchLabels:
Expand Down
2 changes: 1 addition & 1 deletion config/base/operator-controller/manager/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: service
namespace: system
namespace: olmv1-system
labels:
control-plane: operator-controller-controller-manager
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
namespace: olmv1-system
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: leader-election-role
namespace: olmv1-system
rules:
- apiGroups:
- ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: leader-election-rolebinding
namespace: olmv1-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: leader-election-role
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
namespace: olmv1-system
2 changes: 1 addition & 1 deletion config/base/operator-controller/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: manager-role
namespace: system
namespace: olmv1-system
rules:
- apiGroups:
- ""
Expand Down
6 changes: 3 additions & 3 deletions config/base/operator-controller/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ roleRef:
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
namespace: olmv1-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: manager-rolebinding
namespace: system
namespace: olmv1-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: manager-role
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
namespace: olmv1-system
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: controller-manager
namespace: system
namespace: olmv1-system
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
namespace: olmv1-system
resources:
- resources/certificate.yaml
patches:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: catalogd-service-cert
namespace: system
namespace: olmv1-system
spec:
secretName: catalogd-service-cert-git-version
dnsNames:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
namespace: olmv1-system
resources:
- resources/manager_cert.yaml
patches:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: olmv1-cert
namespace: olmv1-system
spec:
secretName: olmv1-cert
dnsNames:
Expand Down
1 change: 0 additions & 1 deletion config/components/e2e/coverage/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
namespace: olmv1-system
resources:
- manager_e2e_coverage_pvc.yaml
- manager_e2e_coverage_copy_pod.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: Pod
metadata:
name: e2e-coverage-copy-pod
namespace: olmv1-system
spec:
restartPolicy: Never
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: e2e-coverage
namespace: olmv1-system
spec:
accessModes:
- ReadWriteOnce
Expand Down
2 changes: 1 addition & 1 deletion config/components/e2e/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
components:
- coverage
- registries-conf
- registry
20 changes: 20 additions & 0 deletions config/components/e2e/registry/certificate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: operator-controller-e2e-registry
namespace: operator-controller-e2e
spec:
secretName: operator-controller-e2e-registry
isCA: true
dnsNames:
- docker-registry.operator-controller-e2e.svc
- docker-registry.operator-controller-e2e.svc.cluster.local
- docker-registry-controller-manager-metrics-service.operator-controller-e2e.svc
- docker-registry-controller-manager-metrics-service.operator-controller-e2e.svc.cluster.local
privateKey:
algorithm: ECDSA
size: 256
issuerRef:
name: olmv1-ca
kind: ClusterIssuer
group: cert-manager.io
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: e2e-registries-conf
namespace: system
namespace: olmv1-system
data:
registries.conf: |
[[registry]]
Expand Down
35 changes: 35 additions & 0 deletions config/components/e2e/registry/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: docker-registry
namespace: operator-controller-e2e
labels:
app: registry
spec:
replicas: 1
selector:
matchLabels:
app: registry
template:
metadata:
labels:
app: registry
spec:
containers:
- name: registry
image: registry:3
imagePullPolicy: IfNotPresent
volumeMounts:
- name: certs-vol
mountPath: "/certs"
env:
- name: REGISTRY_HTTP_ADDR
value: ":5000"
- name: REGISTRY_HTTP_TLS_CERTIFICATE
value: "/certs/tls.crt"
- name: REGISTRY_HTTP_TLS_KEY
value: "/certs/tls.key"
volumes:
- name: certs-vol
secret:
secretName: operator-controller-e2e-registry
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
namespace: olmv1-system
resources:
- registries_conf_configmap.yaml
- certificate.yaml
- deployment.yaml
- configmap.yaml
- service.yaml
- namespace.yaml
patches:
- path: manager_e2e_registries_conf_patch.yaml
4 changes: 4 additions & 0 deletions config/components/e2e/registry/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: operator-controller-e2e
14 changes: 14 additions & 0 deletions config/components/e2e/registry/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: docker-registry
namespace: operator-controller-e2e
spec:
selector:
app: registry
ports:
- name: http
port: 5000
targetPort: 5000
nodePort: 30000
type: NodePort
Loading
Loading