|
|
@ -21,21 +21,22 @@ const (
|
|
|
|
|
|
|
|
|
|
|
|
// Deployment describes the k8s deployment yaml
|
|
|
|
// Deployment describes the k8s deployment yaml
|
|
|
|
type Deployment struct {
|
|
|
|
type Deployment struct {
|
|
|
|
Name string
|
|
|
|
Name string
|
|
|
|
Namespace string
|
|
|
|
Namespace string
|
|
|
|
Image string
|
|
|
|
Image string
|
|
|
|
Secret string
|
|
|
|
Secret string
|
|
|
|
Replicas int
|
|
|
|
Replicas int
|
|
|
|
Revisions int
|
|
|
|
Revisions int
|
|
|
|
Port int
|
|
|
|
Port int
|
|
|
|
NodePort int
|
|
|
|
NodePort int
|
|
|
|
UseNodePort bool
|
|
|
|
UseNodePort bool
|
|
|
|
RequestCpu int
|
|
|
|
RequestCpu int
|
|
|
|
RequestMem int
|
|
|
|
RequestMem int
|
|
|
|
LimitCpu int
|
|
|
|
LimitCpu int
|
|
|
|
LimitMem int
|
|
|
|
LimitMem int
|
|
|
|
MinReplicas int
|
|
|
|
MinReplicas int
|
|
|
|
MaxReplicas int
|
|
|
|
MaxReplicas int
|
|
|
|
|
|
|
|
ServiceAccount string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// DeploymentCommand is used to generate the kubernetes deployment yaml files.
|
|
|
|
// DeploymentCommand is used to generate the kubernetes deployment yaml files.
|
|
|
@ -72,21 +73,22 @@ func DeploymentCommand(c *cli.Context) error {
|
|
|
|
|
|
|
|
|
|
|
|
t := template.Must(template.New("deploymentTemplate").Parse(text))
|
|
|
|
t := template.Must(template.New("deploymentTemplate").Parse(text))
|
|
|
|
err = t.Execute(out, Deployment{
|
|
|
|
err = t.Execute(out, Deployment{
|
|
|
|
Name: c.String("name"),
|
|
|
|
Name: c.String("name"),
|
|
|
|
Namespace: c.String("namespace"),
|
|
|
|
Namespace: c.String("namespace"),
|
|
|
|
Image: c.String("image"),
|
|
|
|
Image: c.String("image"),
|
|
|
|
Secret: c.String("secret"),
|
|
|
|
Secret: c.String("secret"),
|
|
|
|
Replicas: c.Int("replicas"),
|
|
|
|
Replicas: c.Int("replicas"),
|
|
|
|
Revisions: c.Int("revisions"),
|
|
|
|
Revisions: c.Int("revisions"),
|
|
|
|
Port: c.Int("port"),
|
|
|
|
Port: c.Int("port"),
|
|
|
|
NodePort: nodePort,
|
|
|
|
NodePort: nodePort,
|
|
|
|
UseNodePort: nodePort > 0,
|
|
|
|
UseNodePort: nodePort > 0,
|
|
|
|
RequestCpu: c.Int("requestCpu"),
|
|
|
|
RequestCpu: c.Int("requestCpu"),
|
|
|
|
RequestMem: c.Int("requestMem"),
|
|
|
|
RequestMem: c.Int("requestMem"),
|
|
|
|
LimitCpu: c.Int("limitCpu"),
|
|
|
|
LimitCpu: c.Int("limitCpu"),
|
|
|
|
LimitMem: c.Int("limitMem"),
|
|
|
|
LimitMem: c.Int("limitMem"),
|
|
|
|
MinReplicas: c.Int("minReplicas"),
|
|
|
|
MinReplicas: c.Int("minReplicas"),
|
|
|
|
MaxReplicas: c.Int("maxReplicas"),
|
|
|
|
MaxReplicas: c.Int("maxReplicas"),
|
|
|
|
|
|
|
|
ServiceAccount: c.String("serviceAccount"),
|
|
|
|
})
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|