Skip to content

Instantly share code, notes, and snippets.

@anguslees
Created June 26, 2017 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anguslees/3f5c2e548ae8734d0053ee100df1e225 to your computer and use it in GitHub Desktop.
Save anguslees/3f5c2e548ae8734d0053ee100df1e225 to your computer and use it in GitHub Desktop.
basic echoheaders test serviice
local kube = import "kube.libsonnet";
local all = {
namespace:: "gus",
echo_ing: kube.Ingress("echoheaders") {
metadata+: { namespace: $.namespace },
spec+: {
backend: $.echo_svc.name_port,
},
},
echo_svc: kube.Service("echoheaders") {
metadata+: {
namespace: $.namespace,
},
target_pod: $.echo.spec.template,
},
echo: kube.Deployment("echoheaders") {
metadata+: { namespace: $.namespace },
spec+: {
template+: {
spec+: {
containers_+: {
echoheaders: kube.Container("echoheaders") {
image: "gcr.io/google_containers/echoserver:1.4",
ports_+: {
http: { hostPort: 5636, containerPort: 8081 },
},
readinessProbe: {
httpGet: { path: "/", port: "http" },
},
livenessProbe: self.readinessProbe,
},
},
},
},
},
},
};
kube.List() { items_+: all }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment