Skip to content

Commit 6e1fa6a

Browse files
committed
Reorganize config to support reusable components
Update to catalogd v0.17.0 to share a common certificate issuer Signed-off-by: Todd Short <tshort@redhat.com>
1 parent ceba614 commit 6e1fa6a

20 files changed

+111
-106
lines changed

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ else
5454
$(warning Could not find docker or podman in path! This may result in targets requiring a container runtime failing!)
5555
endif
5656

57-
KUSTOMIZE_BUILD_DIR := config/overlays/tls
57+
KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager
5858

5959
# Disable -j flag for make
6060
.NOTPARALLEL:
@@ -155,6 +155,7 @@ test-e2e: GO_BUILD_FLAGS := -cover
155155
test-e2e: run image-registry build-push-e2e-catalog registry-load-bundles e2e e2e-coverage kind-clean #HELP Run e2e test suite on local kind cluster
156156

157157
.PHONY: extension-developer-e2e
158+
extension-developer-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager
158159
extension-developer-e2e: KIND_CLUSTER_NAME := operator-controller-ext-dev-e2e #EXHELP Run extension-developer e2e on local kind cluster
159160
extension-developer-e2e: run image-registry test-ext-dev-e2e kind-clean
160161

Tiltfile

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
if not os.path.exists('../tilt-support'):
22
fail('Please clone https://github.com/operator-framework/tilt-support to ../tilt-support')
33

4-
load('../tilt-support/Tiltfile', 'deploy_repo', 'process_yaml')
4+
load('../tilt-support/Tiltfile', 'deploy_repo')
55

66
config.define_string_list('repos', args=True)
77
cfg = config.parse()
88
repos = cfg.get('repos', ['operator-controller', 'catalogd'])
99

1010
repo = {
1111
'image': 'quay.io/operator-framework/operator-controller',
12-
'yaml': 'config/overlays/tls',
12+
'yaml': 'config/secure',
1313
'binaries': {
1414
'manager': 'operator-controller-controller-manager',
1515
},
1616
'starting_debug_port': 30000,
1717
}
1818

19-
process_yaml("testdata/certs/issuers.yaml")
20-
2119
for r in repos:
2220
if r == 'operator-controller':
2321
deploy_repo('operator-controller', repo)

config/README.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# OPERATOR-CONTROLLER CONFIG
2+
3+
## config/base
4+
5+
This provides an insecure (i.e. no TLS) basic configuration of operator-controller.
6+
7+
This configuration specifies a namespace of `olmv1-system`.
8+
9+
## config/overlays/cert-manager
10+
11+
This includes support for a secure (i.e. with TLS) configuration of operator-controller. This configuration uses:
12+
* config/base
13+
* config/components/tls
14+
* config/components/ca
15+
16+
This configuration requires cert-manager.
17+
18+
## config/overlays/e2e
19+
20+
This provides additional configuration support for end-to-end testing, including code coverage. This configuration uses:
21+
* config/base
22+
* config/components/tls
23+
* config/components/ca
24+
* config/components/coverage
25+
26+
This configuration requires cert-manager.
27+
28+
## Components
29+
30+
Each of the `kustomization.yaml` files specify a `Component`, rather than an overlay.
31+
32+
### config/components/tls
33+
34+
This provides a basic configuration of operator-controller with TLS support for catalogd.
35+
36+
This component specifies the `olmv1-system` namespace.
37+
38+
This component requires cert-manager.
39+
40+
### config/components/coverage
41+
42+
Provides configuration for code coverage.
43+
44+
This component specifies the `olmv1-system` namespace.
45+
46+
### config/components/ca
47+
48+
Procides a CA for operator-controller operation.
49+
50+
This component _does not_ specify a namespace, and must be included last.
51+
52+
This component requires cert-manager.
File renamed without changes.
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: kustomize.config.k8s.io/v1alpha1
2+
kind: Component
3+
# No namespace is specified here, otherwise, it will overwrite _all_ the other namespaces!
4+
resources:
5+
- issuers.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: kustomize.config.k8s.io/v1alpha1
2+
kind: Component
3+
namespace: olmv1-system
4+
resources:
5+
- manager_e2e_coverage_pvc.yaml
6+
- manager_e2e_coverage_copy_pod.yaml
7+
patches:
8+
- path: manager_e2e_coverage_patch.yaml
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: kustomize.config.k8s.io/v1alpha1
2+
kind: Component
3+
namespace: olmv1-system
4+
resources:
5+
- resources/manager_cert.yaml
6+
patches:
7+
- target:
8+
kind: Deployment
9+
name: controller-manager
10+
path: patches/manager_deployment_cert.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
- op: add
2+
path: /spec/template/spec/volumes/-
3+
value: {"name":"olmv1-certificate", "secret":{"secretName":"olmv1-cert", "optional": false, "items": [{"key": "ca.crt", "path": "olm-ca.crt"}]}}
4+
- op: add
5+
path: /spec/template/spec/containers/0/volumeMounts/-
6+
value: {"name":"olmv1-certificate", "readOnly": true, "mountPath":"/var/certs/olm-ca.crt", "subPath":"olm-ca.crt"}
7+
- op: add
8+
path: /spec/template/spec/containers/0/args/-
9+
value: "--ca-certs-dir=/var/certs"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# kustomization file for secure operator-controller
2+
# DO NOT ADD A NAMESPACE HERE
3+
apiVersion: kustomize.config.k8s.io/v1beta1
4+
kind: Kustomization
5+
resources:
6+
- ../../base
7+
components:
8+
- ../../components/tls
9+
# ca must be last or tls will overwrite the namespaces
10+
- ../../components/ca
+10-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
namespace: olmv1-system
2-
1+
# kustomization file for all the e2e's
2+
# DO NOT ADD A NAMESPACE HERE
3+
apiVersion: kustomize.config.k8s.io/v1beta1
4+
kind: Kustomization
35
resources:
4-
- ../../overlays/tls
5-
- manager_e2e_coverage_pvc.yaml
6-
- manager_e2e_coverage_copy_pod.yaml
7-
8-
patches:
9-
- path: manager_e2e_coverage_patch.yaml
6+
- ../../base
7+
components:
8+
- ../../components/tls
9+
- ../../components/coverage
10+
# ca must be last or (tls|coverage) will overwrite the namespaces
11+
- ../../components/ca

