Feat cronjob (#23)
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)
This commit is contained in:
38
helm/role.go
Normal file
38
helm/role.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package helm
|
||||
|
||||
type Rule struct {
|
||||
ApiGroup []string `yaml:"apiGroups,omitempty"`
|
||||
Resources []string `yaml:"resources,omitempty"`
|
||||
Verbs []string `yaml:"verbs,omitempty"`
|
||||
}
|
||||
|
||||
type Role struct {
|
||||
*K8sBase `yaml:",inline"`
|
||||
Rules []Rule `yaml:"rules,omitempty"`
|
||||
}
|
||||
|
||||
func NewCronRole(name string) *Role {
|
||||
role := &Role{
|
||||
K8sBase: NewBase(),
|
||||
}
|
||||
|
||||
role.K8sBase.Metadata.Name = ReleaseNameTpl + "-" + name + "-cron-executor"
|
||||
role.K8sBase.Kind = "Role"
|
||||
role.K8sBase.ApiVersion = "rbac.authorization.k8s.io/v1"
|
||||
role.K8sBase.Metadata.Labels[K+"/component"] = name
|
||||
|
||||
role.Rules = []Rule{
|
||||
{
|
||||
ApiGroup: []string{""},
|
||||
Resources: []string{"pods", "pods/log"},
|
||||
Verbs: []string{"get", "list", "watch", "create", "update", "patch", "delete"},
|
||||
},
|
||||
{
|
||||
ApiGroup: []string{""},
|
||||
Resources: []string{"pods/exec"},
|
||||
Verbs: []string{"create"},
|
||||
},
|
||||
}
|
||||
|
||||
return role
|
||||
}
|
Reference in New Issue
Block a user