Open jkodroff opened 1 year ago
Chatting with @scottslowe, we think this feels like either a next-steps addition to the template pages or maybe an example that starts with a template and builds onto it. Thanks for bringing it up.
Something like this is sufficient:
const k8sProvider = new k8s.Provider("k8s-provider", {
kubeconfig: kubeconfig,
});
const nginxDeployment = new k8s.apps.v1.Deployment("nginx-deployment", {
metadata: {
name: "nginx-deployment",
labels: { app: "nginx" },
},
spec: {
replicas: 1,
selector: { matchLabels: { app: "nginx" } },
template: {
metadata: { labels: { app: "nginx" } },
spec: {
containers: [
{
name: "nginx",
image: "nginx:1.19.10",
ports: [{ containerPort: 80 }],
},
],
},
},
},
}, { provider: k8sProvider });
const nginxService = new k8s.core.v1.Service("nginx-service", {
metadata: { name: "nginx-service" },
spec: {
selector: { app: "nginx" },
type: "LoadBalancer",
ports: [{ port: 80, targetPort: 80 }],
},
}, { provider: k8sProvider });
export const nginxLoadBalancerAddress = nginxService.status.loadBalancer.ingress[0].ip; // or .hostname if supported by the cloud in question
If we wanted to go deluxe, we could show multiple ways of deploying the same workload:
With the devcontainer implemented, I recommend livestreaming this enhancement dev time.
Hello!
Issue details
Our K8s templates are great. I think we could make them better by deploying a workload on to the cluster after it's spun up. By doing this:
Affected area/feature