-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: support k8s 1.22 and upgrade dependencies #50
feat: support k8s 1.22 and upgrade dependencies #50
Conversation
- Upgrade k8s client-go to version 1.19 - Create v1 and v2 sub-packages for the controller The controller package now contains all common code for the controller. The v1 package uses the typed client for the extensions/v1beta1 ingress and defines the sync handler responsible for creating and updating the ingress. The v2 package uses the typed client for the networking/v1 ingress and defines the the sync handler responseible for creation and updating the ingress. - Add a helper function to discover the cluster capabilities and use this to determine which controller to start. Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
Mimic the `update-codegen.sh` implementation from Flagger, this implementation handles modules correctly. The controlle code-generator is not compatible with modules and vendor, so this removes the vendor folder and all of the go flags that set the vendor mode. Update to client-go 0.21.3, which is the latest version with v1beta1 networking support. Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
Convert the tests for MakeAnnotations to a table driven test and add cases for TLS and Skipper Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
1. Readd the vendor folder and revert changes to the Dockerfile 2. Create a new pattern for installing the k8s.io/code-gen tooling. This uses a "submodule" for defining the dependency so that we can use `go mod download` independently of the main peoject and vendor folder. This allows us to use native Go tooling and minimize the amount of custom scripting we need to write and maintain. Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
@alexellis i made the two requested changes
|
A pre-built image is available at |
I tested this in kind with k8s 1.19 using these files # cluster.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
- containerPort: 31112 # this is the NodePort created by the helm chart
hostPort: 8080 # this is your port on localhost
protocol: TCP # test.yaml
apiVersion: openfaas.com/v1alpha2
kind: FunctionIngress
metadata:
name: nodeinfo
namespace: openfaas
spec:
domain: "nodeinfo.myfaas.club"
function: "nodeinfo"
ingressType: "nginx"
path: "/v1/profiles/(.*)" and then $ kind create cluster --config=cluster.yaml
$ arkade install openfaas \
--basic-auth=false \
--clusterrole \
--ingress-operator \
--set ingressOperator.image=ghcr.io/lucasroesler/ingress-operator:pr-50
$ faas-cli store deploy nodeinfo
$ kubectl apply -f test.yaml
$ kubectl get ing
Warning: extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
NAME CLASS HOSTS ADDRESS PORTS AGE
nodeinfo <none> nodeinfo.myfaas.club 80 5s I then upgraded kind and used the latest k8s and got the same results, the ingress was created as expected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I like the simple solution of using the .tools folder. Nicely done.
Description
Mimic the
update-codegen.sh
implementation from Flagger, this implementation handles modules correctly.The controller code-generator is not compatible with modules and vendor, so this removes the vendor folder and all of the go flags that set the vendor mode.
Update to client-go 0.21.3, which is the latest version with v1beta1 networking support.
Create v1 and v2 sub-packages for the controller
The controller package now contains all common code for the controller.
The v1 package uses the typed client for the extensions/v1beta1 ingress
and defines the sync handler responsible for creating and updating
the ingress.
The v2 package uses the typed client for the networking/v1 ingress and
defines the the sync handler responseible for creation and updating
the ingress.
Add a helper function to discover the cluster capabilities and use
this to determine which controller to start.
Motivation and Context
Resolves #49
How Has This Been Tested?
WIP
Types of changes
Impact to existing users
None
Checklist:
git commit -s