ibm-istio

by Helm

Helm chartv1.2.2App 1.2.2Apache-2.0

Helm chart for all istio components

About this chart

Istio

Istio is an open platform for providing a uniform way to integrate microservices, manage traffic flow across microservices, enforce policies and aggregate telemetry data.

Introduction

This chart bootstraps all istio components deployment on a Kubernetes cluster using the Helm package manager.

Chart Details

This chart can install multiple istio components as subcharts:

SubchartComponentDescriptionEnabled by Default
gatewaysGatewaysA platform independent Gateway model for ingress & egress proxies that works across Kubernetes and Cloud Foundry and works seamlessly with routing.Yes
sidecarInjectorWebhookAutomatic Sidecar InjectorA mutating webhook implementation to automatically inject an envoy sidecar container into application pods.Yes
galleyGalleyThe top-level config ingestion, processing and distribution component for Istio, responsible for insulating the rest of the Istio components from the details of obtaining user configuration from the underlying platform.Yes
mixerMixerA centralized component that is leveraged by the proxies and microservices to enforce policies such as authorization, rate limits, quotas, authentication, request tracing and telemetry collection.Yes
pilotPilotA component responsible for configuring the proxies at runtime.Yes
securityCitadelA centralized component responsible for certificate issuance and rotation.Yes
istiocorednsistio-coredns-pluginA CoreDNS gRPC plugin to serve DNS records out of Istio ServiceEntries.No
nodeagentNodeAgentA per-node component responsible for certificate issuance and rotation.No
istiocniIstio-CNIA component that sets up the pods' networking to fulfill this requirement in place of the Istio injected pod initContainers approach.No
grafanaGrafanaA visualization tool for monitoring and metric analytics & dashboards for IstioNo
prometheusPrometheusA service monitoring system for Istio that collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if some condition is observed to be true.No
tracingJaeger or ZipkinIstio uses Jaeger or Zipkin as a tracing provider that is used for monitoring and troubleshooting Istio service mesh.No
kialiKialiKiali works with Istio to visualise the service mesh topology, features like circuit breakers or request rates.No
certmanagerCertManagerAn Istio add-on to automate the management and issuance of TLS certificates from various issuing sources.No

To enable or disable each component, change the corresponding enabled flag.

PodSecurityPolicy Requirements

When installing on 3.1.1 or later

This chart requires a PodSecurityPolicy to be bound to the target namespace(istio-system) prior to installation. To meet this requirement there may be cluster scoped as well as namespace scoped pre and post actions that need to occur.

The predefined PodSecurityPolicy name: ibm-privileged-psp has been verified for this chart, if your target namespace(istio-system) is bound to this PodSecurityPolicy you can proceed to install the chart.

This chart also defines a custom PodSecurityPolicy which can be used to finely control the permissions/capabilities needed to deploy this chart. You can enable this custom PodSecurityPolicy using the ICP user interface.

  • From the user interface, you can copy and paste the following snippets to enable the custom PodSecurityPolicy

    • Custom PodSecurityPolicy definition:
      apiVersion: extensions/v1beta1
      kind: PodSecurityPolicy
      metadata:
        name: ibm-istio-psp
      spec:
        allowPrivilegeEscalation: true
        allowedCapabilities:
        - '*'
        allowedUnsafeSysctls:
        - '*'
        fsGroup:
          rule: RunAsAny
        hostIPC: true
        hostNetwork: true
        hostPID: true
        hostPorts:
        - max: 65535
          min: 0
        privileged: true
        runAsUser:
          rule: RunAsAny
        seLinux:
          rule: RunAsAny
        supplementalGroups:
          rule: RunAsAny
        volumes:
        - '*'
      
    • Custom ClusterRole and ClusterRoleBinding for the custom PodSecurityPolicy:
      apiVersion: rbac.authorization.k8s.io/v1
      kind: ClusterRole
      metadata:
        name: ibm-istio-clusterrole
      rules:
      - apiGroups:
        - extensions
        resourceNames:
        - ibm-istio-psp
        resources:
        - podsecuritypolicies
        verbs:
        - use
      ---
      apiVersion: rbac.authorization.k8s.io/v1
      kind: ClusterRoleBinding
      metadata:
        name: ibm-istio-clusterrolebinding
      roleRef:
        kind: ClusterRole
        name: ibm-istio-clusterrole
        apiGroup: rbac.authorization.k8s.io
      subjects:      
      - kind: Group
        name: system:serviceaccounts:istio-system
        apiGroup: rbac.authorization.k8s.io
      
  • The cluster admin can either paste the above PSP and ClusterRole & ClusterRoleBinding definitions into the create resource screen in the UI or run the following two commands:

    kubectl create -f <PSP-yaml-file>
    kubectl create clusterrole ibm-istio-clusterrole \
        --verb=use \
        --resource=podsecuritypolicy \
        --resource-name=ibm-istio-psp
    kubectl create clusterrolebinding ibm-istio-clusterrolebinding \
      --clusterrole=ibm-istio-clusterrole \
      --group=system:serviceaccounts:istio-system
    

