From 05afaebffcd41c277e27f0efcf7b22096ca1ad8f Mon Sep 17 00:00:00 2001 From: Youngsu Kim <youngsu.kim@csusb.edu> Date: Tue, 25 Jul 2023 13:51:10 -0700 Subject: [PATCH] Add fsGroup --- extraFiles/my_spawner.py | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/extraFiles/my_spawner.py b/extraFiles/my_spawner.py index f12fd37..cb02ca7 100644 --- a/extraFiles/my_spawner.py +++ b/extraFiles/my_spawner.py @@ -50,18 +50,37 @@ class MySpawner(KubeSpawner): 'effect': 'NoSchedule', }] + setattr(self, 'extra_pod_config', { - 'affinity': { - 'nodeAffinity': { - 'requiredDuringSchedulingIgnoredDuringExecution': { - 'nodeSelectorTerms': [{ - 'matchExpressions': nodeSelectorTermsExpressions, - }], + 'securityContext': { + 'fsGroupChangePolicy': 'OnRootMismatch', + 'fsGroup': 100 }, - }, - }, - 'tolerations': tolerationsExpression, - }) + 'affinity': { + 'nodeAffinity': { + 'requiredDuringSchedulingIgnoredDuringExecution': { + 'nodeSelectorTerms': [{ + 'matchExpressions': nodeSelectorTermsExpressions, + }], + }, + }, + }, + 'tolerations': tolerations + }) + + + # setattr(self, 'extra_pod_config', { + # 'affinity': { + # 'nodeAffinity': { + # 'requiredDuringSchedulingIgnoredDuringExecution': { + # 'nodeSelectorTerms': [{ + # 'matchExpressions': nodeSelectorTermsExpressions, + # }], + # }, + # }, + # }, + # 'tolerations': tolerationsExpression, + # }) setattr(self, 'startTimeout', 1200) -- GitLab