apisix-ingress-controller icon indicating copy to clipboard operation
apisix-ingress-controller copied to clipboard

Add new `make dev-env` entry in Makefile

Open tao12345666333 opened this issue 1 year ago • 13 comments

We should add a new make dev-env entry in Makefile, to start a dev environment.

It should do something:

  • using kind create a new cluster
  • Deploy APISIX + etcd
  • Build apisix-ingress-controller’s image
  • Deploy apisix-ingress-controller

Most of them are already contained in the current Makefile, we need to organize them

tao12345666333 avatar Jul 11 '22 08:07 tao12345666333

let me try

Erhao avatar Jul 19 '22 02:07 Erhao

Hi, @Erhao , are you still working on this issue? I'm a new learner of apisix ingress controller. Maybe I can have a try on this.

CrazyCollin avatar Sep 27 '22 17:09 CrazyCollin

thanks! Please!

tao12345666333 avatar Sep 28 '22 00:09 tao12345666333

Hi, @tao12345666333 , feel sorry to bother you, after I build ingress controller image and load it into kind cluster, I have no good way to deploy it, sincerely looking forward to your advice.

CrazyCollin avatar Oct 02 '22 12:10 CrazyCollin

You can change manifests under sample/deploy directory

tao12345666333 avatar Oct 03 '22 01:10 tao12345666333

Many thanks to you.

CrazyCollin avatar Oct 03 '22 15:10 CrazyCollin

@CrazyCollin How is this work going ?

zou8944 avatar Oct 28 '22 09:10 zou8944

@tao12345666333 I tried this job and found something puzzle me.

First I tried the following script to create dev env,

dev-env: kind-up pack-image
	kubectl create namespace ingress-apisix

	helm repo add apisix https://charts.apiseven.com
	helm repo update
	helm install apisix apisix/apisix --namespace ingress-apisix

	CA_BUNDLE=kubectl config view --raw --flatten -o json | jq -r '.clusters[] | select(.name == "'$(kubectl config current-context)'") | .cluster."certificate-authority-data"'
	kubectl kustomize $(PWD)/samples/deploy | sed "s|\${CA_BUNDLE}|${CA_BUNDLE}|g" | kubectl apply -f -
	kubectl set image deployment/ingress-controller ingress-controller=localhost:5001/apache/apisix-ingress-controller:dev

the step is:

running kind-up to strat cluster and k8s -> build image and deploy to local registry -> deploy apisix to k8s with helm -> deploy ingress controller with local directory samples/deployment.

but this didn't work, ingress controller cannot visit apisix properly, there are 2 causes.

  1. apisix did not allow admin visit from other endpoint excepting 127.0.0.1 image

  2. proxy_stream is not configured image

according to apisix helm chart, I need to set ingress-controller.enable=true when helm install, but if so, an ingress controller deployment will be deploy also, this is not expected.

And now I have another idea: deploying apisix and apisix-ingress-controller, and then replace the image with localhost:5001/apache/apisix-ingress-controller:dev, the script may be

dev-env: kind-up pack-image
	kubectl create namespace ingress-apisix

	helm repo add apisix https://charts.apiseven.com
	helm repo update
	helm install apisix apisix/apisix \
		--set gateway.type=NodePort \
		--set ingress-controller.enabled=true \
		--namespace ingress-apisix

	kubectl set image deployment/apisix-ingress-controller apisix-ingress-controller=localhost:5001/apache/apisix-ingress-controller:dev

Could you please give me some advice?

zou8944 avatar Nov 02 '22 07:11 zou8944

Hi @zou8944 , sorry for my work and delayed response as I have a lot going on these days so. My initial idea was to use Helm to deploy apisix and etcd, then load the built ingress image into kind, after many attempts, the apisix instance still can't respond to ingress requests, it may be the same problem as yours. I think maybe my configuration file in samples/deployment is not set correctly. I will unassign myself right away, sorry again.

CrazyCollin avatar Nov 02 '22 18:11 CrazyCollin

@zou8944 sorry for delay, I miss your message.

I think its SGTM.

Using Helm to deploy APISIX + APISIX Ingress controller, then replace apisix-ingress-controller's image.

tao12345666333 avatar Dec 30 '22 08:12 tao12345666333

OK, thanks. then this is PR https://github.com/apache/apisix-ingress-controller/pull/1460

zou8944 avatar Jan 03 '23 02:01 zou8944

I wish to work on this issue.

ps-19 avatar Apr 03 '23 07:04 ps-19

@tao12345666333 are you working on this?

lakshya8066 avatar Dec 21 '23 03:12 lakshya8066