Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #648 from Kuadrant/separate-controller-deploy
Browse files Browse the repository at this point in the history
Separate controller deploy
  • Loading branch information
maleck13 authored Nov 9, 2023
2 parents 27469a2 + 061b011 commit f452cc6
Show file tree
Hide file tree
Showing 56 changed files with 659 additions and 399 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ jobs:
run: |
make docker-build-gateway-controller kind-load-gateway-controller docker-build-policy-controller kind-load-policy-controller deploy-gateway-controller
kubectl --context kind-mgc-control-plane -n multicluster-gateway-controller-system wait --timeout=300s --for=condition=Available deployment/mgc-controller-manager
kubectl --context kind-mgc-control-plane -n multicluster-gateway-controller-system wait --timeout=300s --for=condition=Available deployment/mgc-policy-controller-manager
kubectl --context kind-mgc-control-plane -n multicluster-gateway-controller-system wait --timeout=300s --for=condition=Available deployment/mgc-policy-controller
kubectl --context kind-mgc-control-plane logs --all-containers --ignore-errors deployment/mgc-controller-manager -n multicluster-gateway-controller-system
kubectl --context kind-mgc-control-plane logs --all-containers --ignore-errors deployment/mgc-policy-controller-manager -n multicluster-gateway-controller-system
kubectl --context kind-mgc-control-plane logs --all-containers --ignore-errors deployment/mgc-policy-controller -n multicluster-gateway-controller-system
kubectl get managedzones -n multi-cluster-gateways mgc-dev-mz-aws -o yaml
kubectl --context kind-mgc-control-plane -n multi-cluster-gateways wait --timeout=60s --for=condition=Ready managedzone/mgc-dev-mz-aws
kubectl get managedzones -n multi-cluster-gateways mgc-dev-mz-gcp -o yaml
Expand Down
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,17 @@ clean: ## Clean up temporary files.
-rm -rf ./tmp
-rm -rf ./config/**/charts

.PHONY: gateway-manifests
gateway-manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="./pkg/controllers/gateway" output:rbac:artifacts:config=config/rbac

.PHONY: policy-manifests
policy-manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=policy-role paths="./pkg/controllers/dnshealthcheckprobe" paths="./pkg/controllers/dnspolicy" paths="./pkg/controllers/dnsrecord" paths="./pkg/controllers/managedzone" paths="./pkg/controllers/tlspolicy" output:rbac:dir=config/policy-controller/rbac
$(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=config/policy-controller/crd/bases

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

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down Expand Up @@ -117,13 +125,6 @@ ifndef ignore-not-found
ignore-not-found = false
endif

.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/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 -

.PHONY: deploy-sample-applicationset
deploy-sample-applicationset:
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ When deploying the multicluster gateway controller using the make targets, the f
1. Build the controller image and load it into the control plane
```sh
kubectl config use-context kind-mgc-control-plane
make kind-load-policy-controller
make kind-load-gateway-controller
kubectl config use-context kind-mgc-control-plane
make kind-load-gateway-controller
make kind-load-policy-controller
```

1. Deploy the controller(s) to the control plane cluster
Expand All @@ -71,11 +73,12 @@ When deploying the multicluster gateway controller using the make targets, the f

1. Run the controller locally:
```sh
kubectl config use-context kind-mgc-control-plane
make build-policy-controller install run-policy-controller
make build-gateway-controller install run-gateway-controller
kubectl config use-context kind-mgc-control-plane
make build-gateway-controller install run-gatewway-controller
make build-policy-controller install run-policy-controller
```

## 3. Running the agent in the cluster:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: mgc-dnsrecord-editor-role
rules:
- apiGroups:
- kuadrant.io
resources:
- dnsrecords
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- kuadrant.io
resources:
- dnsrecords/status
verbs:
- get
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: mgc-dnsrecord-viewer-role
rules:
- apiGroups:
- kuadrant.io
resources:
- dnsrecords
verbs:
- get
- list
- watch
- apiGroups:
- kuadrant.io
resources:
- dnsrecords/status
verbs:
- get
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# permissions for end users to edit dnsrecords.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: dnsrecord-editor-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: multicluster-gateway-controller
app.kubernetes.io/part-of: multicluster-gateway-controller
app.kubernetes.io/instance: dnsrecord-editor-role
app.kubernetes.io/managed-by: kustomize
name: dnsrecord-editor-role
app.kubernetes.io/name: clusterrole
app.kubernetes.io/part-of: multicluster-gateway-controller
name: mgc-kuadrant-dnsrecord-editor-role
rules:
- apiGroups:
- kuadrant.io
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# permissions for end users to view dnsrecords.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: dnsrecord-viewer-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: multicluster-gateway-controller
app.kubernetes.io/part-of: multicluster-gateway-controller
app.kubernetes.io/instance: dnsrecord-viewer-role
app.kubernetes.io/managed-by: kustomize
name: dnsrecord-viewer-role
app.kubernetes.io/name: clusterrole
app.kubernetes.io/part-of: multicluster-gateway-controller
name: mgc-kuadrant-dnsrecord-viewer-role
rules:
- apiGroups:
- kuadrant.io
Expand Down
Loading

0 comments on commit f452cc6

Please sign in to comment.