Prerequisites

  • A user with cluster-admin ClusterRole is required to install the chart.
  • Kubernetes 1.9 or newer cluster with RBAC (Role-Based Access Control) enabled is required.
  • To enable automatic sidecar injection, Kubernetes 1.9+ with admissionregistration API is required, and the kube-apiserver process must have the admission-control flag set with the MutatingAdmissionWebhook and ValidatingAdmissionWebhook admission controllers added and listed in the correct order.

Resources Required

The chart deploys pods that consume minimum resources as specified in the resources configuration parameter.

Installing the Chart

  1. Important: If your helm version is < 2.10, which doesn't support crd-install hook, then you need to manually install Istio’s CRDs via kubectl apply before deploying the ibm-istio chart; After all Istio’s CRDs are committed in the kube-apiserver, you have to add --set global.crds=false parameter to helm install ... command line(or if you're installing ibm-istio from Catalog, uncheck the crds checkbox in global section) when you deploy the ibm-istio chart. To manually install Istio’s CRDs, you can execute the following commands:

    $ kubectl apply -f https://raw.githubusercontent.com/IBM/charts/master/stable/ibm-istio/additionalFiles/crds/crd-10.yaml
    $ kubectl apply -f https://raw.githubusercontent.com/IBM/charts/master/stable/ibm-istio/additionalFiles/crds/crd-11.yaml
    

    or if you have downloaded the chart locally:

    $ kubectl apply -f ../ibm-istio/additionalFiles/crds/crd-10.yaml
    $ kubectl apply -f ../ibm-istio/additionalFiles/crds/crd-11.yaml
    

    Note: If you are enabling certmanager, you also need to install its CRDs and wait a few seconds for the CRDs to be committed in the kube-apiserver:

    $ kubectl apply -f https://raw.githubusercontent.com/IBM/charts/master/stable/ibm-istio/additionalFiles/crds/crd-certmanager-10.yaml
    $ kubectl apply -f https://raw.githubusercontent.com/IBM/charts/master/stable/ibm-istio/additionalFiles/crds/crd-certmanager-11.yaml
    

    or if you have downloaded the chart locally:

    $ kubectl apply -f ../ibm-istio/additionalFiles/crds/crd-certmanager-10.yaml
    $ kubectl apply -f ../ibm-istio/additionalFiles/crds/crd-certmanager-11.yaml
    
  2. Create namespace istio-system for the chart:

    $ kubectl create ns istio-system
    
  3. If you are using security mode for Grafana, create the secret first as follows: Encode username, you can change the username to the name as you want:

    $ echo -n 'admin' | base64
    YWRtaW4=
    

    Encode passphrase, you can change the passphrase to the passphrase as you want:

    $ echo -n 'admin' | base64
    YWRtaW4=
    

    Set the namespace where Istio was installed:

    $ NAMESPACE=istio-system
    

    Create secret for Grafana:

    $ cat <<EOF | kubectl apply -f -
    apiVersion: v1
    kind: Secret
    metadata:
      name: grafana
      namespace: $NAMESPACE
      labels:
        app: grafana
    type: Opaque
    data:
      username: YWRtaW4=
      passphrase: YWRtaW4=
    EOF
    
  4. If you are enabling kiali, you also need to create the secret that contains the username and passphrase for kiali dashboard:

    $ echo -n 'admin' | base64
    YWRtaW4=
    $ echo -n 'admin' | base64
    YWRtaW4=
    $ NAMESPACE=istio-system
    $ cat <<EOF | kubectl apply -f -
    apiVersion: v1
    kind: Secret
    metadata:
      name: kiali
      namespace: $NAMESPACE
      labels:
        app: kiali
    type: Opaque
    data:
      username: YWRtaW4=
      passphrase: YWRtaW4=
    EOF
    
  5. To install the chart with the release name istio in namespace istio-system:

    $ helm install ../ibm-istio --name istio --namespace istio-system
    
    • Without the sidecar injection webhook:
    $ helm install ../ibm-istio --name istio --namespace istio-system --set sidecarInjectorWebhook.enabled=false
    

