Home
%3CLINGO-SUB%20id%3D%22lingo-sub-363942%22%20slang%3D%22en-US%22%3EBuilding%20Microservices%20with%20Azure%20Kubernetes%20Service%20and%20Azure%20DevOps%20-%20Part%204%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-363942%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3E%3CSPAN%3E%3CEM%3EIf%20you%20missed%20the%20previous%20parts%20they%20can%20be%20found%20here%3A%26nbsp%3B%3CBR%20%2F%3E%3CA%20title%3D%22Building%20Microservices%20with%20Azure%20Kubernetes%20Service%20and%20Azure%20DevOps%20-%20Part%201%22%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-Developer-Community-Blog%2FBuilding-Microservices-with-Azure-Kubernetes-Service-and-Azure%2Fba-p%2F356402%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EBuilding%20Microservices%20with%20Azure%20Kubernetes%20Service%20and%20Azure%20DevOps%20-%20Part%201%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-Developer-Community-Blog%2FBuilding-Microservices-with-Azure-Kubernetes-Service-and-Azure%2Fba-p%2F359965%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EBuilding%20Microservices%20with%20Azure%20Kubernetes%20Service%20and%20Azure%20DevOps%20-%20Part%202%3C%2FA%3E%3CBR%20%2F%3E%3C%2FEM%3E%3CEM%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-Developer-Community-Blog%2FBuilding-Microservices-with-Azure-Kubernetes-Service-and-Azure%2Fba-p%2F359569%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EBuilding%20Microservices%20with%20Azure%20Kubernetes%20Service%20and%20Azure%20DevOps%20-%20Part%203%3C%2FA%3E%3C%2FEM%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH2%20id%3D%22toc-hId-1678849575%22%20id%3D%22toc-hId-1731630607%22%20id%3D%22toc-hId-1731630607%22%3E%3CSPAN%3EFixing%20remaining%20Ops%20issues%3C%2FSPAN%3E%3C%2FH2%3E%3CP%3EClearly%20there%20are%20a%20couple%20of%20things%20we%20need%20to%20fix%20for%20our%20microservice%20to%20become%20a%20regular%20web%20page%3A%3C%2FP%3E%3CUL%3E%3CLI%3EWe%20need%20an%20external%20IP%20address%20accessible%20over%20the%20Internet.%3C%2FLI%3E%3CLI%3EWe%20would%20like%20to%20assign%20a%20DNS%20name%20to%20the%20IP%20address.%3C%2FLI%3E%3CLI%3EWe%20should%20assign%20a%20certificate%20to%20our%20service%20for%20encrypting%20the%20traffic.%3C%2FLI%3E%3C%2FUL%3E%3CP%3EThe%20opinion%20of%20this%20author%20is%20that%20when%20the%20architect's%20eyes%20become%20glossy%3B%20waxing%20about%20microservices%2C%20they%20often%20omit%20minor%20details%20like%20these.%20It%20certainly%20isn%E2%80%99t%20impossible%20to%20fix%2C%20but%20developers%20usually%20don't%20have%20to%20deal%20with%20this%20when%20deploying%20classic%20monoliths%2C%20and%20mentally%20this%20means%20more%20%22boxes%22%20to%20keep%20track%20of.%20It%20may%20also%20lead%20to%20a%20discussion%20of%20its%20own%20whether%20this%20is%20something%20the%20developers%20can%20be%20trusted%20to%20handle%20themselves%2C%20or%20if%20this%20should%20be%20handled%20by%20the%20operations%20department.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20a%20larger%20organization%20where%20the%20cluster%20is%20already%20up%20and%20running%2C%20and%20the%20developer%20are%20just%20handed%20instructions%20on%20how%20to%20get%20going%2C%20it%20may%20indeed%20already%20have%20been%20taken%20care%20of.%20But%20for%20the%20context%20of%20this%20guide%20the%20reader%20could%20be%20running%20a%20one-man%20shop%20and%20need%20to%20do%20things%20without%20involvement%20from%20operations.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhile%20there%20are%20network%20admins%20who%20have%20enough%20public%20IPv4%20addresses%20to%20supply%20an%20entire%20town%2C%20the%20most%20common%20pattern%20is%20to%20have%20a%20limited%20number%20of%20external%20facing%20addresses%20and%20port%20openings%20exposed%20and%20have%20all%20traffic%20to%20the%20back-end%20flow%20through%20some%20sort%20of%20aggregator.%20(The%20term%20%22aggregator%22%20is%20used%20because%20it%20could%20be%20any%20combination%20of%20firewalls%2C%20load%20balancers%2C%20reverse%20proxies%20and%20routers.)%20Kubernetes%20is%20no%20different%20in%20this%20sense.%20You%20can%20assign%20a%20public%20IP%20for%20each%20service%20if%20your%20cluster%20provider%20doesn't%20limit%20you%2C%20but%20you%20probably%20don't%20have%20a%20good%20design%20if%20you%20set%20it%20up%20like%20that.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20Kubernetes%20construct%20for%20controlling%20inbound%20traffic%20is%20called%20an%20%3CEM%3Eingress%20controller%3C%2FEM%3E%2C%20so%20the%20steps%20in%20this%20guide%20will%20look%20at%20ways%20to%20configure%20this%20component.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH3%20id%3D%22toc-hId--1069820891%22%20id%3D%22toc-hId--1017039859%22%20id%3D%22toc-hId--1017039859%22%3EHTTP%20Application%20Routing%3C%2FH3%3E%3CP%3EWhen%20the%20cluster%20was%20created%20the%20parameter%20%3CEM%3E--enable-addons%20http_application_routing%3C%2FEM%3E%20was%20a%20part%20of%20the%20command.%20This%20sets%20up%20some%20DNS%20integration%20points%20automagically%2C%20and%20if%20you%20browse%20to%20the%20companion%20resource%20group%20you%20will%20have%20a%20DNS%20zone%20preconfigured.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20524px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86387i8E823597092A440C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22DNS_01.png%22%20title%3D%22DNS_01.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2070%20AKS%20Resource%20Groups%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENotice%20that%20Azure%20always%20creates%20a%20second%20resource%20group%20prefixed%20with%20%3CEM%3EMC_%3C%2FEM%3E%20that%20contain%20the%20individual%20resources%20for%20an%20AKS%20cluster.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20541px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86388i81CA1DED99099D99%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22DNS_02.png%22%20title%3D%22DNS_02.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2071%20AKS%20Companion%20Resource%20Group%20Contents%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20means%20that%20services%20deployed%20can%20have%20an%20FQDN%20working%20across%20the%20internet%20without%20manually%20configuring%20DNS%20records.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20are%20two%20possible%20approaches%20you%20can%20take%20to%20acquire%20an%20external%20IP%20address%20and%20a%20DNS%20name.%3C%2FP%3E%3CP%3EThe%20first%2C%20and%20probably%20best%20approach%20if%20you%20stick%20to%20the%20CI%2FCD%20pipelines%20is%20editing%20the%20%3CEM%3EHelm%3C%2FEM%3E%20chart%20that%20was%20checked%20in.%20In%20the%20initial%20check-in%20ingress%20was%20set%20to%20false%2C%20thus%20not%20attempting%20to%20create%20an%20ingress%20either.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20change%20%3CEM%3Evalues.yaml%3C%2FEM%3E%20accordingly%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3Eingress%3A%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3Eenabled%3A%20true%3CBR%20%2F%3Eannotations%3A%20%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20kubernetes.io%2Fingress.class%3A%20addon-http-application-routing%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%7D%3CBR%20%2F%3Epath%3A%20%2F%3CBR%20%2F%3Ehosts%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20-%20%3C%2FSPAN%3E%3CSPAN%3Eaksdotnetcoder.dns-zone%3C%2FSPAN%3E%3CSPAN%3E.northeurope.aksapp.io%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20want%20the%20more%20direct%20approach%2C%20and%20skip%20the%20%3CEM%3EHelm%3C%2FEM%3E%20chart%2C%20you%20can%20create%20a%20file%20called%20%3CEM%3Eaksdotnet-dns.yaml%3C%2FEM%3E%20with%20the%20following%20contents%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3EapiVersion%3A%20apps%2Fv1beta1%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3Ekind%3A%20Deployment%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3Emetadata%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%20name%3A%20aksdotnetcoder%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3Espec%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%20template%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%20metadata%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20labels%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20app%3A%20aksdotnet%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%20spec%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20containers%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20name%3A%20aksdotnet%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20image%3A%20%22acrname%3C%2FSPAN%3E%3CSPAN%3E.azurecr.io%2Faksdotnetcoder%3Alatest%22%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ports%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20containerPort%3A%2080%20%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E---%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3EapiVersion%3A%20v1%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3Ekind%3A%20Service%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3Emetadata%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%20name%3A%20aksdotnet%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3Espec%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%20ports%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%20-%20port%3A%2080%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%20protocol%3A%20TCP%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%20selector%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%20app%3A%20aksdotnet%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%20type%3A%20ClusterIP%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E---%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3EapiVersion%3A%20extensions%2Fv1beta1%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3Ekind%3A%20Ingress%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3Emetadata%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%20name%3A%20aksdotnet%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%20annotations%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%20kubernetes.io%2Fingress.class%3A%20addon-http-application-routing%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3Espec%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%20rules%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%20-%20host%3A%20aksdotnetcoder.dns-zone%3C%2FSPAN%3E%3CSPAN%3E.aksapp.io%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%20http%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3Bpaths%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20backend%3A%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20serviceName%3A%20aksdotnet%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20servicePort%3A%2080%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20path%3A%20%2F%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENote%20that%20if%20you%20apply%20this%20in%20parallel%20with%20a%20deployment%20based%20on%20the%20Helm%20charts%20make%20sure%20the%20names%20are%20unique%2C%20so%20you%20don%E2%80%99t%20get%20a%20conflict%20between%20the%20two.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EReplace%20%3CEM%3Eacrname%3C%2FEM%3E%20with%20your%20Azure%20Container%20Registry%20name%2C%20and%20%3CEM%3Edns-zone%3C%2FEM%3E%20based%20on%20the%20resource%20in%20the%20companion%20resource%20group.%3C%2FP%3E%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EApply%20with%20%3CEM%3Ekubectl%20create%20-f%20aksdotnet-dns.yaml%3C%2FEM%3E.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20979px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86389i03C56D7AC91E4F3F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22DNS_03.png%22%20title%3D%22DNS_03.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2072%20Kubectl%20create%20aksdotnet-dns%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWait%20for%20a%20couple%20minutes%20for%20Azure%20to%20perform%20the%20task%20and%20run%20%3CEM%3Ekubectl%20get%20ingresses%3C%2FEM%3E%20to%20get%20an%20output%20with%20a%20FQDN%20and%20an%20external%20IP%20address.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20979px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86390iE0F43F7EA7B3E930%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22DNS_04.png%22%20title%3D%22DNS_04.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2073%20Kubectl%20get%20external%20IP%20address%20acquired%20by%20Application%20Routing%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20now%20test%20by%20opening%20the%20address%20in%20a%20browser%2C%20and%20you%20will%20hopefully%20see%20the%20AKS%20Web%20App.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20371px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F88547i708CA198F655AD0C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22AKS_Web_App.png%22%20title%3D%22AKS_Web_App.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2074%20AKS%20Web%20App%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20should%20be%20noted%20that%20you%20can%20install%20a%20%3CEM%3EHelm%3C%2FEM%3E%20chart%20without%20going%20through%20%3CEM%3EAzure%20DevOps%3C%2FEM%3E%2C%20but%20it%20is%20not%20recommended%20to%20mix%20options%20in%20that%20way.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH3%20id%3D%22toc-hId-672989444%22%20id%3D%22toc-hId-725770476%22%20id%3D%22toc-hId-725770476%22%3ECustom%20Domain%20Names%3C%2FH3%3E%3CP%3EThere%20is%20however%20one%20flaw%20with%20this%20method.%20It%20does%20not%20support%20custom%20domain%20names.%20Having%20URLs%20with%20random%20guids%20isn%E2%80%99t%20exactly%20user-friendly%20so%20this%20will%20only%20work%20for%20testing.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThose%20familiar%20with%20DNS%20might%20suggest%20using%20CNAME%20records.%20Basically%20having%20%3CSPAN%3E%3CA%20href%3D%22http%3A%2F%2Fwww.contoso.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ewww.contoso.com%3C%2FA%3E%3C%2FSPAN%3E%20point%20to%20%3CSPAN%3E%3CA%20href%3D%22http%3A%2F%2Fwww.randomnumber.northeurope.aksapp.io%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ewww.randomnumber.northeurope.aksapp.io%3C%2FA%3E%3C%2FSPAN%3E.%20This%20will%20work%2C%20but%20only%20for%20HTTP.%20If%20you%20apply%20certificates%20and%20HTTPS%20this%20approach%20will%20break%20unless%20you%20take%20extra%20steps%20to%20ensure%20the%20certificate%20matches%20the%20CNAME%20record%20instead%20of%20the%20A%20record%20linked%20to%20the%20IP%20address.%20While%20this%20is%20a%20workaround%20it%20adds%20extra%20manual%20steps%20to%20make%20sure%20the%20DNS%20zones%20match%20up%2C%20so%20if%20possible%20avoid%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20is%20possible%20to%20skip%20DNS%20handling%20within%20Azure%20and%20just%20acquire%20the%20necessary%20external%20IP%20address%20that%20you%20can%20point%20to%20in%20your%20existing%20DNS%20infrastructure%2C%20however%20this%20guide%20will%20demonstrate%20a%20solution%20for%20integrating%20custom%20domain%20names%20with%20Azure%20DNS.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20followed%20the%20guide%20up%20to%20this%20point%20you%20need%20to%20do%20one%20of%20two%20things%20before%20proceeding%20with%20custom%20DNS%20handling%3A%3C%2FP%3E%3CUL%3E%3CLI%3EUninstall%20the%20Application%20Routing%20with%20the%20following%20command%3CBR%20%2F%3E%3CEM%3Eaz%20aks%20disable-addons%20--addons%20http_application_routing%20--name%20aksdotnet%20--resource-group%20aksdotnetcoder%20--no-wait%3C%2FEM%3E%3C%2FLI%3E%3CLI%3EDelete%20the%20cluster%20and%20re-create%20it%20without%20the%20%3CEM%3E--enable-addons%20http_application_routing%20%3C%2FEM%3E(Remember%20to%20re-apply%20yaml-files%20afterwards.)%3C%2FLI%3E%3C%2FUL%3E%3CP%3EThe%20second%20approach%20is%20slightly%20more%20time-consuming%2C%20and%20is%20more%20work%2C%20but%20provides%20more%20learning%20by%20repeating%20the%20steps.%20As%20it%20also%20creates%20a%20%E2%80%9Cclean%E2%80%9D%20cluster%20this%20is%20the%20basis%20for%20the%20steps%20below.%20(In%20other%20words%20-%20use%20the%20first%20approach%20at%20your%20own%20peril.)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20Azure%20DNS%20zone%20should%20ideally%20be%20in%20a%20resource%20group%20separate%20from%20AKS.%3C%2FP%3E%3CP%3E%3CEM%3Eaz%20group%20create%20%E2%80%93-name%20AKSCustomDNSrg%20%E2%80%93-location%20northeurope%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20785px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86391iBEDF1A73FBD5DE1C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Custom_DNS_01.png%22%20title%3D%22Custom_DNS_01.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2075%20Creating%20Azure%20DNS%20resource%20group%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20automatic%20creation%20of%20DNS%20records%20we%20need%20to%20create%20a%20service%20principal%20that%20the%20Kubernetes%20cluster%20can%20use%20for%20this%20purpose.%20Run%20the%20following%20command%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CEM%3Eaz%20ad%20sp%20create-for-rbac%20--role%3D%22Contributor%22%3CBR%20%2F%3E--scopes%3D%22%2Fsubscriptions%2Fsubscription-guid%2FresourceGroups%2FAKSCustomDNSrg%22%3CBR%20%2F%3E-n%20AKSCustomDnsServicePrincipal%3C%2FEM%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20823px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86392i0C604BCC1F1A2905%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Custom_DNS_02.png%22%20title%3D%22Custom_DNS_02.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2076%20Creating%20Azure%20DNS%20Service%20Principal%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMake%20a%20note%20of%20the%20attributes%20returned%20and%20use%20these%20to%20create%20a%20file%20called%20%3CEM%3Eazure.json%3C%2FEM%3E%20with%20contents%20similar%20to%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3E%7B%3CBR%20%2F%3E%20%20%20%22tenantId%22%3A%20%22tenant-guid%22%2C%3CBR%20%2F%3E%20%20%20%22subscriptionId%22%3A%20%22subscription-guid%22%2C%3CBR%20%2F%3E%20%20%20%22aadClientId%22%3A%20%22appId%22%2C%3CBR%20%2F%3E%20%20%20%22aadClientSecret%22%3A%20%22password%22%2C%3CBR%20%2F%3E%20%20%20%22resourceGroup%22%3A%20%22%2Fsubscriptions%2Fsubscription-guid%2FresourceGroups%2FAKSCustomDNSrg%22%3CBR%20%2F%3E%7D%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ECreate%20the%20Azure%20DNS%20zone%20resource%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3E%3CSPAN%3Eaz%20network%20dns%20zone%20create%20-g%20%3C%2FSPAN%3E%3C%2FEM%3E%3CEM%3EAKSCustomDNSrg%3CSPAN%3E%20-n%20contoso.com%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20823px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86393i685005CEA813DF87%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Custom_DNS_03.png%22%20title%3D%22Custom_DNS_03.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2077%20Creating%20Azure%20DNS%20Zone%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EApply%20the%20configuration%20created%20in%20the%20azure.json%20file%20with%20the%20following%20command%3A%3CBR%20%2F%3E%3CEM%3Ekubectl%20create%20secret%20generic%20azure-config-file%20--from-file%3Dazure.json%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CEM%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20823px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86394iE7E123DAC501CE53%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Custom_DNS_04.png%22%20title%3D%22Custom_DNS_04.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2078%20Kubectl%20create%20dns%20config%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EWhen%20using%20the%20application%20routing%20an%20ingress%20controller%20was%20created%20automatically%20for%20us.%20When%20opting%20to%20deploy%20without%20this%20add-on%20it%20is%20necessary%20to%20install%20separately.%20This%20can%20be%20done%20with%20the%20following%20command%3A%3CBR%20%2F%3E%3CEM%3Ehelm%20install%20stable%2Fnginx-ingress%20--namespace%20kube-system%20--set%20controller.replicaCount%3D2%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EWhile%20AKS%20is%20hosted%20in%20Azure%20it%20doesn%E2%80%99t%20automatically%20have%20the%20means%20for%20updating%20Azure%20DNS%2C%20so%20a%20configuration%20for%20allowing%20this%20is%20required%20by%20employing%20a%20component%20called%20%3CEM%3EExternal%20DNS%3C%2FEM%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ECreate%20a%20file%20called%20external-dns.yaml%20with%20the%20following%20contents%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3Eexternaldns.yaml%3CBR%20%2F%3EapiVersion%3A%20v1%3CBR%20%2F%3Ekind%3A%20ServiceAccount%3CBR%20%2F%3Emetadata%3A%3CBR%20%2F%3Ename%3A%20external-dns%3CBR%20%2F%3E---%3CBR%20%2F%3EapiVersion%3A%20rbac.authorization.k8s.io%2Fv1beta1%3CBR%20%2F%3Ekind%3A%20ClusterRole%3CBR%20%2F%3Emetadata%3A%3CBR%20%2F%3Ename%3A%20external-dns%3CBR%20%2F%3Erules%3A%3CBR%20%2F%3E-%20apiGroups%3A%20%5B%22%22%5D%3CBR%20%2F%3Eresources%3A%20%5B%22services%22%5D%3CBR%20%2F%3Everbs%3A%20%5B%22get%22%2C%22watch%22%2C%22list%22%5D%3CBR%20%2F%3E-%20apiGroups%3A%20%5B%22%22%5D%3CBR%20%2F%3Eresources%3A%20%5B%22pods%22%5D%3CBR%20%2F%3Everbs%3A%20%5B%22get%22%2C%22watch%22%2C%22list%22%5D%3CBR%20%2F%3E-%20apiGroups%3A%20%5B%22extensions%22%5D%20%3CBR%20%2F%3Eresources%3A%20%5B%22ingresses%22%5D%20%3CBR%20%2F%3Everbs%3A%20%5B%22get%22%2C%22watch%22%2C%22list%22%5D%3CBR%20%2F%3E-%20apiGroups%3A%20%5B%22%22%5D%3CBR%20%2F%3Eresources%3A%20%5B%22nodes%22%5D%3CBR%20%2F%3Everbs%3A%20%5B%22list%22%5D%3CBR%20%2F%3E---%3CBR%20%2F%3EapiVersion%3A%20rbac.authorization.k8s.io%2Fv1beta1%3CBR%20%2F%3Ekind%3A%20ClusterRoleBinding%3CBR%20%2F%3Emetadata%3A%3CBR%20%2F%3Ename%3A%20external-dns-viewer%3CBR%20%2F%3EroleRef%3A%3CBR%20%2F%3EapiGroup%3A%20rbac.authorization.k8s.io%3CBR%20%2F%3Ekind%3A%20ClusterRole%3CBR%20%2F%3Ename%3A%20external-dns%3CBR%20%2F%3Esubjects%3A%3CBR%20%2F%3E-%20kind%3A%20ServiceAccount%3CBR%20%2F%3Ename%3A%20external-dns%3CBR%20%2F%3Enamespace%3A%20default%3CBR%20%2F%3E---%3CBR%20%2F%3EapiVersion%3A%20extensions%2Fv1beta1%3CBR%20%2F%3Ekind%3A%20Deployment%3CBR%20%2F%3Emetadata%3A%3CBR%20%2F%3Ename%3A%20external-dns%3CBR%20%2F%3Espec%3A%3CBR%20%2F%3Estrategy%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20type%3A%20Recreate%3CBR%20%2F%3Etemplate%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20metadata%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20labels%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20app%3A%20external-dns%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20spec%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20serviceAccountName%3A%20external-dns%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20containers%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20name%3A%20external-dns%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20image%3A%20registry.opensource.zalan.do%2Fteapot%2Fexternal-dns%3Av0.5.8%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20args%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20--source%3Dservice%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B-%20--source%3Dingress%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20--domain-filter%3Dcontoso.com%20%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20--provider%3Dazure%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20--azure-resource-group%3DAKSCustomDNSrg%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20volumeMounts%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20name%3A%20azure-config-file%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20mountPath%3A%20%2Fetc%2Fkubernetes%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20readOnly%3A%20true%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20volumes%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20name%3A%20azure-config-file%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20secret%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20secretName%3A%20azure-config-file%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EApply%20with%20%3CEM%3Ekubectl%20create%20-f%20externaldns.yaml%3C%2FEM%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20643px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86395iA5F52FF1E7AD47D2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Custom_DNS_05.png%22%20title%3D%22Custom_DNS_05.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2079%20Kubectl%20create%20external-dns%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20ingress%20controller%20was%20installed%20without%20seeing%20the%20helm%20chart%20for%20it%2C%20but%20the%20definition%20can%20be%20changed%20in%20the%20cluster.%20(It%20is%20not%20likely%20the%20ingress%20controller%20will%20be%20re-deployed%20as%20often%20as%20the%20microservices%2C%20so%20it%20might%20not%20be%20needed%20to%20do%20it%20fully%20automated%2C%20but%20that%20is%20largely%20a%20design%20choice.)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ELocate%20the%20nginx-controller%20service%20in%20the%20dashboard.%20(Names%20assigned%20automagically%20so%20your%20cluster%20will%20probably%20not%20match%20the%20screenshots.)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20356px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86396iDAA76C3A55641111%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22nginx_02.png%22%20title%3D%22nginx_02.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2080%20nginx%20controller%20in%20k8s%20dashboard%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHit%20the%20three%20dots%20to%20get%20a%20context%20menu%20and%20select%26nbsp%3B%3CEM%3EView%2Fedit%20YAML%3C%2FEM%3E.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20179px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86397i1152E17BFAE1DFF1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22nginx_03.png%22%20title%3D%22nginx_03.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2081%20nginx%20controller%20View%2Fedit%20YAML%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAdd%20the%20following%20annotation%20to%20the%20YAML%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3E%22annotations%22%3A%20%7B%3CBR%20%2F%3E%22external-dns.alpha.kubernetes.io%2Fhostname%22%3A%20%22aksdotnet.northeurope.cloudapp.azure.com%22%3CBR%20%2F%3E%7D%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EReplace%20with%20the%20DNS%20name%20of%20your%20choice.%20You%20can%20use%20either%26nbsp%3B%3CEM%3Econtoso.com%3C%2FEM%3E%26nbsp%3B(your%20own%20domain%20name)%2C%20or%26nbsp%3B%3CEM%3Ecloudapp.azure.com%3C%2FEM%3E%26nbsp%3B(supplied%20by%20Microsoft)%20here%20if%20you%20like.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20goes%20in%20the%20metadata%20section%20like%20this%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20681px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86398iE9BD840D033EB826%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22nginx_04.png%22%20title%3D%22nginx_04.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CEM%3EFigure%2082%20nginx%20controller%20YAML%20definition%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EOnce%20this%20is%20applied%20the%20DNS%20records%20in%20Azure%20DNS%20are%20automatically%20updated.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThere%20is%20actually%20not%20a%20requirement%20to%20use%20a%20domain%20you%20own%2Fcontrol%20since%20by%20default%20Azure%20DNS%20is%20internal%20to%20Azure.%20You%20can%20delegate%20a%20domain%20you%20own%20by%20pointing%20the%20name%20servers%20to%20Azure%2C%20and%20as%20this%20is%20specific%20to%20your%20registrar%20the%20necessary%20steps%20are%20not%20included%20here.%20Azure%20DNS%20does%20not%20support%20DNSSEC%20yet%20though%2C%20so%20there%20might%20be%20top-level%20domains%20where%20it%E2%80%99s%20not%20so%20easy%20to%20delegate%20to%20Azure%20DNS.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH3%20id%3D%22toc-hId--1879167517%22%20id%3D%22toc-hId--1826386485%22%20id%3D%22toc-hId--1826386485%22%3E%3CSPAN%3ECertificate%20support%3C%2FSPAN%3E%3C%2FH3%3E%3CP%3E%3CSPAN%3EIt%20is%20highly%20recommended%20to%20enable%20support%20for%20TLS%2FSSL%20certificates%20for%20your%20web%20services.%20This%20is%20enabled%20through%20a%20Kubernetes%20plugin%20called%20Cert-Manager%20and%20uses%20Let%E2%80%99s%20Encrypt%20for%20issuing%20certificates.%20The%20steps%20will%20be%20similar%20whether%20you%20are%20using%20the%20auto-generated%20domain%20names%20or%20setting%20up%20a%20custom%20domain.%20For%20this%20guide%20it%20was%20tested%20with%20a%20custom%20domain%20name.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ECreating%20DNS%20records%20isn%E2%80%99t%20the%20only%20thing%20required%20for%20having%20the%20right%20certificate%20issued.%20You%20also%20need%20to%20create%20a%20%E2%80%9Clink%E2%80%9D%20between%20the%20IP%20address%20of%20your%20ingress%20controller%20and%20the%20desired%20FQDN.%20To%20make%20this%20work%20you%20need%20to%20look%20up%20your%20external%20IP%20address%2C%20and%20run%20the%20following%20CLI%20script%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3E%23%20Public%20IP%20address%3CBR%20%2F%3E%24IP%3D%3CINGRESS-EXTERNAL-IP%3E%3C%2FINGRESS-EXTERNAL-IP%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%24DNSNAME%3D%22aksdotnet%22%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%24PUBLICIPID%20%3D%20az%20network%20public-ip%20list%20--query%20%22%5B%3FipAddress!%3Dnull%5D%7C%5B%3Fcontains(ipAddress%2C%20'%24IP')%5D.%5Bid%5D%22%20--output%20tsv%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3Eaz%20network%20public-ip%20update%20--ids%20%24PUBIPID%20--dns-name%20%24DNSNAME%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20next%20step%20is%20to%20install%20Cert-Manager%20through%20%3CEM%3EHelm%3C%2FEM%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CSPAN%3Ehelm%20install%20stable%2Fcert-manager%20--set%20ingressShim.defaultIssuerName%3Dletsencrypt-staging%20--set%20ingressShim.defaultIssuerKind%3DClusterIssuer%3C%2FSPAN%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIn%20these%20samples%2C%20the%20staging%20environment%20of%20Let%E2%80%99s%20Encrypt%20is%20used%2C%20but%20this%20can%20be%20changed%20to%20%3CEM%3Eletsencrypt-prod%3C%2FEM%3E%20instead%20once%20everything%20has%20been%20verified%20working.%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThere%20are%20a%20couple%20of%20configuration%20components%20needed%20to%20issue%20the%20certificates.%20The%20first%20thing%20is%20an%20issuer%20of%20certificates%20within%20Kubernetes.%20Here%20a%20%3CEM%3ECluster%20Issuer%3C%2FEM%3E%20is%20used%2C%20which%20means%20this%20component%20can%20be%20used%20for%20all%20services%20in%20the%20cluster.%20It%20is%20also%20possible%20to%20add%20an%20issuer%20that%20is%20local%20to%20a%20specific%20namespace%2C%20but%20this%20guide%20hasn%E2%80%99t%20covered%20that%20aspect%20of%20k8s%20so%20a%20further%20elaboration%20of%20this%20is%20left%20as%20an%20exercise%20for%20the%20reader.%20Create%20a%20file%20called%20%3CEM%3Ecluster-issuer.yaml%3C%2FEM%3E%20with%20the%20following%20contents%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3EapiVersion%3A%20certmanager.k8s.io%2Fv1alpha1%3CBR%20%2F%3Ekind%3A%20ClusterIssuer%3CBR%20%2F%3Emetadata%3A%3CBR%20%2F%3Ename%3A%20letsencrypt-staging%3CBR%20%2F%3Espec%3A%3CBR%20%2F%3Eacme%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20server%3A%20%3CA%20href%3D%22https%3A%2F%2Facme-staging-v02.api.letsencrypt.org%2Fdirectory%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Facme-staging-v02.api.letsencrypt.org%2Fdirectory%3C%2FA%3E%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20email%3A%20user%40contoso.com%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20privateKeySecretRef%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20name%3A%20letsencrypt-staging%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20http01%3A%20%7B%7D%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EFill%20in%20a%20working%20email%20address%20to%20be%20notified%20when%20the%20certificate%20is%20nearing%20expiration%20time.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EEnable%20with%20%3CEM%3Ekubectl%20create%20-f%20cluster-issuer.yaml%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EYou%20also%20need%20to%20add%20the%20certificate%20object%20for%20a%20specific%20host%20name.%20Create%20a%20file%20called%20%3CEM%3Ecertificates.yaml%3C%2FEM%3E%20with%20the%20following%20contents%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3EapiVersion%3A%20certmanager.k8s.io%2Fv1alpha1%3CBR%20%2F%3Ekind%3A%20Certificate%3CBR%20%2F%3Emetadata%3A%3CBR%20%2F%3Ename%3A%20tls-secret%3CBR%20%2F%3Espec%3A%3CBR%20%2F%3EsecretName%3A%20tls-secret%3CBR%20%2F%3EdnsNames%3A%3CBR%20%2F%3E-%20aksdotnet.northeurope.cloudapp.azure.com%3CBR%20%2F%3Eacme%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20config%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20-%20http01%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ingressClass%3A%20nginx%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20domains%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20aksdotnet.northeurope.cloudapp.azure.com%3CBR%20%2F%3EissuerRef%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20name%3A%20letsencrypt-staging%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20kind%3A%20ClusterIssuer%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EApply%20with%20%3CEM%3Ekubectl%20create%20-f%20certificate.yaml%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EEdit%20%3CEM%3Evalues.yaml%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3E%20hosts%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20-%20aksdotnet.contoso.com%3CBR%20%2F%3Etls%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20-%20secretName%3A%20tls-secret%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20hosts%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20aksdotnet.contoso.com%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EEdit%20the%20helm-chart%20for%20the%20service%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3E%23%20Default%20values%20for%20helm-charts.%3CBR%20%2F%3E%23%20This%20is%20a%20YAML-formatted%20file.%3CBR%20%2F%3E%23%20Declare%20variables%20to%20be%20passed%20into%20your%20templates.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EreplicaCount%3A%201%3CBR%20%2F%3Eimage%3A%3CBR%20%2F%3Erepository%3A%20aksdotnetacr.azurecr.io%2Faksdotnetcoder%3CBR%20%2F%3Etag%3A%20latest%3CBR%20%2F%3EpullPolicy%3A%20IfNotPresent%3CBR%20%2F%3EnameOverride%3A%20%22%22%3CBR%20%2F%3EfullnameOverride%3A%20%22%22%3CBR%20%2F%3Eservice%3A%3CBR%20%2F%3Etype%3A%20ClusterIP%3CBR%20%2F%3Eport%3A%20443%3CBR%20%2F%3Eingress%3A%3CBR%20%2F%3Eenabled%3A%20true%3CBR%20%2F%3Eannotations%3A%20%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20nginx.ingress.kubernetes.io%2Frewrite-target%3A%20%2F%2C%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20kubernetes.io%2Fingress.class%3A%20nginx%2C%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20certmanager.k8s.io%2Fcluster-issuer%3A%20letsencrypt-staging%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%23%20kubernetes.io%2Fingress.class%3A%20addon-http-application-routing%3CBR%20%2F%3E%7D%3CBR%20%2F%3Epath%3A%20%2F%3CBR%20%2F%3Ehosts%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%23-%20chart-example.local%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20%23-%20aksdotnetcoder.3f38909be204470da03e.northeurope.aksapp.io%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20-%20aksdotnet.contoso.com%3CBR%20%2F%3Etls%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20-%20secretName%3A%20tls-secret%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20hosts%3A%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20aksdotnet.contoso.com%3CBR%20%2F%3Eresources%3A%20%7B%7D%3CBR%20%2F%3EnodeSelector%3A%20%7B%7D%3CBR%20%2F%3Etolerations%3A%20%5B%5D%3CBR%20%2F%3Eaffinity%3A%20%7B%7D%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20important%20part%20that%20has%20changed%20is%20the%20annotations%20part%20which%20is%20where%20you%20hook%20into%20the%20components%20that%20do%20the%20heavy%20lifting.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH1%20id%3D%22toc-hId-256669828%22%20id%3D%22toc-hId-309450860%22%20id%3D%22toc-hId-309450860%22%3E%3CSPAN%3EConclusion%3C%2FSPAN%3E%3C%2FH1%3E%3CP%3E%3CSPAN%3EThis%20guide%20covered%20a%20basic%20scenario%20for%20getting%20started%20with%20%3CEM%3EAzure%20Kubernetes%20Service%3C%2FEM%3E%20along%20with%20%3CEM%3EAzure%20DevOps%3C%2FEM%3E%20for%20Continuous%20Integration%20(CI)%20and%20Continuous%20Deployment%20(CD).%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EAll%20the%20important%20core%20topics%20like%20simple%20networking%2C%20DNS%2C%20certificates%2C%20etc.%20were%20covered%2C%20and%20by%20following%20the%20guide%20one%20should%20have%20a%20proof-of-concept%20deployment%20working.%20This%20should%20enable%20the%20reader%20to%20further%20explore%20Kubernetes.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EAll%20instructions%20and%20screenshots%20were%20correct%20at%20the%20time%20of%20writing%20this%20publication%2C%20but%20the%20cloud%20moves%20at%20high%20speed%20so%20unfortunately%20it%20is%20possible%20that%20minor%20details%20have%20changed.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThere%20are%20several%20topics%20that%20should%20be%20studied%20further%20by%20the%20reader%3A%3C%2FSPAN%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CSPAN%3EAdding%20Storage%20to%20an%20AKS%20Cluster.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Faks%2Fazure-disks-dynamic-pv%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Faks%2Fazure-disks-dynamic-pv%3C%2FA%3E%20%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EImplementing%20Advanced%20Azure%20Networking.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Faks%2Fnetworking-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Faks%2Fnetworking-overview%3C%2FA%3E%20%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EImplementing%20a%20Service%20Mesh.%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EUnderstanding%20Microservice%20Patterns%20(this%20guide%20used%20the%20%3CEM%3EAmbassador%3C%2FEM%3E%20pattern).%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3CH1%20id%3D%22toc-hId-1999480163%22%20id%3D%22toc-hId-2052261195%22%20id%3D%22toc-hId-2052261195%22%3E%3CSPAN%3ELearn%20more%3C%2FSPAN%3E%3C%2FH1%3E%3CP%3E%3CSPAN%3EFor%20more%20information%2C%20see%20the%20following%20resources%3A%3C%2FSPAN%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Faks%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Faks%2F%3C%2FA%3E%3CBR%20%2F%3EThe%20official%20documentation%20of%20AKS%20has%20both%20reference%20material%20and%20how%20to%20guides.%20Part%20of%20the%20instructions%20in%20this%20guide%20were%20inspired%20by%20the%20reference%20material.%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Flearn%2Fbrowse%2F%3Fproducts%3Dazure-container-registry%252Cazure-container-instances%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Flearn%2Fbrowse%2F%3Fproducts%3Dazure-container-registry%252Cazure-container-instances%3C%2FA%3E%3CBR%20%2F%3EMicrosoft%20Learn%20%E2%80%93%20Interactive%20Training%20Courses%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Fdevops%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Fdevops%2F%3C%2FA%3E%3CBR%20%2F%3EThe%20starting%20page%20for%20Azure%20DevOps%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fivanfioravanti%2Fkubernetes-the-hard-way-on-azure%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fivanfioravanti%2Fkubernetes-the-hard-way-on-azure%3C%2FA%3E%3C%2FSPAN%3E%3CBR%20%2F%3EKubernetes%20The%20Hard%20Way%20on%20Azure%3CBR%20%2F%3EThis%20is%20a%20low-level%20guide%20on%20how%20to%20start%20from%20scratch%20and%20build%20out%20a%20Kubernetes%20cluster%20on%20Azure.%3C%2FLI%3E%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fazureinteractives.azurewebsites.net%2FCloudDesignPatterns%2Fdefault.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fazureinteractives.azurewebsites.net%2FCloudDesignPatterns%2Fdefault.html%3C%2FA%3E%3C%2FSPAN%3E%3CSPAN%3E%3CBR%20%2F%3ECloud%20Design%20Patterns%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EAzure%20Dev%20Spaces%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Fget-azds%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Faka.ms%2Fget-azds%3C%2FA%3E%20%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%3EThe%20scripts%20and%20yaml%20files%20used%20in%20this%20guide%20can%20be%20found%20at%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fahelland%2FAKS-Guide%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fahelland%2FAKS-Guide%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-363942%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20a%20multi-post%20walkthrough%20we%20take%20a%20tour%20through%20setting%20up%20building%20and%20deploying%20microservices%20on%20Azure%20through%20using%20Azure%20Kubernetes%20Service%20(AKS)%20and%20Azure%20DevOps.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20part%20wraps%20up%20the%20series%20by%20fixing%20things%20like%20certificates%2C%20DNS%2C%20and%20making%20the%20service%20available%20externally.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-642879%22%20slang%3D%22en-US%22%3ERe%3A%20Building%20Microservices%20with%20Azure%20Kubernetes%20Service%20and%20Azure%20DevOps%20-%20Part%204%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-642879%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Andreas%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20followed%20all%20the%20steps%20till%20running%20the%20yaml%20file%20for%20dns.%20My%20CI%20and%20CD%20both%20were%20completed%20successfully%20as%20well.%20However%2C%20when%20I%20try%20to%20browse%20the%20application%2C%20I%20get%20the%20following%20JSON%20response.%20what%20do%20I%20need%20to%20do%20to%20browse%20it%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%7B%0A%20%20%22kind%22%3A%20%22Status%22%2C%0A%20%20%22apiVersion%22%3A%20%22v1%22%2C%0A%20%20%22metadata%22%3A%20%7B%0A%20%20%20%20%0A%20%20%7D%2C%0A%20%20%22status%22%3A%20%22Failure%22%2C%0A%20%20%22message%22%3A%20%22Unauthorized%22%2C%0A%20%20%22reason%22%3A%20%22Unauthorized%22%2C%0A%20%20%22code%22%3A%20401%0A%7D%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Senior Member

If you missed the previous parts they can be found here: 
Building Microservices with Azure Kubernetes Service and Azure DevOps - Part 1
Building Microservices with Azure Kubernetes Service and Azure DevOps - Part 2
Building Microservices with Azure Kubernetes Service and Azure DevOps - Part 3

 

Fixing remaining Ops issues

Clearly there are a couple of things we need to fix for our microservice to become a regular web page:

  • We need an external IP address accessible over the Internet.
  • We would like to assign a DNS name to the IP address.
  • We should assign a certificate to our service for encrypting the traffic.

The opinion of this author is that when the architect's eyes become glossy; waxing about microservices, they often omit minor details like these. It certainly isn’t impossible to fix, but developers usually don't have to deal with this when deploying classic monoliths, and mentally this means more "boxes" to keep track of. It may also lead to a discussion of its own whether this is something the developers can be trusted to handle themselves, or if this should be handled by the operations department.

 

In a larger organization where the cluster is already up and running, and the developer are just handed instructions on how to get going, it may indeed already have been taken care of. But for the context of this guide the reader could be running a one-man shop and need to do things without involvement from operations.

 

While there are network admins who have enough public IPv4 addresses to supply an entire town, the most common pattern is to have a limited number of external facing addresses and port openings exposed and have all traffic to the back-end flow through some sort of aggregator. (The term "aggregator" is used because it could be any combination of firewalls, load balancers, reverse proxies and routers.) Kubernetes is no different in this sense. You can assign a public IP for each service if your cluster provider doesn't limit you, but you probably don't have a good design if you set it up like that.

 

