My overall goal is to use the IP address from my Helm deployed Postgresql service to create an A-Record in my *.
myParent.com DNS record.
Post deploy, I can see the IP in the Kubernetes Service as (yaml)
status:
loadBalancer:
ingress:
- ip: 1.2.3.4
My source code (that isn't working) is below. The goal is setting up the last line:
records: [frontendIp]
const postgresqlChart = new k8s.helm.v3.Chart(
'postgresql',
{
chart: 'postgresql',
version: '10.5.0',
namespace: namespace.metadata.name,
fetchOpts: { repo: '<https://charts.bitnami.com/bitnami/>' },
values: {
postgresqlPostgresPassword: rootPassword,
postgresqlDatabase: key,
postgresqlUsername: key,
postgresqlPassword: password,
service: {
type: 'LoadBalancer',
annotations: {
'<http://external-dns.alpha.kubernetes.io/hostname|external-dns.alpha.kubernetes.io/hostname>': desiredFQDN,
},
},
metrics: {
enabled: true,
},
},
},
{ provider: infra.provider },
)
// Export the IP
const frontend = postgresqlChart.getResource("v1/Service", "postgresql");
const frontendIp = frontend.status.loadBalancer.ingress[0].ip
const aRecord = new azure.dns.ARecord( desiredHostname,
name: desiredHostname,
zoneName: dnsRootDomain,
resourceGroupName: dnsRootResourceGroup,
ttl: 30,
records: [frontendIp],
})
I have verified that Pulumi can find the ip field. If I put a typo in the path, I get an error.