2022-07-21 13:59:19 +02:00
apiVersion : networking.k8s.io/v1
kind : Ingress
metadata :
name : ingress
annotations :
bunkerweb.io/AUTO_LETS_ENCRYPT : "yes"
spec :
rules :
2022-10-19 17:37:13 +02:00
- host : app1.example.com
http :
paths :
- path : /
pathType : Prefix
backend :
service :
name : svc-app1
port :
number : 80
- host : app2.example.com
http :
paths :
- path : /
pathType : Prefix
backend :
service :
name : svc-app2
port :
number : 80
- host : app3.example.com
http :
paths :
- path : /
pathType : Prefix
backend :
service :
name : svc-app3
port :
number : 80
2022-07-21 13:59:19 +02:00
---
# you don't even need to mount the config as volumes : a declaration is enough, the controller will take care of the rest
# bunkerweb.io/CONFIG_TYPE accepted values are http, stream, server-http, server-stream, default-server-http, modsec and modsec-crs
# bunkerweb.io/CONFIG_SITE lets you choose on which web service the config should be applied (MULTISITE mode) and if it's not set, the config will be applied for all services
# more info at https://docs.bunkerweb.io
apiVersion : v1
kind : ConfigMap
metadata :
name : cfg-bunkerweb-all-server-http
annotations :
bunkerweb.io/CONFIG_TYPE : "server-http"
data :
myconf : |
location /hello {
default_type "text/plain";
content_by_lua_block {
ngx.say("hello")
}
}
---
apiVersion : v1
kind : ConfigMap
metadata :
name : cfg-bunkerweb-app1-server-http
annotations :
bunkerweb.io/CONFIG_TYPE : "server-http"
bunkerweb.io/CONFIG_SITE : "app1.example.com"
data :
myconf : |
location /app1 {
default_type "text/plain";
content_by_lua_block {
ngx.say("app1")
}
}
---
apiVersion : v1
kind : ConfigMap
metadata :
name : cfg-bunkerweb-app2-server-http
annotations :
bunkerweb.io/CONFIG_TYPE : "server-http"
2023-12-04 17:29:57 +01:00
bunkerweb.io/CONFIG_SITE : "app2.example.com"
2022-07-21 13:59:19 +02:00
data :
myconf : |
location /app2 {
default_type "text/plain";
content_by_lua_block {
ngx.say("app2")
}
}
---
apiVersion : v1
kind : ConfigMap
metadata :
name : cfg-bunkerweb-app3-server-http
annotations :
bunkerweb.io/CONFIG_TYPE : "server-http"
2023-12-04 17:29:57 +01:00
bunkerweb.io/CONFIG_SITE : "app3.example.com"
2022-07-21 13:59:19 +02:00
data :
myconf : |
location /app3 {
default_type "text/plain";
content_by_lua_block {
ngx.say("app3")
}
}
---
apiVersion : apps/v1
kind : Deployment
metadata :
name : app1
labels :
app : app1
spec :
replicas : 1
selector :
matchLabels :
app : app1
template :
metadata :
labels :
app : app1
spec :
containers :
2022-10-19 17:37:13 +02:00
- name : app1
image : tutum/hello-world
ports :
- containerPort : 80
2022-07-21 13:59:19 +02:00
---
apiVersion : apps/v1
kind : Deployment
metadata :
name : app2
labels :
app : app2
spec :
replicas : 1
selector :
matchLabels :
app : app2
template :
metadata :
labels :
app : app2
spec :
containers :
2022-10-19 17:37:13 +02:00
- name : app2
image : tutum/hello-world
ports :
- containerPort : 80
2022-07-21 13:59:19 +02:00
---
apiVersion : apps/v1
kind : Deployment
metadata :
name : app3
labels :
app : app3
spec :
replicas : 1
selector :
matchLabels :
app : app3
template :
metadata :
labels :
app : app3
spec :
containers :
2022-10-19 17:37:13 +02:00
- name : app3
image : tutum/hello-world
ports :
- containerPort : 80
2022-07-21 13:59:19 +02:00
---
apiVersion : v1
kind : Service
metadata :
name : svc-app1
spec :
selector :
app : app1
ports :
- protocol : TCP
port : 80
targetPort : 80
---
apiVersion : v1
kind : Service
metadata :
name : svc-app2
spec :
selector :
app : app2
ports :
- protocol : TCP
port : 80
targetPort : 80
---
apiVersion : v1
kind : Service
metadata :
name : svc-app3
spec :
selector :
app : app3
ports :
- protocol : TCP
port : 80
2022-10-19 17:37:13 +02:00
targetPort : 80