The Kubernetes construct for controlling inbound traffic is called an ingress controller, so the steps in this guide will look at ways to configure this component.

 

HTTP Application Routing

When the cluster was created the parameter --enable-addons http_application_routing was a part of the command. This sets up some DNS integration points automagically, and if you browse to the companion resource group you will have a DNS zone preconfigured.

 

DNS_01.png

Figure 70 AKS Resource Groups

 

Notice that Azure always creates a second resource group prefixed with MC_ that contain the individual resources for an AKS cluster.

DNS_02.png

Figure 71 AKS Companion Resource Group Contents

 

This means that services deployed can have an FQDN working across the internet without manually configuring DNS records.

 

There are two possible approaches you can take to acquire an external IP address and a DNS name.

The first, and probably best approach if you stick to the CI/CD pipelines is editing the Helm chart that was checked in. In the initial check-in ingress was set to false, thus not attempting to create an ingress either.

 

You can change values.yaml accordingly:

 

ingress:
enabled: true
annotations: {
   kubernetes.io/ingress.class: addon-http-application-routing

}
path: /
hosts:
   -
aksdotnetcoder.dns-zone.northeurope.aksapp.io

 

If you want the more direct approach, and skip the Helm chart, you can create a file called aksdotnet-dns.yaml with the following contents:

 

apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: aksdotnetcoder
spec:
template:
   metadata:
     labels:
       app: aksdotnet
   spec:
     containers:
     - name: aksdotnet
       image: "acrname.azurecr.io/aksdotnetcoder:latest"
       ports:
       - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: aksdotnet
spec:
ports:
- port: 80
   protocol: TCP
selector:
   app: aksdotnet
type: ClusterIP
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: aksdotnet
annotations:
   kubernetes.io/ingress.class: addon-http-application-routing
spec:
rules:
- host: aksdotnetcoder.dns-zone.aksapp.io
   http:
    paths:
     - backend:
         serviceName: aksdotnet
         servicePort: 80
       path: /

 

Note that if you apply this in parallel with a deployment based on the Helm charts make sure the names are unique, so you don’t get a conflict between the two.

 

Replace acrname with your Azure Container Registry name, and dns-zone based on the resource in the companion resource group.

 

Apply with kubectl create -f aksdotnet-dns.yaml.

DNS_03.png

Figure 72 Kubectl create aksdotnet-dns

 

Wait for a couple minutes for Azure to perform the task and run kubectl get ingresses to get an output with a FQDN and an external IP address.

DNS_04.png

Figure 73 Kubectl get external IP address acquired by Application Routing

 

You can now test by opening the address in a browser, and you will hopefully see the AKS Web App.

