Skip to content

Commit c2130f3

Browse files
committed
chore: re-organize values and adding examples
- re-organize values - adding test - adding examples
1 parent 2bef4f5 commit c2130f3

14 files changed

+658
-114
lines changed

charts/meowhq-istio/README.md

Lines changed: 61 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,64 @@ Helm Chart for installing and configuring Istio Base and Istiod with Istio offic
77
- `istio/base`: Istio base chart which contains cluster-wide Custom Resource Definitions (CRDs) which must be installed prior to the deployment of the Istio control plane
88
- `istio/istiod`: Istio discovery chart which deploys the istiod service
99

10-
## Multicluster Config Example
11-
12-
### Multi-Primary
13-
14-
It follows the installation instruction:
15-
16-
- [Install Multi-Primary](https://istio.io/latest/docs/setup/install/multicluster/multi-primary/)
17-
- [Install Multi-Primary on different networks](https://istio.io/latest/docs/setup/install/multicluster/multi-primary_multi-network/)
18-
19-
Helm values example:
20-
21-
```yaml
22-
# =============================================================================
23-
# istiod Helm Chart configuration
24-
# =============================================================================
25-
istiod:
26-
global:
27-
meshID: "meowhq-lab-mesh"
28-
network: "meowhq-lab"
29-
multiCluster:
30-
enabled: true
31-
clusterName: "meowhq"
32-
```
33-
34-
### Primary-Remote
35-
36-
It follows the installation instruction:
37-
38-
- [Install Primary-Remote](https://istio.io/latest/docs/setup/install/multicluster/primary-remote/)
39-
- [Install Primary-Remote on different networks](https://istio.io/latest/docs/setup/install/multicluster/primary-remote_multi-network/)
40-
41-
Helm values example:
42-
43-
```yaml
44-
# =============================================================================
45-
# istiod Helm Chart configuration
46-
# =============================================================================
47-
istiod:
48-
global:
49-
meshID: "meowhq-lab-mesh"
50-
network: "meowhq-lab"
51-
externalIstiod: true # when expose istiod to external - primary-remote setup
52-
multiCluster:
53-
enabled: true
54-
clusterName: "meowhq"
55-
```
10+
## Configuration Values
11+
12+
please see [examples](examples/README.md) for more about usage and examples of values.
13+
14+
### Global Settings
15+
16+
Shared global settings for both istio base and istiod subchart.
17+
18+
- `global.istioNamespace` - Namespace where Istio components will be installed (default: istio-system). it is shared global value for both istio base and istiod subchart
19+
- `global.imagePullSecrets` - Image pull secrets for accessing container registry (default: artifactory-registry). it is shared global value for both istio base and istiod subchart
20+
21+
### Istio Base Settings
22+
23+
For more detail: <https://github.com/istio/istio/blob/master/manifests/charts/base/values.yaml>
24+
25+
- `base.enabled` - Enable installation of Istio base chart (default: true)
26+
- `base.profile` - istio profile to be applied (default: not defined). set `remote` for Remote cluster for Primary-Remote multicluster setup
27+
- `base.defaultRevision` - Default revision for Istio installation (default: default)
28+
29+
### Istiod Settings
30+
31+
For more details: <https://github.com/istio/istio/blob/master/manifests/charts/istio-control/istio-discovery/values.yaml>
32+
33+
#### Global Istiod Configuration
34+
35+
- `istiod.enabled` - Enable installation of Istiod component (default: true)
36+
- `istiod.profile` - istio profile to be applied (default: not defined). set `remote` for Remote cluster for Primary-Remote multicluster setup
37+
- `istiod.global.configValidation` - Enable config validation (default: true)
38+
- `istiod.global.priorityClass` - Priority class for Istiod pods (default: infra-critical)
39+
- `istiod.global.caAddress` - CA address for istio-csr integration (default: "") this is for cert-manager-istio-csr integration.
40+
41+
#### Multicluster Configuration
42+
43+
- `istiod.global.meshID` - Mesh ID for multicluster setup (default: ""). no meshID required for Remote cluster. the `remote` profile will ignore in anyways.
44+
- `istiod.global.network` - Network name for multicluster setup (default: "")
45+
- `istiod.global.multiCluster.enabled` - Enable multicluster setup (default: false)
46+
- `istiod.global.multiCluster.clusterName` - Name of the cluster in multicluster setup (default: "")
47+
- `istiod.global.externalIstiod` - Enable control of remote clusters (default: false)
48+
- `istiod.global.configCluster` - Configure as remote cluster for external istiod (default: false)
49+
50+
#### Proxy Configuration
51+
52+
- `istiod.global.proxy.logLevel` - Log level for sidecars (default: info)
53+
- `istiod.global.proxy.resources.requests.cpu` - CPU requests for sidecar (default: 100m)
54+
- `istiod.global.proxy.resources.requests.memory` - Memory requests for sidecar (default: 64Mi)
55+
- `istiod.global.proxy.resources.limits.cpu` - CPU limits for sidecar (default: 200m)
56+
- `istiod.global.proxy.resources.limits.memory` - Memory limits for sidecar (default: 128Mi)
57+
58+
#### Mesh Configuration
59+
60+
- `istiod.meshConfig.accessLogFile` - Access log file path (default: /dev/stdout)
61+
- `istiod.meshConfig.enableTracing` - Enable distributed tracing (default: true)
62+
- `istiod.meshConfig.defaultConfig.holdApplicationUntilProxyStarts` - Hold app start until proxy ready (default: true)
63+
64+
#### Pilot Configuration
65+
66+
- `istiod.pilot.autoscaleEnabled` - Enable autoscaling for istiod (default: true)
67+
- `istiod.pilot.autoscaleMin` - Minimum replicas for istiod (default: 2)
68+
- `istiod.pilot.cni.enabled` - Enable CNI plugin (default: true)
69+
- `istiod.pilot.resources.requests.cpu` - CPU requests for istiod (default: 10m)
70+
- `istiod.pilot.resources.requests.memory` - Memory requests for istiod (default: 100Mi)
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Examples
2+
3+
## normal installation
4+
5+
just install with default values for normal and non-multicluster configuration.
6+
7+
## use another priority class
8+
9+
values.yaml:
10+
11+
```yaml
12+
istiod:
13+
global:
14+
priorityClass: something-else
15+
```
16+
17+
following also works:
18+
19+
```yaml
20+
global:
21+
priorityClass: something-else
22+
```
23+
24+
## Multicluster example
25+
26+
prerequisites of following example:
27+
28+
- `cert-manager-istio-csr` chart installed
29+
- Vault PKI engine is integrated
30+
31+
### Multi-Primary on different networks example
32+
33+
> ref: <https://istio.io/latest/docs/setup/install/multicluster/multi-primary_multi-network/>
34+
35+
values.yaml: in all clusters in the mesh cluster
36+
37+
```yaml
38+
istiod:
39+
global:
40+
caAddress: "cert-manager-istio-csr.istio-system.svc:443"
41+
meshID: "mesh1"
42+
network: "network1"
43+
multiCluster:
44+
enabled: true
45+
clusterName: "cluster1"
46+
pilot:
47+
env:
48+
ENABLE_CA_SERVER: false
49+
```
50+
51+
### Primary-Remote on different networks example
52+
53+
Primary-Remote consists of Primary and Remote clusters, and the configuration is slightly different between them.
54+
55+
> ⚠️ INFO:
56+
>
57+
> - ensure the Istio cross-network gateway is configured for each primary / remote cluster
58+
> - some manual configuration may be required to set label/annotation to istio-system namespace
59+
>
60+
> ref: <https://istio.io/latest/docs/setup/install/multicluster/primary-remote_multi-network/>
61+
62+
#### Primary
63+
64+
> ref: <https://istio.io/latest/docs/setup/install/multicluster/primary-remote_multi-network/#configure-cluster1-as-a-primary>
65+
66+
values.yaml:
67+
68+
```yaml
69+
istiod:
70+
global:
71+
caAddress: "cert-manager-istio-csr.istio-system.svc:443"
72+
meshID: "mesh1"
73+
network: "network1"
74+
multiCluster:
75+
enabled: true
76+
clusterName: "cluster1"
77+
externalIstiod: true
78+
pilot:
79+
env:
80+
ENABLE_CA_SERVER: false
81+
```
82+
83+
#### Remote
84+
85+
> ref: <https://istio.io/latest/docs/setup/install/multicluster/primary-remote_multi-network/#configure-cluster2-as-a-remote>
86+
87+
values.yaml:
88+
89+
> ⚠️ INFO:
90+
>
91+
> - no meshID for Remote cluster
92+
93+
```yaml
94+
base:
95+
profile: remote
96+
istiod:
97+
profile: remote
98+
global:
99+
caAddress: "cert-manager-istio-csr.istio-system.svc:443"
100+
network: "network2"
101+
multiCluster:
102+
enabled: true
103+
clusterName: "cluster2"
104+
configCluster: true
105+
remotePilotAddress: 192.168.10.20 # loadbalancer ip of primary cluster cross-network-gateway svc
106+
istiodRemote:
107+
injectionPath: /inject/cluster/cluster1/net/network1
108+
pilot:
109+
env:
110+
ENABLE_CA_SERVER: false
111+
```
112+
113+
you can get loadbalancer ip of primary cluster:
114+
115+
```bash
116+
# ensure you are in primary cluster context
117+
kubectl -n istio-system get svc istio-cross-network-gateway \
118+
-o jsonpath='{.status.loadBalancer.ingress[0].ip}'
119+
```

charts/meowhq-istio/templates/multicluster/istio-reader-sa-remote-token.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ kind: Secret
1010
type: kubernetes.io/service-account-token
1111
metadata:
1212
name: istio-reader-service-account-istio-remote-secret-token
13-
namespace: {{ .Release.Namespace }}
13+
namespace: {{ .Values.global.istioNamespace }}
1414
annotations:
1515
kubernetes.io/service-account.name: istio-reader-service-account
1616
{{- end }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
suite: istiod test with default values
2+
templates:
3+
- charts/* # this includes all the templates in the subchart
4+
release:
5+
name: "istio"
6+
namespace: "istio-system"
7+
tests:
8+
- it: should render deployment with default values
9+
template: charts/istiod/templates/deployment.yaml
10+
asserts:
11+
- containsDocument:
12+
apiVersion: apps/v1
13+
kind: Deployment
14+
name: istiod
15+
namespace: istio-system
16+
- equal:
17+
path: spec.template.spec.containers[?(@.name == "discovery")].env[?(@.name == "CLUSTER_ID")].value
18+
value: "Kubernetes"
19+
- notExists:
20+
path: spec.template.spec.containers[?(@.name == "discovery")].env[?(@.name == "ENABLE_CA_SERVER")]
Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,40 @@
11
suite: test istio-reader-sa-remote-token template
22
templates:
33
- multicluster/istio-reader-sa-remote-token.yaml
4-
release:
5-
namespace: istio-system
6-
values:
7-
- values/multicluster-values.yaml
4+
set:
5+
istiod.global.multiCluster.enabled: true
6+
global.istioNamespace: istio-system
7+
88
tests:
9-
- it: should render secret
9+
- it: should render metadata.name and namespace with the correct value
1010
asserts:
11-
- containsDocument:
12-
apiVersion: v1
13-
kind: Secret
14-
name: istio-reader-service-account-istio-remote-secret-token
15-
namespace: istio-system
16-
- isSubset:
17-
path: metadata.annotations
18-
content:
19-
kubernetes.io/service-account.name: istio-reader-service-account
11+
- equal:
12+
path: metadata.name
13+
value: "istio-reader-service-account-istio-remote-secret-token"
14+
- equal:
15+
path: metadata.namespace
16+
value: "istio-system"
17+
18+
- it: should render the apiVersion with the correct value
19+
asserts:
20+
- equal:
21+
path: apiVersion
22+
value: "v1"
23+
24+
- it: should render the kind with the correct value
25+
asserts:
26+
- equal:
27+
path: kind
28+
value: "Secret"
29+
30+
- it: should render the correct type for the Secret
31+
asserts:
32+
- equal:
33+
path: type
34+
value: "kubernetes.io/service-account-token"
35+
36+
- it: should render the correct service account annotation if present
37+
asserts:
38+
- equal:
39+
path: metadata.annotations["kubernetes.io/service-account.name"]
40+
value: "istio-reader-service-account"

0 commit comments

Comments
 (0)