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
7 changes: 5 additions & 2 deletions workspaces/controller/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
TAG ?= $(shell git describe --tags --always --dirty)
IMG ?= ghcr.io/kubeflow/notebooks/workspaces-controller:$(TAG)


# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.31.0

Expand Down Expand Up @@ -128,7 +131,7 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
.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 controller=${IMG}
cd config/manager && $(KUSTOMIZE) edit set image workspaces-controller=${IMG}
$(KUSTOMIZE) build config/default > dist/install.yaml

##@ Deployment
Expand Down
2 changes: 1 addition & 1 deletion workspaces/controller/PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
domain: kubeflow.org
layout:
- go.kubebuilder.io/v4
projectName: workspace-controller
projectName: workspaces-controller
repo: github.com/kubeflow/notebooks/workspaces/controller
resources:
- api:
Expand Down
10 changes: 5 additions & 5 deletions workspaces/controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Kubeflow Workspace Controller is responsible for reconciling the `Workspace`
> ⚠️ __Warning__ ⚠️
>
> The Kubeflow Workspace Controller is a work in progress and is __NOT__ currently ready for use.
> We greatly appreciate any contributions.
> We greatly appreciate any contributions.

## Getting Started

Expand All @@ -18,7 +18,7 @@ The Kubeflow Workspace Controller is responsible for reconciling the `Workspace`
**Build and push your image to the location specified by `IMG`:**

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

**NOTE:** This image ought to be published in the personal registry you specified.
Expand All @@ -34,7 +34,7 @@ make install
**Deploy the Manager to the cluster with the image specified by `IMG`:**

```sh
make deploy IMG=<some-registry>/workspace-controller:tag
make deploy IMG=<some-registry>/workspaces-controller:tag
```

> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
Expand Down Expand Up @@ -75,7 +75,7 @@ Following are the steps to build the installer and distribute this project to us
1. Build the installer for the image built and published in the registry:

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

NOTE: The makefile target mentioned above generates an 'install.yaml'
Expand All @@ -88,5 +88,5 @@ its dependencies.
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>/workspace-controller/<tag or branch>/dist/install.yaml
kubectl apply -f https://raw.githubusercontent.com/<org>/workspaces-controller/<tag or branch>/dist/install.yaml
```
12 changes: 0 additions & 12 deletions workspaces/controller/config/certmanager/certificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,17 @@ apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
labels:
app.kubernetes.io/name: certificate
app.kubernetes.io/instance: serving-cert
app.kubernetes.io/component: certificate
app.kubernetes.io/created-by: workspace-controller
app.kubernetes.io/part-of: workspace-controller
app.kubernetes.io/managed-by: kustomize
name: selfsigned-issuer
namespace: system
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
labels:
app.kubernetes.io/name: certificate
app.kubernetes.io/instance: serving-cert
app.kubernetes.io/component: certificate
app.kubernetes.io/created-by: workspace-controller
app.kubernetes.io/part-of: workspace-controller
app.kubernetes.io/managed-by: kustomize
name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml
namespace: system
spec:
# SERVICE_NAME and SERVICE_NAMESPACE will be substituted by kustomize
dnsNames:
Expand Down
4 changes: 4 additions & 0 deletions workspaces/controller/config/certmanager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
labels:
- pairs:
app.kubernetes.io/component: webhook

resources:
- certificate.yaml

Expand Down
20 changes: 7 additions & 13 deletions workspaces/controller/config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# Adds namespace to all resources.
namespace: workspace-controller-system
namespace: kubeflow-workspaces

# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: workspace-controller-

# Labels to add to all resources and selectors.
#labels:
#- includeSelectors: true
# pairs:
# someName: someValue
labels:
- includeSelectors: true
pairs:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: workspaces-controller
app.kubernetes.io/part-of: kubeflow-workspaces

resources:
- ../crd
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
name: workspaces-controller
spec:
template:
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
name: workspaces-controller
spec:
template:
spec:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
name: workspaces-controller
spec:
template:
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
labels:
app.kubernetes.io/name: validatingwebhookconfiguration
app.kubernetes.io/instance: validating-webhook-configuration
app.kubernetes.io/component: webhook
app.kubernetes.io/created-by: workspace-controller
app.kubernetes.io/part-of: workspace-controller
app.kubernetes.io/managed-by: kustomize
name: validating-webhook-configuration
annotations:
cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
10 changes: 8 additions & 2 deletions workspaces/controller/config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- manager.yaml

labels:
- includeSelectors: true
pairs:
app.kubernetes.io/component: controller-manager

images:
- name: controller
newName: ghcr.io/kubeflow/notebooks/workspace-controller
- name: workspaces-controller
newName: ghcr.io/kubeflow/notebooks/workspaces-controller
newTag: latest
23 changes: 6 additions & 17 deletions workspaces/controller/config/manager/manager.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
app.kubernetes.io/name: workspace-controller
app.kubernetes.io/managed-by: kustomize
name: system
name: kubeflow-workspaces
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
namespace: system
labels:
control-plane: controller-manager
app.kubernetes.io/name: workspace-controller
app.kubernetes.io/managed-by: kustomize
name: workspaces-controller
spec:
selector:
matchLabels:
control-plane: controller-manager
matchLabels: {}
replicas: 1
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
control-plane: controller-manager
labels: {}
spec:
# TODO(user): Uncomment the following code to configure the nodeAffinity expression
# according to the platforms which are supported by your solution.
Expand Down Expand Up @@ -64,7 +53,7 @@ spec:
- --leader-elect
- --health-probe-bind-address=:8081
- --metrics-bind-address=0
image: controller:latest
image: workspaces-controller:latest
imagePullPolicy: IfNotPresent
name: manager
securityContext:
Expand Down Expand Up @@ -93,5 +82,5 @@ spec:
requests:
cpu: 10m
memory: 64Mi
serviceAccountName: controller-manager
serviceAccountName: workspaces-controller
terminationGracePeriodSeconds: 10
4 changes: 4 additions & 0 deletions workspaces/controller/config/prometheus/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
resources:
- monitor.yaml

labels:
- pairs:
app.kubernetes.io/component: metrics
9 changes: 2 additions & 7 deletions workspaces/controller/config/prometheus/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
control-plane: controller-manager
app.kubernetes.io/name: workspace-controller
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-monitor
namespace: system
name: workspaces-controller-metrics-monitor
spec:
endpoints:
- path: /metrics
port: http # Ensure this is the name of the port that exposes HTTP metrics
scheme: http
selector:
matchLabels:
control-plane: controller-manager
app.kubernetes.io/component: controller-manager
5 changes: 5 additions & 0 deletions workspaces/controller/config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
labels:
- pairs:
app.kubernetes.io/component: controller-manager

resources:
# All RBAC will be applied under this service account in
# the deployment namespace. You may comment out this resource
Expand All @@ -18,3 +22,4 @@ resources:
- workspacekind_viewer_role.yaml
- workspace_editor_role.yaml
- workspace_viewer_role.yaml

3 changes: 0 additions & 3 deletions workspaces/controller/config/rbac/leader_election_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app.kubernetes.io/name: workspace-controller
app.kubernetes.io/managed-by: kustomize
name: leader-election-role
rules:
- apiGroups:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app.kubernetes.io/name: workspace-controller
app.kubernetes.io/managed-by: kustomize
name: leader-election-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: leader-election-role
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
name: workspaces-controller
namespace: kubeflow-workspaces
9 changes: 2 additions & 7 deletions workspaces/controller/config/rbac/metrics_service.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
apiVersion: v1
kind: Service
metadata:
labels:
control-plane: controller-manager
app.kubernetes.io/name: workspace-controller
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-service
namespace: system
name: workspaces-controller-metrics-service
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
control-plane: controller-manager
app.kubernetes.io/component: controller-manager
7 changes: 2 additions & 5 deletions workspaces/controller/config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/name: workspace-controller
app.kubernetes.io/managed-by: kustomize
name: manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: manager-role
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
name: workspaces-controller
namespace: kubeflow-workspaces
6 changes: 1 addition & 5 deletions workspaces/controller/config/rbac/service_account.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/name: workspace-controller
app.kubernetes.io/managed-by: kustomize
name: controller-manager
namespace: system
name: workspaces-controller
3 changes: 0 additions & 3 deletions workspaces/controller/config/rbac/workspace_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: workspace-controller
app.kubernetes.io/managed-by: kustomize
name: workspace-editor-role
rules:
- apiGroups:
Expand Down
3 changes: 0 additions & 3 deletions workspaces/controller/config/rbac/workspace_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: workspace-controller
app.kubernetes.io/managed-by: kustomize
name: workspace-viewer-role
rules:
- apiGroups:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: workspace-controller
app.kubernetes.io/managed-by: kustomize
name: workspacekind-editor-role
rules:
- apiGroups:
Expand Down
Loading
Loading