Skip to content

Commit

Permalink
Merge release/v4.0.0 into master
Browse files Browse the repository at this point in the history
Merge Helm Chart release/v4.0.0 into master
  • Loading branch information
agolybev authored Feb 6, 2024
2 parents 5680c18 + 13569f1 commit 851362e
Show file tree
Hide file tree
Showing 13 changed files with 181 additions and 52 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Change log

## 4.0.0

### New Features

* Added the ability to connect to Redis Cluster
* Added the ability to set up custom `podAntiAffinity`
* Added the ability to set up max size uploaded file
* Added the ability to map config file to Example

### Changes

* Updated the Security Context Constraints policy for OpenShift
* Released [v8.0.0](https://github.com/ONLYOFFICE/DocumentServer/blob/master/CHANGELOG.md#800) of ONLYOFFICE Docs

## 3.5.0

### New Features
Expand Down
4 changes: 2 additions & 2 deletions Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ description: Helm chart for installing ONLYOFFICE Docs in Kubernetes

type: application

version: 3.5.0
version: 4.0.0

appVersion: 7.5.1
appVersion: 8.0.0
31 changes: 19 additions & 12 deletions README.md

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions sources/scc/docs-components.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
kind: SecurityContextConstraints
apiVersion: v1
apiVersion: security.openshift.io/v1
metadata:
name: scc-docs-components
allowPrivilegedContainer: false
runAsUser:
type: MustRunAsRange
uidRangeMax: 101
uidRangeMin: 101
type: MustRunAs
uid: 101
seLinuxContext:
type: MustRunAs
fsGroup:
type: MustRunAs
ranges:
ranges:
- max: 101
min: 101
supplementalGroups:
Expand Down
11 changes: 6 additions & 5 deletions sources/scc/helm-components.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
kind: SecurityContextConstraints
apiVersion: v1
apiVersion: security.openshift.io/v1
metadata:
name: scc-helm-components
allowPrivilegedContainer: false
runAsUser:
type: MustRunAsRange
uidRangeMax: 1001
uidRangeMin: 1001
type: MustRunAs
uid: 1001
seLinuxContext:
type: MustRunAs
fsGroup:
type: MustRunAs
ranges:
ranges:
- max: 1001
min: 1001
supplementalGroups:
type: MustRunAs
users: []
groups: []
seccompProfiles:
- runtime/default
40 changes: 35 additions & 5 deletions sources/scripts/test_ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
redisPassword = os.environ.get('REDIS_SERVER_PWD')
redisDBNum = os.environ.get('REDIS_SERVER_DB_NUM')
redisConnectTimeout = 15
if os.environ.get('REDIS_CLUSTER_NODES'):
redisClusterNodes = list(os.environ.get('REDIS_CLUSTER_NODES').split(" "))
redisClusterNode = redisClusterNodes[0].split(":")[0]
redisClusterPort = redisClusterNodes[0].split(":")[1]
if redisConnectorName == 'ioredis':
redisSentinelGroupName = os.environ.get('REDIS_SENTINEL_GROUP_NAME')

Expand Down Expand Up @@ -72,10 +76,33 @@ def get_redis_status():
)
rc.ping()
except Exception as msg_redis:
logger_test_ds.error(f'Failed to check the availability of the Redis... {msg_redis}\n')
logger_test_ds.error(f'Failed to check the availability of the Redis Standalone... {msg_redis}\n')
total_result['CheckRedis'] = 'Failed'
else:
logger_test_ds.info('Successful connection to Redis')
logger_test_ds.info('Successful connection to Redis Standalone')
return rc.ping()


def get_redis_cluster_status():
install_module('redis')
from redis.cluster import RedisCluster as Redis
from redis.cluster import ClusterNode
global rc
try:
nodes = [ClusterNode(redisClusterNode, redisClusterPort)]
rc = Redis(
startup_nodes=nodes,
username=redisUser,
password=redisPassword,
socket_connect_timeout=redisConnectTimeout,
retry_on_timeout=True
)
rc.ping()
except Exception as msg_redis:
logger_test_ds.error(f'Failed to check the availability of the Redis Cluster... {msg_redis}\n')
total_result['CheckRedis'] = 'Failed'
else:
logger_test_ds.info('Successful connection to Redis Cluster')
return rc.ping()


Expand All @@ -98,10 +125,10 @@ def get_redis_sentinel_status():
)
rc.ping()
except Exception as msg_redis:
logger_test_ds.error(f'Failed to check the availability of the Redis... {msg_redis}\n')
logger_test_ds.error(f'Failed to check the availability of the Redis Sentinel... {msg_redis}\n')
total_result['CheckRedis'] = 'Failed'
else:
logger_test_ds.info('Successful connection to Redis')
logger_test_ds.info('Successful connection to Redis Sentinel')
return rc.ping()


Expand All @@ -122,9 +149,12 @@ def check_redis_key():

