Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit f00a696

Browse files
authored
Enable more linters on this repo. (#392)
- Fix linter warnings.
1 parent ed02ef3 commit f00a696

File tree

9 files changed

+63
-102
lines changed

9 files changed

+63
-102
lines changed

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
export BUILD_WITH_CONTAINER ?= 0
3030

3131
ifeq ($(BUILD_WITH_CONTAINER),1)
32-
IMG = gcr.io/istio-testing/build-tools:2019-09-04T21-28-42
32+
IMG = gcr.io/istio-testing/build-tools:2019-09-11T09-52-48
3333
UID = $(shell id -u)
3434
PWD = $(shell pwd)
3535
GOBIN_SOURCE ?= $(GOPATH)/bin
@@ -74,7 +74,6 @@ RUN = docker run -t -i --sig-proxy=true -u $(UID) --rm \
7474
--mount type=bind,source="$(GOBIN_SOURCE)",destination="/go/out/bin" \
7575
-w /work $(IMG)
7676
else
77-
export GOBIN ?= ./out/bin
7877
RUN =
7978
endif
8079

Makefile.core.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ ${TOP}/bin/dep:
329329
lint:
330330
$(MAKE) kind-run TARGET="run-lint"
331331

332-
lint_modern: lint-go lint-pyhton lint-copyright-banner
332+
lint_modern: lint-go lint-pyhton lint-copyright-banner lint-markdown lint-protos
333333

334334
include test/install.mk
335335
include test/tests.mk

README.md

Lines changed: 41 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -76,40 +76,38 @@ The new installer recommends isolating components in different namespaces with d
7676
Recommended mode:
7777

7878
Singleton:
79+
7980
- `istio-system`: root CA and cert provisioning components.
8081
- `istio-cni`: optional CNI (avoids requiring root/netadmin from workload pods)
8182

8283
Multi-environment components:
84+
8385
- `istio-control`: config, discovery, auto-inject. All impact the generated config including enforcement of policies
8486
and secure naming.
8587
- `istio-telemetry`: mixer, kiali, tracing providers, grafana, prometheus. Custom install of prometheus, grafana can
8688
be used instead in dedicated namespaces.
8789
- `istio-policy`
88-
- `istio-gateways` - production domains should be in a separate namespace, to restrict access. It is possible to
90+
- `istio-gateways`: production domains should be in a separate namespace, to restrict access. It is possible to
8991
segregate gateways by the team that control access to the domain. Access to the gateway namespace provides access
9092
to certificates and control over domain delegation. The optional egress gateway provides control over outbound
9193
traffic.
9294

9395
In addition, it is recommended to have a second set of the multi-environment components to use
9496
for canary/testing new versions. In this doc we will use an environment based on the `istio-master` namespace:
97+
9598
- `istio-master`: config, discovery, etc
9699
- `istio-telemetry-master`
97100
- `istio-gateway-master`
98101
- `istio-policy-master`
99102
...
100103

101-
102-
# Installing
103-
104104
For each component, there are 2 styles of installing, using 'helm + tiller' or '`helm template` + `kubectl apply --prune`'.
105105

106106
Using `kubectl --prune` is recommended:
107107

108108
```bash
109-
110109
helm template --namespace $NAMESPACE -n $COMPONENT $CONFIGDIR -f global.yaml | \
111110
kubectl apply -n $NAMESPACE --prune -l release=$COMPONENT -f -
112-
113111
```
114112

115113
Using helm:
@@ -137,13 +135,13 @@ Istio has strong integration with certmanager. Some operators may want to keep
137135
CRDs in place and not have Istio modify them. In this case, it is necessary to apply CRD files individually.
138136

139137
```bash
140-
kubectl apply -k github.com/istio/installer/crds
138+
kubectl apply -k github.com/istio/installer/crds
141139
```
142140

143141
or
144142

145143
```bash
146-
kubectl apply -f crds/files
144+
kubectl apply -f crds/files
147145
```
148146

149147
## Install Security
@@ -198,36 +196,34 @@ Galley provides config access and validation. Only one environment should enable
198196
currently supported in multiple namespaces.
199197

200198
```bash
201-
iop istio-control istio-config $IBASE/istio-control/istio-config --set configValidation=true
199+
iop istio-control istio-config $IBASE/istio-control/istio-config --set configValidation=true
202200

203-
# Second Galley, using master version of istio
204-
TAG=master-latest-daily HUB=gcr.io/istio-release iop istio-master istio-config-master $IBASE/istio-control/istio-config
201+
# Second Galley, using master version of istio
202+
TAG=master-latest-daily HUB=gcr.io/istio-release iop istio-master istio-config-master $IBASE/istio-control/istio-config
205203
```
206204

207205
Other MCP providers can be used - currently the address and credentials need to match what galley is using.
208206

209207
Discovery, Policy and Telemetry components will need to be configured with the address of the config
210208
server - either in the local cluster or in a central cluster.
211209

212-
213210
### Discovery (Pilot)
214211

215212
This can run in any cluster. A mesh should have at least one cluster should run Pilot or equivalent XDS server,
216213
and it is recommended to have Pilot running in each region and in multiple availability zones for multi cluster.
217214

218215
```bash
219-
iop istio-control istio-discovery $IBASE/istio-control/istio-discovery \
220-
--set global.istioNamespace=istio-system \
221-
--set global.configNamespace=istio-control \
222-
--set global.telemetryNamespace=istio-telemetry \
223-
--set global.policyNamespace=istio-policy
224-
TAG=master-latest-daily HUB=gcr.io/istio-release iop istio-master istio-discovery-master $IBASE/istio-control/istio-discovery \
225-
--set policy.enable=false \
226-
--set global.istioNamespace=istio-master \
227-
--set global.configNamespace=istio-master \
228-
--set global.telemetryNamespace=istio-telemetry-master \
229-
--set global.policyNamespace=istio-policy-master
230-
216+
iop istio-control istio-discovery $IBASE/istio-control/istio-discovery \
217+
--set global.istioNamespace=istio-system \
218+
--set global.configNamespace=istio-control \
219+
--set global.telemetryNamespace=istio-telemetry \
220+
--set global.policyNamespace=istio-policy
221+
TAG=master-latest-daily HUB=gcr.io/istio-release iop istio-master istio-discovery-master $IBASE/istio-control/istio-discovery \
222+
--set policy.enable=false \
223+
--set global.istioNamespace=istio-master \
224+
--set global.configNamespace=istio-master \
225+
--set global.telemetryNamespace=istio-telemetry-master \
226+
--set global.policyNamespace=istio-policy-master
231227
```
232228

233229
### Auto-injection
@@ -243,17 +239,15 @@ If `istio-system` has set `enableNamespaceByDefault` you must set `istio-inject:
243239
istio-system from taking over. In this case, it is recommended to first install `istio-control` autoinject with
244240
the default disabled, test it, and move the default from `istio-system` to `istio-control`.
245241

246-
247242
```bash
248-
# ENABLE_CNI is set to true if istio-cni is installed
249-
iop istio-control istio-autoinject $IBASE/istio-control/istio-autoinject --set sidecarInjectorWebhook.enableNamespacesByDefault=true --set global.configNamespace=istio-control \
250-
--set istio_cni.enabled=${ENABLE_CNI}
251-
252-
# Second auto-inject using master version of istio
253-
# Notice the different options
254-
TAG=master-latest-daily HUB=gcr.io/istio-release iop istio-master istio-autoinject-master $IBASE/istio-control/istio-autoinject \
255-
--set global.configNamespace=istio-master
256-
243+
# ENABLE_CNI is set to true if istio-cni is installed
244+
iop istio-control istio-autoinject $IBASE/istio-control/istio-autoinject --set sidecarInjectorWebhook.enableNamespacesByDefault=true --set global.configNamespace=istio-control \
245+
--set istio_cni.enabled=${ENABLE_CNI}
246+
247+
# Second auto-inject using master version of istio
248+
# Notice the different options
249+
TAG=master-latest-daily HUB=gcr.io/istio-release iop istio-master istio-autoinject-master $IBASE/istio-control/istio-autoinject \
250+
--set global.configNamespace=istio-master
257251
```
258252

259253
## Gateways
@@ -265,7 +259,6 @@ gateway in a dedicated namespace and restrict access.
265259

266260
For large-scale gateways it is optionally possible to use a dedicated pilot in the gateway namespace.
267261

268-
269262
## K8S Ingress
270263

271264
To support K8S ingress we currently use a separate namespace. In Istio 1.1, this requires using a dedicated
@@ -275,42 +268,27 @@ Note that running a dedicated Pilot for ingress/gateways is supported and recomm
275268
but in the case of K8S ingress it is currently required.
276269

277270
```bash
278-
iop istio-ingress istio-ingress $IBASE/gateways/istio-ingress --set global.configNamespace=istio-control
279-
TAG=master-latest-daily HUB=gcr.io/istio-release iop istio-ingress-master istio-ingress $IBASE/gateways/istio-ingress \
280-
--set global.configNamespace=istio-master\
281-
271+
iop istio-ingress istio-ingress $IBASE/gateways/istio-ingress --set global.configNamespace=istio-control
272+
TAG=master-latest-daily HUB=gcr.io/istio-release iop istio-ingress-master istio-ingress $IBASE/gateways/istio-ingress \
273+
--set global.configNamespace=istio-master\
282274
```
283275

284276
## Telemetry
285277

286278
```bash
287-
iop istio-telemetry istio-grafana $IBASE/istio-telemetry/grafana/ --set global.configNamespace=istio-control
288-
iop istio-telemetry istio-mixer $IBASE/istio-telemetry/mixer-telemetry/ --set global.configNamespace=istio-control
289-
iop istio-telemetry istio-prometheus $IBASE/istio-telemetry/prometheus/ --set global.configNamespace=istio-control
290-
291-
TAG=master-latest-daily HUB=gcr.io/istio-release iop istio-telemetry-master istio-grafana $IBASE/istio-telemetry/grafana/ \
292-
--set global.configNamespace=istio-master
293-
TAG=master-latest-daily HUB=gcr.io/istio-release iop istio-telemetry-master istio-mixer $IBASE/istio-telemetry/mixer-telemetry/ \
294-
--set global.configNamespace=istio-master
295-
TAG=master-latest-daily HUB=gcr.io/istio-release iop istio-telemetry-master istio-prometheus $IBASE/istio-telemetry/prometheus/ \
296-
--set global.configNamespace=istio-master
279+
iop istio-telemetry istio-grafana $IBASE/istio-telemetry/grafana/ --set global.configNamespace=istio-control
280+
iop istio-telemetry istio-mixer $IBASE/istio-telemetry/mixer-telemetry/ --set global.configNamespace=istio-control
281+
iop istio-telemetry istio-prometheus $IBASE/istio-telemetry/prometheus/ --set global.configNamespace=istio-control
282+
283+
TAG=master-latest-daily HUB=gcr.io/istio-release iop istio-telemetry-master istio-grafana $IBASE/istio-telemetry/grafana/ \
284+
--set global.configNamespace=istio-master
285+
TAG=master-latest-daily HUB=gcr.io/istio-release iop istio-telemetry-master istio-mixer $IBASE/istio-telemetry/mixer-telemetry/ \
286+
--set global.configNamespace=istio-master
287+
TAG=master-latest-daily HUB=gcr.io/istio-release iop istio-telemetry-master istio-prometheus $IBASE/istio-telemetry/prometheus/ \
288+
--set global.configNamespace=istio-master
297289
```
298290

299-
## Policy
300-
301-
TODO - see example
302-
303-
## Egress
304-
305-
306-
## Other components
307-
308-
### Kiali
309-
310-
###
311-
312291
## Additional test templates
313292

314293
A number of helm test setups are general-purpose and should be installable in any cluster, to confirm
315294
Istio works properly and allow testing the specific install.
316-

common/.commonfiles.sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
26f9010dc0dd119451e2e32fb7f704121af55104
1+
0c08017c3bfe198f061322c98c36e4e3638a09ad

common/Makefile.common.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ lint-typescript:
5555
@${FINDFILES} -name '*.ts' -print0 | ${XARGS} tslint -c common/config/tslint.json
5656

5757
lint-protos:
58-
@$(FINDFILES) -name '*.proto' -print0 | $(XARGS) -L 1 prototool lint --protoc-bin-path=/usr/bin/protoc --protoc-wkt-path=common-protos
58+
@if test -d common-protos; then $(FINDFILES) -name '*.proto' -print0 | $(XARGS) -L 1 prototool lint --protoc-bin-path=/usr/bin/protoc --protoc-wkt-path=common-protos; fi
5959

6060
lint-all: lint-dockerfiles lint-scripts lint-yaml lint-helm lint-copyright-banner lint-go lint-python lint-markdown lint-sass lint-typescript lint-protos
6161

docs/labels.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,26 @@ The most frequent problem in Istio with 'upgrade in place' is the label missmatc
55
This happens when the upgrade Deployment.template.metadata.labels object on the upgrade doesn't matches
66
the previous version.
77

8-
98
Example error:
10-
```text
119

10+
```text
1211
for: "test/demo": Deployment.apps "egressgateway" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app":"istio-egressgateway", "istio":"egressgateway"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
13-
1412
```
1513

1614
For Istio 1.0, the label style was:
1715

1816
```yaml
19-
20-
21-
22-
...
23-
labels:
24-
app: pilot
25-
istio: pilot
26-
17+
...
18+
labels:
19+
app: pilot
20+
istio: pilot
2721
```
2822
2923
'matchLabels' is only used in prometheus, with 'app:prometheus'.
3024
3125
In 1.1, we added 3 more labels:
3226
3327
```yaml
34-
3528
template:
3629
metadata:
3730
labels:
@@ -41,11 +34,10 @@ In 1.1, we added 3 more labels:
4134
chart: pilot
4235
heritage: Tiller
4336
release: istio
44-
4537
```
4638
47-
For 1.2, we want to stop adding 'chart'/'heritage'/release, to reduce the dependency on Helm/Tiller and avoid
48-
similar problems in the future.
39+
For 1.2, we want to stop adding 'chart'/'heritage'/release, to reduce the dependency on Helm/Tiller and avoid
40+
similar problems in the future.
4941
5042
We also want to allow in-place update of istio-system, for demo or users who need this (as a backup
5143
plan).

istio-control/istio-config/README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,21 @@ The default implementation is Galley, using the K8S apiserver for storage - othe
77
It is recommended to run only one production config server - it registers a validation webhook which will apply
88
to all Istio configs. It is possible to run a second staging/canary config server in a different namespace.
99

10-
# Installation
10+
## Installation
1111

12-
Galley relies on DNS certificates. Before installing it in a custom namespace you should update Citadel or
12+
Galley relies on DNS certificates. Before installing it in a custom namespace you should update Citadel or
1313
create a custom certificate.
1414

15-
# Validation
15+
## Validation
1616

1717
A cluster should have a single galley with validation enabled - usually the prod environment.
1818
It is possible to enable validation on other environments as well - but each Galley will do its own
1919
validation, and a staging version may impact production validation.
2020

21-
```bash
22-
23-
24-
```
25-
2621
```yamml
27-
2822
security:
2923
...
3024
dnsCerts:
3125
...
3226
istio-galley-service-account.MY_NAMESPACE: istio-galley.MY_NAMESPACE.svc
33-
34-
3527
```

kustomize/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
Organization: each directory corresponds to a namespace ( 'environment' ).
44

55
Inside each component will have a directory, named to match the name of the directory where the helm template is defined.
6-
7-
A 'kustomization.yaml' file inside the directory can apply the normal kustomize rules. It should expect a 'k8s.yaml'
6+
7+
A 'kustomization.yaml' file inside the directory can apply the normal kustomize rules. It should expect a 'k8s.yaml'
88
resource.
99

10-
# Usage
10+
## Usage
1111

12-
"helm template" will be used with the normal values/global/user settings, and generate a k8s.yaml file under
12+
"helm template" will be used with the normal values/global/user settings, and generate a k8s.yaml file under
1313
$OUT/$NAMESPACE/$COMPONENT
1414

1515
If the kustomize file exists, it will be applied before running "kubectl apply --prune".

test/buildkite/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
## Machine
44

5-
install-machine.sh script has a basic install, i.e. agent plus tools used to run Istio tests (cached so we don't
5+
install-machine.sh script has a basic install, i.e. agent plus tools used to run Istio tests (cached so we don't
66
download again).
77

88
## Kubernetes
99

10-
Runs priviledged, the container has access to the 'node' docker. Can run KIND, or could run tests
10+
Runs privileged, the container has access to the 'node' docker. Can run KIND, or could run tests
1111
in a regular k8s container if we grant permissions to create pods.
1212

1313
## K8s - not privileged
1414

15-
A variant would be to run a non-priv agent, with namespace permissions.
15+
A variant would be to run a non-priv agent, with namespace permissions.
1616
The installer can add an option to not require cluster permissions, or only minimal cluster permissions granted
1717
to the agent service account.
1818

1919
## Docker
2020

2121
Not clear if this is needed - but we can run the agent/builder inside a docker container. Since it has priv, no
22-
major benefit compared with machine.
22+
major benefit compared with machine.

0 commit comments

Comments
 (0)