Files
katenary/doc/docs/packages/internal/generator.md
2026-05-03 21:21:38 +02:00

1082 lines
25 KiB
Markdown

<!-- Code generated by gomarkdoc. DO NOT EDIT -->
# generator
```go
import "katenary.io/internal/generator"
```
Package generator generates kubernetes objects from a "compose" file and transforms them into a helm chart.
The generator package is the core of katenary. It is responsible for generating kubernetes objects from a compose file and transforming them into a helm chart. Conversion manipulates Yaml representation of kubernetes object to add conditions, labels, annotations, etc. to the objects. It also create the values to be set to the values.yaml file.
The generate.Convert\(\) create an HelmChart object and call "Generate\(\)" method to convert from a compose file to a helm chart. It saves the helm chart in the given directory.
If you want to change or override the write behavior, you can use the HelmChart.Generate\(\) function and implement your own write function. This function returns the helm chart object containing all kubernetes objects and helm chart ingormation. It does not write the helm chart to the disk.
## Variables
<a name="Annotations"></a>
```go
var (
// Standard annotationss
Annotations = map[string]string{
labels.LabelName("version"): Version,
}
)
```
<a name="Version"></a>Version is the version of katenary. It is set at compile time.
```go
var Version = "master" // changed at compile time
```
<a name="Convert"></a>
## func Convert
```go
func Convert(config ConvertOptions, dockerComposeFile ...string) error
```
Convert a compose \(docker, podman...\) project to a helm chart. It calls Generate\(\) to generate the chart and then write it to the disk.
<a name="GetLabels"></a>
## func GetLabels
```go
func GetLabels(serviceName, appName string) map[string]string
```
GetLabels returns the labels for a service. It uses the appName to replace the \_\_replace\_\_ in the labels. This is used to generate the labels in the templates.
<a name="GetMatchLabels"></a>
## func GetMatchLabels
```go
func GetMatchLabels(serviceName, appName string) map[string]string
```
GetMatchLabels returns the matchLabels for a service. It uses the appName to replace the \_\_replace\_\_ in the labels. This is used to generate the matchLabels in the templates.
<a name="GetVersion"></a>
## func GetVersion
```go
func GetVersion() string
```
GetVersion return the version of katneary. It's important to understand that the version is set at compile time for the github release. But, it the user get katneary using \`go install\`, the version should be different.
<a name="Helper"></a>
## func Helper
```go
func Helper(name string) string
```
Helper returns the \_helpers.tpl file for a chart.
<a name="NewCronJob"></a>
## func NewCronJob
```go
func NewCronJob(service types.ServiceConfig, chart *HelmChart, appName string) (*CronJob, *RBAC)
```
NewCronJob creates a new CronJob from a compose service. The appName is the name of the application taken from the project name.
<a name="ToK8SYaml"></a>
## func ToK8SYaml
```go
func ToK8SYaml(obj any) ([]byte, error)
```
<a name="UnWrapTPL"></a>
## func UnWrapTPL
```go
func UnWrapTPL(in []byte) []byte
```
UnWrapTPL removes the line wrapping from a template.
<a name="ChartTemplate"></a>
## type ChartTemplate
ChartTemplate is a template of a chart. It contains the content of the template and the name of the service. This is used internally to generate the templates.
```go
type ChartTemplate struct {
Servicename string
Content []byte
}
```
<a name="ConfigMap"></a>
## type ConfigMap
ConfigMap is a kubernetes ConfigMap. Implements the DataMap interface.
```go
type ConfigMap struct {
*corev1.ConfigMap
// contains filtered or unexported fields
}
```
<a name="NewConfigMap"></a>
### func NewConfigMap
```go
func NewConfigMap(service types.ServiceConfig, appName string, forFile bool) *ConfigMap
```
NewConfigMap creates a new ConfigMap from a compose service. The appName is the name of the application taken from the project name. The ConfigMap is filled by environment variables and labels "map\-env".
<a name="NewConfigMapFromDirectory"></a>
### func NewConfigMapFromDirectory
```go
func NewConfigMapFromDirectory(service types.ServiceConfig, appName, path string) *ConfigMap
```
NewConfigMapFromDirectory creates a new ConfigMap from a compose service. This path is the path to the file or directory. If the path is a directory, all files in the directory are added to the ConfigMap. Each subdirectory are ignored. Note that the Generate\(\) function will create the subdirectories ConfigMaps.
<a name="ConfigMap.AddBinaryData"></a>
### func \(\*ConfigMap\) AddBinaryData
```go
func (c *ConfigMap) AddBinaryData(key string, value []byte)
```
AddBinaryData adds binary data to the configmap. Append or overwrite the value if the key already exists.
<a name="ConfigMap.AddData"></a>
### func \(\*ConfigMap\) AddData
```go
func (c *ConfigMap) AddData(key, value string)
```
AddData adds a key value pair to the configmap. Append or overwrite the value if the key already exists.
<a name="ConfigMap.AppendDir"></a>
### func \(\*ConfigMap\) AppendDir
```go
func (c *ConfigMap) AppendDir(path string) error
```
AppendDir adds files from given path to the configmap. It is not recursive, to add all files in a directory, you need to call this function for each subdirectory.
<a name="ConfigMap.AppendFile"></a>
### func \(\*ConfigMap\) AppendFile
```go
func (c *ConfigMap) AppendFile(path string) error
```
<a name="ConfigMap.Filename"></a>
### func \(\*ConfigMap\) Filename
```go
func (c *ConfigMap) Filename() string
```
Filename returns the filename of the configmap. If the configmap is used for files, the filename contains the path.
<a name="ConfigMap.SetData"></a>
### func \(\*ConfigMap\) SetData
```go
func (c *ConfigMap) SetData(data map[string]string)
```
SetData sets the data of the configmap. It replaces the entire data.
<a name="ConfigMap.Yaml"></a>
### func \(\*ConfigMap\) Yaml
```go
func (c *ConfigMap) Yaml() ([]byte, error)
```
Yaml returns the yaml representation of the configmap
<a name="ConfigMapMount"></a>
## type ConfigMapMount
```go
type ConfigMapMount struct {
// contains filtered or unexported fields
}
```
<a name="ConvertOptions"></a>
## type ConvertOptions
ConvertOptions are the options to convert a compose project to a helm chart.
```go
type ConvertOptions struct {
AppVersion *string
OutputDir string
ChartVersion string
Icon string
Profiles []string
EnvFiles []string
Force bool
HelmUpdate bool
}
```
<a name="CronJob"></a>
## type CronJob
CronJob is a kubernetes CronJob.
```go
type CronJob struct {
*batchv1.CronJob
// contains filtered or unexported fields
}
```
<a name="CronJob.Filename"></a>
### func \(\*CronJob\) Filename
```go
func (c *CronJob) Filename() string
```
Filename returns the filename of the cronjob.
Implements the Yaml interface.
<a name="CronJob.Yaml"></a>
### func \(\*CronJob\) Yaml
```go
func (c *CronJob) Yaml() ([]byte, error)
```
Yaml returns the yaml representation of the cronjob.
Implements the Yaml interface.
<a name="CronJobValue"></a>
## type CronJobValue
CronJobValue is a cronjob configuration that will be saved in values.yaml.
```go
type CronJobValue struct {
Repository *RepositoryValue `yaml:"repository,omitempty"`
Environment map[string]any `yaml:"environment,omitempty"`
ImagePullPolicy string `yaml:"imagePullPolicy,omitempty"`
Schedule string `yaml:"schedule"`
}
```
<a name="DataMap"></a>
## type DataMap
DataMap is a kubernetes ConfigMap or Secret. It can be used to add data to the ConfigMap or Secret.
```go
type DataMap interface {
SetData(map[string]string)
AddData(string, string)
}
```
<a name="Deployment"></a>
## type Deployment
Deployment is a kubernetes Deployment.
```go
type Deployment struct {
*appsv1.Deployment `yaml:",inline"`
// contains filtered or unexported fields
}
```
<a name="NewDeployment"></a>
### func NewDeployment
```go
func NewDeployment(service types.ServiceConfig, chart *HelmChart) *Deployment
```
NewDeployment creates a new Deployment from a compose service. The appName is the name of the application taken from the project name. It also creates the Values map that will be used to create the values.yaml file.
<a name="Deployment.AddContainer"></a>
### func \(\*Deployment\) AddContainer
```go
func (d *Deployment) AddContainer(service types.ServiceConfig)
```
AddContainer adds a container to the deployment.
<a name="Deployment.AddHealthCheck"></a>
### func \(\*Deployment\) AddHealthCheck
```go
func (d *Deployment) AddHealthCheck(service types.ServiceConfig, container *corev1.Container)
```
<a name="Deployment.AddIngress"></a>
### func \(\*Deployment\) AddIngress
```go
func (d *Deployment) AddIngress(service types.ServiceConfig, appName string) *Ingress
```
AddIngress adds an ingress to the deployment. It creates the ingress object.
<a name="Deployment.AddIngressRoute"></a>
### func \(\*Deployment\) AddIngressRoute
```go
func (d *Deployment) AddIngressRoute(service types.ServiceConfig, appName string) Yaml
```
AddIngressRoute adds an IngressRoute to the deployment if type is "ingressroute".
<a name="Deployment.AddLegacyVolume"></a>
### func \(\*Deployment\) AddLegacyVolume
```go
func (d *Deployment) AddLegacyVolume(name, kind string)
```
<a name="Deployment.AddVolumes"></a>
### func \(\*Deployment\) AddVolumes
```go
func (d *Deployment) AddVolumes(service types.ServiceConfig, appName string)
```
AddVolumes adds a volume to the deployment. It does not create the PVC, it only adds the volumes to the deployment. If the volume is a bind volume it will warn the user that it is not supported yet.
<a name="Deployment.BindFrom"></a>
### func \(\*Deployment\) BindFrom
```go
func (d *Deployment) BindFrom(service types.ServiceConfig, binded *Deployment)
```
<a name="Deployment.BindMapFilesToContainer"></a>
### func \(\*Deployment\) BindMapFilesToContainer
```go
func (d *Deployment) BindMapFilesToContainer(service types.ServiceConfig, secrets []string, appName string) (*corev1.Container, int)
```
<a name="Deployment.DependsOn"></a>
### func \(\*Deployment\) DependsOn
```go
func (d *Deployment) DependsOn(to *Deployment, servicename string) error
```
DependsOn adds a initContainer to the deployment that will wait for the service to be up.
<a name="Deployment.Filename"></a>
### func \(\*Deployment\) Filename
```go
func (d *Deployment) Filename() string
```
Filename returns the filename of the deployment.
<a name="Deployment.MountExchangeVolumes"></a>
### func \(\*Deployment\) MountExchangeVolumes
```go
func (d *Deployment) MountExchangeVolumes()
```
<a name="Deployment.SetEnvFrom"></a>
### func \(\*Deployment\) SetEnvFrom
```go
func (d *Deployment) SetEnvFrom(service types.ServiceConfig, appName string, samePod ...bool)
```
SetEnvFrom sets the environment variables to a configmap. The configmap is created.
<a name="Deployment.SetServiceAccountName"></a>
### func \(\*Deployment\) SetServiceAccountName
```go
func (d *Deployment) SetServiceAccountName()
```
<a name="Deployment.Yaml"></a>
### func \(\*Deployment\) Yaml
```go
func (d *Deployment) Yaml() ([]byte, error)
```
Yaml returns the yaml representation of the deployment.
<a name="FileMapUsage"></a>
## type FileMapUsage
FileMapUsage is the usage of the filemap.
```go
type FileMapUsage uint8
```
<a name="FileMapUsageConfigMap"></a>FileMapUsage constants.
```go
const (
FileMapUsageConfigMap FileMapUsage = iota // pure configmap for key:values.
FileMapUsageFiles // files in a configmap.
)
```
<a name="HelmChart"></a>
## type HelmChart
HelmChart is a Helm Chart representation. It contains all the templates, values, versions, helpers...
```go
type HelmChart struct {
Templates map[string]*ChartTemplate `yaml:"-"`
Values map[string]any `yaml:"-"`
VolumeMounts map[string]any `yaml:"-"`
Name string `yaml:"name"`
Icon string `yaml:"icon,omitempty"`
APIVersion string `yaml:"apiVersion"`
Version string `yaml:"version"`
AppVersion string `yaml:"appVersion"`
Description string `yaml:"description"`
Helper string `yaml:"-"`
Dependencies []labelstructs.Dependency `yaml:"dependencies,omitempty"`
// contains filtered or unexported fields
}
```
<a name="Generate"></a>
### func Generate
```go
func Generate(project *types.Project) (*HelmChart, error)
```
Generate a chart from a compose project. This does not write files to disk, it only creates the HelmChart object.
The Generate function will create the HelmChart object this way:
- Detect the service port name or leave the port number if not found.
- Create a deployment for each service that are not ingore.
- Create a service and ingresses for each service that has ports and/or declared ingresses.
- Create a PVC or Configmap volumes for each volume.
- Create init containers for each service which has dependencies to other services.
- Create a chart dependencies.
- Create a configmap and secrets from the environment variables.
- Merge the same\-pod services.
<a name="NewChart"></a>
### func NewChart
```go
func NewChart(name string) *HelmChart
```
NewChart creates a new empty chart with the given name.
<a name="HelmChart.SaveTemplates"></a>
### func \(\*HelmChart\) SaveTemplates
```go
func (chart *HelmChart) SaveTemplates(templateDir string)
```
SaveTemplates the templates of the chart to the given directory.
<a name="Ingress"></a>
## type Ingress
```go
type Ingress struct {
*networkv1.Ingress
// contains filtered or unexported fields
}
```
<a name="NewIngress"></a>
### func NewIngress
```go
func NewIngress(service types.ServiceConfig, Chart *HelmChart) *Ingress
```
NewIngress creates a new standard Kubernetes Ingress from a compose service.
<a name="Ingress.Filename"></a>
### func \(\*Ingress\) Filename
```go
func (ingress *Ingress) Filename() string
```
<a name="Ingress.Yaml"></a>
### func \(\*Ingress\) Yaml
```go
func (ingress *Ingress) Yaml() ([]byte, error)
```
<a name="IngressRoute"></a>
## type IngressRoute
IngressRoute represents a Traefik IngressRoute CRD
```go
type IngressRoute struct {
metav1.TypeMeta `yaml:",inline"`
metav1.ObjectMeta `yaml:"metadata"`
Spec IngressRouteSpec `yaml:"spec"`
// contains filtered or unexported fields
}
```
<a name="NewIngressRoute"></a>
### func NewIngressRoute
```go
func NewIngressRoute(service types.ServiceConfig, Chart *HelmChart, mapping *labelstructs.Ingress, serviceName, appName string) *IngressRoute
```
NewIngressRoute creates a new Traefik IngressRoute from a compose service.
<a name="IngressRoute.Filename"></a>
### func \(\*IngressRoute\) Filename
```go
func (ir *IngressRoute) Filename() string
```
<a name="IngressRoute.Yaml"></a>
### func \(\*IngressRoute\) Yaml
```go
func (ir *IngressRoute) Yaml() ([]byte, error)
```
<a name="IngressRouteRoute"></a>
## type IngressRouteRoute
IngressRouteRoute defines a route in the IngressRoute
```go
type IngressRouteRoute struct {
Match string `json:"match" yaml:"match"`
Kind string `json:"kind" yaml:"kind"`
Services []IngressRouteService `json:"services" yaml:"services"`
}
```
<a name="IngressRouteService"></a>
## type IngressRouteService
IngressRouteService defines a service backend in IngressRoute
```go
type IngressRouteService struct {
Name string `json:"name" yaml:"name"`
Port int `json:"port" yaml:"port"`
}
```
<a name="IngressRouteSpec"></a>
## type IngressRouteSpec
IngressRouteSpec defines the spec for Traefik IngressRoute
```go
type IngressRouteSpec struct {
EntryPoints []string `json:"entryPoints,omitempty" yaml:"entryPoints,omitempty"`
Routes []IngressRouteRoute `json:"routes" yaml:"routes"`
TLS *IngressRouteTLS `json:"tls,omitempty" yaml:"tls,omitempty"`
}
```
<a name="IngressRouteTLS"></a>
## type IngressRouteTLS
IngressRouteTLS defines TLS configuration for IngressRoute
```go
type IngressRouteTLS struct {
SecretName string `json:"secretName,omitempty" yaml:"secretName,omitempty"`
Domains []IngressRouteTLSDomain `json:"domains,omitempty" yaml:"domains,omitempty"`
}
```
<a name="IngressRouteTLSDomain"></a>
## type IngressRouteTLSDomain
IngressRouteTLSDomain defines a domain for TLS
```go
type IngressRouteTLSDomain struct {
Main string `json:"main" yaml:"main"`
}
```
<a name="IngressValue"></a>
## type IngressValue
IngressValue is a ingress configuration that will be saved in values.yaml.
```go
type IngressValue struct {
Annotations map[string]string `yaml:"annotations"`
Host string `yaml:"host"`
Path string `yaml:"path"`
Class string `yaml:"class"`
Type string `yaml:"type"`
Enabled bool `yaml:"enabled"`
IngressRouteEnabled bool `yaml:"ingressRouteEnabled"`
TLS TLS `yaml:"tls"`
}
```
<a name="PersistenceValue"></a>
## type PersistenceValue
PersistenceValue is a persistence configuration that will be saved in values.yaml.
```go
type PersistenceValue struct {
StorageClass string `yaml:"storageClass"`
Size string `yaml:"size"`
AccessMode []string `yaml:"accessMode"`
Enabled bool `yaml:"enabled"`
}
```
<a name="RBAC"></a>
## type RBAC
RBAC is a kubernetes RBAC containing a role, a rolebinding and an associated serviceaccount.
```go
type RBAC struct {
RoleBinding *RoleBinding
Role *Role
ServiceAccount *ServiceAccount
}
```
<a name="NewRBAC"></a>
### func NewRBAC
```go
func NewRBAC(service types.ServiceConfig, appName string) *RBAC
```
NewRBAC creates a new RBAC from a compose service. The appName is the name of the application taken from the project name.
<a name="RepositoryValue"></a>
## type RepositoryValue
RepositoryValue is a docker repository image and tag that will be saved in values.yaml.
```go
type RepositoryValue struct {
Image string `yaml:"image"`
Tag string `yaml:"tag"`
}
```
<a name="Role"></a>
## type Role
Role is a kubernetes Role.
```go
type Role struct {
*rbacv1.Role
// contains filtered or unexported fields
}
```
<a name="NewRestrictedRole"></a>
### func NewRestrictedRole
```go
func NewRestrictedRole(service types.ServiceConfig, appName string) *Role
```
NewRestrictedRole creates a Role with minimal permissions for init containers.
<a name="Role.Filename"></a>
### func \(\*Role\) Filename
```go
func (r *Role) Filename() string
```
<a name="Role.Yaml"></a>
### func \(\*Role\) Yaml
```go
func (r *Role) Yaml() ([]byte, error)
```
<a name="RoleBinding"></a>
## type RoleBinding
RoleBinding is a kubernetes RoleBinding.
```go
type RoleBinding struct {
*rbacv1.RoleBinding
// contains filtered or unexported fields
}
```
<a name="NewRestrictedRoleBinding"></a>
### func NewRestrictedRoleBinding
```go
func NewRestrictedRoleBinding(service types.ServiceConfig, appName string) *RoleBinding
```
NewRestrictedRoleBinding creates a RoleBinding that binds the restricted role to the ServiceAccount.
<a name="RoleBinding.Filename"></a>
### func \(\*RoleBinding\) Filename
```go
func (r *RoleBinding) Filename() string
```
<a name="RoleBinding.Yaml"></a>
### func \(\*RoleBinding\) Yaml
```go
func (r *RoleBinding) Yaml() ([]byte, error)
```
<a name="Secret"></a>
## type Secret
Secret is a kubernetes Secret.
Implements the DataMap interface.
```go
type Secret struct {
*corev1.Secret
// contains filtered or unexported fields
}
```
<a name="NewSecret"></a>
### func NewSecret
```go
func NewSecret(service types.ServiceConfig, appName string) *Secret
```
NewSecret creates a new Secret from a compose service
<a name="Secret.AddData"></a>
### func \(\*Secret\) AddData
```go
func (s *Secret) AddData(key, value string)
```
AddData adds a key value pair to the secret.
<a name="Secret.Filename"></a>
### func \(\*Secret\) Filename
```go
func (s *Secret) Filename() string
```
Filename returns the filename of the secret.
<a name="Secret.SetData"></a>
### func \(\*Secret\) SetData
```go
func (s *Secret) SetData(data map[string]string)
```
SetData sets the data of the secret.
<a name="Secret.Yaml"></a>
### func \(\*Secret\) Yaml
```go
func (s *Secret) Yaml() ([]byte, error)
```
Yaml returns the yaml representation of the secret.
<a name="Service"></a>
## type Service
Service is a kubernetes Service.
```go
type Service struct {
*v1.Service `yaml:",inline"`
// contains filtered or unexported fields
}
```
<a name="NewService"></a>
### func NewService
```go
func NewService(service types.ServiceConfig, appName string) *Service
```
NewService creates a new Service from a compose service.
<a name="Service.AddPort"></a>
### func \(\*Service\) AddPort
```go
func (s *Service) AddPort(port types.ServicePortConfig, serviceName ...string)
```
AddPort adds a port to the service.
<a name="Service.Filename"></a>
### func \(\*Service\) Filename
```go
func (s *Service) Filename() string
```
Filename returns the filename of the service.
<a name="Service.Yaml"></a>
### func \(\*Service\) Yaml
```go
func (s *Service) Yaml() ([]byte, error)
```
Yaml returns the yaml representation of the service.
<a name="ServiceAccount"></a>
## type ServiceAccount
ServiceAccount is a kubernetes ServiceAccount.
```go
type ServiceAccount struct {
*corev1.ServiceAccount
// contains filtered or unexported fields
}
```
<a name="NewServiceAccount"></a>
### func NewServiceAccount
```go
func NewServiceAccount(service types.ServiceConfig, appName string) *ServiceAccount
```
NewServiceAccount creates a new ServiceAccount from a compose service.
<a name="ServiceAccount.Filename"></a>
### func \(\*ServiceAccount\) Filename
```go
func (r *ServiceAccount) Filename() string
```
<a name="ServiceAccount.Yaml"></a>
### func \(\*ServiceAccount\) Yaml
```go
func (r *ServiceAccount) Yaml() ([]byte, error)
```
<a name="TLS"></a>
## type TLS
```go
type TLS struct {
Enabled bool `yaml:"enabled"`
SecretName string `yaml:"secretName"`
}
```
<a name="Value"></a>
## type Value
Value will be saved in values.yaml. It contains configuration for all deployment and services.
```go
type Value struct {
Repository *RepositoryValue `yaml:"repository,omitempty"`
Persistence map[string]*PersistenceValue `yaml:"persistence,omitempty"`
Ingress *IngressValue `yaml:"ingress,omitempty"`
Environment map[string]any `yaml:"environment,omitempty"`
Replicas *uint32 `yaml:"replicas,omitempty"`
CronJob *CronJobValue `yaml:"cronjob,omitempty"`
NodeSelector map[string]string `yaml:"nodeSelector"`
Resources map[string]any `yaml:"resources"`
ImagePullPolicy string `yaml:"imagePullPolicy,omitempty"`
ServiceAccount string `yaml:"serviceAccount"`
}
```
<a name="NewValue"></a>
### func NewValue
```go
func NewValue(service types.ServiceConfig, main ...bool) *Value
```
NewValue creates a new Value from a compose service. The value contains the necessary information to deploy the service \(image, tag, replicas, etc.\).
If \`main\` is true, the tag will be empty because it will be set in the helm chart appVersion.
<a name="Value.AddIngress"></a>
### func \(\*Value\) AddIngress
```go
func (v *Value) AddIngress(host, path string)
```
<a name="Value.AddPersistence"></a>
### func \(\*Value\) AddPersistence
```go
func (v *Value) AddPersistence(volumeName string)
```
AddPersistence adds persistence configuration to the Value.
<a name="VolumeClaim"></a>
## type VolumeClaim
VolumeClaim is a kubernetes VolumeClaim. This is a PersistentVolumeClaim.
```go
type VolumeClaim struct {
*v1.PersistentVolumeClaim
// contains filtered or unexported fields
}
```
<a name="NewVolumeClaim"></a>
### func NewVolumeClaim
```go
func NewVolumeClaim(service types.ServiceConfig, volumeName, appName string) *VolumeClaim
```
NewVolumeClaim creates a new VolumeClaim from a compose service.
<a name="VolumeClaim.Filename"></a>
### func \(\*VolumeClaim\) Filename
```go
func (v *VolumeClaim) Filename() string
```
Filename returns the suggested filename for a VolumeClaim.
<a name="VolumeClaim.Yaml"></a>
### func \(\*VolumeClaim\) Yaml
```go
func (v *VolumeClaim) Yaml() ([]byte, error)
```
Yaml marshals a VolumeClaim into yaml.
<a name="Yaml"></a>
## type Yaml
Yaml is a kubernetes object that can be converted to yaml.
```go
type Yaml interface {
Yaml() ([]byte, error)
Filename() string
}
```
<a name="NewIngressRouteFromService"></a>
### func NewIngressRouteFromService
```go
func NewIngressRouteFromService(service types.ServiceConfig, Chart *HelmChart) Yaml
```
NewIngressRouteFromService creates a Traefik IngressRoute from the same service config. This is called separately to generate the IngressRoute file in addition to Ingress.
Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)