ancient-megabyte-79588
05/13/2020, 8:56 PMconst env = pulumi.getStack(); // reference to this stack
const stackId = `dave/aks/${env}`;
const aksStack = new pulumi.StackReference(stackId);
const k8sDnsName = aksStack.getOutput("k8sDnsName"); // <-- This is "identity-auth-dev"
// Deploy ingress-controller using helm to AKS Cluster
const options = {
chart: "nginx-ingress-controller",
namespace: "kube-system",
repo: "bitnami",
values: {
annotations: {
"<http://service.beta.kubernetes.io/azure-dns-label-name|service.beta.kubernetes.io/azure-dns-label-name>": "identity-auth-dev"
},
resources: { requests : {memory: "150Mi", cpu: "100m"}},
serviceType: "LoadBalancer",
nodeCount: 1,
}
};
const nginxIngress = new k8s.helm.v3.Chart("nginx", options, {provider: k8sProvider });
billowy-army-68599
05/13/2020, 9:01 PMancient-megabyte-79588
05/13/2020, 9:04 PMhelm install nginx-ingress bitnami/nginx-ingress-controller \
--namespace ingress \
--set controller.replicaCount=1 \
--set controller.service.annotations."service\.beta\.kubernetes\.io\/azure-dns-label-name"=identity-auth-dev \
billowy-army-68599
05/13/2020, 10:04 PMancient-megabyte-79588
05/13/2020, 11:06 PMrhythmic-finland-36256
05/16/2020, 12:18 PMancient-megabyte-79588
05/19/2020, 3:10 PMkind-mechanic-53546
05/24/2020, 12:07 PMancient-megabyte-79588
05/24/2020, 4:37 PMpulumi destroy
and pulumi up
today and I'll let you knw.kind-mechanic-53546
05/24/2020, 10:23 PMancient-megabyte-79588
05/25/2020, 4:20 PM// from the start of the app
const k8sDnsName = aksStack.getOutput("k8sDnsName");
const clusterResourceGroup = aksStack.getOutput("nodeResourceGroup");
// Deploy ingress-controller using helm to AKS Cluster
const nginxIngress = new k8s.helm.v3.Chart("nginx", {
chart: "nginx-ingress-controller",
namespace: "kube-system",
repo: "bitnami",
values: {
annotations: {
"<http://service.beta.kubernetes.io/azure-dns-label-name|service.beta.kubernetes.io/azure-dns-label-name>": k8sDnsName,
"<http://service.beta.kubernetes.io/azure-load-balancer-resource-group|service.beta.kubernetes.io/azure-load-balancer-resource-group>": clusterResourceGroup,
},
resources: { requests : {memory: "150Mi", cpu: "100m"}},
serviceType: "LoadBalancer",
nodeCount: 1,
}
}, {provider: k8sProvider });
# get the PublicIP object for our load balancer
$pip = az network public-ip list --query "[?tags.service=='kube-system/nginx-nginx-ingress-controller']" | ConvertFrom-Json
# update the --dns-name and refresh our object in PowerShell
$pip = az network public-ip update -n $pip.name -g $pip.resourceGroup --dns-name "identity-auth-dev" | ConvertFrom-Json
# set the clusterFQDN in Pulumi
pulumi config set clusterFQDN $pip.dnsSettings.fqdn
# verify that we can resolve our DNS entry
nslookup $pip.dnsSettings.fqdn
rhythmic-finland-36256
05/25/2020, 4:59 PMazure-load-balancer-resource-group
and the loadBalancerIP
as both are probably created from the same pulumi stack.ancient-megabyte-79588
05/25/2020, 5:03 PMrhythmic-finland-36256
05/25/2020, 5:04 PMancient-megabyte-79588
05/25/2020, 5:06 PMidentity-auth-dev
would turn into identity-auth-dev.westus.cloudapp.azure.com which I put in my DNS provider (GoDaddy) as a CNAME entry of <http://auth.codingwithdave.xyz|auth.codingwithdave.xyz>
pointing to identity-auth-dev.westus.cloudapps.azure.comrhythmic-finland-36256
05/25/2020, 5:07 PMancient-megabyte-79588
05/25/2020, 5:07 PMcontroller.service.LoadBalancerIP
at the start.rhythmic-finland-36256
05/25/2020, 5:08 PMancient-megabyte-79588
05/25/2020, 5:09 PMannotations: {
"<http://service.beta.kubernetes.io/azure-dns-label-name|service.beta.kubernetes.io/azure-dns-label-name>": k8sDnsName,
"<http://service.beta.kubernetes.io/azure-load-balancer-resource-group|service.beta.kubernetes.io/azure-load-balancer-resource-group>": clusterResourceGroup,
},
annotation doesn't work anymore.rhythmic-finland-36256
05/25/2020, 5:09 PMancient-megabyte-79588
05/25/2020, 5:10 PMrhythmic-finland-36256
05/25/2020, 5:11 PMancient-megabyte-79588
05/25/2020, 5:12 PMrhythmic-finland-36256
05/25/2020, 5:12 PMancient-megabyte-79588
05/25/2020, 5:12 PMrhythmic-finland-36256
05/25/2020, 5:13 PMancient-megabyte-79588
05/25/2020, 5:14 PMrhythmic-finland-36256
05/25/2020, 5:14 PMancient-megabyte-79588
05/25/2020, 5:16 PMpulumi up
so I have to do it with PS script against the azure-cli after the deployment.rhythmic-finland-36256
05/25/2020, 5:16 PMancient-megabyte-79588
05/25/2020, 5:16 PMpulumi up
# get the PublicIP object for our load balancer
$pip = az network public-ip list --query "[?tags.service=='kube-system/nginx-nginx-ingress-controller']" | ConvertFrom-Json
# update the --dns-name and refresh our object in PowerShell
$pip = az network public-ip update -n $pip.name -g $pip.resourceGroup --dns-name "identity-auth-dev" | ConvertFrom-Json
# set the clusterFQDN in Pulumi
pulumi config set clusterFQDN $pip.dnsSettings.fqdn
# verify that we can resolve our DNS entry
nslookup $pip.dnsSettings.fqdn
rhythmic-finland-36256
05/25/2020, 5:18 PMancient-megabyte-79588
05/25/2020, 5:18 PMrhythmic-finland-36256
05/25/2020, 5:24 PMancient-megabyte-79588
05/25/2020, 5:25 PMtraefik
in there for a bit, but found examples harder to find. I'm really interested in continuing that exploration.rhythmic-finland-36256
05/25/2020, 5:25 PMancient-megabyte-79588
05/25/2020, 5:26 PMrhythmic-finland-36256
05/25/2020, 5:30 PMancient-megabyte-79588
05/25/2020, 5:43 PMrhythmic-finland-36256
05/25/2020, 5:57 PMkubernetes apps
stack, but creating a public IP from there didn’t feel right.kind-mechanic-53546
05/26/2020, 12:11 PM// Deploy NGINX ingress controller using the Helm chart.
const nginx = new k8s.helm.v2.Chart(
"nginx-ingress-helm-chart",
{
namespace: conf.k8sClusterConfig.ingressNsName,
chart: "nginx-ingress",
version: nginx_helm_chart_version,
fetchOpts: { repo: "<https://kubernetes-charts.storage.googleapis.com/>" },
values: {
controller: {
publishService: { enabled: true },
service: {
//loadBalancerIP: lbPublicIp.ipAddress.apply((v) => v),
annotations: {
"<http://service.beta.kubernetes.io/azure-dns-label-name|service.beta.kubernetes.io/azure-dns-label-name>":
"asdfluahsdfasdf",
},
},
},
},
transformations: [
(obj: any) => {
// Do transformations on the YAML to set the namespace
if (obj.metadata) {
obj.metadata.namespace = conf.k8sClusterConfig.ingressNsName;
}
},
],
},
{ provider: provider }
);
ancient-megabyte-79588
05/26/2020, 10:10 PMkind-mechanic-53546
05/26/2020, 10:10 PMancient-megabyte-79588
05/26/2020, 10:11 PMpublishService: { enabled: true },
does?const nginxIngress = new k8s.helm.v3.Chart("nginx", {
kind-mechanic-53546
05/26/2020, 10:13 PMancient-megabyte-79588
05/26/2020, 10:15 PMkind-mechanic-53546
05/26/2020, 10:18 PMOnly the LoadBalancer Service knows the IP address of the automatically created Load Balancer. Some apps (such as ExternalDNS) need to know its IP address, but can only read the configuration of an Ingress. The Controller can be configured to publish the IP address on each Ingress by setting theparameter tocontroller.publishService.enabled
duringtrue
. It is recommended to enable this setting to support applications that may depend on the IP address of the Load Balancer.helm install
ancient-megabyte-79588
05/26/2020, 10:23 PMkind-mechanic-53546
05/26/2020, 10:24 PMancient-megabyte-79588
05/26/2020, 10:27 PMkind-mechanic-53546
05/26/2020, 10:28 PMancient-megabyte-79588
05/26/2020, 10:28 PM// Deploy ingress-controller using helm to AKS Cluster
const nginxIngress = new k8s.helm.v3.Chart("nginx", {
chart: "nginx-ingress-controller",
namespace: "kube-system",
repo: "bitnami",
values: {
controller: {
publishService: { enabled: true },
service: {
annotations: {
"<http://service.beta.kubernetes.io/azure-dns-label-name|service.beta.kubernetes.io/azure-dns-label-name>": "k8sDnsName",
"<http://service.beta.kubernetes.io/azure-load-balancer-resource-group|service.beta.kubernetes.io/azure-load-balancer-resource-group>": clusterResourceGroup,
}
},
},
resources: { requests : {memory: "150Mi", cpu: "100m"}},
serviceType: "LoadBalancer",
nodeCount: 1,
}
}, {provider: k8sProvider });
kind-mechanic-53546
05/26/2020, 10:33 PMancient-megabyte-79588
05/26/2020, 10:33 PMkind-mechanic-53546
05/26/2020, 10:34 PMancient-megabyte-79588
05/26/2020, 10:38 PMchart: "nginx-ingress",
is yours
chart: "nginx-ingress-controller",
is minekind-mechanic-53546
05/26/2020, 10:45 PMancient-megabyte-79588
05/26/2020, 10:51 PMkind-mechanic-53546
05/26/2020, 10:53 PMancient-megabyte-79588
05/26/2020, 11:00 PMkind-mechanic-53546
05/26/2020, 11:01 PMancient-megabyte-79588
05/26/2020, 11:05 PMkind-mechanic-53546
05/26/2020, 11:07 PMancient-megabyte-79588
05/26/2020, 11:07 PMkind-mechanic-53546
05/26/2020, 11:08 PMancient-megabyte-79588
05/26/2020, 11:09 PMkind-mechanic-53546
05/26/2020, 11:09 PMancient-megabyte-79588
05/26/2020, 11:10 PMkind-mechanic-53546
05/26/2020, 11:10 PMancient-megabyte-79588
05/26/2020, 11:10 PMnginx-ingress
chartkind-mechanic-53546
05/26/2020, 11:22 PMancient-megabyte-79588
05/26/2020, 11:29 PMkind-mechanic-53546
05/26/2020, 11:32 PMancient-megabyte-79588
05/26/2020, 11:33 PMkind-mechanic-53546
05/26/2020, 11:42 PMrhythmic-finland-36256
05/27/2020, 9:08 AMancient-megabyte-79588
05/27/2020, 1:43 PMvalues: {}
object// Deploy ingress-controller using helm to AKS Cluster
const nginxIngress = new k8s.helm.v3.Chart("nginx", {
chart: "nginx-ingress-controller",
namespace: "kube-system",
repo: "bitnami",
values: {
service :{
annotations: {
"<http://service.beta.kubernetes.io/azure-dns-label-name|service.beta.kubernetes.io/azure-dns-label-name>": k8sDnsName,
"<http://service.beta.kubernetes.io/azure-load-balancer-resource-group|service.beta.kubernetes.io/azure-load-balancer-resource-group>": clusterResourceGroup,
},
},
resources: { requests : {memory: "150Mi", cpu: "100m"}},
serviceType: "LoadBalancer",
nodeCount: 1,
}
}, {provider: k8sProvider });
controller : { services: { annotations :{} } }
and in the bitnami chart, you leave out the controller: { }
parent objectvalues: {}
object, I'd wouldn't pay enough attention to which repo/chart I was using and look at that specific charts github values.yml example.kind-mechanic-53546
05/27/2020, 9:50 PMancient-megabyte-79588
05/27/2020, 10:07 PMkind-mechanic-53546
05/27/2020, 10:07 PMancient-megabyte-79588
05/27/2020, 10:08 PMkind-mechanic-53546
05/27/2020, 10:08 PMancient-megabyte-79588
05/27/2020, 10:09 PMkind-mechanic-53546
05/27/2020, 10:10 PMancient-megabyte-79588
05/27/2020, 10:11 PMkind-mechanic-53546
05/27/2020, 10:12 PMancient-megabyte-79588
05/27/2020, 10:12 PMkind-mechanic-53546
05/27/2020, 10:12 PMancient-megabyte-79588
05/27/2020, 10:13 PMkind-mechanic-53546
05/27/2020, 10:15 PMancient-megabyte-79588
05/28/2020, 12:31 AM