Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Commands:
help [<command>...]
Show help.

gke info
gke info -v hashStable:COMMIT1 -v hashTesting:COMMIT2

gke cluster create
gke cluster create -a service-account.json -f FileOrFolder

Expand Down
3 changes: 3 additions & 0 deletions infra/infra.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ func main() {
Short('a').
StringVar(&g.Auth)

k8sGKE.Command("info", "gke info -v hashStable:COMMIT1 -v hashTesting:COMMIT2").
Action(g.GetDeploymentVars)

// Cluster operations.
k8sGKECluster := k8sGKE.Command("cluster", "manage GKE clusters").
Action(g.NewGKEClient).
Expand Down
10 changes: 10 additions & 0 deletions pkg/provider/gke/gke.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,3 +579,13 @@ func (c *GKE) ResourceDelete(*kingpin.ParseContext) error {
}
return nil
}

// GetDeploymentVars shows deployment variables.
func (c *GKE) GetDeploymentVars(parseContext *kingpin.ParseContext) error {
fmt.Print("-------------------\n DeploymentVars \n------------------- \n")
for key, value := range c.DeploymentVars {
fmt.Println(key, " : ", value)
}

return nil
}
8 changes: 5 additions & 3 deletions pkg/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ type DeploymentResource struct {
// NewDeploymentResource returns DeploymentResource with default values.
func NewDeploymentResource() *DeploymentResource {
return &DeploymentResource{
DeploymentFiles: []string{},
FlagDeploymentVars: map[string]string{},
DefaultDeploymentVars: map[string]string{},
DeploymentFiles: []string{},
FlagDeploymentVars: map[string]string{},
DefaultDeploymentVars: map[string]string{
"NGINX_SERVICE_TYPE": "LoadBalancer",
},
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ metadata:
app.kubernetes.io/part-of: ingress-nginx
spec:
externalTrafficPolicy: Local
type: LoadBalancer
type: "{{ .NGINX_SERVICE_TYPE }}"
selector:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
Expand Down