AKS_Web_App.png

Figure 74 AKS Web App

 

It should be noted that you can install a Helm chart without going through Azure DevOps, but it is not recommended to mix options in that way.

 

Custom Domain Names

There is however one flaw with this method. It does not support custom domain names. Having URLs with random guids isn’t exactly user-friendly so this will only work for testing.

 

Those familiar with DNS might suggest using CNAME records. Basically having www.contoso.com point to www.randomnumber.northeurope.aksapp.io. This will work, but only for HTTP. If you apply certificates and HTTPS this approach will break unless you take extra steps to ensure the certificate matches the CNAME record instead of the A record linked to the IP address. While this is a workaround it adds extra manual steps to make sure the DNS zones match up, so if possible avoid it.

 

It is possible to skip DNS handling within Azure and just acquire the necessary external IP address that you can point to in your existing DNS infrastructure, however this guide will demonstrate a solution for integrating custom domain names with Azure DNS.

 

If you followed the guide up to this point you need to do one of two things before proceeding with custom DNS handling:

  • Uninstall the Application Routing with the following command
    az aks disable-addons --addons http_application_routing --name aksdotnet --resource-group aksdotnetcoder --no-wait
  • Delete the cluster and re-create it without the --enable-addons http_application_routing (Remember to re-apply yaml-files afterwards.)

The second approach is slightly more time-consuming, and is more work, but provides more learning by repeating the steps. As it also creates a “clean” cluster this is the basis for the steps below. (In other words - use the first approach at your own peril.)

 

The Azure DNS zone should ideally be in a resource group separate from AKS.

az group create –-name AKSCustomDNSrg –-location northeurope

Custom_DNS_01.png

Figure 75 Creating Azure DNS resource group

 

For automatic creation of DNS records we need to create a service principal that the Kubernetes cluster can use for this purpose. Run the following command:

 

az ad sp create-for-rbac --role="Contributor"
--scopes="/subscriptions/subscription-guid/resourceGroups/AKSCustomDNSrg"
-n AKSCustomDnsServicePrincipal

 

Custom_DNS_02.png

Figure 76 Creating Azure DNS Service Principal

 

Make a note of the attributes returned and use these to create a file called azure.json with contents similar to this:

 

{
"tenantId": "tenant-guid",
"subscriptionId": "subscription-guid",
"aadClientId": "appId",
"aadClientSecret": "password",
"resourceGroup": "/subscriptions/subscription-guid/resourceGroups/AKSCustomDNSrg"
}

 

Create the Azure DNS zone resource:

az network dns zone create -g AKSCustomDNSrg -n contoso.com

 

Custom_DNS_03.png

Figure 77 Creating Azure DNS Zone

 

Apply the configuration created in the azure.json file with the following command:
kubectl create secret generic azure-config-file --from-file=azure.json

 

Custom_DNS_04.png

Figure 78 Kubectl create dns config

 

When using the application routing an ingress controller was created automatically for us. When opting to deploy without this add-on it is necessary to install separately. This can be done with the following command:
helm install stable/nginx-ingress --namespace kube-system --set controller.replicaCount=2

 

While AKS is hosted in Azure it doesn’t automatically have the means for updating Azure DNS, so a configuration for allowing this is required by employing a component called External DNS.

 

Create a file called external-dns.yaml with the following contents:

 

externaldns.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: external-dns
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: external-dns
rules:
- apiGroups: [""]
resources: ["services"]
verbs: ["get","watch","list"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get","watch","list"]
- apiGroups: ["extensions"]
resources: ["ingresses"]
verbs: ["get","watch","list"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: external-dns-viewer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: external-dns
subjects:
- kind: ServiceAccount
name: external-dns
namespace: default
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: external-dns
spec:
strategy:
   type: Recreate
template:
   metadata:
     labels:
       app: external-dns
   spec:
     serviceAccountName: external-dns
     containers:
     - name: external-dns
       image: registry.opensource.zalan.do/teapot/external-dns:v0.5.8
       args:
       - --source=service
      - --source=ingress
       - --domain-filter=contoso.com
       - --provider=azure
       - --azure-resource-group=AKSCustomDNSrg
       volumeMounts:
       - name: azure-config-file
         mountPath: /etc/kubernetes
         readOnly: true
     volumes:
     - name: azure-config-file
       secret:
         secretName: azure-config-file

 

Apply with kubectl create -f externaldns.yaml.

 

Custom_DNS_05.png

Figure 79 Kubectl create external-dns

 

The ingress controller was installed without seeing the helm chart for it, but the definition can be changed in the cluster. (It is not likely the ingress controller will be re-deployed as often as the microservices, so it might not be needed to do it fully automated, but that is largely a design choice.)

 

Locate the nginx-controller service in the dashboard. (Names assigned automagically so your cluster will probably not match the screenshots.)

nginx_02.png

Figure 80 nginx controller in k8s dashboard

 

Hit the three dots to get a context menu and select View/edit YAML.

nginx_03.png

Figure 81 nginx controller View/edit YAML

 

Add the following annotation to the YAML:

 

"annotations": {
"external-dns.alpha.kubernetes.io/hostname": "aksdotnet.northeurope.cloudapp.azure.com"
}

 

Replace with the DNS name of your choice. You can use either contoso.com (your own domain name), or cloudapp.azure.com (supplied by Microsoft) here if you like.

 

It goes in the metadata section like this:

nginx_04.png

Figure 82 nginx controller YAML definition

 

Once this is applied the DNS records in Azure DNS are automatically updated.

 

There is actually not a requirement to use a domain you own/control since by default Azure DNS is internal to Azure. You can delegate a domain you own by pointing the name servers to Azure, and as this is specific to your registrar the necessary steps are not included here. Azure DNS does not support DNSSEC yet though, so there might be top-level domains where it’s not so easy to delegate to Azure DNS.

 

Certificate support

It is highly recommended to enable support for TLS/SSL certificates for your web services. This is enabled through a Kubernetes plugin called Cert-Manager and uses Let’s Encrypt for issuing certificates. The steps will be similar whether you are using the auto-generated domain names or setting up a custom domain. For this guide it was tested with a custom domain name.

 

Creating DNS records isn’t the only thing required for having the right certificate issued. You also need to create a “link” between the IP address of your ingress controller and the desired FQDN. To make this work you need to look up your external IP address, and run the following CLI script:

 

# Public IP address
$IP=<ingress-external-ip>

$DNSNAME="aksdotnet"
$PUBLICIPID = az network public-ip list --query "[?ipAddress!=null]|[?contains(ipAddress, '$IP')].[id]" --output tsv

az network public-ip update --ids $PUBIPID --dns-name $DNSNAME   

 

The next step is to install Cert-Manager through Helm.

 

helm install stable/cert-manager --set ingressShim.defaultIssuerName=letsencrypt-staging --set ingressShim.defaultIssuerKind=ClusterIssuer

 

In these samples, the staging environment of Let’s Encrypt is used, but this can be changed to letsencrypt-prod instead once everything has been verified working.

 

There are a couple of configuration components needed to issue the certificates. The first thing is an issuer of certificates within Kubernetes. Here a Cluster Issuer is used, which means this component can be used for all services in the cluster. It is also possible to add an issuer that is local to a specific namespace, but this guide hasn’t covered that aspect of k8s so a further elaboration of this is left as an exercise for the reader. Create a file called cluster-issuer.yaml with the following contents:

 

apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
spec:
acme:
   server: https://acme-staging-v02.api.letsencrypt.org/directory
   email: user@contoso.com
   privateKeySecretRef:
     name: letsencrypt-staging
   http01: {}

 

Fill in a working email address to be notified when the certificate is nearing expiration time.

 

Enable with kubectl create -f cluster-issuer.yaml

 

You also need to add the certificate object for a specific host name. Create a file called certificates.yaml with the following contents:

 

apiVersion: certmanager.k8s.io/v1alpha1
kind: Certificate
metadata:
name: tls-secret
spec:
secretName: tls-secret
dnsNames:
- aksdotnet.northeurope.cloudapp.azure.com
acme:
   config:
   - http01:
       ingressClass: nginx
     domains:
     - aksdotnet.northeurope.cloudapp.azure.com
issuerRef:
   name: letsencrypt-staging
   kind: ClusterIssuer

 

Apply with kubectl create -f certificate.yaml

 

Edit values.yaml

 

 hosts:
   - aksdotnet.contoso.com
tls:
   - secretName: tls-secret
     hosts:
       - aksdotnet.contoso.com

 

Edit the helm-chart for the service:

 

# Default values for helm-charts.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.


replicaCount: 1
image:
repository: aksdotnetacr.azurecr.io/aksdotnetcoder
tag: latest
pullPolicy: IfNotPresent
nameOverride: ""
fullnameOverride: ""
service:
type: ClusterIP
port: 443
ingress:
enabled: true
annotations: {
   nginx.ingress.kubernetes.io/rewrite-target: /,
   kubernetes.io/ingress.class: nginx,
   certmanager.k8s.io/cluster-issuer: letsencrypt-staging
   # kubernetes.io/ingress.class: addon-http-application-routing
}
path: /
hosts:
   #- chart-example.local
   #- aksdotnetcoder.3f38909be204470da03e.northeurope.aksapp.io
   - aksdotnet.contoso.com
tls:
   - secretName: tls-secret
     hosts:
       - aksdotnet.contoso.com
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}

 

The important part that has changed is the annotations part which is where you hook into the components that do the heavy lifting.

 

Conclusion

This guide covered a basic scenario for getting started with Azure Kubernetes Service along with Azure DevOps for Continuous Integration (CI) and Continuous Deployment (CD).

 

All the important core topics like simple networking, DNS, certificates, etc. were covered, and by following the guide one should have a proof-of-concept deployment working. This should enable the reader to further explore Kubernetes.

 

All instructions and screenshots were correct at the time of writing this publication, but the cloud moves at high speed so unfortunately it is possible that minor details have changed.

 

There are several topics that should be studied further by the reader:

Learn more

For more information, see the following resources:

The scripts and yaml files used in this guide can be found at https://github.com/ahelland/AKS-Guide

1 Comment
Occasional Visitor

Hi Andreas,

 

I have followed all the steps till running the yaml file for dns. My CI and CD both were completed successfully as well. However, when I try to browse the application, I get the following JSON response. what do I need to do to browse it?

 

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {
    
  },
  "status": "Failure",
  "message": "Unauthorized",
  "reason": "Unauthorized",
  "code": 401
}