Skip to content

Commit be81f17

Browse files
MK8S-25: Fix nginx container health check failures by creating index files before container start
The nginx container was failing health checks because index.html files were being created AFTER the container started, causing 403 "directory index forbidden" errors during the liveness/readiness probes. This fix moves the index.html file creation to happen BEFORE the container manifest is deployed, ensuring the files exist when nginx starts and can serve the health check requests successfully. Root cause: nginx.conf has "autoindex off; index index.html;" but files didn't exist at container startup time, causing health check failures and container restarts.
1 parent eca84fa commit be81f17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

salt/metalk8s/repo/installed.sls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Install repositories manifest:
7373
- file: Generate repositories nginx configuration
7474
- file: Deploy container registry nginx configuration
7575
- file: Generate container registry configuration
76+
- file: Create saltenv index file
7677
7778
Delay after repositories pod deployment:
7879
module.wait:
@@ -94,7 +95,6 @@ Ensure repositories container is up:
9495
- metalk8s: Install repositories manifest
9596
- require:
9697
- module: Delay after repositories pod deployment
97-
- file: Create saltenv index file
9898
9999
# Create index.html files to prevent directory listing issues
100100
Create repository index files:
@@ -103,8 +103,6 @@ Create repository index files:
103103
- contents: ''
104104
- makedirs: True
105105
- mode: 644
106-
- require:
107-
- module: Ensure repositories container is up
108106
109107
Create saltenv index file:
110108
file.managed:
@@ -121,3 +119,5 @@ Wait for Repositories container to answer:
121119
repo.port }}/{{ saltenv }}/
122120
- status: 200
123121
- request_interval: 1
122+
require:
123+
- file: Create saltenv index file

0 commit comments

Comments
 (0)