Files
katenary/helm/ingress.go
Patrice Ferlet 8ccdb2854b Remove annotation for ingres.class
This yield an error on new Kubernetes
TODO: check k8s version like does "helm create"?
2021-12-17 10:28:16 +01:00

52 lines
957 B
Go

package helm
type Ingress struct {
*K8sBase `yaml:",inline"`
Spec IngressSpec
}
func NewIngress(name string) *Ingress {
i := &Ingress{}
i.K8sBase = NewBase()
i.K8sBase.Metadata.Name = RELEASE_NAME + "-" + name
i.K8sBase.Kind = "Ingress"
i.ApiVersion = "networking.k8s.io/v1"
i.K8sBase.Metadata.Labels[K+"/component"] = name
return i
}
func (i *Ingress) SetIngressClass(name string) {
class := "{{ .Values." + name + ".ingress.class }}"
i.Spec.IngressClassName = class
}
type IngressSpec struct {
IngressClassName string `yaml:"ingressClassName,omitempty"`
Rules []IngressRule
}
type IngressRule struct {
Host string
Http IngressHttp
}
type IngressHttp struct {
Paths []IngressPath
}
type IngressPath struct {
Path string
PathType string `yaml:"pathType"`
Backend IngressBackend
}
type IngressBackend struct {
Service IngressService
}
type IngressService struct {
Name string
Port map[string]interface{}
}