Skip to content

Commit fced7d3

Browse files
author
scott coulton
committed
adding last stuff
1 parent 4689603 commit fced7d3

File tree

3 files changed

+139
-3
lines changed

3 files changed

+139
-3
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,16 @@ To run through the lab start [here](securing-our-pods/securing.md)
3939

4040
## Rbac, namespaces and cluster roles <a name="roles"></a>
4141
In this module we will take the application we deployed in pervious module but this time create a namespace and limit
42-
the application to only have access to any resource in that namespace using service accounts, roles and role bindings.
42+
the application to only have access to any resource in that namespace using service accounts, roles and role bindings.
4343
To run through the lab start [here](rbac-namespaces-cluterroles/namespaces.md)
4444

4545
## Introduction to knative <a name="knative"></a>
46+
In this module we will look at what makes up knative
47+
To run through the lab start [here](introduction-into-knative/intro.md)
4648

4749
## Securing application communication with knative <a name="secknative"></a>
48-
50+
In this module we will look at how to configure engress with istio
51+
To run through the lab start [here](securing-application-communication-with-knative/intro.md)
4952

5053
### Instructors
5154
If you are giving this workshop there are some instructor notes [here](instructor-notes/notes.md)

introduction-into-knative/intro.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,38 @@
11
# Introduction into Knative
2-
![console](images/knative.svg)
2+
3+
In this module we will look at knative and its components.
4+
5+
![console](images/knative.svg)
6+
7+
Knative is broken up into three major parts.
8+
9+
## Knative
10+
11+
Knative extends Kubernetes to provide a set of middleware components that are essential to build modern, source-centric, and container-based applications that can run anywhere: on premises, in the cloud, or even in a third-party data center.
12+
13+
Each of the components under the Knative project attempt to identify common patterns and codify the best practices that are shared by successful real-world Kubernetes-based frameworks and applications
14+
15+
## Istio
16+
17+
Cloud platforms provide a wealth of benefits for the organizations that use them. There’s no denying, however, that adopting the cloud can put strains on DevOps teams. Developers must use microservices to architect for portability, meanwhile operators are managing extremely large hybrid and multi-cloud deployments. Istio lets you connect, secure, control, and observe services.
18+
19+
At a high level, Istio helps reduce the complexity of these deployments, and eases the strain on your development teams. It is a completely open source service mesh that layers transparently onto existing distributed applications. It is also a platform, including APIs that let it integrate into any logging platform, or telemetry or policy system. Istio’s diverse feature set lets you successfully, and efficiently, run a distributed microservice architecture, and provides a uniform way to secure, connect, and monitor microservices.
20+
21+
Istio makes it easy to create a network of deployed services with load balancing, service-to-service authentication, monitoring, and more, without any changes in service code. You add Istio support to services by deploying a special sidecar proxy throughout your environment that intercepts all network communication between microservices, then configure and manage Istio using its control plane functionality, which includes:
22+
23+
Automatic load balancing for HTTP, gRPC, WebSocket, and TCP traffic.
24+
25+
Fine-grained control of traffic behavior with rich routing rules, retries, failovers, and fault injection.
26+
27+
A pluggable policy layer and configuration API supporting access controls, rate limits and quotas.
28+
29+
Automatic metrics, logs, and traces for all traffic within a cluster, including cluster ingress and egress.
30+
31+
Secure service-to-service communication in a cluster with strong identity-based authentication and authorization.
32+
33+
## Kubernetes
34+
35+
We have already covered that :)
36+
37+
Now we know that knatve and what it does we will use one of its components istio to to limit out bound traffic from our pods.
38+
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Securing application communication with knative
2+
3+
# Installing knative
4+
5+
To install knative run the following
6+
7+
### minikube
8+
```
9+
curl -L https://raw.githubusercontent.com/knative/serving/v0.2.0/third_party/istio-1.0.2/istio.yaml \
10+
| sed 's/LoadBalancer/NodePort/' \
11+
| kubectl apply --filename -
12+
kubectl label namespace default istio-injection=enabled
13+
curl -L https://github.com/knative/serving/releases/download/v0.2.0/release-lite.yaml \
14+
| sed 's/LoadBalancer/NodePort/' \
15+
| kubectl apply --filename -
16+
```
17+
18+
### Play with kubernetes
19+
```
20+
kubectl apply --filename https://raw.githubusercontent.com/knative/serving/v0.2.2/third_party/istio-1.0.2/istio.yaml
21+
kubectl label namespace default istio-injection=enabled
22+
kubectl apply --filename https://github.com/knative/serving/releases/download/v0.2.2/release.yaml
23+
```
24+
25+
# Configuring outbound network access
26+
27+
Knative blocks all outbound traffic by default. To enable outbound access (when you want to connect
28+
to the Cloud Storage API, for example), you need to change the scope of the proxy IP range by editing
29+
the `config-network` map.
30+
31+
## Determining the IP scope of your cluster
32+
33+
To set the correct scope, you need to determine the IP ranges of your cluster. The scope varies
34+
depending on your platform:
35+
36+
* For Minikube use `10.0.0.1/24`
37+
38+
## Setting the IP scope
39+
40+
The `istio.sidecar.includeOutboundIPRanges` parameter in the `config-network` map specifies
41+
the IP ranges that Istio sidecar intercepts. To allow outbound access, replace the default parameter
42+
value with the IP ranges of your cluster.
43+
44+
Run the following command to edit the `config-network` map:
45+
46+
```shell
47+
kubectl edit configmap config-network --namespace knative-serving
48+
```
49+
50+
Then, use an editor of your choice to change the `istio.sidecar.includeOutboundIPRanges` parameter value
51+
from `*` to the IP range you need. Separate multiple IP entries with a comma. For example:
52+
53+
```
54+
# Please edit the object below. Lines beginning with a '#' will be ignored,
55+
# and an empty file will abort the edit. If an error occurs while saving this file will be
56+
# reopened with the relevant failures.
57+
#
58+
apiVersion: v1
59+
data:
60+
istio.sidecar.includeOutboundIPRanges: '10.16.0.0/14,10.19.240.0/20'
61+
kind: ConfigMap
62+
metadata:
63+
...
64+
```
65+
66+
By default, the `istio.sidecar.includeOutboundIPRanges` parameter is set to `*`,
67+
which means that Istio intercepts all traffic within the cluster as well as all traffic that is going
68+
outside the cluster. Istio blocks all traffic that is going outside the cluster unless
69+
you create the necessary egress rules.
70+
71+
When you set the parameter to a valid set of IP address ranges, Istio will no longer intercept
72+
traffic that is going to the IP addresses outside the provided ranges, and you don't need to specify
73+
any egress rules.
74+
75+
If you omit the parameter or set it to `''`, Knative uses the value of the `global.proxy.includeIPRanges`
76+
parameter that is provided at Istio deployment time. In the default Knative Serving
77+
deployment, `global.proxy.includeIPRanges` value is set to `*`.
78+
79+
If an invalid value is passed, `''` is used instead.
80+
81+
If you are still having trouble making off-cluster calls, you can verify that the policy was
82+
applied to the pod running your service by checking the metadata on the pod.
83+
Verify that the `traffic.sidecar.istio.io/includeOutboundIPRanges` annotation matches the
84+
expected value from the config-map.
85+
86+
```shell
87+
$ kubectl get pod ${POD_NAME} --output yaml
88+
89+
apiVersion: v1
90+
kind: Pod
91+
metadata:
92+
annotations:
93+
serving.knative.dev/configurationGeneration: "2"
94+
sidecar.istio.io/inject: "true"
95+
...
96+
traffic.sidecar.istio.io/includeOutboundIPRanges: 10.16.0.0/14,10.19.240.0/20
97+
...

0 commit comments

Comments
 (0)