Upgrading the Chart

  1. Important: There is a know issue that crd-install hook isn't working during upgrading. For now, if you want to upgrade ibm-istio chart to current version, you need to manually apply all the CRDs before upgrading with the following commmands:

    $ kubectl apply -f https://raw.githubusercontent.com/IBM/charts/master/stable/ibm-istio/additionalFiles/crds/crd-10.yaml
    $ kubectl apply -f https://raw.githubusercontent.com/IBM/charts/master/stable/ibm-istio/additionalFiles/crds/crd-11.yaml
    

    or if you have downloaded the chart locally:

    $ kubectl apply -f ../ibm-istio/additionalFiles/crds/crd-10.yaml
    $ kubectl apply -f ../ibm-istio/additionalFiles/crds/crd-11.yaml
    

    Note: If you are enabling certmanager, you also need to install its CRDs and wait a few seconds for the CRDs to be committed in the kube-apiserver:

    $ kubectl apply -f https://raw.githubusercontent.com/IBM/charts/master/stable/ibm-istio/additionalFiles/crds/crd-certmanager-10.yaml
    $ kubectl apply -f https://raw.githubusercontent.com/IBM/charts/master/stable/ibm-istio/additionalFiles/crds/crd-certmanager-11.yaml
    

    or if you have downloaded the chart locally:

    $ kubectl apply -f ../ibm-istio/additionalFiles/crds/crd-certmanager-10.yaml
    $ kubectl apply -f ../ibm-istio/additionalFiles/crds/crd-certmanager-11.yaml
    
  2. Get the external values for old chart release and write them to a local file named values-old.yaml:

    helm get values istio > values-old.yaml
    
  3. Create new values file named values-override.yaml that contains all the customized fields for new chart released, eg. if you want to deploy all istio components to management node and enable kiali, then execute the following commands:

    cat > values-override.yaml <<EOF
    global:
      defaultTolerations:
      - key: "dedicated"
        operator: "Exists"
        effect: "NoSchedule"
      - key: "CriticalAddonsOnly"
        operator: "Exists"
      defaultNodeSelector:
        management: "true"
    kiali:
      enabled: true
    EOF
    
  4. Upgrade the istio chart with --force flag:

    helm upgrade istio ../ibm-istio --namespace istio-system --force -f values-old.yaml -f values-override.yaml
    

Note: Adding --dry-run and --debug flags to helm upgrade before upgrading the istio chart is helpful to troubleshooting. eg. helm upgrade istio ../ibm-istio --namespace istio-system --force -f values-old.yaml -f values-override.yaml --dry-run --debug, if no error in the output, you can remove --dry-run and --debug flags.

Helm manages all the resources in chart templates based on each chart release, so once the upgrade/installation fails, you need to delete the chart release and clean all the revelant resources before proceeding to next helm upgrade/installation. For istio chart, you can execute the following commands to completely clean the chart release and resources:

helm delete istio --purge --no-hooks
kubectl delete clusterrole $(kubectl get clusterrole | grep istio | awk '{print $1}')
kubectl delete clusterrolebinding $(kubectl get clusterrolebinding | grep istio | awk '{print $1}')
kubectl delete crd $(kubectl get crds | grep istio.io | awk '{print $1}')

Configuration

The Helm chart ships with reasonable defaults. There may be circumstances in which defaults require overrides. To override Helm values, use --set key=value argument during the helm install command. Multiple --set operations may be used in the same Helm operation.

Helm charts expose configuration options which are currently in alpha. The currentl

Deploy ibm-istio with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ibm-istio on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartibm-istio is pinned at v1.2.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply