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

Add container override for images #273

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 21 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ docker-buildx-runtime:
##@ Deployment

ifndef ignore-not-found
ignore-not-found = false
ignore-not-found = true
endif

.PHONY: install
Expand All @@ -211,18 +211,36 @@ install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~

.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.
$(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -k config/dependency
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
$(KUBECTL) delete -k config/dependency

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

.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 -

.PHONY: install-vke
install-vke: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
## helm creates objects without aibrix prefix, hence deploying gateway components outside of kustomization
$(KUBECTL) create -k config/overlays/vke/dependency

.PHONY: uninstall-vke
uninstall-vke: 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.
$(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -k config/overlays/vke/dependency
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: deploy-vke
deploy-vke: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/overlays/vke/default | $(KUBECTL) create -f -

.PHONY: undeploy-vke
undeploy-vke: 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/overlays/vke/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -

##@ Dependencies

## Location to install dependencies to
Expand Down
10 changes: 0 additions & 10 deletions config/default/manager_config_patch.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions config/default/manager_metrics_patch.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions config/overlays/vke/default/gateway/envoyproxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
name: custom-proxy-config
namespace: aibrix-system
spec:
provider:
type: Kubernetes
kubernetes:
envoyDeployment:
container:
image: aibrix-container-registry-cn-beijing.cr.volces.com/envoyproxy/envoy:distroless-v1.31.0
12 changes: 12 additions & 0 deletions config/overlays/vke/default/gateway/gateway_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: eg
namespace: aibrix-system
spec:
gatewayClassName: aibrix-eg
infrastructure:
parametersRef:
group: gateway.envoyproxy.io
kind: EnvoyProxy
name: aibrix-custom-proxy-config
26 changes: 26 additions & 0 deletions config/overlays/vke/default/gateway/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
resources:
- ../../../../gateway
- envoyproxy.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious why can not we use envoyproxy + gatreway_patch.yaml from the original folder? If we just like to override the images? I think the one under default/kustomization.yaml is good enough?

Copy link
Collaborator Author

@varungup90 varungup90 Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no envoyproxy + gateway_patch in config/gateway. Its a override added to replace envoyproxy image, which was not needed in US env.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Makes sense. I misunderstand this part


patches:
- path: gateway_patch.yaml


apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: busybox
newName: aibrix-container-registry-cn-beijing.cr.volces.com/aibrix/busybox
newTag: stable
- name: aibrix/plugins
newName: aibrix-container-registry-cn-beijing.cr.volces.com/aibrix/plugins
newTag: nightly
- name: envoyproxy/envoy
newName: aibrix-container-registry-cn-beijing.cr.volces.com/envoyproxy/envoy
newTag: distroless-v1.31.0
- name: aibrix/users
newName: aibrix-container-registry-cn-beijing.cr.volces.com/aibrix/users
newTag: nightly
- name: redis
newName: aibrix-container-registry-cn-beijing.cr.volces.com/aibrix/redis
newTag: latest
10 changes: 10 additions & 0 deletions config/overlays/vke/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace: aibrix-system

namePrefix: aibrix-

resources:
- ../../../crd
- ../../../rbac
- manager
- gateway
- ../dependency/kuberay-operator
7 changes: 7 additions & 0 deletions config/overlays/vke/default/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resources:
- ../../../../manager

images:
- name: aibrix/controller-manager
newName: aibrix-container-registry-cn-beijing.cr.volces.com/aibrix/controller-manager
newTag: nightly
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: envoy-gateway-config
namespace: envoy-gateway-system
data:
envoy-gateway.yaml: |
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyGateway
provider:
kubernetes:
shutdownManager:
image: aibrix-container-registry-cn-beijing.cr.volces.com/envoyproxy/gateway:v1.1.0
type: Kubernetes
gateway:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
extensionApis:
enableEnvoyPatchPolicy: true
10 changes: 10 additions & 0 deletions config/overlays/vke/dependency/envoy-gateway/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resources:
- ../../../../dependency

patches:
- path: envoy_config_patch.yaml

images:
- name: envoyproxy/gateway
newName: aibrix-container-registry-cn-beijing.cr.volces.com/envoyproxy/gateway
newTag: v1.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resources:
- ../../../../dependency/kuberay-operator

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: quay.io/kuberay/operator
newName: aibrix-container-registry-cn-beijing.cr.volces.com/aibrix/quay.io/kuberay/operator
newTag: v1.2.1
4 changes: 4 additions & 0 deletions config/overlays/vke/dependency/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kind: Kustomization
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we move image override to this folder. does it mean we just need this single file?

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In dependency, envoy-gateway has different namespace. So that will always be separate. In other cases, we can not merge because each one references to their parent also. When I tried to club everything together, resources order is not guaranteed and it was not working.


resources:
- envoy-gateway
Loading