Converting ingress service type as deployment var and adding a infra CLI command to show deployment vars#406
Conversation
|
cc @geekodour |
|
Logs- |
b2067a1 to
efff23a
Compare
…ar in gke.go Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>
There was a problem hiding this comment.
What I was suggesting was something like
c.DeploymentVars["PROVIDER_SERVICE"] = "GKE"
and use something like
{{ if (eq .PROVIDER_SERVICE "GKE") }}
in the manifest file, but the approach in this PR actually looks better i think :) . I've commented some ways this can be improved.
pkg/provider/gke/gke.go
Outdated
| func (c *GKE) NewGKEClient(*kingpin.ParseContext) error { | ||
|
|
||
| // Set PROVIDER_SERVICE Deployment variable to LoadBalancer | ||
| c.DeploymentVars["PROVIDER_SERVICE"] = "LoadBalancer" |
There was a problem hiding this comment.
| c.DeploymentVars["PROVIDER_SERVICE"] = "LoadBalancer" | |
| c.DeploymentVars["NGINX_SERVICE_TYPE"] = "LoadBalancer" |
In the provider specific docs, we could just add a section about what are the deployment variables that are automatically passed for this specific provider.
It'll be good if we could have these deployment variables overridable when uses passes the same using the -v flag. Maybe also have a provider specific flag to list out all the set deployment variables. (This way we won't have to update readme manually and we could just use embedmd #353)
What I think will be good is to have a default DeploymentVars and have it set to the default value, like for eg. in this example only nginx controller k8s service type needs to be changed when running in KIND (to CLusterIP).
But for EKS and GKE, the type LoadBalancer works, so we could have some defaults and only modify them when creating the provider that needs the change(in our case KIND)
|
@rajdas98 Also ingress in kind uses And GKE currently uses Difference being : λ diff gke_deploy.yml kind_deply.yml
287,288c287
< type: LoadBalancer
< externalTrafficPolicy: Local
---
> type: NodePort
322a322,325
> strategy:
> rollingUpdate:
> maxUnavailable: 1
> type: RollingUpdate
343d345
< - --publish-service=ingress-nginx/ingress-nginx-controller
349a352
> - --publish-status-address=localhost
390a394
> hostPort: 80
393a398
> hostPort: 443
404a410,415
> nodeSelector:
> ingress-ready: 'true'
> tolerations:
> - effect: NoSchedule
> key: node-role.kubernetes.io/master
> operator: Equal
406c417
< terminationGracePeriodSeconds: 300
---
> terminationGracePeriodSeconds: 0So, is just changing the service type enough? |
|
So as far as i can see there should be three levels to this:
|
e3acd7b to
42a7e28
Compare
Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>
geekodour
left a comment
There was a problem hiding this comment.
Nice work! 👍 Thanks!
Some suggestions and improvements.
d827e86 to
aa7e113
Compare
Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>
geekodour
left a comment
There was a problem hiding this comment.
Some questions and suggestions. :)
Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>
Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>
Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>
geekodour
left a comment
There was a problem hiding this comment.
Some questions and suggestions :)
I think once this is merged, we don't have any other blockers for local?
07bb3c8 to
6a5175b
Compare
geekodour
left a comment
There was a problem hiding this comment.
Everything looks good 🥳 just small nits.
Will merge after changes are resolved :)
Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>
* Add NGINX_SERVICE_TYPE to DefaultDeploymentVars * Add info command to infra to show provider specific DeploymentVars Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>
Motivation:
Changes:
gke info deploymentvarscommand to show all default deployment variables.Signed-off-by: Raj Babu Das mail.rajdas@gmail.com