Skip to content

Commit

Permalink
Update docs following upstreaming of kube (#4652)
Browse files Browse the repository at this point in the history
* Update docs following upstreaming of kube

* Finish kube todo

* Fix links
  • Loading branch information
richard-cox authored Oct 15, 2020
1 parent 86b6633 commit e0528f9
Show file tree
Hide file tree
Showing 12 changed files with 306 additions and 91 deletions.
79 changes: 0 additions & 79 deletions docs/connecting-k8s.md

This file was deleted.

2 changes: 1 addition & 1 deletion website/docs/deploy/cloud-foundry/cloud-foundry.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ applications:

This will set the the UAA client and UAA secret used to invite users for the default CF only.

See the [invite users guide](../../advanced/invite-user-guide) for more information about user invites in Stratos.
See the [invite users guide](../../endpoints/cf/invite-user-guide) for more information about user invites in Stratos.

#### Use of the Default Embedded SQLite Database

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Stratos on EKS
---
title: Stratos on EKS
sidebar_label: Stratos on EKS
---

## EKS Setup

Expand All @@ -10,7 +13,7 @@ If you plan to deploy SCF in the cluster, make the following modifications when

## Helm Setup

Download the latest Helm release (atleast 2.9 is required for RBAC support) from https://github.com/helm/helm/releases
Download the latest Helm release (at least 2.9 is required for RBAC support) from https://github.com/helm/helm/releases

Save the following to a file caleld `helm-rbac.yaml`
```
Expand Down
56 changes: 56 additions & 0 deletions website/docs/developer/developers-guide-kube-local-dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Kubernetes Features in Local Development
sidebar_label: Kube Features
---

Some Stratos Kubernetes features depend on additional configuration and external requirements. In order to run these in a local development
environment see the instructions below.


## Enabling the Kubernetes Terminal in local development

You need a Kubernetes cluster with `kubectl` set up and configured with the kubeconfig file.

Run the script `build/tools/kube-terminal-dev.sh`

This script will:

- Create a service account named `stratos`
- Create a namespace named `stratos-dev`
- Write environment variables to the `src/jetstream/config.properties` file

If you have minikube running, the configuration for your Kubernetes API Server will be set correctly - otherwise
you will need to edit the `src/jetstream/config.properties` file and set these two variables:

- `KUBERNETES_SERVICE_HOST`
- `KUBERNETES_SERVICE_PORT`

The Jetstream backend should be configured.

:::note
Ensure you set `ENABLE_TECH_PREVIEW=true` to enable the Kubernetes Terminal feature.
:::


## Enabling Security Obvervability Analyzers in local development

You need to build the docker image for the analyzers container.

```
cd src/jetstream/plugins/analysis/container
docker build . -t stratos-analyzers
```

Now run this container - this will provide the analysis engines to Stratos:

`docker run -d -p 8090:8090 stratos-analyzers`

Edit your Jetstream `config.properties` file and add the following lines:

```
ANALYSIS_SERVICES_API=http://127.0.0.1:8090
```

:::note
Ensure you set `ENABLE_TECH_PREVIEW=true` to enable the Kubernetes Terminal feature.
:::
30 changes: 30 additions & 0 deletions website/docs/endpoints/cf/cf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: Cloud Foundry Endpoints
sidebar_label: Introduction
---

[Cloud Foundry](https://www.cloudfoundry.org/) is the industry-standard open source cloud application platform for developing and deploying
enterprise cloud applications.

Stratos provides easy access to many of Cloud Foundry's features such as

1. Browsing, deploying and managing applications
1. Browsing services, and creating and managing service instances
1. Managing Organisations and Spaces
1. User role management
1. ... and much more

## Registering a Cloud Foundry Endpoint
Stratos Administrator's can register endpoints via the Endpoints page.

The CF API address must be supplied.

The Client ID and Client Secret can usually be left blank (by default stratos will use `cf` as the client id). If you would like Stratos
to communicate with the cf using a specific client enter them here.

To allow the user to connect to the endpoint via SSO check the box. Some of the information in the [Stratos SSO Guide](../../advanced/sso)
may be helpful.

## Connecting to a Cloud Foundry Endpoint

Simply navigate to the Endpoints page, find the Cloud Foundry endpoint, click connect and enter your Cloud Foundry username and password.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ This action must be performed by an Administrator in Stratos.
1) Use the `Configure` button in the `User Invitation Support` section.
1) Supply the uaa client id and secret and click `Configure`

> Note: If Stratos has been deployed via `cf push` and the steps under the `Pre-configure invite UAA client` header in the [CF deploy guide](../deploy/cloud-foundry/cloud-foundry) have been followed, you will not follow these steps for the default CF.
> Note: If Stratos has been deployed via `cf push` and the steps under the `Pre-configure invite UAA client` header in the [CF deploy guide](../../deploy/cloud-foundry/cloud-foundry) have been followed, you will not follow these steps for the default CF.
## Configuration for CF Push

Expand Down Expand Up @@ -145,7 +145,7 @@ When developing locally, we recommend using [mailcatcher](https://mailcatcher.me

To install mailcatcher via docker, use the following command: `docker run -d -p 1080:80 -p 1025:25 --name mail tophfr/mailcatcher`. Once mailcatcher is installed, continue to follow the instructions below.

SMTP server details can be set via rhe usual environment variable approach or, when running locally, in the `jetstream/config.properties` file (see Backend Development - Configuration in [developers-guide](../developer/introduction)). The config settings, with example values, are as follows:
SMTP server details can be set via rhe usual environment variable approach or, when running locally, in the `jetstream/config.properties` file (see Backend Development - Configuration in [developers-guide](../../developer/introduction)). The config settings, with example values, are as follows:

```
SMTP_FROM_ADDRESS=Stratos<[email protected]>
Expand Down
31 changes: 31 additions & 0 deletions website/docs/endpoints/helm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Helm Endpoints
sidebar_label: Helm
---

[Helm](https://helm.sh/) is a tool that streamlines installing and managing Kubernetes applications.

Stratos unlocks the ability to

1. Browse Helm charts in a single page from one or more Helm chart repositories
1. View detailed information about a Helm Chart
1. Review past version of a Helm Chart

Adding a Stratos Kubernetes Endpoint alongside Helm endpoint unlocks additional features

1. Install a Helm chart into the kubernetes
1. Supply values for the install via either a dynamically created form or freehand syntax checked yaml
1. Upgrade new or existing Helm charts


## Registering a Helm Endpoint
Stratos Administrator's can register endpoints via the Endpoints page.

To add a Helm Repository all that's needed is the url that hosts the repositories chart.yaml.

Nothing is needed to register Artifact Hub, just the administrators inclination.


## Connecting to Helm Endpoint

Helm endpoints don't require user credentials. Once they're registered they're available to all.
13 changes: 13 additions & 0 deletions website/docs/endpoints/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Stratos Endpoints
sidebar_label: Introduction
---

Stratos uses endpoints to communicate with other systems such as Cloud Foundries, Kubernetes, Helm Repositories, etc. A Stratos Administrator
will register these endpoints in Stratos. All users will then be able to supply credentials per endpoint. Stratos can then communicate with
these systems on behalf of the user.

Multiple endpoints can be registered and connected. Some views in Stratos, like the Cloud Foundry Application page, show amalgamated data
from all endpoints of that type.

Some endpoints allow credentials to be shared amongst all users, for instance Stratos Metrics
116 changes: 116 additions & 0 deletions website/docs/endpoints/k8s.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
title: Kubernetes Endpoints
sidebar_label: Kubernetes
---

[Kubernetes](https://kubernetes.io/) (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications

Stratos provides easy access to Kubernetes features such as

1. Browsing Kubernetes resources and their state
1. Terminal with kubectl (and helm) CLI tools (Tech Preview)
1. Run Security Observability Tools (Tech Preview)
1. Browsing Kubernetes Workloads
1. The Kubernetes Dashboard (Tech Preview)

Adding a Stratos Helm Endpoint alongside a Kubernetes endpoint unlocks additional features

1. Install a Helm chart into the kubernetes
1. Upgrade new or existing Helm charts

## Registering a Kubernetes Endpoint
Stratos Administrator's can register endpoints via the Endpoints page.

Usually all that's needed is the Kubernetes API address, as well as a friendly name to identify the endpoint in Stratos.

Some basic information for finding the endpoint address for specific kubernetes clusters can be found bellow in the connecting section.


## Connecting a Kubernetes Endpoint

Stratos supports a number of different ways to authenticate with your Kubernetes cluster. There are a few generic ways that cover many types of clusters, but also authentication methods specific to some providers.

The currently supported connection methods and types of cluster are:

1. Certificate based Kubernetes authentication
1. Username and password based Kubernetes authentication
1. [SUSE CaaSP](https://www.suse.com/products/caas-platform/) (OIDC)
1. [AWS EKS](https://aws.amazon.com/eks/) (AWS IAM auth)
1. [Azure AKS](https://azure.microsoft.com/en-gb/services/kubernetes-service/)
1. [K3S](https://k3s.io/)


### Certificate based authentication

Some kubernetes clusters use TLS certificates for authentication. The following example shows how to register and connect to one of these called [Minikube](https://minikube.sigs.k8s.io/docs/).

To find the Minikube endpoint URL, locate the `minikube` entry in your local `kubeconfig` file. In the following example, the `minikube` endpoint URL is `https://192.168.99.100:8443`.

```
- cluster:
certificate-authority: /home/user/.minikube/ca.crt
server: https://192.168.99.100:8443
name: minikube
```

To connect to the cluster, locate the relevant entry in the `users` section in your kubernetes config file.

```
users:
- name: minikube
user:
client-certificate: /home/user/.minikube/client.crt
client-key: /home/user/.minikube/client.key
```
The two files specified under `client-certificate` and `client-key` are required to connect to the cluster.
Select the `Kubernetes Cert Auth` option as the Auth Type in the connect dialog and select the two files to connect.

### Username and password based authentication
To connect using a username and password simply select the `Username and Password` option as the Auth Type in the connect dialog.


### CAASP (OIDC)
To connect a CAASP cluster to Stratos, download a `kubeconfig` from Velum.

1. To find the endpoint URL, inspect the file. The `server` property details the endpoint URL

```
apiVersion: v1
kind: Config
clusters:
- name: caasp
cluster:
server: https://kube-api-x1.devenv.caasp.suse.net:6443 <---Endpoint URL
certificate-authority-data: 1c1MFpYSnVZV3dnUTBFd0hoY05NVGd4TURBMU1USXhNalU1V2hjTk1qZ3hNREF5TVRJeE1qVTVXakNCb1RFTApNQWtHQTFVRUJoTUNSRVV4RURBT0JnTlZCQWdNQjBKaGRtRnlhV0V4RWpBUUJnTlZCQWNNQ1U1MWNtVnRZbVZ5Clp6RWJNQmtHQTFVRUNnd1NVMVZUUlNCQmRYUnZaMl...
```
2. Specify the Endpoint URL when adding the endpoint to Stratos.
3. To connect to Kubernetes, select the `CAASP (OIDC)` option as the Auth Type, and upload the `kubeconfig` file downloaded from Velum.

### Amazon EKS
To Connect the following details are required:
- Cluster Name (See the following example)
- AWS Access Key
- AWS Secret Key

#### EKS Endpoint URL And Cluster Name
You can locate the EKS cluster endpoint URL and the cluster name, by inspecting the generated cluster configuration in your local `kubeconfig`.

```
10:20 $ cat ~/.kube/config
- cluster:
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa...QXR2N3dOQkt3eFhsYgpxZm5HRUs0WHRmSWNIcjJHSjhZOXdIa0lPRm0rR3Nvak1PaG1pK05wbER2YjVJc3BmMmxxbXdLd3RmRT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
server: https://40BCD34B7E297903DA2EAF19B6164521.sk1.us-east-1.eks.amazonaws.com
name: arn:aws:eks:us-east-1:138384977974:cluster/BRSSCF
```
The endpoint URL is specified in the `server` property (i.e. `https://40BCD34B7E297903DA2EAF19B6164521.sk1.us-east-1.eks.amazonaws.com`), while the cluster name is the last part of the `name` property (i.e `BRSSCF`).

### Azure AKS
To connect an AKS kubernetes instance, the following is required:
1. AKS Endpoint URL, which can be found from the AKS console or the generated kubernetes configuration.
2. To connect to the cluster, provide the `kubeconfig` file.

## For a quick way to registered all endpoints
For a quick way to register kubernetes endpoints and in some cases also connect, the user can select `Import Kubeconfig` instead of the
endpoint types listed above. Once the user has provided the file they can then select which contexts to register and, if applicable, how to connect to it. Not all connection types are supported this way, for instance where files are reference in config. These can still be registered, and via the Endpoints page connected to, just not connected at that time.
File renamed without changes.
Loading

0 comments on commit e0528f9

Please sign in to comment.