Make possible to declare cronTabs inside docker-compose file. ⇒ Also, add multiple compose file injection with `-c` arguments ⇒ Also, fixes “ignore depends on” for same pod ⇒ Also fixes * fix [Be able to specify compose.yml files and its override #21](https://github.com/metal3d/katenary/issues/21) * fix [Be able to ignore ports to expose in a katenary.io/ports list #16](https://github.com/metal3d/katenary/issues/16) And more fixes… (later, we will use branches in a better way, that was a hard, long fix process)
48 lines
1.2 KiB
Go
48 lines
1.2 KiB
Go
package helm
|
|
|
|
// Deployment is a k8s deployment.
|
|
type Deployment struct {
|
|
*K8sBase `yaml:",inline"`
|
|
Spec *DepSpec `yaml:"spec"`
|
|
}
|
|
|
|
func NewDeployment(name string) *Deployment {
|
|
d := &Deployment{K8sBase: NewBase(), Spec: NewDepSpec()}
|
|
d.K8sBase.Metadata.Name = ReleaseNameTpl + "-" + name
|
|
d.K8sBase.ApiVersion = "apps/v1"
|
|
d.K8sBase.Kind = "Deployment"
|
|
d.K8sBase.Metadata.Labels[K+"/component"] = name
|
|
d.K8sBase.Metadata.Labels[K+"/resource"] = "deployment"
|
|
return d
|
|
}
|
|
|
|
type DepSpec struct {
|
|
Replicas int `yaml:"replicas"`
|
|
Selector map[string]interface{} `yaml:"selector"`
|
|
Template PodTemplate `yaml:"template"`
|
|
}
|
|
|
|
func NewDepSpec() *DepSpec {
|
|
return &DepSpec{
|
|
Replicas: 1,
|
|
Template: PodTemplate{
|
|
Metadata: Metadata{
|
|
Labels: map[string]string{
|
|
K + "/resource": "deployment",
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
type PodSpec struct {
|
|
InitContainers []*Container `yaml:"initContainers,omitempty"`
|
|
Containers []*Container `yaml:"containers"`
|
|
Volumes []map[string]interface{} `yaml:"volumes,omitempty"`
|
|
}
|
|
|
|
type PodTemplate struct {
|
|
Metadata Metadata `yaml:"metadata"`
|
|
Spec PodSpec `yaml:"spec"`
|
|
}
|