config/overlays/tls/kustomization.yaml

-22
This file was deleted.

config/overlays/tls/patches/manager_cert_patch.yaml

-23
This file was deleted.

config/overlays/tls/patches/manager_deployment_cert.yaml

-9
This file was deleted.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/go-logr/logr v1.4.2
1111
github.com/google/go-cmp v0.6.0
1212
github.com/operator-framework/api v0.26.0
13-
github.com/operator-framework/catalogd v0.16.0
13+
github.com/operator-framework/catalogd v0.17.0
1414
github.com/operator-framework/helm-operator-plugins v0.2.2-0.20240520180534-f463c36fedf9
1515
github.com/operator-framework/operator-registry v1.44.0
1616
github.com/operator-framework/rukpak v0.24.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,8 @@ github.com/openshift/crd-schema-checker v0.0.0-20240404194209-35a9033b1d11 h1:eT
606606
github.com/openshift/crd-schema-checker v0.0.0-20240404194209-35a9033b1d11/go.mod h1:EmVJt97N+pfWFsli/ipXTBZqSG5F5KGQhm3c3IsGq1o=
607607
github.com/operator-framework/api v0.26.0 h1:YVntU2NkVl5zSLLwK5kFcH6P3oSvN9QDgTsY9mb4yUM=
608608
github.com/operator-framework/api v0.26.0/go.mod h1:3IxOwzVUeGxYlzfwKCcfCyS+q3EEhWA/4kv7UehbeyM=
609-
github.com/operator-framework/catalogd v0.16.0 h1:9J3Kg5ey5NptXReZ7J0ZAarXEz6RsWanfeWhurDtVh0=
610-
github.com/operator-framework/catalogd v0.16.0/go.mod h1:7zVv39zlmvJvRePtRzdMRqn8s/WRH4ALXMJCKNQMKmc=
609+
github.com/operator-framework/catalogd v0.17.0 h1:Vsl32qKf2nKbAnKNfJ6eREOkirx5+oxpUuSwMxGS/dc=
610+
github.com/operator-framework/catalogd v0.17.0/go.mod h1:7zVv39zlmvJvRePtRzdMRqn8s/WRH4ALXMJCKNQMKmc=
611611
github.com/operator-framework/helm-operator-plugins v0.2.2-0.20240520180534-f463c36fedf9 h1:f7/TMBpuIZEQ3JbD9UyP1L1ZCSLLWdR2aPN+A+dOHFY=
612612
github.com/operator-framework/helm-operator-plugins v0.2.2-0.20240520180534-f463c36fedf9/go.mod h1:ly6Bd9rSzmt37Wy6WtZHmA+IY9zG958MryJFLcVpCXw=
613613
github.com/operator-framework/operator-lib v0.14.0 h1:er+BgZymZD1im2wytLJiPLZpGALAX6N0gXaHx3PKbO4=

scripts/install.tpl.sh

-36
Original file line numberDiff line numberDiff line change
@@ -35,42 +35,6 @@ function kubectl_wait() {
3535
kubectl apply -f "https://github.com/cert-manager/cert-manager/releases/download/${cert_mgr_version}/cert-manager.yaml"
3636
kubectl_wait "cert-manager" "deployment/cert-manager-webhook" "60s"
3737

38-
# Create a self-signed ClusterIssuer
39-
kubectl apply -f - <<EOF
40-
apiVersion: cert-manager.io/v1
41-
kind: Issuer
42-
metadata:
43-
name: self-sign-issuer
44-
namespace: cert-manager
45-
spec:
46-
selfSigned: {}
47-
---
48-
apiVersion: cert-manager.io/v1
49-
kind: Certificate
50-
metadata:
51-
name: olmv1-ca
52-
namespace: cert-manager
53-
spec:
54-
isCA: true
55-
commonName: olmv1-ca
56-
secretName: olmv1-ca
57-
privateKey:
58-
algorithm: ECDSA
59-
size: 256
60-
issuerRef:
61-
name: self-sign-issuer
62-
kind: Issuer
63-
group: cert-manager.io
64-
---
65-
apiVersion: cert-manager.io/v1
66-
kind: ClusterIssuer
67-
metadata:
68-
name: olmv1-ca
69-
spec:
70-
ca:
71-
secretName: olmv1-ca
72-
EOF
73-
7438
kubectl apply -f "https://github.com/operator-framework/catalogd/releases/download/${catalogd_version}/catalogd.yaml"
7539
kubectl_wait "olmv1-system" "deployment/catalogd-controller-manager" "60s"
7640

0 commit comments

Comments
 (0)