ibm-istio
by Helm
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:
| Subchart | Component | Description | Enabled by Default |
|---|---|---|---|
| gateways | Gateways | A platform independent Gateway model for ingress & egress proxies that works across Kubernetes and Cloud Foundry and works seamlessly with routing. | Yes |
| sidecarInjectorWebhook | Automatic Sidecar Injector | A mutating webhook implementation to automatically inject an envoy sidecar container into application pods. | Yes |
| galley | Galley | The 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 |
| mixer | Mixer | A 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 |
| pilot | Pilot | A component responsible for configuring the proxies at runtime. | Yes |
| security | Citadel | A centralized component responsible for certificate issuance and rotation. | Yes |
| istiocoredns | istio-coredns-plugin | A CoreDNS gRPC plugin to serve DNS records out of Istio ServiceEntries. | No |
| nodeagent | NodeAgent | A per-node component responsible for certificate issuance and rotation. | No |
| istiocni | Istio-CNI | A component that sets up the pods' networking to fulfill this requirement in place of the Istio injected pod initContainers approach. | No |
| grafana | Grafana | A visualization tool for monitoring and metric analytics & dashboards for Istio | No |
| prometheus | Prometheus | A 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 |
| tracing | Jaeger or Zipkin | Istio uses Jaeger or Zipkin as a tracing provider that is used for monitoring and troubleshooting Istio service mesh. | No |
| kiali | Kiali | Kiali works with Istio to visualise the service mesh topology, features like circuit breakers or request rates. | No |
| certmanager | CertManager | An 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
- Custom PodSecurityPolicy definition:
-
The cluster admin can either paste the above
PSPandClusterRole&ClusterRoleBindingdefinitions 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-adminClusterRole 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
admissionregistrationAPI is required, and thekube-apiserverprocess must have theadmission-controlflag set with theMutatingAdmissionWebhookandValidatingAdmissionWebhookadmission 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
-
Important: If your helm version is < 2.10, which doesn't support
crd-installhook, then you need to manually install Istio’s CRDs viakubectl applybefore deploying theibm-istiochart; After all Istio’s CRDs are committed in the kube-apiserver, you have to add--set global.crds=falseparameter tohelm install ...command line(or if you're installingibm-istiofromCatalog, uncheck thecrdscheckbox in global section) when you deploy theibm-istiochart. 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.yamlor 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.yamlNote: 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.yamlor 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 -
Create namespace
istio-systemfor the chart:$ kubectl create ns istio-system -
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-systemCreate 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 -
If you are enabling
kiali, you also need to create the secret that contains the username and passphrase forkialidashboard:$ 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 -
To install the chart with the release name
istioin namespaceistio-system:- With automatic sidecar injection (requires Kubernetes >=1.9.0):
$ 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
-
Important: There is a know issue that
crd-installhook isn't working during upgrading. For now, if you want to upgradeibm-istiochart 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.yamlor 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.yamlNote: 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.yamlor 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 -
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 -
Create new values file named
values-override.yamlthat contains all the customized fields for new chart released, eg. if you want to deploy all istio components to management node and enablekiali, 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 -
Upgrade the istio chart with
--forceflag:helm upgrade istio ../ibm-istio --namespace istio-system --force -f values-old.yaml -f values-override.yaml
Note: Adding
--dry-runand--debugflags tohelm upgradebefore 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-runand--debugflags.
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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartibm-istio is pinned at v1.2.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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