Skip to content

Commit fd5fad0

Browse files
authored
Merge branch 'main' into update-istio-charts-1.26.4+2
2 parents ddf28d3 + 3196a23 commit fd5fad0

File tree

442 files changed

+58613
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

442 files changed

+58613
-0
lines changed
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Istio Installer
2+
3+
Note: If making any changes to the charts or values.yaml in this dir, first read [UPDATING-CHARTS.md](UPDATING-CHARTS.md)
4+
5+
Istio installer is a modular, 'a-la-carte' installer for Istio. It is based on a
6+
fork of the Istio helm templates, refactored to increase modularity and isolation.
7+
8+
Goals:
9+
- Improve upgrade experience: users should be able to gradually roll upgrades, with proper
10+
canary deployments for Istio components. It should be possible to deploy a new version while keeping the
11+
stable version in place and gradually migrate apps to the new version.
12+
13+
- More flexibility: the new installer allows multiple 'environments', allowing applications to select
14+
a set of control plane settings and components. While the entire mesh respects the same APIs and config,
15+
apps may target different 'environments' which contain different instances and variants of Istio.
16+
17+
- Better security: separate Istio components reside in different namespaces, allowing different teams or
18+
roles to manage different parts of Istio. For example, a security team would maintain the
19+
root CA and policy, a telemetry team may only have access to Prometheus,
20+
and a different team may maintain the control plane components (which are highly security sensitive).
21+
22+
The install is organized in 'environments' - each environment consists of a set of components
23+
in different namespaces that are configured to work together. Regardless of 'environment',
24+
workloads can talk with each other and obey the Istio configuration resources, but each environment
25+
can use different Istio versions and different configuration defaults.
26+
27+
`istioctl kube-inject` or the automatic sidecar injector are used to select the environment.
28+
In the case of the sidecar injector, the namespace label `istio-env: <NAME_OF_ENV>` is used instead
29+
of the conventional `istio-injected: true`. The name of the environment is defined as the namespace
30+
where the corresponding control plane components (config, discovery, auto-injection) are running.
31+
In the examples below, by default this is the `istio-control` namespace. Pod annotations can also
32+
be used to select a different 'environment'.
33+
34+
## Installing
35+
36+
The new installer is intended to be modular and very explicit about what is installed. It has
37+
far more steps than the Istio installer - but each step is smaller and focused on a specific
38+
feature, and can be performed by different people/teams at different times.
39+
40+
It is strongly recommended that different namespaces are used, with different service accounts.
41+
In particular access to the security-critical production components (root CA, policy, control)
42+
should be locked down and restricted. The new installer allows multiple instances of
43+
policy/control/telemetry - so testing/staging of new settings and versions can be performed
44+
by a different role than the prod version.
45+
46+
The intended users of this repo are users running Istio in production who want to select, tune
47+
and understand each binary that gets deployed, and select which combination to use.
48+
49+
Note: each component can be installed in parallel with an existing Istio 1.0 or 1.1 installation in
50+
`istio-system`. The new components will not interfere with existing apps, but can interoperate,
51+
and it is possible to gradually move apps from Istio 1.0/1.1 to the new environments and
52+
across environments ( for example canary -> prod )
53+
54+
Note: there are still some cluster roles that may need to be fixed, most likely cluster permissions
55+
will need to move to the security component.
56+
57+
## Everything is Optional
58+
59+
Each component in the new installer is optional. Users can install the component defined in the new installer,
60+
use the equivalent component in `istio-system`, configured with the official installer, or use a different
61+
version or implementation.
62+
63+
For example, you may use your own Prometheus and Grafana installs, or you may use a specialized/custom
64+
certificate provisioning tool, or use components that are centrally managed and running in a different cluster.
65+
66+
This is a work in progress - building on top of the multi-cluster installer.
67+
68+
As an extreme, the goal is to be possible to run Istio workloads in a cluster without installing any Istio component
69+
in that cluster. Currently, the minimum we require is the security provider (node agent or citadel).
70+
71+
### Install Istio CRDs
72+
73+
This is the first step of the installation. Please do not remove or edit any CRD - config currently requires
74+
all CRDs to be present. On each upgrade it is recommended to reapply the file, to make sure
75+
you get all CRDs. CRDs are separated by release and by component type in the CRD directory.
76+
77+
Istio has strong integration with certmanager. Some operators may want to keep their current certmanager
78+
CRDs in place and not have Istio modify them. In this case, it is necessary to apply CRD files individually.
79+
80+
```bash
81+
kubectl apply -k github.com/istio/installer/base
82+
```
83+
84+
or
85+
86+
```bash
87+
kubectl apply -f base/files
88+
```
89+
90+
### Install Istio-CNI
91+
92+
This is an optional step - CNI must run in a dedicated namespace, it is a 'singleton' and extremely
93+
security sensitive. Access to the CNI namespace must be highly restricted.
94+
95+
**NOTE:** The environment variable `ISTIO_CLUSTER_ISGKE` is assumed to be set to `true` if the cluster
96+
is a GKE cluster.
97+
98+
```bash
99+
ISTIO_CNI_ARGS=
100+
# TODO: What k8s data can we use for this check for whether GKE?
101+
if [[ "${ISTIO_CLUSTER_ISGKE}" == "true" ]]; then
102+
ISTIO_CNI_ARGS="--set cni.cniBinDir=/home/kubernetes/bin"
103+
fi
104+
iop kube-system istio-cni $IBASE/istio-cni/ ${ISTIO_CNI_ARGS}
105+
```
106+
107+
TODO. It is possible to add Istio-CNI later, and gradually migrate.
108+
109+
### Install Control plane
110+
111+
This can run in any cluster. A mesh should have at least one cluster should run Pilot or equivalent XDS server,
112+
and it is recommended to have Pilot running in each region and in multiple availability zones for multi cluster.
113+
114+
```bash
115+
iop istio-control istio-discovery $IBASE/istio-control/istio-discovery \
116+
--set global.istioNamespace=istio-system
117+
118+
# Second istio-discovery, using master version of istio
119+
TAG=latest HUB=gcr.io/istio-testing iop istio-master istio-discovery-master $IBASE/istio-control/istio-discovery \
120+
--set policy.enable=false \
121+
--set global.istioNamespace=istio-master
122+
```
123+
124+
### Gateways
125+
126+
A cluster may use multiple Gateways, each with a different load balancer IP, domains and certificates.
127+
128+
Since the domain certificates are stored in the gateway namespace, it is recommended to keep each
129+
gateway in a dedicated namespace and restrict access.
130+
131+
For large-scale gateways it is optionally possible to use a dedicated pilot in the gateway namespace.
132+
133+
### Additional test templates
134+
135+
A number of helm test setups are general-purpose and should be installable in any cluster, to confirm
136+
Istio works properly and allow testing the specific installation.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->
2+
# Table of Contents
3+
4+
- [Updating charts and values.yaml](#updating-charts-and-valuesyaml)
5+
- [Acceptable Pull Requests](#acceptable-pull-requests)
6+
- [Making changes](#making-changes)
7+
- [Value deprecation](#value-deprecation)
8+
9+
<!-- markdown-toc end -->
10+
11+
# Updating charts and values.yaml
12+
13+
## Acceptable Pull Requests
14+
15+
Helm charts `values.yaml` represent a complex user facing API that tends to grow uncontrollably over time
16+
due to design choices in Helm.
17+
The underlying Kubernetes resources we configure have 1000s of fields; given enough users and bespoke use cases,
18+
eventually someone will want to customize every one of those fields.
19+
If all fields are exposed in `values.yaml`, we end up with an massive API that is also likely worse than just using the Kubernetes API directly.
20+
21+
To avoid this, the project attempts to minimize additions to the `values.yaml` API where possible.
22+
23+
- Helm is for configuration that is expected to be set at install-time only. If the change is a dynamic runtime configuration, it probably belongs in the [MeshConfig API](https://github.com/istio/api/blob/master/mesh/v1alpha1/config.proto). This allows configuration without re-installing or restarting deployments.
24+
25+
- Adding new `global` values is discouraged as a general rule. The only exceptions are values that are frequently and consistently consumed across at least 2 charts (things like image tags, common labels, etc), but these would only be accepted on a strict case-by-case basis.
26+
27+
- If the change is to a Kubernetes field (such as modifying a Deployment attribute), it will likely need to be install-time configuration. However, that doesn't necessarily mean a PR to add a value will be accepted. The `values.yaml` API is intended to maintain a *minimal core set of configuration* that most users will use. For bespoke use cases, [Helm Chart Customization](https://istio.io/latest/docs/setup/additional-setup/customize-installation-helm/#advanced-helm-chart-customization) can be used to allow arbitrary customizations.
28+
29+
- Avoid exposing a single subkey of a multi-value field if it would be more flexible to expose the entire field as arbitrary YAML. If the change truly is generally purpose, it is generally preferred to have broader APIs. For example, instead of providing direct access to each of the complex fields in [affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/), just providing a single `affinity` field that is passed through as-is to the Kubernetes resource. This provides maximum flexibility with minimal API surface overhead.
30+
31+
- All value additions or removals are user-facing and must come with a release note.
32+
33+
- If you find yourself writing the same templating logic across several charts or needing to craft complex conditionals, consider using a shared Helm template for consistency rather than inlining.
34+
35+
## Making changes
36+
37+
### Step 1. Make changes in charts and values.yaml in `manifests` directory
38+
39+
Be sure to provide sufficient documentation and example usage in values.yaml.
40+
41+
- If the chart has a `values.schema.json`, that should be updated as well.
42+
43+
### Step 2. Update the istioctl/Operator values
44+
45+
If you are modifying the `gateway` chart, you can stop here.
46+
All other charts, however, are exposed by `istioctl` and need to follow the steps below.
47+
48+
- The charts in the `manifests` directory are used in istioctl to generate an installation manifest.
49+
50+
- If `values.yaml` is changed, be sure to update corresponding values changes in [../profiles/default.yaml](../profiles/default.yaml)
51+
52+
### Step 3. Update istioctl schema
53+
54+
Istioctl uses a [schema](../../operator/pkg/apis/values_types.proto) to validate the values. Any changes to
55+
the schema must be added here, otherwise istioctl users will see errors.
56+
Once the schema file is updated, run:
57+
58+
```bash
59+
$ make operator-proto
60+
```
61+
62+
This will regenerate the Go structs used for schema validation.
63+
64+
### Step 4. Update the generated manifests
65+
66+
Tests of istioctl use the auto-generated manifests to ensure that the istioctl binary has the correct version of the charts.
67+
68+
To regenerate the manifests, run:
69+
70+
```bash
71+
$ make copy-templates update-golden
72+
```
73+
74+
### Step 5. Create a PR using outputs from Steps 1 to 4
75+
76+
Your PR should pass all the checks if you followed these steps.
77+
78+
## Value deprecation
79+
80+
- Values may be marked as deprecated, but may not be removed until a minimum of 2 releases after the PR marking them as such is merged.
81+
82+
- If you are marking a value as `deprecated`, you must update [templates/NOTES.txt](https://github.com/istio/istio/blob/723d3210dd068dd44f4abe740042e18f3c9da3a6/manifests/charts/istio-control/istio-discovery/templates/NOTES.txt) of the affected charts at time of deprecation, so that users will be explicitly warned if they use deprecated values.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v2
2+
appVersion: 1.24.6-tetrate8
3+
description: Helm chart for deploying Istio cluster resources and CRDs
4+
icon: https://istio.io/latest/favicons/android-192x192.png
5+
keywords:
6+
- istio
7+
name: base
8+
sources:
9+
- https://github.com/istio/istio
10+
version: 1.24.6+tetrate8
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Istio base Helm Chart
2+
3+
This chart installs resources shared by all Istio revisions. This includes Istio CRDs.
4+
5+
## Setup Repo Info
6+
7+
```console
8+
helm repo add istio https://istio-release.storage.googleapis.com/charts
9+
helm repo update
10+
```
11+
12+
_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._
13+
14+
## Installing the Chart
15+
16+
To install the chart with the release name `istio-base`:
17+
18+
```console
19+
kubectl create namespace istio-system
20+
helm install istio-base istio/base -n istio-system
21+
```
22+
23+
### Profiles
24+
25+
Istio Helm charts have a concept of a `profile`, which is a bundled collection of value presets.
26+
These can be set with `--set profile=<profile>`.
27+
For example, the `demo` profile offers a preset configuration to try out Istio in a test environment, with additional features enabled and lowered resource requirements.
28+
29+
For consistency, the same profiles are used across each chart, even if they do not impact a given chart.
30+
31+
Explicitly set values have highest priority, then profile settings, then chart defaults.
32+
33+
As an implementation detail of profiles, the default values for the chart are all nested under `defaults`.
34+
When configuring the chart, you should not include this.
35+
That is, `--set some.field=true` should be passed, not `--set defaults.some.field=true`.

0 commit comments

Comments
 (0)