Skip to content

Commit

Permalink
Add the ability to set up studio annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
VyacheslavSemin committed May 2, 2024
1 parent ba26d70 commit 1100be0
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 28 deletions.
12 changes: 7 additions & 5 deletions templates/applications/socket.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "docspace.labels.commonLabels" . | trim | nindent 4 }}
{{- end }}
{{- if or .Values.commonAnnotations .Values.socket.annotations }}
{{- $dictValue := default .Values.commonAnnotations .Values.socket.annotations }}
annotations: {{- include "docspace.annotations" ( dict "keyName" $dictValue "context" $ ) | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.socket.replicaCount }}
selector:
Expand Down Expand Up @@ -37,11 +41,9 @@ spec:
{{- if .Values.commonLabels }}
{{- include "docspace.labels.commonLabels" . | trim | nindent 8 }}
{{- end }}
{{- if .Values.podAnnotations }}
annotations:
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ tpl $value $ }}
{{- end }}
{{- if or .Values.podAnnotations .Values.socket.podAnnotations }}
{{- $dictValue := default .Values.podAnnotations .Values.socket.podAnnotations }}
annotations: {{- include "docspace.annotations" ( dict "keyName" $dictValue "context" $ ) | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "docspace.serviceAccountName" . }}
Expand Down
12 changes: 7 additions & 5 deletions templates/applications/ssoauth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "docspace.labels.commonLabels" . | trim | nindent 4 }}
{{- end }}
{{- if or .Values.commonAnnotations .Values.ssoauth.annotations }}
{{- $dictValue := default .Values.commonAnnotations .Values.ssoauth.annotations }}
annotations: {{- include "docspace.annotations" ( dict "keyName" $dictValue "context" $ ) | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.ssoauth.replicaCount }}
selector:
Expand Down Expand Up @@ -37,11 +41,9 @@ spec:
{{- if .Values.commonLabels }}
{{- include "docspace.labels.commonLabels" . | trim | nindent 8 }}
{{- end }}
{{- if .Values.podAnnotations }}
annotations:
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ tpl $value $ }}
{{- end }}
{{- if or .Values.podAnnotations .Values.ssoauth.podAnnotations }}
{{- $dictValue := default .Values.podAnnotations .Values.ssoauth.podAnnotations }}
annotations: {{- include "docspace.annotations" ( dict "keyName" $dictValue "context" $ ) | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "docspace.serviceAccountName" . }}
Expand Down
28 changes: 15 additions & 13 deletions templates/applications/studio-notify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@
apiVersion: apps/v1
kind: {{ .Values.studioNotify.kind }}
metadata:
name: studio-notify
name: studio-studioNotify
namespace: {{ include "docspace.namespace" . | quote }}
labels:
app: studio-notify
app: studio-studioNotify
{{- if .Values.commonLabels }}
{{- include "docspace.labels.commonLabels" . | trim | nindent 4 }}
{{- end }}
{{- if or .Values.commonAnnotations .Values.studioNotify.annotations }}
{{- $dictValue := default .Values.commonAnnotations .Values.studioNotify.annotations }}
annotations: {{- include "docspace.annotations" ( dict "keyName" $dictValue "context" $ ) | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.studioNotify.replicaCount }}
selector:
matchLabels:
app: studio-notify
app: studio-studioNotify
{{- if .Values.commonLabels }}
{{- include "docspace.labels.commonLabels" . | trim | nindent 6 }}
{{- end }}
{{- if eq .Values.studioNotify.kind "StatefulSet" }}
serviceName: studio-notify
serviceName: studio-studioNotify
{{- end }}
{{- if .Values.studioNotify.updateStrategy }}
{{- if eq .Values.studioNotify.kind "Deployment" }}
Expand All @@ -33,15 +37,13 @@ spec:
template:
metadata:
labels:
app: studio-notify
app: studio-studioNotify
{{- if .Values.commonLabels }}
{{- include "docspace.labels.commonLabels" . | trim | nindent 8 }}
{{- end }}
{{- if .Values.podAnnotations }}
annotations:
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ tpl $value $ }}
{{- end }}
{{- if or .Values.podAnnotations .Values.studioNotify.podAnnotations }}
{{- $dictValue := default .Values.podAnnotations .Values.studioNotify.podAnnotations }}
annotations: {{- include "docspace.annotations" ( dict "keyName" $dictValue "context" $ ) | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "docspace.serviceAccountName" . }}
Expand All @@ -64,7 +66,7 @@ spec:
- key: app
operator: In
values:
- studio-notify
- studio-studioNotify
topologyKey: {{ .Values.podAntiAffinity.topologyKey }}
weight: {{ .Values.podAntiAffinity.weight }}
{{- else if eq .Values.podAntiAffinity.type "required" }}
Expand All @@ -74,7 +76,7 @@ spec:
- key: app
operator: In
values:
- studio-notify
- studio-studioNotify
topologyKey: {{ .Values.podAntiAffinity.topologyKey }}
{{- end }}
{{- with .Values.studioNotify.customPodAntiAffinity }}
Expand Down Expand Up @@ -119,7 +121,7 @@ spec:
{{- toYaml . | nindent 6 }}
{{- end }}
containers:
- name: studio-notify
- name: studio-studioNotify
image: {{ include "docspace.imageRepository" (list . .Values.studioNotify.image.repository) }}:{{ default .Values.images.tag .Values.studioNotify.image.tag }}
imagePullPolicy: {{ .Values.studioNotify.image.pullPolicy }}
{{- if or .Values.containerSecurityContext.enabled .Values.studioNotify.containerSecurityContext.enabled }}
Expand Down
12 changes: 7 additions & 5 deletions templates/applications/studio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ metadata:
{{- if .Values.commonLabels }}
{{- include "docspace.labels.commonLabels" . | trim | nindent 4 }}
{{- end }}
{{- if or .Values.commonAnnotations .Values.studio.annotations }}
{{- $dictValue := default .Values.commonAnnotations .Values.studio.annotations }}
annotations: {{- include "docspace.annotations" ( dict "keyName" $dictValue "context" $ ) | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.studio.replicaCount }}
selector:
Expand Down Expand Up @@ -37,11 +41,9 @@ spec:
{{- if .Values.commonLabels }}
{{- include "docspace.labels.commonLabels" . | trim | nindent 8 }}
{{- end }}
{{- if .Values.podAnnotations }}
annotations:
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ tpl $value $ }}
{{- end }}
{{- if or .Values.podAnnotations .Values.studio.podAnnotations }}
{{- $dictValue := default .Values.podAnnotations .Values.studio.podAnnotations }}
annotations: {{- include "docspace.annotations" ( dict "keyName" $dictValue "context" $ ) | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "docspace.serviceAccountName" . }}
Expand Down
24 changes: 24 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2542,6 +2542,10 @@ socket:
# socket.kind The controller used for deploy
# Possible values are `Deployment` (default) or `StatefulSet`
kind: Deployment
# socket.annotations Defines annotations that will be additionally added to Socket deploy
# If set to, it takes priority over the `commonAnnotations`
# You can also use `tpl` as the value for the key
annotations: {}
# socket.replicaCount Number of Socket replicas to deploy
replicaCount: 2
# Update strategy used to replace old Pods by new ones
Expand All @@ -2559,6 +2563,8 @@ socket:
# Used if `socket.kind` is set to `StatefulSet`
# ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-management-policies
podManagementPolicy: OrderedReady
# socket.podAnnotations Map of annotations to add to the Socket pods
podAnnotations: {}
# Configure a Security Context for the Socket Pods
# If set to, it takes priority over the `podSecurityContext`
podSecurityContext:
Expand Down Expand Up @@ -2696,6 +2702,10 @@ ssoauth:
# ssoauth.kind The controller used for deploy
# Possible values are `Deployment` (default) or `StatefulSet`
kind: Deployment
# ssoauth.annotations Defines annotations that will be additionally added to ssoauth deploy
# If set to, it takes priority over the `commonAnnotations`
# You can also use `tpl` as the value for the key
annotations: {}
# ssoauth.replicaCount Number of ssoauth replicas to deploy
replicaCount: 2
# Update strategy used to replace old Pods by new ones
Expand All @@ -2713,6 +2723,8 @@ ssoauth:
# Used if `ssoauth.kind` is set to `StatefulSet`
# ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-management-policies
podManagementPolicy: OrderedReady
# ssoauth.podAnnotations Map of annotations to add to the ssoauth pods
podAnnotations: {}
# Configure a Security Context for the ssoauth Pods
# If set to, it takes priority over the `podSecurityContext`
podSecurityContext:
Expand Down Expand Up @@ -2844,6 +2856,10 @@ studio:
# studio.kind The controller used for deploy
# Possible values are `Deployment` (default) or `StatefulSet`
kind: Deployment
# studio.annotations Defines annotations that will be additionally added to Studio deploy
# If set to, it takes priority over the `commonAnnotations`
# You can also use `tpl` as the value for the key
annotations: {}
# studio.replicaCount Number of Studio replicas to deploy
replicaCount: 2
# Update strategy used to replace old Pods by new ones
Expand All @@ -2861,6 +2877,8 @@ studio:
# Used if `studio.kind` is set to `StatefulSet`
# ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-management-policies
podManagementPolicy: OrderedReady
# studio.podAnnotations Map of annotations to add to the Studio pods
podAnnotations: {}
# Configure a Security Context for the Studio Pods
# If set to, it takes priority over the `podSecurityContext`
podSecurityContext:
Expand Down Expand Up @@ -2996,6 +3014,10 @@ studioNotify:
# studioNotify.kind The controller used for deploy
# Possible values are `Deployment` (default) or `StatefulSet`
kind: Deployment
# studioNotify.annotations Defines annotations that will be additionally added to Studio Notify deploy
# If set to, it takes priority over the `commonAnnotations`
# You can also use `tpl` as the value for the key
annotations: {}
# studioNotify.replicaCount Number of Studio Notify replicas to deploy
replicaCount: 2
# Update strategy used to replace old Pods by new ones
Expand All @@ -3013,6 +3035,8 @@ studioNotify:
# Used if `studioNotify.kind` is set to `StatefulSet`
# ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-management-policies
podManagementPolicy: OrderedReady
# studioNotify.podAnnotations Map of annotations to add to the Studio Notify pods
podAnnotations: {}
# Configure a Security Context for the Studio Notify Pods
# If set to, it takes priority over the `podSecurityContext`
podSecurityContext:
Expand Down

0 comments on commit 1100be0

Please sign in to comment.