Skip to content
Merged
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
4 changes: 2 additions & 2 deletions workspaces/backend/api/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ var _ = BeforeSuite(func() {
ctx, cancel = context.WithCancel(context.Background())

By("bootstrapping test environment")
path := filepath.Join("..", "..", "controller", "config", "crd", "bases")
path := filepath.Join("..", "..", "controller", "manifests", "kustomize", "base", "crd")
fmt.Println(path)
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{
filepath.Join("..", "..", "controller", "config", "crd", "bases"),
filepath.Join("..", "..", "controller", "manifests", "kustomize", "base", "crd"),
},
ErrorIfCRDPathMissing: true,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ resources:
labels:
- includeSelectors: true
pairs:
app.kubernetes.io/component: api
app.kubernetes.io/component: api

images:
- name: workspaces-backend
newName: ghcr.io/kubeflow/notebooks/workspaces-backend
newTag: latest
21 changes: 9 additions & 12 deletions workspaces/controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ help: ## Display this help.

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." \
output:crd:artifacts:config=manifests/kustomize/base/crd \
output:webhook:artifacts:config=manifests/kustomize/base/webhook \
output:rbac:artifacts:config=manifests/kustomize/base/manager

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down Expand Up @@ -124,12 +127,6 @@ docker-build-multi-arch:
docker-build-push-multi-arch:
docker buildx build --platform ${ARCH} --tag ${IMG} --push .

.PHONY: build-installer
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
mkdir -p dist
cd config/manager && $(KUSTOMIZE) edit set image workspaces-controller=${IMG}
$(KUSTOMIZE) build config/default > dist/install.yaml

##@ Deployment

ifndef ignore-not-found
Expand All @@ -138,20 +135,20 @@ endif

.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
$(KUSTOMIZE) build manifests/kustomize/base/crd | $(KUBECTL) apply -f -

.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
$(KUSTOMIZE) build manifests/kustomize/base/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image workspaces-controller=${IMG}
$(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
cd manifests/kustomize/overlays/istio && $(KUSTOMIZE) edit set image workspaces-controller=${IMG}
$(KUBECTL) apply -k manifests/kustomize/overlays/istio

.PHONY: undeploy
undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
$(KUBECTL) delete -k manifests/kustomize/overlays/istio --ignore-not-found=$(ignore-not-found)

##@ Dependencies

Expand Down
29 changes: 3 additions & 26 deletions workspaces/controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ make deploy IMG=<some-registry>/workspaces-controller:tag
privileges or be logged in as admin.

**Create instances of your solution**
You can apply the samples (examples) from the config/sample:
You can apply the samples (examples) from the manifests/kustomize/samples:

```sh
kubectl apply -k config/samples/
kubectl apply -k manifests/kustomize/samples/
```

>**NOTE**: Ensure that the samples has default values to test it out.
Expand All @@ -53,7 +53,7 @@ kubectl apply -k config/samples/
**Delete the instances (CRs) from the cluster:**

```sh
kubectl delete -k config/samples/
kubectl delete -k manifests/kustomize/samples/
```

**Delete the APIs(CRDs) from the cluster:**
Expand All @@ -67,26 +67,3 @@ make uninstall
```sh
make undeploy
```

## Project Distribution

Following are the steps to build the installer and distribute this project to users.

1. Build the installer for the image built and published in the registry:

```sh
make build-installer IMG=<some-registry>/workspaces-controller:tag
```

NOTE: The makefile target mentioned above generates an 'install.yaml'
file in the dist directory. This file contains all the resources built
with Kustomize, which are necessary to install this project without
its dependencies.

2. Using the installer

Users can just run kubectl apply -f <URL for YAML BUNDLE> to install the project, i.e.:

```sh
kubectl apply -f https://raw.githubusercontent.com/<org>/workspaces-controller/<tag or branch>/dist/install.yaml
```
9 changes: 0 additions & 9 deletions workspaces/controller/config/certmanager/kustomization.yaml

This file was deleted.

121 changes: 0 additions & 121 deletions workspaces/controller/config/default/kustomization.yaml

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions workspaces/controller/config/default/webhookcainjection_patch.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions workspaces/controller/config/prometheus/kustomization.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions workspaces/controller/config/rbac/kustomization.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions workspaces/controller/config/rbac/workspace_editor_role.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions workspaces/controller/config/rbac/workspace_viewer_role.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions workspaces/controller/config/rbac/workspacekind_editor_role.yaml

This file was deleted.

Loading
Loading