Skip to content

Commit

Permalink
Fix experimental helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
gornication committed Sep 29, 2023
1 parent 45244d1 commit 6c12918
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/brokencrystals-experimental/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: |
Benchmark application that uses modern technologies and implements a set of
common security vulnerabilities
type: application
version: 0.0.21
version: 0.0.22
keywords:
- brokencrystals-exp
- brkn-e
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
spec:
containers:
- name: {{ include "brokencrystals.fullname" . }}-nodejs-app
image: brokencrystals:{{ .Values.images.main }}
image: brightsec/brokencrystals:{{ .Values.images.main }}
# command: ["/bin/sleep"]
# args: ["10000"]
env:
Expand Down Expand Up @@ -67,6 +67,10 @@ spec:
scheme: HTTP
initialDelaySeconds: 120
periodSeconds: 30
volumes:
- name: {{ include "brokencrystals.fullname" . }}-nginx
configMap:
name: {{ include "brokencrystals.fullname" . }}-nginx

---
kind: Service
Expand Down
8 changes: 4 additions & 4 deletions charts/brokencrystals-experimental/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ metadata:
spec:
tls:
- hosts:
- {{ .Values.ingress.url }}
- {{ .Release.Name }}.{{ .Values.ingress.url }}
secretName: {{ if eq .Values.ingress.cert "" }}{{ include "brokencrystals.fullname" . }}-brokencrystals-secret{{ else }}{{ .Values.ingress.cert }}{{ end }}
rules:
- host: {{ .Values.ingress.url }}
- host: {{ .Release.Name }}.{{ .Values.ingress.url }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ include "brokencrystals.fullname" . }}-nodejs-proxy-service
name: {{ include "brokencrystals.fullname" . }}-nodejs
port:
number: 80
number: 3000

---
apiVersion: networking.k8s.io/v1
Expand Down
75 changes: 75 additions & 0 deletions charts/brokencrystals-experimental/templates/nginx-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "brokencrystals.fullname" . }}-nginx
namespace: {{ .Release.Namespace }}
data:
# /etc/nginx/conf.d/default.conf
default.conf: |
server {
listen [::]:80 ipv6only=on;
listen 80;
root /var/www/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
index index.html;
location / {
autoindex on;
try_files $uri $uri/ /index.html =404;
}
location /api {
# Forward API requests to the Node.js application
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /swagger {
# Forward /swagger requests to the Node.js application
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /graphiql {
# Forward /graphiql requests to the Node.js application
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /graphql {
# Forward /graphql requests to the Node.js application
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /put.raw {
# Forward /put.raw requests to the Node.js application
rewrite ^/put.raw /api/file/raw?path=./gil.txt break;
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^/(config\.js|config\.json|\.htaccess|\.env|\.nginx\.conf|\.robots\.txt)$ {
allow all;
log_not_found off;
access_log off;
expires 1d;
}
error_page 404 /404.html;
location = /404.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
2 changes: 1 addition & 1 deletion charts/brokencrystals-experimental/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ingress:
url: brokencrystals-exp.dev.vuln.nexploit.app
url: k3s.brokencrystals.nexploit.app
cert: ""
authlevel: "."
images:
Expand Down

0 comments on commit 6c12918

Please sign in to comment.