diff --git a/solutions/monitoring_openTelemetry/Ingress_controller_setup_AKS.asciidoc b/solutions/monitoring_openTelemetry/Ingress_controller_setup_AKS.asciidoc new file mode 100644 index 000000000..ccb1d535b --- /dev/null +++ b/solutions/monitoring_openTelemetry/Ingress_controller_setup_AKS.asciidoc @@ -0,0 +1,64 @@ +== HTTP application routing in Azure: +The HTTP application routing add-on is designed to let you quickly create an ingress controller and access your applications. +This add-on is not currently designed for use in a production environment and is not recommended for production use. + +Following steps to enable HTTP application routing. + +. Enable HTTP routing on existing AKS cluster using the `az aks enable-addons` with the Azure CLI + + az aks enable-addons --resource-group myResourceGroup --name myAKSCluster --addons http_application_routing + + +. use the `az aks show` command to retrieve the DNS zone name. + + az aks show --resource-group myResourceGroup --name myAKSCluster --query addonProfiles.httpApplicationRouting.config.HTTPApplicationRoutingZoneName -o table + +. Adding annotations + + annotations: + kubernetes.io/ingress.class: addon-http-application-routing + +. Change your ingress host with http application DNS Zone name. + + host: xxxxx.xxxxxx.xxxx.region.aksapp.io + +== Nginx-ingress-controller-setup: + +Install Nginx ingress controller in kubernetes cluster by using helm chart. + +* Adding the Helm repository, if you’re installing the chart via the helm repository. + + helm repo add bitnami https://charts.bitnami.com/bitnami + +* Upgrading the Chart + + helm repo update + +* Nginx-ingress controller: Installing the Helm charts deploy the nginx ingress controller with the following command. + + helm install nginx-ingress bitnami/nginx-ingress-controller --set ingressClassResource.default=true --set containerSecurityContext.allowPrivilegeEscalation=false --namespace nginx-ingress --create-namespace + +== Create multiple nginx controller service for multi domain access. + +1. Import already existed nginx controller service in to yaml, modify service name and re-deploy service. + + kubectl get svc nginx-ingress-nginx-ingress-controller -n nginx-ingress -o yaml > filename.yml + + Note: In Azure create Public IP addresses(domain) for nginx ingress service external IP. + +2. Redeploy service with minor changes. + + kubectl apply -f nginx_controller_service.yml -n nginx-ingress + +3. Setup ingress host with nginx ingress controller service domain to access application using domain. + + host: xxx.xxx.xx.com + +deploy and access application using domain. + +== Examples +=== Providing Dynamic Values to Helm chart +When installing Helm charts with the helm install command, the `--set` argument allows you to define value in a values.yaml file, `application.cloud` is deployment environment(AZURE), `ingress.host` is to set host value. + + helm install otlp ./helm --set application.cloud="AZURE" --set ingress.host="xxx.com" + diff --git a/solutions/monitoring_openTelemetry/helm/templates/_helpers.tpl b/solutions/monitoring_openTelemetry/helm/templates/_helpers.tpl new file mode 100644 index 000000000..0df3b7a7e --- /dev/null +++ b/solutions/monitoring_openTelemetry/helm/templates/_helpers.tpl @@ -0,0 +1,14 @@ +{{/* +Prepare ingress host, pass it as parameter. +*/}} +{{- define "ingress.application.host" -}} +{{- printf "application.%s" .Values.ingress.host -}} +{{- end -}} + +{{- define "ingress.jaeger.host" -}} +{{- printf "jaeger.%s" .Values.ingress.host -}} +{{- end -}} + +{{- define "ingress.grafana.host" -}} +{{- printf "grafana.%s" .Values.ingress.host -}} +{{- end -}} diff --git a/solutions/monitoring_openTelemetry/helm/templates/ingress.yaml b/solutions/monitoring_openTelemetry/helm/templates/ingress.yaml index d0539ba7e..80ddd828f 100644 --- a/solutions/monitoring_openTelemetry/helm/templates/ingress.yaml +++ b/solutions/monitoring_openTelemetry/helm/templates/ingress.yaml @@ -2,9 +2,16 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress + annotations: + {{- if contains $.Values.application.cloud "AWS" }} + {{ toYaml .Values.ingress.aws.annotations | indent 2 }} + {{- end }} + {{- if contains $.Values.application.cloud "AZURE" }} + {{ toYaml .Values.ingress.azure.annotations | indent 2 }} + {{- end }} spec: rules: - - host: {{ .Values.ingress.application.host }} + - host: {{ template "ingress.application.host" . }} http: paths: - path: "/" @@ -14,7 +21,7 @@ spec: name: {{ .Values.application.service.name }} port: number: {{ .Values.ingress.application.port }} - - host: {{ .Values.ingress.jaeger.host }} + - host: {{ template "ingress.jaeger.host" . }} http: paths: - path: "/" @@ -24,7 +31,7 @@ spec: name: jaeger-all-in-one port: number: {{ .Values.ingress.jaeger.port }} - - host: {{ .Values.ingress.grafana.host }} + - host: {{ template "ingress.grafana.host" . }} http: paths: - path: "/" @@ -33,4 +40,4 @@ spec: service: name: grafana port: - number: {{ .Values.ingress.grafana.port }} \ No newline at end of file + number: {{ .Values.ingress.grafana.port }} diff --git a/solutions/monitoring_openTelemetry/helm/values.yaml b/solutions/monitoring_openTelemetry/helm/values.yaml index fcddfa709..385e9b50b 100644 --- a/solutions/monitoring_openTelemetry/helm/values.yaml +++ b/solutions/monitoring_openTelemetry/helm/values.yaml @@ -1,5 +1,6 @@ # Application configuration application: + cloud: "" # AWS or AZURE # Configuration to get the metrics information metrics: jobname: "metrics-jobname" @@ -12,12 +13,17 @@ application: # Ingress configuration ingress: + aws: + annotations: {} + azure: + annotations: { + kubernetes.io/ingress.class: addon-http-application-routing + } + # hostname should be passed on helm install + host: "" application: - host: "application.localhost" port: 8080 jaeger: - host: "jaeger.localhost" port: 16686 grafana: - host: "grafana.localhost" - port: 3000 \ No newline at end of file + port: 3000