-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cmd/scripts/kubernetes): Add create-kubernetes-api-ingress command
- Loading branch information
1 parent
5017e86
commit 050ce68
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
cmd/scripts/kubernetes/create_kubernetes_api_ingress/create_kubernetes_api_ingress.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package create_kubernetes_api_ingress | ||
|
||
import ( | ||
parent_cmd "github.com/sikalabs/slu/cmd/scripts/kubernetes" | ||
"github.com/sikalabs/slu/utils/k8s_scripts" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var FlagDry bool | ||
var FlagDomain string | ||
|
||
var Cmd = &cobra.Command{ | ||
Use: "create-kubernetes-api-ingress", | ||
Short: "Create Ingress for Kubernetes API (kubernetes.default.svc)", | ||
Aliases: []string{"ckai"}, | ||
Args: cobra.NoArgs, | ||
Run: func(c *cobra.Command, args []string) { | ||
k8s_scripts.ApplyKubernetesApiIngress(FlagDomain, FlagDry) | ||
}, | ||
} | ||
|
||
func init() { | ||
parent_cmd.Cmd.AddCommand(Cmd) | ||
Cmd.Flags().BoolVar( | ||
&FlagDry, | ||
"dry", | ||
false, | ||
"Dry run", | ||
) | ||
Cmd.Flags().StringVarP( | ||
&FlagDomain, | ||
"domain", | ||
"d", | ||
"", | ||
"Domain for Kubernetes API Ingress", | ||
) | ||
Cmd.MarkFlagRequired("domain") | ||
} |