Skip to content

Commit e89bf57

Browse files
committed
Improve examples
1 parent aac137a commit e89bf57

File tree

15 files changed

+112
-34
lines changed

15 files changed

+112
-34
lines changed

docs/deployment/README.md

Lines changed: 51 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,35 @@ ShinyProxy operator on minikube.
8484
```
8585
8686
6. Once all deployments are finished, you can access ShinyProxy at
87-
`shinyproxy-demo.local`.
87+
`shinyproxy-demo.local`. You will get a security warning from your browser
88+
because if the invalid (self-signed) certificate. You can safely bypass this
89+
warning during this example.
8890
7. Wait until the ShinyProxy instance is fully started. (before you will see a
8991
`Not Found` page).
9092
8. Try to launch an application and keep this application running.
91-
9. Change something in the `resources/shinyproxy.shinyproxy.yaml` file (e.g.
92-
the `title` property) and then run:
93+
9. Change something in the `resources/shinyproxy.shinyproxy.yaml` file. For
94+
example change the `title` property and instruct the operator to create two
95+
ShinyProxy replicas:
96+
97+
```yaml
98+
apiVersion: openanalytics.eu/v1
99+
kind: ShinyProxy
100+
metadata:
101+
name: shinyproxy
102+
namespace: shinyproxy
103+
spec:
104+
# ...
105+
proxy:
106+
store-mode: Redis
107+
stop-proxies-on-shutdown: false
108+
title: ShinyProxy 2 # <- MAKE THE CHANGE HERE
109+
# ...
110+
replicas: 2 # <- ADD THIS LINE
111+
image: openanalytics/shinyproxy:3.0.1
112+
imagePullPolicy: Always
113+
fqdn: shinyproxy-demo.local
114+
```
115+
10. Apply this change using `kubectl`:
93116
94117
```bash
95118
kubectl apply -f resources/shinyproxy.shinyproxy.yaml
@@ -101,20 +124,19 @@ ShinyProxy operator on minikube.
101124
Websocket connections. New requests will immediately be handled by the new
102125
server as soon as it is ready. Try going to the main page of ShinyProxy and
103126
check whether the change your made has been applied.
104-
10. Try the other examples:
105-
106-
```bash
107-
kubectl delete namespace/shinyproxy
108-
kubectl delete namespace/shinyproxy-operator # may fail
109-
kubectl delete namespace/shinyproxy-dept2 # may fail
110-
kubectl delete namespace/my-namespace # may fail
111-
kubectl delete namespace/redis # may fail
112-
kubectl delete namespace/skipper # may fail
113-
kubectl delete -n default ingress/nginx-to-skipper-ingress # may fail
114-
kubectl delete -n skipper ingress/nginx-to-skipper-ingress # may fail
115-
cd directory_of_example
116-
kustomize build . | kubectl apply -f -
117-
```
127+
11. Try the other examples. The following commands first remove the current
128+
example, next you can open another example (e.g. `2-clustered`) and deploy
129+
it using `kubectl`:
130+
131+
```bash
132+
kubectl delete namespace/shinyproxy
133+
kubectl delete namespace/shinyproxy-operator # may fail
134+
kubectl delete namespace/shinyproxy-dept2 # may fail
135+
kubectl delete namespace/my-namespace # may fail
136+
kubectl delete namespace/redis # may fail
137+
cd ../2-clustered
138+
kustomize build . | kubectl apply -f -
139+
```
118140
119141
## Overview of examples
120142
@@ -231,17 +253,25 @@ spec:
231253
- op: add
232254
path: /spec/ingressClassName
233255
value: nginx
256+
- op: add
257+
path: /spec/tls
258+
value:
259+
- hosts:
260+
- shinyproxy-demo.local
261+
# secretName: example # uncomment and change this line if needed
234262
image: openanalytics/shinyproxy:3.0.1
235263
imagePullPolicy: Always
236264
fqdn: shinyproxy-demo.local
237265
```
238266
239267
The first patch adds some additional annotations to the ShinyProx resource. For
240268
example, in order to set up a redirect from HTTP to HTTPS. The second patch
241-
changes the ingressClassName to `nginx`. Any patch is accepted, but make sure
242-
that the resulting Ingress resource still works for the ShinyProxy Deployment.
243-
The ShinyProxy Operator logs the manifest before and after applying the patch,
244-
this can be useful while creating the patches.
269+
changes the ingressClassName to `nginx`. Finally, the last patch configures TLS
270+
for the ingress resource. In a production environment, you can uncomment the
271+
line with the `secretName` to refer to a proper secret. Any patch is accepted,
272+
but make sure that the resulting Ingress resource still works for the ShinyProxy
273+
Deployment. The ShinyProxy Operator logs the manifest before and after applying
274+
the patch, this can be useful while creating the patches.
245275
246276
**Note:** the previous section only applies to version 2 of the operator.
247277
Version 1 behaves differently since it used Skipper as (intermediate) ingress

docs/deployment/overlays/1-namespaced/kustomization.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ kind: Kustomization
33
namespace: shinyproxy
44

55
resources:
6-
- ../../bases/redis-sentinel
7-
- ../../bases/namespaced
8-
- ../../bases/shinyproxy
6+
- github.com/openanalytics/shinyproxy-operator/docs/deployment/bases/redis-sentinel?ref=v2.0.0
7+
- github.com/openanalytics/shinyproxy-operator/docs/deployment/bases/namespaced?ref=v2.0.0
8+
- github.com/openanalytics/shinyproxy-operator/docs/deployment/bases/shinyproxy?ref=v2.0.0
99
- resources/shinyproxy.namespace.yaml
1010
- resources/shinyproxy.shinyproxy.yaml

docs/deployment/overlays/1-namespaced/resources/shinyproxy.shinyproxy.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ spec:
8888
- op: add
8989
path: /spec/ingressClassName
9090
value: nginx
91+
- op: add
92+
path: /spec/tls
93+
value:
94+
- hosts:
95+
- shinyproxy-demo.local
96+
# secretName: example # uncomment and change this line if needed
9197
image: openanalytics/shinyproxy:3.0.1
9298
imagePullPolicy: Always
9399
fqdn: shinyproxy-demo.local

docs/deployment/overlays/2-clustered/redis/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Kustomization
33
namespace: redis
44

55
resources:
6-
- ../../../bases/redis-sentinel
6+
- github.com/openanalytics/shinyproxy-operator/docs/deployment/bases/redis-sentinel?ref=v2.0.0
77
- resources/redis.namespace.yaml
88

99
patchesStrategicMerge:

docs/deployment/overlays/2-clustered/shinyproxy-dept2/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Kustomization
33
namespace: shinyproxy-dept2
44

55
resources:
6-
- ../../../bases/shinyproxy
6+
- github.com/openanalytics/shinyproxy-operator/docs/deployment/bases/shinyproxy?ref=v2.0.0
77
- resources/redis.secret.yaml
88
- resources/shinyproxy.shinyproxy.yaml
99
- resources/shinyproxy.namespace.yaml

docs/deployment/overlays/2-clustered/shinyproxy-dept2/resources/shinyproxy.shinyproxy.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ spec:
8787
- op: add
8888
path: /spec/ingressClassName
8989
value: nginx
90+
- op: add
91+
path: /spec/tls
92+
value:
93+
- hosts:
94+
- shinyproxy-demo2.local
95+
# secretName: example # uncomment and change this line if needed
9096
image: openanalytics/shinyproxy:3.0.1
9197
imagePullPolicy: Always
9298
fqdn: shinyproxy-demo2.local

docs/deployment/overlays/2-clustered/shinyproxy-operator/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ kind: Kustomization
33
namespace: shinyproxy-operator
44

55
resources:
6-
- ../../../bases/clustered
6+
- github.com/openanalytics/shinyproxy-operator/docs/deployment/bases/clustered?ref=v2.0.0
77
- resources/shinyproxy-operator.namespace.yaml

docs/deployment/overlays/2-clustered/shinyproxy/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Kustomization
33
namespace: shinyproxy
44

55
resources:
6-
- ../../../bases/shinyproxy
6+
- github.com/openanalytics/shinyproxy-operator/docs/deployment/bases/shinyproxy?ref=v2.0.0
77
- resources/redis.secret.yaml
88
- resources/shinyproxy.shinyproxy.yaml
99
- resources/shinyproxy.namespace.yaml

docs/deployment/overlays/2-clustered/shinyproxy/resources/shinyproxy.shinyproxy.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,18 @@ spec:
8787
- op: add
8888
path: /spec/ingressClassName
8989
value: nginx
90+
- op: add
91+
path: /spec/tls
92+
value:
93+
- hosts:
94+
- shinyproxy-demo.local
95+
# secretName: example # uncomment and change this line if needed
96+
- op: add
97+
path: /spec/tls
98+
value:
99+
- hosts:
100+
- shinyproxy-demo.local
101+
# secretName: example # uncomment and change this line if needed
90102
image: openanalytics/shinyproxy:3.0.1
91103
imagePullPolicy: Always
92104
fqdn: shinyproxy-demo.local

docs/deployment/overlays/3-namespaced-app-ns/shinyproxy/kustomization.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ kind: Kustomization
33
namespace: shinyproxy
44

55
resources:
6-
- ../../../bases/redis-sentinel
7-
- ../../../bases/namespaced
8-
- ../../../bases/shinyproxy
6+
- github.com/openanalytics/shinyproxy-operator/docs/deployment/bases/redis-sentinel?ref=v2.0.0
7+
- github.com/openanalytics/shinyproxy-operator/docs/deployment/bases/namespaced?ref=v2.0.0
8+
- github.com/openanalytics/shinyproxy-operator/docs/deployment/bases/shinyproxy?ref=v2.0.0
99
- resources/shinyproxy.namespace.yaml
1010
- resources/shinyproxy.shinyproxy.yaml

0 commit comments

Comments
 (0)