mirror of
https://gitlab.com/TECHNOFAB/nixlets.git
synced 2025-12-12 01:50:05 +01:00
fix(attic): securityContext improvements and conditionally switch to StatefulSet
This commit is contained in:
parent
7d0c2c6d11
commit
ff98c7e3b5
1 changed files with 14 additions and 3 deletions
|
|
@ -3,15 +3,26 @@
|
|||
lib,
|
||||
...
|
||||
}: {
|
||||
kubernetes.resources = {
|
||||
deployments."${values.uniqueName}" = {
|
||||
kubernetes.resources = let
|
||||
# switch to a StatefulSet if we don't use an external storage configuration
|
||||
type =
|
||||
if values.externalStorage
|
||||
then "deployments"
|
||||
else "statefulSets";
|
||||
in {
|
||||
${type}."${values.uniqueName}" = {
|
||||
spec = {
|
||||
replicas = values.replicaCount;
|
||||
selector.matchLabels.app = "${values.uniqueName}";
|
||||
serviceName = "attic";
|
||||
template = {
|
||||
metadata.labels.app = "${values.uniqueName}";
|
||||
spec = {
|
||||
securityContext.fsGroup = 1000;
|
||||
securityContext = {
|
||||
fsGroup = 1000;
|
||||
runAsUser = 1000;
|
||||
runAsGroup = 1000;
|
||||
};
|
||||
containers."api-server" = {
|
||||
image = "${values.image.repository}:${values.image.tag}";
|
||||
imagePullPolicy = values.image.pullPolicy;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue