- Remotely Accessing Telemetry Addons
- Configuring remote access
- Option 1: Secure access (HTTPS)
- Option 2: Insecure access (HTTP)
- Cleanup
- 相关内容
- Configuring remote access
Remotely Accessing Telemetry Addons
This task shows how to configure Istio to expose and access the telemetry addons outside ofa cluster.
Configuring remote access
Remote access to the telemetry addons can be configured in a number of different ways. This task coverstwo basic access methods: secure (via HTTPS) and insecure (via HTTP). The secure method is stronglyrecommended for any production or sensitive environment. Insecure access is simpler to set up, butwill not protect any credentials or data transmitted outside of your cluster.
Option 1: Secure access (HTTPS)
A server certificate is required for secure access. Follow these steps to install and configureserver certificates for a domain that you control.
You may use self-signed certificates instead. Visit ourSecuring Gateways with HTTPS Using Secret Discovery Service taskfor general information on using self-signed certificates to access in-cluster services.
This option covers securing the transport layer only. You should also configure the telemetryaddons to require authentication when exposing them externally.
Install cert-manager to manage certificates automatically.
Install Istio in your cluster and enable the
cert-managerflag and configureistio-ingressgatewayto usethe Secret Discovery Service.
To install Istio accordingly, use the following installation options:
—set values.gateways.enabled=true—set values.gateways.istio-ingressgateway.enabled=true—set values.gateways.istio-ingressgateway.sds.enabled=trueTo additionally install the telemetry addons, use the following installation options:Grafana:
—set values.grafana.enabled=true- Kiali:
—set values.kiali.enabled=true - Prometheus:
—set values.prometheus.enabled=true Tracing:
—set values.tracing.enabled=true- Configure the DNS records for your domain.
Get the external IP address of the
istio-ingressgateway.
$ kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}'<IP ADDRESS OF CLUSTER INGRESS>
- Set an environment variable to hold your target domain.
$ TELEMETRY_DOMAIN=<your.desired.domain>
- Point your desired domain at that external IP address via your domain provider.
The mechanism for achieving this step varies by provider. Here are a few example documentation links:
- Bluehost: [DNS Management Add Edit or Delete DNS Entries](https://my.bluehost.com/hosting/help/559)- GoDaddy: [Add an A record](https://www.godaddy.com/help/add-an-a-record-19238)- Google Domains: [Resource Records](https://support.google.com/domains/answer/3290350?hl=en)- Name.com: [Adding an A record](https://www.name.com/support/articles/115004893508-Adding-an-A-record)
- Verify that the DNS records are correct.
$ dig +short $TELEMETRY_DOMAIN<IP ADDRESS OF CLUSTER INGRESS>
- Generate a server certificate
$ cat <<EOF | kubectl apply -f -apiVersion: certmanager.k8s.io/v1alpha1kind: Certificatemetadata:name: telemetry-gw-certnamespace: istio-systemspec:secretName: telemetry-gw-certissuerRef:name: letsencryptkind: ClusterIssuercommonName: $TELEMETRY_DOMAINdnsNames:- $TELEMETRY_DOMAINacme:config:- http01:ingressClass: istiodomains:- $TELEMETRY_DOMAIN---EOFcertificate.certmanager.k8s.io "telemetry-gw-cert" created
- Wait until the server certificate is ready.
$ JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status}{end}{end}' && kubectl -n istio-system get certificates -o jsonpath="$JSONPATH"telemetry-gw-cert:Ready=True
Apply networking configuration for the telemetry addons.
- Apply the following configuration to expose Grafana:
$ cat <<EOF | kubectl apply -f -apiVersion: networking.istio.io/v1alpha3kind: Gatewaymetadata:name: grafana-gatewaynamespace: istio-systemspec:selector:istio: ingressgatewayservers:- port:number: 15031name: https-grafanaprotocol: HTTPStls:mode: SIMPLEserverCertificate: sdsprivateKey: sdscredentialName: telemetry-gw-certhosts:- "$TELEMETRY_DOMAIN"---apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata:name: grafana-vsnamespace: istio-systemspec:hosts:- "$TELEMETRY_DOMAIN"gateways:- grafana-gatewayhttp:- match:- port: 15031route:- destination:host: grafanaport:number: 3000---apiVersion: networking.istio.io/v1alpha3kind: DestinationRulemetadata:name: grafananamespace: istio-systemspec:host: grafanatrafficPolicy:tls:mode: DISABLE---EOFgateway.networking.istio.io "grafana-gateway" configuredvirtualservice.networking.istio.io "grafana-vs" configureddestinationrule.networking.istio.io "grafana" configured
- Apply the following configuration to expose Kiali:
$ cat <<EOF | kubectl apply -f -apiVersion: networking.istio.io/v1alpha3kind: Gatewaymetadata:name: kiali-gatewaynamespace: istio-systemspec:selector:istio: ingressgatewayservers:- port:number: 15029name: https-kialiprotocol: HTTPStls:mode: SIMPLEserverCertificate: sdsprivateKey: sdscredentialName: telemetry-gw-certhosts:- "$TELEMETRY_DOMAIN"---apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata:name: kiali-vsnamespace: istio-systemspec:hosts:- "$TELEMETRY_DOMAIN"gateways:- kiali-gatewayhttp:- match:- port: 15029route:- destination:host: kialiport:number: 20001---apiVersion: networking.istio.io/v1alpha3kind: DestinationRulemetadata:name: kialinamespace: istio-systemspec:host: kialitrafficPolicy:tls:mode: DISABLE---EOFgateway.networking.istio.io "kiali-gateway" configuredvirtualservice.networking.istio.io "kiali-vs" configureddestinationrule.networking.istio.io "kiali" configured
- Apply the following configuration to expose Prometheus:
$ cat <<EOF | kubectl apply -f -apiVersion: networking.istio.io/v1alpha3kind: Gatewaymetadata:name: prometheus-gatewaynamespace: istio-systemspec:selector:istio: ingressgatewayservers:- port:number: 15030name: https-promprotocol: HTTPStls:mode: SIMPLEserverCertificate: sdsprivateKey: sdscredentialName: telemetry-gw-certhosts:- "$TELEMETRY_DOMAIN"---apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata:name: prometheus-vsnamespace: istio-systemspec:hosts:- "$TELEMETRY_DOMAIN"gateways:- prometheus-gatewayhttp:- match:- port: 15030route:- destination:host: prometheusport:number: 9090---apiVersion: networking.istio.io/v1alpha3kind: DestinationRulemetadata:name: prometheusnamespace: istio-systemspec:host: prometheustrafficPolicy:tls:mode: DISABLE---EOFgateway.networking.istio.io "prometheus-gateway" configuredvirtualservice.networking.istio.io "prometheus-vs" configureddestinationrule.networking.istio.io "prometheus" configured
- Apply the following configuration to expose the tracing service:
$ cat <<EOF | kubectl apply -f -apiVersion: networking.istio.io/v1alpha3kind: Gatewaymetadata:name: tracing-gatewaynamespace: istio-systemspec:selector:istio: ingressgatewayservers:- port:number: 15032name: https-tracingprotocol: HTTPStls:mode: SIMPLEserverCertificate: sdsprivateKey: sdscredentialName: telemetry-gw-certhosts:- "$TELEMETRY_DOMAIN"---apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata:name: tracing-vsnamespace: istio-systemspec:hosts:- "$TELEMETRY_DOMAIN"gateways:- tracing-gatewayhttp:- match:- port: 15032route:- destination:host: tracingport:number: 80---apiVersion: networking.istio.io/v1alpha3kind: DestinationRulemetadata:name: tracingnamespace: istio-systemspec:host: tracingtrafficPolicy:tls:mode: DISABLE---EOFgateway.networking.istio.io "tracing-gateway" configuredvirtualservice.networking.istio.io "tracing-vs" configureddestinationrule.networking.istio.io "tracing" configured
Visit the telemetry addons via your browser.
- Kiali:
https://$TELEMETRY_DOMAIN:15029/ - Prometheus:
https://$TELEMETRY_DOMAIN:15030/ - Grafana:
https://$TELEMETRY_DOMAIN:15031/ - Tracing:
https://$TELEMETRY_DOMAIN:15032/
- Kiali:
Option 2: Insecure access (HTTP)
- Install Istio in your cluster with your desired telemetry addons.
To additionally install the telemetry addons, use the following installation options:
- Grafana:
—set values.grafana.enabled=true - Kiali:
—set values.kiali.enabled=true - Prometheus:
—set values.prometheus.enabled=true Tracing:
—set values.tracing.enabled=true- Apply networking configuration for the telemetry addons.
Apply the following configuration to expose Grafana:
$ cat <<EOF | kubectl apply -f -apiVersion: networking.istio.io/v1alpha3kind: Gatewaymetadata:name: grafana-gatewaynamespace: istio-systemspec:selector:istio: ingressgatewayservers:- port:number: 15031name: http-grafanaprotocol: HTTPhosts:- "*"---apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata:name: grafana-vsnamespace: istio-systemspec:hosts:- "*"gateways:- grafana-gatewayhttp:- match:- port: 15031route:- destination:host: grafanaport:number: 3000---apiVersion: networking.istio.io/v1alpha3kind: DestinationRulemetadata:name: grafananamespace: istio-systemspec:host: grafanatrafficPolicy:tls:mode: DISABLE---EOFgateway.networking.istio.io "grafana-gateway" configuredvirtualservice.networking.istio.io "grafana-vs" configureddestinationrule.networking.istio.io "grafana" configured
- Apply the following configuration to expose Kiali:
$ cat <<EOF | kubectl apply -f -apiVersion: networking.istio.io/v1alpha3kind: Gatewaymetadata:name: kiali-gatewaynamespace: istio-systemspec:selector:istio: ingressgatewayservers:- port:number: 15029name: http-kialiprotocol: HTTPhosts:- "*"---apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata:name: kiali-vsnamespace: istio-systemspec:hosts:- "*"gateways:- kiali-gatewayhttp:- match:- port: 15029route:- destination:host: kialiport:number: 20001---apiVersion: networking.istio.io/v1alpha3kind: DestinationRulemetadata:name: kialinamespace: istio-systemspec:host: kialitrafficPolicy:tls:mode: DISABLE---EOFgateway.networking.istio.io "kiali-gateway" configuredvirtualservice.networking.istio.io "kiali-vs" configureddestinationrule.networking.istio.io "kiali" configured
- Apply the following configuration to expose Prometheus:
$ cat <<EOF | kubectl apply -f -apiVersion: networking.istio.io/v1alpha3kind: Gatewaymetadata:name: prometheus-gatewaynamespace: istio-systemspec:selector:istio: ingressgatewayservers:- port:number: 15030name: http-promprotocol: HTTPhosts:- "*"---apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata:name: prometheus-vsnamespace: istio-systemspec:hosts:- "*"gateways:- prometheus-gatewayhttp:- match:- port: 15030route:- destination:host: prometheusport:number: 9090---apiVersion: networking.istio.io/v1alpha3kind: DestinationRulemetadata:name: prometheusnamespace: istio-systemspec:host: prometheustrafficPolicy:tls:mode: DISABLE---EOFgateway.networking.istio.io "prometheus-gateway" configuredvirtualservice.networking.istio.io "prometheus-vs" configureddestinationrule.networking.istio.io "prometheus" configured
- Apply the following configuration to expose the tracing service:
$ cat <<EOF | kubectl apply -f -apiVersion: networking.istio.io/v1alpha3kind: Gatewaymetadata:name: tracing-gatewaynamespace: istio-systemspec:selector:istio: ingressgatewayservers:- port:number: 15032name: http-tracingprotocol: HTTPhosts:- "*"---apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata:name: tracing-vsnamespace: istio-systemspec:hosts:- "*"gateways:- tracing-gatewayhttp:- match:- port: 15032route:- destination:host: tracingport:number: 80---apiVersion: networking.istio.io/v1alpha3kind: DestinationRulemetadata:name: tracingnamespace: istio-systemspec:host: tracingtrafficPolicy:tls:mode: DISABLE---EOFgateway.networking.istio.io "tracing-gateway" configuredvirtualservice.networking.istio.io "tracing-vs" configureddestinationrule.networking.istio.io "tracing" configured
Visit the telemetry addons via your browser.
- Kiali:
http://<IP ADDRESS OF CLUSTER INGRESS>:15029/ - Prometheus:
http://<IP ADDRESS OF CLUSTER INGRESS>:15030/ - Grafana:
http://<IP ADDRESS OF CLUSTER INGRESS>:15031/ - Tracing:
http://<IP ADDRESS OF CLUSTER INGRESS>:15032/
- Kiali:
Cleanup
- Remove all related Gateways:
$ kubectl -n istio-system delete gateway grafana-gateway kiali-gateway prometheus-gateway tracing-gatewaygateway.networking.istio.io "grafana-gateway" deletedgateway.networking.istio.io "kiali-gateway" deletedgateway.networking.istio.io "prometheus-gateway" deletedgateway.networking.istio.io "tracing-gateway" deleted
- Remove all related Virtual Services:
$ kubectl -n istio-system delete virtualservice grafana-vs kiali-vs prometheus-vs tracing-vsvirtualservice.networking.istio.io "grafana-vs" deletedvirtualservice.networking.istio.io "kiali-vs" deletedvirtualservice.networking.istio.io "prometheus-vs" deletedvirtualservice.networking.istio.io "tracing-vs" deleted
- If installed, remove the gateway certificate:
$ kubectl -n istio-system delete certificate telemetry-gw-certcertificate.certmanager.k8s.io "telemetry-gw-cert" deleted
相关内容
Jaeger
了解如何配置代理以向 Jaeger 发送追踪请求。
Zipkin
Learn how to configure the proxies to send tracing requests to Zipkin.
LightStep
How to configure the proxies to send tracing requests to LightStep.
Overview
Overview of distributed tracing in Istio.
Multi-mesh deployments for isolation and boundary protection
Deploy environments that require isolation into separate meshes and enable inter-mesh communication by mesh federation.
Secure Control of Egress Traffic in Istio, part 3
Comparison of alternative solutions to control egress traffic including performance considerations.
