@@ -13,9 +13,9 @@ and dependencies of the operator.
1313 servers.
1414- ** ShinyProxy** : the ShinyProxy servers, these host the Shiny apps. You do not
1515 need to create these servers manually, since these are created by the
16- operator. Instead, you define which servers to create, and the operator creates
17- all necessary Kubernetes resources, without affecting any existing server or
18- causing downtime.
16+ operator. Instead, you define which servers to create, and the operator
17+ creates all necessary Kubernetes resources, without affecting any existing
18+ server or causing downtime.
1919- ** Redis** : Redis is used by ShinyProxy (not by the operator) to implement
2020 [ session and app persistence] ( https://shinyproxy.io/documentation/configuration/#session-and-app-persistence ) .
2121 This ensures that when a ShinyProxy server is replaced, the user is still
@@ -26,8 +26,8 @@ and dependencies of the operator.
2626 server provided by cloud providers.
2727
2828 ** Note:** when deploying to production, it is important to change the password
29- used to secure Redis. Each example (see below) already changes the
30- password to ` mySecurePassword12 ` . For an example see
29+ used to secure Redis. Each example (see below) already changes the password
30+ to ` mySecurePassword12 ` . For an example see
3131 the [ ` overlays/1-namespaced/patches/redis.secret.yaml ` ] ( overlays/1-namespaced/patches/redis.secret.yaml )
3232 file.
3333
@@ -82,7 +82,8 @@ ShinyProxy operator on minikube.
8282 minikube ip
8383 ` ` `
8484
85- Next, add the following entries to ` /etc/hosts` , replacing ` MINIKUBE_IP` by the output of the previous command ;
85+ Next, add the following entries to ` /etc/hosts` , replacing ` MINIKUBE_IP` by
86+ the output of the previous command ;
8687
8788 ` ` ` text
8889 MINIKUBE_IP shinyproxy-demo.local
@@ -114,22 +115,23 @@ ShinyProxy operator on minikube.
114115 title: ShinyProxy 2 # <- MAKE THE CHANGE HERE
115116 # ...
116117 replicas: 2 # <- ADD THIS LINE
117- image: openanalytics/shinyproxy:3.0.1
118+ image: openanalytics/shinyproxy:3.1.0
118119 imagePullPolicy: Always
119120 fqdn: shinyproxy-demo.local
120121 ` ` `
12112210. Apply this change using ` kubectl` :
122123
123- ` ` ` bash
124- kubectl apply -f resources/shinyproxy.shinyproxy.yaml
125- ` ` `
124+ ` ` ` bash
125+ kubectl apply -f resources/shinyproxy.shinyproxy.yaml
126+ ` ` `
127+
128+ The operator now deploys a new ShinyProxy instance. The old instance will be
129+ kept intact as long as a Websocket connection is active on the old instance. The
130+ old instance will automatically be removed once it no longer has any open
131+ Websocket connections. New requests will immediately be handled by the new
132+ server as soon as it is ready. Try going to the main page of ShinyProxy and
133+ check whether the change your made has been applied.
126134
127- The operator now deploys a new ShinyProxy instance. The old instance will be
128- kept intact as long as a Websocket connection is active on the old instance.
129- The old instance will automatically be removed once it no longer has any open
130- Websocket connections. New requests will immediately be handled by the new
131- server as soon as it is ready. Try going to the main page of ShinyProxy and
132- check whether the change your made has been applied.
13313511. Try the other examples. The following commands first remove the current
134136 example, next you can open another example (e.g. ` 2-clustered` ) and deploy
135137 it using ` kubectl` :
@@ -150,37 +152,37 @@ The Operator is designed to be flexible and fit many type of deployments. This
150152repository includes examples for many kinds of deployments:
151153
152154- * 1-namespaced* :
153- - Operator-mode: ` namespaced`
154- - Operator-namespace: ` shinyproxy`
155- - Redis-namespace: ` shinyproxy`
156- - ShinyProxy-namespace: ` shinyproxy`
157- - URLs: ` https://shinyproxy-demo.local`
155+ - Operator-mode: ` namespaced`
156+ - Operator-namespace: ` shinyproxy`
157+ - Redis-namespace: ` shinyproxy`
158+ - ShinyProxy-namespace: ` shinyproxy`
159+ - URLs: ` https://shinyproxy-demo.local`
158160
159161 This is a very simple deployment of the operator, where everything runs in the
160162 same namespace.
161163
162164- * 2-clustered* :
163- - Operator-mode: ` clustered`
164- - Operator-namespace: ` shinyproxy-operator`
165- - Redis-namespace: ` redis`
166- - ShinyProxy-namespace: ` shinyproxy` and ` shinyproxy-dept2`
167- - URLs:
168- - ` https://shinyproxy-demo.local`
169- - ` https://shinyproxy-demo2.local`
165+ - Operator-mode: ` clustered`
166+ - Operator-namespace: ` shinyproxy-operator`
167+ - Redis-namespace: ` redis`
168+ - ShinyProxy-namespace: ` shinyproxy` and ` shinyproxy-dept2`
169+ - URLs:
170+ - ` https://shinyproxy-demo.local`
171+ - ` https://shinyproxy-demo2.local`
170172
171173 In this example, the operator runs in ` clustered` mode. Therefore, the
172174 operator will look into all namespaces for ` ShinyProxy` resources and deploy
173- these resources in their respective namespace. This example also demonstrates how
174- the Operator can be used in a multi-tenancy or multi-realm way. Each
175+ these resources in their respective namespace. This example also demonstrates
176+ how the Operator can be used in a multi-tenancy or multi-realm way. Each
175177 ShinyProxy server runs in its own namespace, isolated from the other servers.
176178 However, they are managed by a single operator.
177179
178180- * 3-namespaced-app-ns* :
179- - Operator-mode: ` namespaced`
180- - Operator-namespace: ` shinyproxy`
181- - Redis-namespace: ` shinyproxy`
182- - ShinyProxy-namespace: ` shinyproxy`
183- - URLs: ` https://shinyproxy-demo.local`
181+ - Operator-mode: ` namespaced`
182+ - Operator-namespace: ` shinyproxy`
183+ - Redis-namespace: ` shinyproxy`
184+ - ShinyProxy-namespace: ` shinyproxy`
185+ - URLs: ` https://shinyproxy-demo.local`
184186
185187 Similar to example 1, however, the ` 01_hello` app will now run in the
186188 ` my-namespace` namespace instead of the ` shinyproxy` namespace. In addition to
@@ -189,14 +191,14 @@ repository includes examples for many kinds of deployments:
189191 the ` ServiceAccount` of the ShinyProxy server.
190192
191193- * 4-namespaced-multi* :
192- - Operator-mode: ` namespaced`
193- - Operator-namespace: ` shinyproxy`
194- - Redis-namespace: ` shinyproxy`
195- - ShinyProxy-namespace: ` shinyproxy`
196- - URLs:
197- - ` https://shinyproxy-demo.local/shinyproxy1/`
198- - ` https://shinyproxy-demo.local/shinyproxy2/`
199- - ` https://shinyproxy-demo.local/shinyproxy3/`
194+ - Operator-mode: ` namespaced`
195+ - Operator-namespace: ` shinyproxy`
196+ - Redis-namespace: ` shinyproxy`
197+ - ShinyProxy-namespace: ` shinyproxy`
198+ - URLs:
199+ - ` https://shinyproxy-demo.local/shinyproxy1/`
200+ - ` https://shinyproxy-demo.local/shinyproxy2/`
201+ - ` https://shinyproxy-demo.local/shinyproxy3/`
200202
201203 Based on the second example, this example shows how multi-tenancy can be
202204 achieved using sub-paths instead of multiple domain names. Each ShinyProxy
@@ -218,16 +220,24 @@ important:
218220 the [example](# modify-the-shinyproxy-pod))
219221- ` kubernetesIngressPatches` : allows to patch the ` Ingress` resources created by
220222 the operator (see the [example](# modify-the-ingress-resource))
223+ - ` kubernetesServicePatches` : allows to patch the ` Service` resources created by
224+ the operator (see the [example](# modify-the-service-resource))
221225- ` image` : the docker image to use for the ShinyProxy server (
222- e.g. ` openanalytics/shinyproxy:3.0.1 ` )
226+ e.g. ` openanalytics/shinyproxy:3.1.0 ` )
223227- ` imagePullPolicy` : the pull policy for ShinyProxy Image; the default value is
224228 ` IfNotPresent` ; valid options are ` Never` , ` IfNotPresent` and ` Always` .
225229- ` fqdn` : the FQDN at which the service should be available, e.g. `
226230 shinyproxy-demo.local
231+ - ` additionalFqdns` : (optional) a list of additional FQDNs that can be used to
232+ access this ShinyProxy server
227233- ` appNamespaces` : a list of namespaces in which apps will be deployed. This is
228234 only needed when you change the namespace of an app using the
229235 ` kubernetes-pod-patches` feature. The namespace of the operator and ShinyProxy
230236 instance are automatically included
237+ - ` antiAffinityTopologyKey` : the topology key to use in
238+ the [anti-affinity](# anti-affinity) configuration of the ShinyProxy pods
239+ - ` antiAffinityRequired` : if enabled, the [anti-affinity](# anti-affinity)
240+ configuration rules are ` required` instead of ` preferred`
231241
232242# # Modify the Ingress Resource
233243
@@ -248,7 +258,7 @@ metadata:
248258 namespace: shinyproxy
249259spec:
250260 proxy:
251- # ...
261+ # ...
252262 kubernetesIngressPatches: |
253263 - op: add
254264 path: /metadata/annotations
@@ -265,7 +275,7 @@ spec:
265275 - hosts:
266276 - shinyproxy-demo.local
267277 # secretName: example # uncomment and change this line if needed
268- image: openanalytics/shinyproxy:3.0.1
278+ image: openanalytics/shinyproxy:3.1.0
269279 imagePullPolicy: Always
270280 fqdn: shinyproxy-demo.local
271281` ` `
@@ -304,7 +314,7 @@ metadata:
304314 namespace: shinyproxy
305315spec:
306316 proxy:
307- # ...
317+ # ...
308318 kubernetesPodTemplateSpecPatches: |
309319 - op: add
310320 path: /spec/containers/0/env/-
@@ -326,7 +336,7 @@ spec:
326336 - op: add
327337 path: /spec/serviceAccountName
328338 value: shinyproxy-sa
329- image: openanalytics/shinyproxy:3.0.1
339+ image: openanalytics/shinyproxy:3.1.0
330340 imagePullPolicy: Always
331341 fqdn: shinyproxy-demo.local
332342` ` `
@@ -397,3 +407,48 @@ and `/spec/containers/0/volumeMounts` arrays of the pod. The ShinyProxy Operator
397407automatically creates a mount for a configmap which contains the ShinyProxy
398408configuration. By overriding these mounts, this configmap is not be mounted and
399409the default (demo) configuration of ShinyProxy is loaded.
410+
411+ # # Modify the Service Resource
412+
413+ The ShinyProxy Operator automatically creates a Service resource for each
414+ ShinyProxy resource you create. The created Service resource contains everything
415+ that is needed for a working ShinyProxy deployment. However, in some cases it is
416+ required to modify the resource. This can be achieved using
417+ the ` kubernetesServicePatches` field. This field should contain a string which
418+ contains a list of [JSON Patches](https://jsonpatch.com/) to apply to the
419+ Service resource. For example:
420+
421+ ` ` ` yaml
422+ apiVersion: openanalytics.eu/v1
423+ kind: ShinyProxy
424+ metadata:
425+ name: shinyproxy
426+ namespace: shinyproxy
427+ spec:
428+ proxy:
429+ # ...
430+ kubernetesServicePatches: |
431+ - op: add
432+ path: /metadata/annotations
433+ value:
434+ my-annotation: my-value
435+ image: openanalytics/shinyproxy:3.1.0
436+ imagePullPolicy: Always
437+ fqdn: shinyproxy-demo.local
438+ ` ` `
439+
440+ This example patch adds the annotation ` my-annotation: my-value` to the Service
441+ resource created by the operator.
442+
443+ # # Anti-affinity
444+
445+ Starting with version 2.1.0, the operator automatically
446+ adds [anti-affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)
447+ rules, such that Kubernetes will try to not schedule multiple ShinyProxy
448+ replicas on the same Kubernetes node. Note that this only has effect when
449+ running multiple replicas of ShinyProxy. If Kubernetes is unable to satisfy the
450+ requirement, it will still schedule multiple replicas on the same node. This
451+ behavior can be changed by setting ` antiAffinityRequired` to ` true` in your
452+ ShinyProxy configuration. It is also possible to change the topology, by setting
453+ the ` antiAffinityTopologyKey` , e.g. to not run multiple replicas in the same
454+ availability zone you can set this property to ` topology.kubernetes.io/zone ` .
0 commit comments