Skip to content

Commit 2537d07

Browse files
committed
port to AppWrapper controller using cert-controller
1 parent 302e369 commit 2537d07

23 files changed

+337
-25
lines changed

.github/workflows/e2e_tests.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ jobs:
5555
- name: Setup and start KinD cluster
5656
uses: ./common/github-actions/kind
5757

58+
- name: Deploy Kueue
59+
run: |
60+
make kueue-e2e
61+
5862
- name: Deploy CodeFlare stack
5963
id: deploy
6064
run: |

.github/workflows/olm_tests.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ jobs:
5454
- name: Setup and start KinD cluster
5555
uses: ./common/github-actions/kind
5656

57+
- name: Deploy Kueue
58+
run: |
59+
make kueue-e2e
60+
5761
- name: Install OLM
5862
run: |
5963
kubectl create -f https://github.com/operator-framework/operator-lifecycle-manager/releases/download/${OLM_VERSION}/crds.yaml

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ VERSION ?= v0.0.0-dev
1212
BUNDLE_VERSION ?= $(VERSION:v%=%)
1313

1414
# APPWRAPPER_VERSION defines the default version of the AppWrapper controller
15-
APPWRAPPER_VERSION ?= v0.6.4
15+
APPWRAPPER_VERSION ?= v0.7.0
1616
APPWRAPPER_REPO ?= github.com/project-codeflare/appwrapper
1717
# Upstream AppWrapper is currently only creating release tags of the form `vX.Y.Z` (i.e the version)
1818
APPWRAPPER_CRD ?= ${APPWRAPPER_REPO}/config/crd?ref=${APPWRAPPER_VERSION}
1919

20+
# KUEUE_VERSION defines the default version of Kueue (used for testing)
21+
KUEUE_VERSION ?= v0.6.1
22+
2023
# KUBERAY_VERSION defines the default version of the KubeRay operator (used for testing)
2124
KUBERAY_VERSION ?= v1.0.0
2225

@@ -375,6 +378,10 @@ test-e2e: manifests fmt vet ## Run e2e tests.
375378
kind-e2e: ## Set up e2e KinD cluster
376379
test/e2e/kind.sh
377380

381+
.PHONY: kueue-e2e
382+
kueue-e2e: ## Deploy Kueue
383+
KUEUE_VERSION=$(KUEUE_VERSION) test/e2e/kueue.sh
384+
378385
.PHONY: setup-e2e
379386
setup-e2e: ## Set up e2e tests.
380387
KUBERAY_VERSION=$(KUBERAY_VERSION) test/e2e/setup.sh

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ The e2e tests can be executed locally by running the following commands:
3333
```bash
3434
# Create a KinD cluster
3535
make kind-e2e
36+
# Deploy Kueue
37+
make kueue-e2e
3638
# Install the CRDs
3739
make install
3840
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
resources:
4-
- github.com/project-codeflare/appwrapper/config/crd?ref=v0.6.4
4+
- github.com/project-codeflare/appwrapper/config/crd?ref=v0.7.0

config/crd/crd-appwrapper.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
annotations:
5-
cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
65
controller-gen.kubebuilder.io/version: v0.14.0
76
name: appwrappers.workload.codeflare.dev
87
spec:
@@ -212,6 +211,10 @@ spec:
212211
phase:
213212
description: Phase of the AppWrapper object
214213
type: string
214+
resettingCount:
215+
description: Retries counts the number of times the AppWrapper has entered the Resetting Phase
216+
format: int32
217+
type: integer
215218
type: object
216219
type: object
217220
served: true

config/crd/kustomization.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,15 @@ resources:
55
- crd-appwrapper.yml
66

77
#+kubebuilder:scaffold:crdkustomizeresource
8+
9+
patches:
10+
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
11+
# patches here are for enabling the conversion webhook for each CRD
12+
- path: patches/webhook_in_appwrappers.yaml
13+
#+kubebuilder:scaffold:crdkustomizewebhookpatch
14+
15+
# [WEBHOOK] To enable webhook, uncomment the following section
16+
# the following config is for teaching kustomize how to do kustomization for CRDs.
17+
18+
configurations:
19+
- kustomizeconfig.yaml

config/crd/kustomizeconfig.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This file is for teaching kustomize how to substitute name and namespace reference in CRD
2+
nameReference:
3+
- kind: Service
4+
version: v1
5+
fieldSpecs:
6+
- kind: CustomResourceDefinition
7+
version: v1
8+
group: apiextensions.k8s.io
9+
path: spec/conversion/webhook/clientConfig/service/name
10+
11+
namespace:
12+
- kind: CustomResourceDefinition
13+
version: v1
14+
group: apiextensions.k8s.io
15+
path: spec/conversion/webhook/clientConfig/service/namespace
16+
create: false
17+
18+
varReference:
19+
- path: metadata/annotations
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# The following patch enables a conversion webhook for the CRD
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
name: appwrappers.workload.codeflare.dev
6+
spec:
7+
conversion:
8+
strategy: Webhook
9+
webhook:
10+
clientConfig:
11+
service:
12+
namespace: system
13+
name: webhook-service
14+
path: /convert
15+
conversionReviewVersions:
16+
- v1

config/default/kustomization.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,17 @@ bases:
1717
- ../crd
1818
- ../rbac
1919
- ../manager
20+
- ../internalcert
21+
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
22+
# crd/kustomization.yaml
23+
- ../webhook
2024
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
2125
# - ../prometheus
2226

27+
patches:
28+
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
29+
# crd/kustomization.yaml
30+
- path: manager_webhook_patch.yaml
31+
2332
resources:
2433
- metrics_service.yaml

0 commit comments

Comments
 (0)