able-bird-91336
04/23/2022, 6:54 AMOutput<string>
from a n00b. :)
I have tried reading the q/a given in this Slack, the doc and other blogs but still can't really wrap my head around it. I don't get how to apply (pun) this to my situation.
The solution I have today works, but feels wrong. Could somebody give some pointers on how to do this "for real"?
The problem:
I'm creating a Kubernetes Service "LoadBalancer" and need to get hold of the created IP-adr.
I then need to use this IP-adr when creating a ConfigMap using it as data to create a file of it used by a Deployment.
(please see code below for what I'm trying to do)
The code (simplified, a lot more going on but it is the gist of it):
// TypeScript & Azure
myService.status.loadBalancer.ingress[0].ip.apply(hostname => {
const yamlConfigGroup = new kubernetes.yaml.ConfigGroup(
"deploymentconfigmap-yml",
{
yaml: `
apiVersion: v1
kind: ConfigMap
metadata:
name: deployment-config
namespace: kube-system
labels:
k8s-app: theapp
data:
thedata.yml: |-
thesettings.monitors:
- type: mydata
hosts: ["${hostname}"]
`
}
);
});
This works but "feels" wrong because it doesn't show the creation in Preview.billowy-army-68599
04/23/2022, 7:07 AMable-bird-91336
04/23/2022, 7:18 AMbillowy-army-68599
04/23/2022, 7:18 AMable-bird-91336
04/23/2022, 7:20 AMbillowy-army-68599
04/23/2022, 7:24 AMable-bird-91336
04/23/2022, 7:37 AM