Skip to content

Commit f5fb7f2

Browse files
committed
Adding a getting started section for installing the APIs
Signed-off-by: Dyanngg <[email protected]>
1 parent 579435f commit f5fb7f2

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ nav:
3939
- Resources: api-overview.md
4040
- Versioning: versioning.md
4141
- Implementations: implementations.md
42+
- Guides:
43+
- Getting started: getting-started.md
4244
- Reference:
4345
- Examples: reference/examples.md
4446
- API Reference: reference/spec.md

site-src/getting-started.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Getting started with Network Policy API
2+
3+
**1. Install a Network Policy API compatible CNI**
4+
5+
There are numerous Container Network Plugin projects that support or are actively working on
6+
supporting the Network Policy API. Please refer to the [implementations](implementations.md)
7+
doc for details on the supportability matrix.
8+
9+
**2. Install the Network Policy API CRDs**
10+
11+
The following commands will install the latest release version of the `AdminNetworkPolicy` and
12+
`BaselineAdminNetworkPolicy` CRDs in your K8s cluster:
13+
14+
```bash
15+
kubectl apply -f https://github.com/kubernetes-sigs/network-policy-api/releases/download/v0.1.0/install.yaml
16+
```
17+
18+
**3. Try out one of the sample yamls for specific user stories**
19+
20+
- [Deny traffic at a cluster level](reference/examples.md#sample-spec-for-story-1-deny-traffic-at-a-cluster-level)
21+
- [Allow traffic at a cluster level](reference/examples.md#sample-spec-for-story-2-allow-traffic-at-a-cluster-level)
22+
- [Explicitly Delegate traffic to existing K8s Network Policy](reference/examples.md#sample-spec-for-story-3-explicitly-delegate-traffic-to-existing-k8s-network-policy)
23+
- [Create and Isolate multiple tenants in a cluster](reference/examples.md#sample-spec-for-story-4-create-and-isolate-multiple-tenants-in-a-cluster)
24+
- [Cluster Wide Default Guardrails](reference/examples.md#sample-spec-for-story-5-cluster-wide-default-guardrails)

site-src/reference/examples.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ spec:
6565
app: kube-dns
6666
```
6767
68-
### Story 3: Explicitly Delegate traffic to existing K8s Network Policy
68+
### Sample Spec for Story 3: Explicitly Delegate traffic to existing K8s Network Policy
6969
7070
![Alt text](../../images/delegation.png?raw=true "Delegate")
7171
@@ -81,21 +81,20 @@ spec:
8181
egress:
8282
- action: Pass
8383
to:
84-
- namespaces:
84+
- pods:
8585
namespaceSelector:
8686
matchLabels:
8787
kubernetes.io/metadata.name: bar-ns-1
88-
pods:
8988
podSelector:
9089
matchLabels:
9190
app: svc-pub
9291
ports:
93-
- portNumber:
94-
protocol: TCP
95-
port: 8080
92+
- portNumber:
93+
protocol: TCP
94+
port: 8080
9695
```
9796
98-
### Story 4: Create and Isolate multiple tenants in a cluster
97+
### Sample Spec for Story 4: Create and Isolate multiple tenants in a cluster
9998
10099
![Alt text](../../images/tenants.png?raw=true "Tenants")
101100
@@ -117,7 +116,7 @@ spec:
117116
- tenant
118117
```
119118
120-
This can also be expressed in the following way:
119+
This can also be expressed in the following way:
121120
122121
```yaml
123122
apiVersion: policy.networking.k8s.io/v1alpha1
@@ -141,7 +140,7 @@ spec:
141140
namespaceSelector: {}
142141
```
143142
144-
### Story 5: Cluster Wide Default Guardrails
143+
### Sample Spec for Story 5: Cluster Wide Default Guardrails
145144
146145
![Alt text](../../images/baseline.png?raw=true "Default Rules")
147146

0 commit comments

Comments
 (0)