diff --git a/examples/behind-reverse-proxy/tests.json b/examples/behind-reverse-proxy/tests.json index aad171c55..a31dcf2ca 100644 --- a/examples/behind-reverse-proxy/tests.json +++ b/examples/behind-reverse-proxy/tests.json @@ -7,7 +7,7 @@ "tests": [ { "type": "string", - "url": "http://www.example.com", + "url": "https://www.example.com", "string": "hello" } ] diff --git a/examples/docker-configs/tests.json b/examples/docker-configs/tests.json index ab233f555..1431a0609 100644 --- a/examples/docker-configs/tests.json +++ b/examples/docker-configs/tests.json @@ -7,22 +7,22 @@ "tests": [ { "type": "string", - "url": "http://app1.example.com/hello", + "url": "https://app1.example.com/hello", "string": "world" }, { "type": "string", - "url": "http://app2.example.com/hello", + "url": "https://app2.example.com/hello", "string": "world" }, { "type": "string", - "url": "http://app1.example.com/app1", + "url": "https://app1.example.com/app1", "string": "app1" }, { "type": "string", - "url": "http://app2.example.com/app2", + "url": "https://app2.example.com/app2", "string": "app2" } ] diff --git a/examples/kubernetes-configs/apps.yml b/examples/kubernetes-configs/apps.yml deleted file mode 100644 index cef079ba0..000000000 --- a/examples/kubernetes-configs/apps.yml +++ /dev/null @@ -1,101 +0,0 @@ -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: - - name: app1 - image: tutum/hello-world - ports: - - containerPort: 80 ---- -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: - - name: app2 - image: tutum/hello-world - ports: - - containerPort: 80 ---- -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: - - name: app3 - image: tutum/hello-world - ports: - - containerPort: 80 ---- -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 - targetPort: 80 \ No newline at end of file diff --git a/examples/kubernetes-configs/configs.yml b/examples/kubernetes-configs/configs.yml deleted file mode 100644 index 50fd6389f..000000000 --- a/examples/kubernetes-configs/configs.yml +++ /dev/null @@ -1,66 +0,0 @@ -# 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" - bunkerweb.io/SERVER_NAME: "app2.example.com" -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" - bunkerweb.io/SERVER_NAME: "app3.example.com" -data: - myconf: | - location /app3 { - default_type "text/plain"; - content_by_lua_block { - ngx.say("app3") - } - } \ No newline at end of file diff --git a/examples/kubernetes-configs/ingress.yml b/examples/kubernetes-configs/ingress.yml deleted file mode 100644 index 4d67f20a3..000000000 --- a/examples/kubernetes-configs/ingress.yml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ingress - annotations: - bunkerweb.io/AUTOCONF: "yes" - bunkerweb.io/AUTO_LETS_ENCRYPT: "yes" - bunkerweb.io/USE_LETS_ENCRYPT_STAGING: "yes" -spec: - rules: - - 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 \ No newline at end of file diff --git a/examples/kubernetes-configs/kubernetes.yml b/examples/kubernetes-configs/kubernetes.yml new file mode 100644 index 000000000..0bed118b8 --- /dev/null +++ b/examples/kubernetes-configs/kubernetes.yml @@ -0,0 +1,207 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ingress + annotations: + bunkerweb.io/AUTO_LETS_ENCRYPT: "yes" +spec: + rules: + - 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 +--- +# 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" + bunkerweb.io/SERVER_NAME: "app2.example.com" +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" + bunkerweb.io/SERVER_NAME: "app3.example.com" +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: + - name: app1 + image: tutum/hello-world + ports: + - containerPort: 80 +--- +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: + - name: app2 + image: tutum/hello-world + ports: + - containerPort: 80 +--- +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: + - name: app3 + image: tutum/hello-world + ports: + - containerPort: 80 +--- +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 + targetPort: 80 \ No newline at end of file diff --git a/examples/kubernetes-configs/tests.json b/examples/kubernetes-configs/tests.json new file mode 100644 index 000000000..705b9908b --- /dev/null +++ b/examples/kubernetes-configs/tests.json @@ -0,0 +1,39 @@ +{ + "name": "kubernetes-configs", + "kinds": [ + "kubernetes" + ], + "timeout": 60, + "tests": [ + { + "type": "string", + "url": "https://app1.example.com/hello", + "string": "hello" + }, + { + "type": "string", + "url": "https://app2.example.com/hello", + "string": "hello" + }, + { + "type": "string", + "url": "https://app3.example.com/hello", + "string": "hello" + }, + { + "type": "string", + "url": "https://app1.example.com/app1", + "string": "app1" + }, + { + "type": "string", + "url": "https://app2.example.com/app2", + "string": "app2" + }, + { + "type": "string", + "url": "https://app3.example.com/app3", + "string": "app3" + } + ] +} \ No newline at end of file