Skip to content

Commit d69cfcd

Browse files
committed
Update docs for v2
1 parent e861d8a commit d69cfcd

File tree

4 files changed

+44
-254
lines changed

4 files changed

+44
-254
lines changed

docs/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Docs
22

33
- [Deployment (with examples)](deployment/)
4-
- [Behavior in combination with ShinyProxy](shinyproxy.md)
54
- [Prometheus monitoring](prometheus.md)

docs/deployment/README.md

Lines changed: 41 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,13 @@ and dependencies of the operator.
1717
all necessary Kubernetes resources, without affecting any existing server or
1818
causing downtime.
1919
- **Redis**: Redis is used by ShinyProxy (not by the operator) to implement
20-
session persistence. This ensures that when a ShinyProxy server is replaced,
21-
the user is still logged in. This provides a smooth transition when the
22-
operator replaces a ShinyProxy server.
23-
- **Skipper**: Skipper is used as an ingress controller. Currently, this is the
24-
only ingress controller supported by the operator. The reason is that the
25-
ingress controller is responsible for routing users to the correct ShinyProxy
26-
server. Skipper is the only ingress controller we found suitable for this
27-
feature. However, this does not mean you will have to replace your existing
28-
ingress solution. You can deploy Skipper as an "intermediate" ingress
29-
controller and forward your existing ingress controller to the Skipper
30-
service. In fact, all example in this repository assume this way of working.
20+
[session and app persistence](https://shinyproxy.io/documentation/configuration/#session-and-app-persistence).
21+
This ensures that when a ShinyProxy server is replaced, the user is still
22+
logged in and all apps remain active. Redis is always required when using the
23+
operator. When deploying Redis on the Kubernetes cluster, we advise to
24+
use [Redis Sentinel](https://redis.io/docs/management/sentinel/) such that
25+
Redis is run in a high-available way. It is also possible to use a Redis
26+
server provided by cloud providers.
3127

3228
## Tutorial using minikube
3329

@@ -43,20 +39,20 @@ ShinyProxy operator on minikube.
4339
2. Start minikube:
4440

4541
```bash
46-
minikube start --kubernetes-version='v1.21.6' --addons=metrics-server,ingress
42+
minikube start --kubernetes-version='v1.25.6' --addons=metrics-server,ingress --container-runtime=containerd
4743
````
4844

4945
3. Clone this repository and change the working directory:
5046

5147
```bash
5248
git clone https://github.com/openanalytics/shinyproxy-operator
53-
cd shinyproxy-operator/docs/deployment/overlays/1-namespaced-hpa
49+
cd shinyproxy-operator/docs/deployment/overlays/1-namespaced
5450
```
5551

5652
4. Apply all resources
5753

5854
```bash
59-
kustomize build . | kubectl apply -f -
55+
kustomize build . | kubectl apply -f - --server-side
6056
```
6157

6258
**Note:** this command may not finish successfully from the first attempt,
@@ -92,17 +88,19 @@ ShinyProxy operator on minikube.
9288
7. Wait until the ShinyProxy instance is fully started. (before you will see a
9389
`Not Found` page).
9490
8. Try to launch an application and keep this application running.
95-
9. Change something in the `shinyproxy/shinyproxy.yaml` file and then run:
91+
9. Change something in the `resources/shinyproxy.shinyproxy.yaml` file (e.g.
92+
the `title` property) and then run:
9693
9794
```bash
98-
kubectl apply -f shinyproxy.yaml
95+
kubectl apply -f resources/shinyproxy.shinyproxy.yaml
9996
```
10097
101-
The operator now deploys a new ShinyProxy instance. As long as the old
102-
instance is being used (i.e. apps are running on it), the old instance will
103-
be kept intact. Users using the old instance, will stay on the old instance.
104-
The old instance will automatically be removed once no apps are running on
105-
it.
98+
The operator now deploys a new ShinyProxy instance. The old instance will be
99+
kept intact as long as a Websocket connection is active on the old instance.
100+
The old instance will automatically be removed once it no longer has any open
101+
Websocket connections. New requests will immediately be handled by the new
102+
server as soon as it is ready. Try going to the main page of ShinyProxy and
103+
check whether the change your made has been applied.
106104
10. Try the other examples:
107105
108106
```bash
@@ -120,87 +118,62 @@ ShinyProxy operator on minikube.
120118
121119
## Overview of examples
122120
123-
The Operator is designed to be flexible and fit many type of deployments. This repository includes examples for many kinds of deployments:
121+
The Operator is designed to be flexible and fit many type of deployments. This
122+
repository includes examples for many kinds of deployments:
124123
125-
- *1-namespaced-hpa*:
124+
- *1-namespaced*:
126125
- Operator-mode: `namespaced`
127126
- Operator-namespace: `shinyproxy`
128-
- Skipper-namespace: `shinyproxy`
129127
- Redis-namespace: `shinyproxy`
130-
- Skipper deployment: `Deployment` + `HorizontalPodAutoScaler`
131128
- ShinyProxy-namespace: `shinyproxy`
132129
- URLs: `https://shinyproxy-demo.local`
133130
134-
This is a very simple deployment of the operator, where everything runs in the same namespace.
131+
This is a very simple deployment of the operator, where everything runs in the
132+
same namespace.
135133
136-
- *2-namespaced-ds*:
137-
- Operator-mode: `namespaced`
138-
- Operator-namespace: `shinyproxy`
139-
- Skipper-namespace: `shinyproxy`
140-
- Redis-namespace: `shinyproxy`
141-
- Skipper deployment: `DaemonSet`
142-
- ShinyProxy-namespace: `shinyproxy`
143-
- URLs: `https://shinyproxy-demo.local`
144-
145-
This deployment is very similar to the previous one, except that it runs Skipper using a `DaemonSet` instead of an automatically scaling `Deployment`. Using the `DaemonSet` ensures that every Kubernetes nodes contains a Skipper pod. This is useful when you want a predictable amount of Skipper pods. In the previous example, the cluster automatically scales the amount of Skipper pods according to the load of these pods. When properly configured, this ensures that Skipper has enough resources to
146-
do its work, while not wasting resources.
147-
148-
- *3-clustered-hpa*:
149-
- Operator-mode: `clustered`
150-
- Operator-namespace: `shinyproxy-operator`
151-
- Skipper-namespace: `skipper`
152-
- Redis-namespace: `redis`
153-
- Skipper deployment: `Deployment` + `HorizontalPodAutoScaler`
154-
- ShinyProxy-namespace: `shinyproxy` and `shinyproxy-dept2`
155-
- URLs:
156-
- `https://shinyproxy-demo.local`
157-
- `https://shinyproxy-demo2.local`
158-
159-
In this example, the operator runs in `clustered` mode. Therefore, the operator will look into all namespaces for `ShinyProxy` resources and deploy these resources in their respective namespace. This also requires Skipper to be run in clustered mode (in the previous examples it would only look at `Ingress`
160-
definitions in the `shinyproxy` namespace.) This example also demonstrates how the Operator can be used in a multi-tenancy or multi-realm way. Each ShinyProxy server runs in its own namespace, isolated from the other servers. However, they are managed by a single operator.
161-
162-
- *4-clustered-ds*:
134+
- *2-clustered*:
163135
- Operator-mode: `clustered`
164136
- Operator-namespace: `shinyproxy-operator`
165-
- Skipper-namespace: `skipper`
166137
- Redis-namespace: `redis`
167-
- Skipper deployment: `DaemonSet`
168138
- ShinyProxy-namespace: `shinyproxy` and `shinyproxy-dept2`
169139
- URLs:
170140
- `https://shinyproxy-demo.local`
171141
- `https://shinyproxy-demo2.local`
172142
173-
Equal to example 3, except that Skipper is deployed using a `DaemonSet` instead of `Deployment`.
143+
In this example, the operator runs in `clustered` mode. Therefore, the
144+
operator will look into all namespaces for `ShinyProxy` resources and deploy
145+
these resources in their respective namespace. This example also demonstrates how
146+
the Operator can be used in a multi-tenancy or multi-realm way. Each
147+
ShinyProxy server runs in its own namespace, isolated from the other servers.
148+
However, they are managed by a single operator.
174149
175-
- *5-namespaced-hpa-app-ns*:
150+
- *3-namespaced-hpa-app-ns*:
176151
- Operator-mode: `namespaced`
177152
- Operator-namespace: `shinyproxy`
178-
- Skipper-namespace: `shinyproxy`
179153
- Redis-namespace: `shinyproxy`
180-
- Skipper deployment: `Deployment` + `HorizontalPodAutoScaler`
181154
- ShinyProxy-namespace: `shinyproxy`
182155
- URLs: `https://shinyproxy-demo.local`
183156
184157
Similar to example 1, however, the `01_hello` app will now run in the
185-
`my-namespace` namespace instead of the `shinyproxy` namespace. In addition to the change in the `shinyproxy.yaml`, this configuration requires the definition of the extra namespace and the modification of the `ServiceAccount`
186-
of the ShinyProxy server.
158+
`my-namespace` namespace instead of the `shinyproxy` namespace. In addition to
159+
the change in the `shinyproxy.shinyproxy.yaml` file, this configuration
160+
requires the definition of the extra namespace and the modification of
161+
the `ServiceAccount` of the ShinyProxy server.
187162
188-
- *6-namespaced-ds-multi*:
163+
- *4-namespaced-multi*:
189164
- Operator-mode: `namespaced`
190165
- Operator-namespace: `shinyproxy`
191-
- Skipper-namespace: `shinyproxy`
192166
- Redis-namespace: `shinyproxy`
193-
- Skipper deployment: `DaemonSet`
194167
- ShinyProxy-namespace: `shinyproxy`
195168
- URLs:
196169
- `https://shinyproxy-demo.local/shinyproxy1/`
197170
- `https://shinyproxy-demo.local/shinyproxy2/`
198171
- `https://shinyproxy-demo.local/shinyproxy3/`
199172
200-
Based on example 2, this example shows how multi-tenancy can be achieved using
201-
sub-paths instead of multiple domain names. Each ShinyProxy server is made
202-
available at the same domain name but at a different path under that
203-
domain name.
173+
Based on the second example, this example shows how multi-tenancy can be
174+
achieved using sub-paths instead of multiple domain names. Each ShinyProxy
175+
server is made available at the same domain name but at a different path under
176+
that domain name.
204177
205178
## ShinyProxy CRD
206179

docs/prometheus.md

Lines changed: 3 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,5 @@
11
# Prometheus Usage Statistics
22

3-
This page describes how the usage statistics feature of ShinyProxy works in
4-
combination with the operator.
5-
6-
**Note:** this page is only applicable to ShinyProxy 2.6.0.
7-
8-
Before diving into the details, have a look at the setup of Prometheus
9-
monitoring with ShinyProxy in a [regular deployment](https://shinyproxy.io/documentation/usage-statistics/#micrometer).
10-
11-
Because the operator is meant to dynamically create ShinyProxy servers, it does
12-
not suffice to configure a static list of ShinyProxy servers in Prometheus.
13-
Fortunately, Prometheus has the concept of [Service Discovery](https://prometheus.io/docs/prometheus/latest/configuration/configuration/),
14-
which allows Prometheus to automatically *discover* ShinyProxy servers. We
15-
assume here that Prometheus is running in the same Kubernetes cluster as the
16-
ShinyProxy operator.
17-
18-
Example Prometheus configuration:
19-
20-
```yaml
21-
scrape_configs:
22-
- job_name: 'k8pods'
23-
kubernetes_sd_configs:
24-
- role: pod
25-
relabel_configs:
26-
- source_labels: [__meta_kubernetes_pod_container_port_name]
27-
regex: metrics
28-
action: keep
29-
- source_labels: [__meta_kubernetes_pod_container_name]
30-
target_label: job
31-
- job_name: 'shinyproxy'
32-
metrics_path: '/actuator/prometheus'
33-
kubernetes_sd_configs:
34-
- role: pod
35-
relabel_configs:
36-
# instruct Prometheus to only look for ShinyProxy servers
37-
- source_labels: [__meta_kubernetes_pod_label_app]
38-
regex: shinyproxy
39-
action: keep
40-
# instruct Prometheus to use the special actuator port (9090)
41-
- source_labels: [__meta_kubernetes_pod_container_port_name]
42-
regex: actuator
43-
action: keep
44-
# provide a value for the job label
45-
- source_labels: [__meta_kubernetes_pod_container_name]
46-
target_label: job
47-
```
48-
49-
This configuration automatically discovers all ShinyProxy servers.
50-
51-
![Prometheus UI](../.github/screenshots/prometheus.png)
52-
53-
The above screenshot shows the `absolute_users_active` metric int the Prometheus
54-
UI. The `shinyproxy_realm` label is automatically added by ShinyProxy to every
55-
metric. The tag contains the resource name of the ShinyProxy server. Therefore,
56-
this tag is not added to the metrics when ShinyProxy is not being run using the
57-
Operator. In the screenshot there are three ShinyProxy servers being managed by
58-
the ShinyProxy server and two servers using a traditional deployment. The
59-
`shinyproxy` realm has two severs (instances) running (see the
60-
`shinyproxy_instance` label). The dashboard provided on the [ShinyProxy website](https://shinyproxy.io/documentation/usage-statistics/#micrometer)
61-
is designed to work with multiple realms and multiple servers inside each realm.
62-
For example, when displaying the Active Users, the dashboard differentiates
63-
between the different realms:
64-
65-
![Grafana UI](../.github/screenshots/grafana_active_users.png)
66-
67-
The dashboard contains two variables which allow you to filter the panels by
68-
realm or app name. By default, these are hidden, check the [ShinyProxy website](https://shinyproxy.io/documentation/usage-statistics/#variable-filters)
69-
to makes these visible.
3+
Check out the
4+
[ShinyProxy Monitoring Stack](https://github.com/openanalytics/shinyproxy-monitoring)
5+
for a ready to use deployment of Prometheus, Loki and Grafana.

docs/shinyproxy.md

Lines changed: 0 additions & 118 deletions
This file was deleted.

0 commit comments

Comments
 (0)