def check_redis():
logger_test_ds.info('Checking Redis availability...')
if redisConnectorName == 'redis':
if redisConnectorName == 'redis' and not os.environ.get('REDIS_CLUSTER_NODES'):
if get_redis_status() is True:
check_redis_key()
elif redisConnectorName == 'redis' and os.environ.get('REDIS_CLUSTER_NODES'):
if get_redis_cluster_status() is True:
check_redis_key()
elif redisConnectorName == 'ioredis':
if get_redis_sentinel_status() is True:
check_redis_key()
Expand Down
2 changes: 1 addition & 1 deletion sources/shutdown-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
defaultMode: 0755
containers:
- name: shutdown-ds
image: onlyoffice/docs-utils:7.5.1-2
image: onlyoffice/docs-utils:8.0.0-1
command: ["/bin/sh", "-c"]
args: ["/scripts/stop.sh"]
volumeMounts:
Expand Down
4 changes: 4 additions & 0 deletions templates/configmaps/documentserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ data:
REDIS_SERVER_PORT: {{ .Values.connections.redisPort | quote }}
REDIS_SERVER_USER: {{ .Values.connections.redisUser }}
REDIS_SERVER_DB_NUM: {{ .Values.connections.redisDBNum | quote }}
{{- if.Values.connections.redisClusterNodes }}
REDIS_CLUSTER_NODES: {{ join " " .Values.connections.redisClusterNodes }}
{{- end }}
{{- if eq .Values.connections.redisConnectorName "ioredis" }}
REDIS_SENTINEL_GROUP_NAME: {{ .Values.connections.redisSentinelGroupName }}
{{- end }}
Expand All @@ -38,6 +41,7 @@ data:
LOG_PATTERN: {{ .Values.log.pattern | quote }}
NGINX_ACCESS_LOG: {{ .Values.proxy.accessLog | quote }}
NGINX_GZIP_PROXIED: {{ .Values.proxy.gzipProxied | quote }}
NGINX_CLIENT_MAX_BODY_SIZE: {{ .Values.proxy.clientMaxBodySize | quote }}
NGINX_WORKER_CONNECTIONS: {{ .Values.proxy.workerConnections | quote }}
SECURE_LINK_SECRET: {{ .Values.proxy.secureLinkSecret | quote }}
{{- if .Values.example.enabled }}
Expand Down
9 changes: 6 additions & 3 deletions templates/deployments/converter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
{{- end }}
affinity:
podAntiAffinity:
{{- if eq .Values.podAntiAffinity.type "soft" }}
{{- if eq .Values.podAntiAffinity.type "soft" }}
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
Expand All @@ -52,7 +52,7 @@ spec:
- converter
topologyKey: {{ .Values.podAntiAffinity.topologyKey }}
weight: {{ .Values.podAntiAffinity.weight }}
{{- else if eq .Values.podAntiAffinity.type "hard" }}
{{- else if eq .Values.podAntiAffinity.type "hard" }}
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
Expand All @@ -61,7 +61,10 @@ spec:
values:
- converter
topologyKey: {{ .Values.podAntiAffinity.topologyKey }}
{{- end }}
{{- end }}
{{- with .Values.converter.customPodAntiAffinity }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.converter.podAffinity }}
podAffinity:
{{- toYaml . | nindent 10 }}
Expand Down
9 changes: 6 additions & 3 deletions templates/deployments/docservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
# app: docservice
affinity:
podAntiAffinity:
{{- if eq .Values.podAntiAffinity.type "soft" }}
{{- if eq .Values.podAntiAffinity.type "soft" }}
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
Expand All @@ -59,7 +59,7 @@ spec:
- docservice
topologyKey: {{ .Values.podAntiAffinity.topologyKey }}
weight: {{ .Values.podAntiAffinity.weight }}
{{- else if eq .Values.podAntiAffinity.type "hard" }}
{{- else if eq .Values.podAntiAffinity.type "hard" }}
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
Expand All @@ -68,7 +68,10 @@ spec:
values:
- docservice
topologyKey: {{ .Values.podAntiAffinity.topologyKey }}
{{- end }}
{{- end }}
{{- with .Values.docservice.customPodAntiAffinity }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.docservice.podAffinity }}
podAffinity:
{{- toYaml . | nindent 10 }}
Expand Down
2 changes: 1 addition & 1 deletion templates/jobs/dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
defaultMode: 0755
containers:
- name: grafana-dashboard
image: onlyoffice/docs-utils:7.5.1-2
image: onlyoffice/docs-utils:8.0.0-1
command: ["/bin/sh", "-c"]
{{- if .Values.webProxy.enabled }}
args: ["http_proxy={{ .Values.webProxy.http }} https_proxy={{ .Values.webProxy.https }} no_proxy={{ .Values.webProxy.noProxy }} /scripts/get_dashboard.sh"]
Expand Down
18 changes: 17 additions & 1 deletion templates/statefulset/example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ spec:
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{- toYaml .Values.podSecurityContext.example | nindent 8 }}
{{- end }}
{{- if or .Values.example.podAffinity .Values.example.nodeAffinity }}
{{- if or .Values.example.customPodAntiAffinity .Values.example.podAffinity .Values.example.nodeAffinity }}
affinity:
{{- with .Values.example.customPodAntiAffinity }}
podAntiAffinity:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.example.podAffinity }}
podAffinity:
{{- toYaml . | nindent 10 }}
Expand Down Expand Up @@ -74,4 +78,16 @@ spec:
name: {{ template "ds.jwt.secretName" . }}
- configMapRef:
name: example
{{- if .Values.example.extraConf.configMap }}
volumeMounts:
- name: example-custom-file
mountPath: /etc/{{ .Values.product.name }}/documentserver-example/{{ .Values.example.extraConf.filename }}
subPath: {{ .Values.example.extraConf.filename }}
{{- end }}
{{- if .Values.example.extraConf.configMap }}
volumes:
- name: example-custom-file
configMap:
name: {{ .Values.example.extraConf.configMap }}
{{- end }}
{{- end }}
Loading

0 comments on commit 851362e

Please sign in to comment.