Skip to content

Add openshift-infra dev env deployment #39

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

Merged
merged 2 commits into from
Apr 21, 2025
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
24 changes: 11 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,8 @@ uninstall-k8s: check-kubectl check-kustomize check-envsubst ## Uninstall from Ku
install-openshift-infrastructure:
ifeq ($(strip $(INFRASTRUCTURE_OVERRIDE)),true)
@echo "INFRASTRUCTURE_OVERRIDE is set to true, deploying infrastructure components"
@echo "Installing CRDs"
kustomize build deploy/components/crds | kubectl apply --server-side --force-conflicts -f -
@echo "Installing the Istio Control Plane"
kustomize build deploy/components/istio-control-plane | kubectl apply -f -
@echo "Installing OpenShift Infrastructure"
kustomize build deploy/environments/dev/openshift-infra | kubectl apply --server-side --force-conflicts -f -
else
$(error "Error: The environment variable INFRASTRUCTURE_OVERRIDE must be set to true in order to run this target.")
endif
Expand All @@ -583,11 +581,12 @@ endif
.PHONY: uninstall-openshift-infrastructure
uninstall-openshift-infrastructure:
ifeq ($(strip $(INFRASTRUCTURE_OVERRIDE)),true)
@echo "INFRASTRUCTURE_OVERRIDE is set to true, removing infrastructure components"
@echo "Uninstalling the Istio Control Plane"
kustomize build deploy/components/istio-control-plane | kubectl delete -f - || true
@echo "Uninstalling CRDs"
kustomize build deploy/components/crds | kubectl delete -f - || true
@echo "INFRASTRUCTURE_OVERRIDE is set to true, removing infrastructure components (this is extremely destructive)"
@echo "This is extremely destructive. We'll provide a few seconds before starting to give you a chance to cancel."
sleep 3
@echo "Uninstalling OpenShift Infrastructure Components"
@echo "Installing OpenShift Infrastructure"
kustomize build deploy/environments/dev/openshift-infra | kubectl delete -f - || true
else
$(error "Error: The environment variable INFRASTRUCTURE_OVERRIDE must be set to true in order to run this target.")
endif
Expand Down Expand Up @@ -786,6 +785,9 @@ print-namespace: ## Print the current namespace
print-project-name: ## Print the current project name
@echo "$(PROJECT_NAME)"

.PHONY: install-hooks
install-hooks: ## Install git hooks
git config core.hooksPath hooks
#
# Development Environments
#
Expand Down Expand Up @@ -818,7 +820,3 @@ environment.dev.kind.update: image-build
@echo "INFO: Restarting the Endpoint Picker Deployment"
kubectl --context kind-$(KIND_CLUSTER_NAME) -n default rollout restart deployment endpoint-picker
kubectl --context kind-$(KIND_CLUSTER_NAME) -n default rollout status deployment endpoint-picker

.PHONY: install-hooks
install-hooks: ## Install git hooks
git config core.hooksPath hooks
19 changes: 19 additions & 0 deletions deploy/environments/dev/openshift-infra/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# ------------------------------------------------------------------------------
# OpenShift Environment - Infrastructure
#
# This provides the infrastructure-level requirements that individual
# development environments (see `deploy/environments/dev/openshift`) will need
# (e.g. CRDs, Operators, RBAC, etc).
#
# **WARNING**: Needs to be run once, and regularly updated on an OpenShift
# cluster by an administrator prior to deploying individual environments on
# that cluster with `deploy/environments/dev/openshift`.
#
# ------------------------------------------------------------------------------
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../../components/crds/
- ../../../components/istio-control-plane/
- rbac.yaml
66 changes: 66 additions & 0 deletions deploy/environments/dev/openshift-infra/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: gateway-management
rules:
# ---------------------------------------------------------------------------
# Gateway API
# ---------------------------------------------------------------------------
- apiGroups:
- gateway.networking.k8s.io
resources:
- gateways
- httproutes
- grpcroutes
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
# ---------------------------------------------------------------------------
# Gateway API Inference Extension (GIE)
# ---------------------------------------------------------------------------
- apiGroups:
- inference.networking.x-k8s.io
resources:
- inferencepools
- inferencemodels
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
# ---------------------------------------------------------------------------
# Istio
# ---------------------------------------------------------------------------
- apiGroups:
- networking.istio.io
resources:
- destinationrules
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: authenticated-gateway-management
subjects:
- kind: Group
name: system:authenticated
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: ClusterRole
name: gateway-management
apiGroup: rbac.authorization.k8s.io