Compare commits

...

2 Commits

Author SHA1 Message Date
Jörg Thalheim 468384dc43
only start one nginx replica 2021-01-08 13:08:38 +01:00
Jörg Thalheim f7f5c5aa8d
don't create cache/log volume 2021-01-08 13:06:05 +01:00
2 changed files with 4 additions and 7 deletions

View File

@ -3,9 +3,10 @@
dockerTools.buildLayeredImage {
name = "nginx";
contents = [ nginx ];
# also we log to stderr, it still needs /var/log/nginx on start
extraCommands = ''
mkdir -p etc
chmod u+w etc
mkdir -p etc var/cache/nginx var/log/nginx
chmod u+w etc var/cache/nginx var/log/nginx
echo "nginx:x:1000:1000::/:" > etc/passwd
echo "nginx:x:1000:nginx" > etc/group
'';

View File

@ -11,7 +11,7 @@ in {
kubernetes.resources.deployments.nginx = {
spec = {
replicas = 10;
replicas = 1;
selector.matchLabels.app = "nginx";
template = {
metadata.labels.app = "nginx";
@ -22,13 +22,9 @@ in {
imagePullPolicy = "IfNotPresent";
volumeMounts."/etc/nginx".name = "config";
volumeMounts."/var/lib/html".name = "static";
volumeMounts."/var/log/nginx".name = "logs";
volumeMounts."/var/log/cache".name = "cache";
};
volumes.config.configMap.name = "nginx-config";
volumes.static.configMap.name = "nginx-static";
volumes.logs.configMap.name = "nginx-logs";
volumes.cache.configMap.name = "nginx-cache";
};
};
};