Skip to content
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

Remove plugin registry #252

Merged
merged 7 commits into from
Feb 5, 2021
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
28 changes: 4 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export PULL_POLICY ?= Always
export WEBHOOK_ENABLED ?= true
export DEFAULT_ROUTING ?= basic
export KUBECONFIG ?= ${HOME}/.kube/config
REGISTRY_ENABLED ?= true
DEVWORKSPACE_API_VERSION ?= aeda60d4361911da85103f224644bfa792498499

#internal params
Expand All @@ -43,7 +42,7 @@ else
K8S_CLI := kubectl
endif

ifeq ($(shell $(K8S_CLI) api-resources --api-group='route.openshift.io' | grep -o routes),routes)
ifeq ($(shell $(K8S_CLI) api-resources --api-group='route.openshift.io' 2>&1 | grep -o routes),routes)
PLATFORM := openshift
else
PLATFORM := kubernetes
Expand Down Expand Up @@ -93,7 +92,6 @@ _print_vars:
@echo " ROUTING_SUFFIX=$(ROUTING_SUFFIX)"
@echo " WEBHOOK_ENABLED=$(WEBHOOK_ENABLED)"
@echo " DEFAULT_ROUTING=$(DEFAULT_ROUTING)"
@echo " REGISTRY_ENABLED=$(REGISTRY_ENABLED)"
@echo " DEVWORKSPACE_API_VERSION=$(DEVWORKSPACE_API_VERSION)"

_create_namespace:
Expand Down Expand Up @@ -162,15 +160,15 @@ _login_with_devworkspace_sa:
oc login --token=$(SA_TOKEN) --kubeconfig=$(BUMPED_KUBECONFIG)

### run: Run against the configured Kubernetes cluster in ~/.kube/config
run: _print_vars _gen_configuration_env _bump_kubeconfig _login_with_devworkspace_sa _eval_plugin_registry_url
run: _print_vars _gen_configuration_env _bump_kubeconfig _login_with_devworkspace_sa
source $(RELATED_IMAGES_FILE)
export KUBECONFIG=$(BUMPED_KUBECONFIG)
CONTROLLER_SERVICE_ACCOUNT_NAME=$(DEVWORKSPACE_CTRL_SA) \
WATCH_NAMESPACE=$(NAMESPACE) \
go run ./main.go

### debug: Run controller locally with debugging enabled, watching cluster defined in ~/.kube/config
debug: _print_vars _gen_configuration_env _bump_kubeconfig _login_with_devworkspace_sa _eval_plugin_registry_url
debug: _print_vars _gen_configuration_env _bump_kubeconfig _login_with_devworkspace_sa
source $(RELATED_IMAGES_FILE)
export KUBECONFIG=$(BUMPED_KUBECONFIG)
CONTROLLER_SERVICE_ACCOUNT_NAME=$(DEVWORKSPACE_CTRL_SA) \
Expand All @@ -182,7 +180,7 @@ install_crds: _kustomize _init_devworkspace_crds
$(KUSTOMIZE) build config/crd | $(K8S_CLI) apply -f -

### install: Install controller in the configured Kubernetes cluster in ~/.kube/config
install: _print_vars _kustomize _init_devworkspace_crds _create_namespace _eval_plugin_registry_url
install: _print_vars _kustomize _init_devworkspace_crds _create_namespace
mv config/cert-manager/kustomization.yaml config/cert-manager/kustomization.yaml.bak
mv config/service-ca/kustomization.yaml config/service-ca/kustomization.yaml.bak
mv config/base/config.properties config/base/config.properties.bak
Expand Down Expand Up @@ -233,15 +231,6 @@ endif
$(K8S_CLI) delete validatingwebhookconfigurations.admissionregistration.k8s.io controller.devfile.io --ignore-not-found
$(K8S_CLI) delete namespace $(NAMESPACE) --ignore-not-found

### deploy_registry: Deploy plugin registry
deploy_registry: _print_vars _create_namespace
$(K8S_CLI) apply -f config/registry/local -n $(NAMESPACE)
ifeq ($(PLATFORM),kubernetes)
envsubst < config/registry/local/k8s/ingress.yaml | $(K8S_CLI) apply -n $(NAMESPACE) -f -
else
$(K8S_CLI) apply -f config/registry/local/os -n $(NAMESPACE)
endif

### manifests: Generate manifests e.g. CRD, RBAC etc.
manifests: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=role webhook paths="./..." \
Expand Down Expand Up @@ -325,14 +314,6 @@ endif
install_cert_manager:
kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.0.4/cert-manager.yaml

# export plugin registry url for other rules to use
_eval_plugin_registry_url: deploy_registry
ifeq ($(PLATFORM),kubernetes)
$(eval export PLUGIN_REGISTRY_URL=http://che-plugin-registry.$(ROUTING_SUFFIX)/v3)
else
$(eval export PLUGIN_REGISTRY_URL=http://$(shell $(K8S_CLI) get route -n $(NAMESPACE) che-plugin-registry -o=yaml | yq -r '.spec.host')/v3)
endif

_kustomize:
ifeq (, $(shell which kustomize))
@{ \
Expand Down Expand Up @@ -379,5 +360,4 @@ help: Makefile
@echo ' ROUTING_SUFFIX - Cluster routing suffix (e.g. $$(minikube ip).nip.io, apps-crc.testing)'
@echo ' PULL_POLICY - Image pull policy for controller'
@echo ' WEBHOOK_ENABLED - Whether webhooks should be enabled in the deployment'
@echo ' REGISTRY_ENABLED - Whether the plugin registry should be deployed'
@echo ' DEVWORKSPACE_API_VERSION - Branch or tag of the github.com/devfile/api to depend on. Defaults to master'
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ The repository contains a Makefile; building and deploying can be configured via
| `ROUTING_SUFFIX` | Cluster routing suffix (e.g. `$(minikube ip).nip.io`, `apps-crc.testing`). Required for Kubernetes | `192.168.99.100.nip.io` |
| `PULL_POLICY` | Image pull policy for controller | `Always` |
| `WEBHOOK_ENABLED` | Whether webhooks should be enabled in the deployment | `false` |
| `REGISTRY_ENABLED` | Whether the plugin registry should be deployed | `true` |
| `DEVWORKSPACE_API_VERSION` | Branch or tag of the github.com/devfile/api to depend on | `v1alpha1` |

Some of the rules supported by the makefile:
Expand Down
1 change: 0 additions & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ FROM registry.access.redhat.com/ubi8-minimal:8.2-349
WORKDIR /
COPY --from=builder /devworkspace-operator/_output/bin/devworkspace-controller /usr/local/bin/devworkspace-controller
COPY --from=builder /devworkspace-operator/_output/bin/webhook-server /usr/local/bin/webhook-server
COPY --from=builder /devworkspace-operator/internal-registry internal-registry

ENV USER_UID=1001 \
USER_NAME=devworkspace-controller
Expand Down
1 change: 0 additions & 1 deletion build/rhel.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ FROM registry.access.redhat.com/ubi8-minimal:8.2-349
WORKDIR /
COPY --from=builder /devworkspace-operator/_output/bin/devworkspace-controller /usr/local/bin/devworkspace-controller
COPY --from=builder /devworkspace-operator/_output/bin/webhook-server /usr/local/bin/webhook-server
COPY --from=builder /devworkspace-operator/internal-registry internal-registry

USER nonroot:nonroot

Expand Down
3 changes: 1 addition & 2 deletions config/base/config.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
devworkspace.routing.cluster_host_suffix=${ROUTING_SUFFIX}
controller.plugin_registry.url=${PLUGIN_REGISTRY_URL}
controller.plugin_artifacts_broker.image=quay.io/eclipse/che-plugin-artifacts-broker:v3.4.0
controller.webhooks.enabled=${WEBHOOK_ENABLED}
devworkspace.routing.cluster_host_suffix=${ROUTING_SUFFIX}
devworkspace.default_routing_class=${DEFAULT_ROUTING}
# image pull policy that is applied to all workspace's containers
devworkspace.sidecar.image_pull_policy=${PULL_POLICY}
Expand Down
32 changes: 0 additions & 32 deletions config/components/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,6 @@ rules:
- '*'
verbs:
- '*'
- apiGroups:
- controller.devfile.io
resources:
- components
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- controller.devfile.io
resources:
- components/status
verbs:
- get
- patch
- update
- apiGroups:
- controller.devfile.io
resources:
Expand All @@ -135,18 +115,6 @@ rules:
- get
- patch
- update
- apiGroups:
- ""
resources:
- configmap
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- extensions
resources:
Expand Down
45 changes: 0 additions & 45 deletions config/registry/local/deployment.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions config/registry/local/k8s/ingress.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions config/registry/local/os/route.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions config/registry/local/service.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions controllers/controller/component/cmd_terminal/cmd_terminal.go

This file was deleted.

Loading