Skip to content

Commit

Permalink
add configmap with conf.d for nginx deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
SonOfLope committed Apr 10, 2024
1 parent b497eb6 commit 79e5ace
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions apps/applets/hello/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ resources:
- redis/statefulset.yaml
- nginx/deployment.yaml
- nginx/service.yaml
- nginx/configMap.yaml
13 changes: 13 additions & 0 deletions apps/applets/hello/base/nginx/configMap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
data:
custom-nginx.conf: |
server {
listen 8080;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}
13 changes: 8 additions & 5 deletions apps/applets/hello/base/nginx/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ spec:
- name: nginx-cdn
image: nginx:stable
ports:
- containerPort: 80
- containerPort: 8080
volumeMounts:
- name: hello-volume
mountPath: /usr/share/nginx/html
- name: nginx-temp
mountPath: /var/cache/nginx
- name: config-volume
mountPath: /etc/nginx/conf.d
readOnly: true
securityContext:
runAsUser: 1000
runAsGroup: 1000
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
add:
- NET_BIND_SERVICE
allowPrivilegeEscalation: false
resources:
requests:
cpu: "100m"
Expand All @@ -45,3 +45,6 @@ spec:
claimName: hello-pvc
- name: nginx-temp
emptyDir: {}
- name: config-volume
configMap:
name: nginx-config
2 changes: 1 addition & 1 deletion apps/applets/hello/base/nginx/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ spec:
ports:
- protocol: TCP
port: 80
targetPort: 80
targetPort: 8080
type: ClusterIP

0 comments on commit 79e5ace

Please sign in to comment.