https://pulumi.com logo
#kubernetes
Title
# kubernetes
f

fresh-hospital-81544

05/25/2021, 4:56 AM
hi. in here https://www.pulumi.com/docs/guides/adopting/from_kubernetes/ it shows
Copy code
import * as k8s from "@pulumi/kubernetes";

// Deploy the latest version of the stable/wordpress chart.
const wordpress = new k8s.helm.v3.Chart("wpdev", {
    repo: "stable",
    chart: "wordpress",
    version: "9.0.3",
});

// Export the public IP for WordPress.
const frontend = wordpress.getResource("v1/Service", "wpdev-wordpress");
export const frontendIp = frontend.status.loadBalancer.ingress[0].ip;
Is there a way to get this code to run as is or must it be modified with apply like so
Copy code
import * as k8s from "@pulumi/kubernetes";

// Deploy the latest version of the stable/wordpress chart.
const wordpress = new k8s.helm.v3.Chart("wpdev", {
    repo: "stable",
    chart: "wordpress",
    version: "9.0.3",
});

// Export the public IP for WordPress.
const frontend = wordpress.apply(wordpress => wordpress.getResource("v1/Service", "wpdev-wordpress"));
export const frontendIp = frontend.apply(frontend=>frontend.status.loadBalancer.ingress[0].ip);
Thanks
3 Views