Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write a very simple getting started guide #427

Merged
merged 1 commit into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions docs-src/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Getting started with Services APIs

## Installing CRDs

This project provides a collection of Custom Resource Definitions (CRDs) that can
be installed into any Kubernetes (>= 1.16) cluster.

To install the CRDs, please execute:

```
kubectl kustomize "github.com/kubernetes-sigs/service-apis/config/crd?ref=master" \
| kubectl apply -f -
Comment on lines +11 to +12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a good way to do this without kustomize? It seems like we're not really using kustomize for anything. (This does not need to block this PR).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do this in our Makefile too: https://github.com/kubernetes-sigs/service-apis/blob/master/Makefile#L54

Do note that the user doesn't need to install kustomize. It is included as a plugin inside kubectl itself. Users need to make sure that their kubectl version is not an ancient one, which again is expected.

```

## Install an implementation

Multiple projects implement the APIs defined by this project.
You will need to either install an implementation or verify that one is already
setup for your cluster.

## Sample Gateway

Once you have the CRDs and an implementation installed, you are ready to
use Service APIs.

In this example, we are installing three resources:

- An `acme-lb` GatewayClass which is being managed by a `acme.io/gateway-controller`
controller running in the cluster. Typically, a GatewayClass is provided by
the implementation and must be installed in the cluster.
- A Gateway which is of type `acme-lb`:
- This gateway has a single HTTP listener on port 80 which selects HTTPRoutes
from all namespaces which have the label `app: foo` on them.

- Finally, we have an HTTPRoute resource which is attached to the above Gateway
and has two rules:
- All requests with path beginning with `/bar` are forwarded to my-service1
Kubernetes Service.
- All requests with path beginning with `/some/thing` AND have an HTTP header
`magic: foo` are forwarded to my-service2 Kubernetes Service.

With this configuration, you now have a Gateway resource which is forwarding
traffic to two Kubernetes Services based on HTTP request metadata.

```
{% include 'basic-http.yaml' %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a good solution for this, and this doesn't need to block the PR, but one downside of embedding examples is that the examples could actually begin to skew from the docs. Maybe we should find a way to document which examples are being used in which docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this problem too and arrived at the same solution as you.
Essentially adding a link to the guide file as a yaml comment.
Let's continue this in #446.

```

For more advanced examples, please read the other [guides](guides.md).

## Uninstalling the CRDs

Comment on lines +51 to +52
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a bit of an explanation here, something like:

To uninstall the CRDs and all resources created with them, run the following command. Note that this will remove all GatewayClass and Gateway resources in your cluster. If you have been using these resources for any other purpose, do not uninstall these CRDs.

To uninstall the CRDs and all resources created with them, run the following
command. Note that this will remove all GatewayClass and Gateway resources in
your cluster. If you have been using these resources for any other purpose do
not uninstall these CRDs.

```
kubectl kustomize "github.com/kubernetes-sigs/service-apis/config/crd?ref=master" \
| kubectl delete -f -
```
1 change: 1 addition & 0 deletions docs-src/guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
Guides demonstrate and provide examples of how to use the API.
Please checkout one of the following guides:

- [Getting started](getting-started.md)
- [Configuring TLS](tls.md)
12 changes: 12 additions & 0 deletions docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,18 @@



<li class="md-nav__item">
<a href="/getting-started/" title="Getting started" class="md-nav__link">
Getting started
</a>
</li>







<li class="md-nav__item">
<a href="/tls/" title="TLS" class="md-nav__link">
TLS
Expand Down
12 changes: 12 additions & 0 deletions docs/community/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,18 @@



<li class="md-nav__item">
<a href="../getting-started/" title="Getting started" class="md-nav__link">
Getting started
</a>
</li>







<li class="md-nav__item">
<a href="../tls/" title="TLS" class="md-nav__link">
TLS
Expand Down
12 changes: 12 additions & 0 deletions docs/concepts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,18 @@



<li class="md-nav__item">
<a href="../getting-started/" title="Getting started" class="md-nav__link">
Getting started
</a>
</li>







<li class="md-nav__item">
<a href="../tls/" title="TLS" class="md-nav__link">
TLS
Expand Down
12 changes: 12 additions & 0 deletions docs/devguide/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,18 @@



<li class="md-nav__item">
<a href="../getting-started/" title="Getting started" class="md-nav__link">
Getting started
</a>
</li>







<li class="md-nav__item">
<a href="../tls/" title="TLS" class="md-nav__link">
TLS
Expand Down
12 changes: 12 additions & 0 deletions docs/enhancement-requests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,18 @@



<li class="md-nav__item">
<a href="../getting-started/" title="Getting started" class="md-nav__link">
Getting started
</a>
</li>







<li class="md-nav__item">
<a href="../tls/" title="TLS" class="md-nav__link">
TLS
Expand Down
12 changes: 12 additions & 0 deletions docs/faq/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,18 @@



<li class="md-nav__item">
<a href="../getting-started/" title="Getting started" class="md-nav__link">
Getting started
</a>
</li>







<li class="md-nav__item">
<a href="../tls/" title="TLS" class="md-nav__link">
TLS
Expand Down
Loading