Move CNI template to helm#3581
Conversation
d8c22b0 to
d23c125
Compare
718d858 to
05aeeaa
Compare
alpeb
left a comment
There was a problem hiding this comment.
Nice refactor 👍
I think we can't have cni-plugin.yaml live under charts/linkerd2/templates because it will get picked up by bin/helm-build package when building the helm release or by anyone installing with helm directly with the source (helm install charts/linikerd2). That'll create the cni resources even if not using cni.
Probably the cleanest would be to create a separate chart in charts/cni to house this guy.
|
I'm a big +1 to having a separate chart. We should (as a general rule) be keeping individual charts as small as possible and introducing dependencies between them. |
|
@alpeb Thanks for pointing that out, was not aware. Will split it up! |
|
@alpeb Currently I am reusing the values.go for the cni template. Do we want to split that up as well and have |
Yeah, I think it would make sense to have all cleanly separated 👍 People could get confused by those CNI values in the default |
05aeeaa to
d110219
Compare
|
@alpeb I split up the CNI parts further and added some tests around that. Let me know if that looks better |
alpeb
left a comment
There was a problem hiding this comment.
Thanks @zaharidichev !
It all looks good to me 👍 Just one minor comment below. Also, you forgot to remove /charts/linkerd2/templates/cni-plugin.yaml ;-)
I'll try running the CNI integration tests and report back.
charts/linkerd2-cni/README.md
Outdated
| | Parameter | Description | Default | | ||
| |--------------------------------------|-----------------------------------------------------------------------|-------------------------------| | ||
| |`Namespace` | Control plane namespace | `linkerd`| | ||
| |`ControllerNamespaceLabel` | Control plane label. Do not edit |`linkerd.io/control-plane-component`| |
There was a problem hiding this comment.
I believe the default here should be linkerd.io/control-plane-ns
| sed -i s~__INBOUND_PORTS_TO_IGNORE__~"${INBOUND_PORTS_TO_IGNORE:=}"~g ${TMP_CONF} | ||
| sed -i s~__OUTBOUND_PORTS_TO_IGNORE__~"${OUTBOUND_PORTS_TO_IGNORE:=}"~g ${TMP_CONF} | ||
| sed -i s~__SIMULATE__~"${SIMULATE:=false}"~g ${TMP_CONF} | ||
| sed -i s~__USE_WAIT_FLAG__~"${USE_WAIT_FLAG:=false}"~g ${TMP_CONF} |
There was a problem hiding this comment.
Nice riddance, those were indeed not necessary, along with the env vars! 👍
|
@alpeb Thanks a lot! If I move it from a fork branch to an internal one the tests should be ran automatically, right ? |
I'm afraid not. The CNI integration tests only run when merging to master, or when tagging master. |
|
It took me a while to run the integration tests because I had a misconfigured docker install 😬 They are throwing some errors, could you please address those? It's actually not a big deal to run those tests after all, and they don't even require a cluster. Feel free to ping me if you need any assistance. |
alpeb
left a comment
There was a problem hiding this comment.
It all looks good to me 👍
Also tested fine in cluster.
|
@zaharidichev this tested well using the CLI, but in order to do it through Helm, a new value in linkerd's |
|
@alpeb there is already |
|
You're right, I was thrown off by the absence of This tested fine in Minikube using the following commands: |
69e1c45 to
e344e06
Compare
|
@grampelberg yes its been a while :) the refactor I did here will align nicely with some other work I am doing atm so that's where my desire to get it merged comes from |
There was a problem hiding this comment.
@zaharidichev Thanks for cleaning this up 👍!
This branch works with the following commands on my GKE cluster:
# nodes should run Ubuntu, as COS uses read-only root filesystem
$ linkerd install-cni --dest-cni-bin-dir=/home/kubernetes/bin|k apply -f -
$ linkerd install --linkerd-cni-enabled|k apply -f -
$ helm install --name=linkerd2-cni --set DestCNIBinDir=/home/kubernetes/bin charts/linkerd2-cni
$ helm install --name=linkerd2 --set Identity.Issuer.CrtExpiry="Dec 9 16:10:37 2019" --set-file Identity.TrustAnchorsPEM=ca.crt --set-file Identity.Issuer.TLS.CrtPEM=issuer.crt --set-file Identity.Issuer.TLS.KeyPEM=issuer.key --set LinkerdVersion=git-57e39022 --set Proxy.Image.Version=git-57e39022 --set NoInitContainer=true --set InstallNamespace=false charts/linkerd2
See some comments on the README and variable names (in light of the Go convention) below.
950a722 to
1d25bfb
Compare
ihcsim
left a comment
There was a problem hiding this comment.
LGTM 👍! See a comment below regarding the extra println().
|
I just noticed the unresolved conflicts and fork. Please run the integration test on this fork, once the conflicts are resolved, before merging into |
Signed-off-by: zaharidichev <[email protected]>
Signed-off-by: zaharidichev <[email protected]>
Signed-off-by: zaharidichev <[email protected]>
Signed-off-by: zaharidichev <[email protected]>
Signed-off-by: zaharidichev <[email protected]>
Signed-off-by: zaharidichev <[email protected]>
Signed-off-by: Zahari Dichev <[email protected]>
1d25bfb to
f33a581
Compare
This PR moves the cni installation logic from cni-template.go to a helm template. It also simplifies some of the logic around how configuration is being supplied to the plugin.
Fixes: #2921
Signed-off-by: zaharidichev [email protected]