fierce-pager-95248
06/28/2019, 11:07 PMimport * as k8s from '@pulumi/kubernetes';
import * as k8sInput from '@pulumi/kubernetes/types/input';
import * as pulumi from '@pulumi/pulumi';
export class EnvoyDeployment extends k8s.apps.v1.Deployment {
constructor(name: string,
args: k8stypes.apps.v1.Deployment,
opts?: pulumi.CustomResourceOptions) {
const pod = args.spec.template.spec;
// Add an Envoy sidecar container.
pod.containers = pod.containers || [];
pod.containers.push({
name: "envoy",
image: "lyft/envoy:latest",
command: ["/usr/local/bin/envoy"],
args: [
"--concurrency 4",
"--config-path /etc/envoy/envoy.json",
"--mode serve"
],
ports: [{ containerPort: 80, protocol: "TCP" }],
resources: {
limits: { cpu: "1000m", memory: "512Mi" },
requests: { cpu: "100m", memory: "64Mi" }
},
volumeMounts: [{ name: "envoy-conf", mountPath: "/etc/envoy" }]
});
// Add an associated Volume for Envoy's config, mounted as a ConfigMap.
pod.volumes = pod.volumes || [];
pod.volumes.push({
name: "envoy-conf", configMap: { name: "envoy" },
});
super(name, args, opts);
}
}
but the compiler is giving my fits
Property 'template' does not exist on type 'Input<DeploymentSpec>'.
Property 'template' does not exist on type 'Promise<DeploymentSpec>'.
on const pod = args.spec.template.spec;
Is this no longer a valid example? Could anyone help point out what I'm missing here?