|
|
@ -29,22 +29,23 @@ var (
|
|
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
ServiceAccount string
|
|
|
|
|
|
|
|
ImagePullPolicy string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// DeploymentCommand is used to generate the kubernetes deployment yaml files.
|
|
|
|
// DeploymentCommand is used to generate the kubernetes deployment yaml files.
|
|
|
@ -82,22 +83,23 @@ func deploymentCommand(_ *cobra.Command, _ []string) 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: varStringName,
|
|
|
|
Name: varStringName,
|
|
|
|
Namespace: varStringNamespace,
|
|
|
|
Namespace: varStringNamespace,
|
|
|
|
Image: varStringImage,
|
|
|
|
Image: varStringImage,
|
|
|
|
Secret: varStringSecret,
|
|
|
|
Secret: varStringSecret,
|
|
|
|
Replicas: varIntReplicas,
|
|
|
|
Replicas: varIntReplicas,
|
|
|
|
Revisions: varIntRevisions,
|
|
|
|
Revisions: varIntRevisions,
|
|
|
|
Port: varIntPort,
|
|
|
|
Port: varIntPort,
|
|
|
|
NodePort: nodePort,
|
|
|
|
NodePort: nodePort,
|
|
|
|
UseNodePort: nodePort > 0,
|
|
|
|
UseNodePort: nodePort > 0,
|
|
|
|
RequestCpu: varIntRequestCpu,
|
|
|
|
RequestCpu: varIntRequestCpu,
|
|
|
|
RequestMem: varIntRequestMem,
|
|
|
|
RequestMem: varIntRequestMem,
|
|
|
|
LimitCpu: varIntLimitCpu,
|
|
|
|
LimitCpu: varIntLimitCpu,
|
|
|
|
LimitMem: varIntLimitMem,
|
|
|
|
LimitMem: varIntLimitMem,
|
|
|
|
MinReplicas: varIntMinReplicas,
|
|
|
|
MinReplicas: varIntMinReplicas,
|
|
|
|
MaxReplicas: varIntMaxReplicas,
|
|
|
|
MaxReplicas: varIntMaxReplicas,
|
|
|
|
ServiceAccount: varStringServiceAccount,
|
|
|
|
ServiceAccount: varStringServiceAccount,
|
|
|
|
|
|
|
|
ImagePullPolicy: varStringImagePullPolicy,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|