coreos / kpm

KPM is a tool to deploy and manage application stacks on Kubernetes.
Apache License 2.0
124 stars 29 forks source link

Generators, create resources without templates #153

Open ant31 opened 7 years ago

ant31 commented 7 years ago

Most of the time resources are identical, only few fields are modified. Kpm can help to generate them without having to add any template in the package it self.

app_ports:: [8080, 6000]
resources: [ 
 {
    file: my-webapp-svc.yaml 
    type: svc 
    generator: {
        ports: $.app_ports
        type: nodePort
     }
  },
 { 
    file: my-webapp-deploy.yaml
    type: deployment
    generator: { 
       pod: [ 
            {image: container1, ports: $.app_ports},
            {image: sidecar1}
            ]
 },
 {
  file : my-webapp-ingress.yaml
  type: ingress, 
  generator: 
    { domains: [app.kubespray.com]
      paths: {path: "/", port: 8080}
}
]
ant31 commented 7 years ago

https://github.com/heptio/kube.libsonnet/