From 1e58dd1bb4ea83542571dd520a871ad9a29bc613 Mon Sep 17 00:00:00 2001 From: James Pannacciulli Date: Fri, 3 Nov 2023 17:24:28 -0400 Subject: initial commit of possibly working code --- seagl2023/generic.ingress.yaml | 63 +++++++++++++++++ seagl2023/k8s.jp.net/example00/Dockerfile | 2 + seagl2023/k8s.jp.net/example00/html/index.html | 16 +++++ .../k8s.jp.net/example00/html/seagl.lounging.png | Bin 0 -> 54027 bytes seagl2023/k8s.jp.net/example01/Dockerfile | 2 + seagl2023/k8s.jp.net/example01/html/index.html | 14 ++++ seagl2023/k8s.jp.net/example01/html/seagl.left.png | Bin 0 -> 45982 bytes .../k8s.jp.net/example01/html/seagl.right.png | Bin 0 -> 30768 bytes seagl2023/k8s.jp.net/ingress.yaml | 76 +++++++++++++++++++++ seagl2023/k8s.jp.net/seagl00.yaml | 37 ++++++++++ seagl2023/k8s.jp.net/seagl01.yaml | 37 ++++++++++ 11 files changed, 247 insertions(+) create mode 100644 seagl2023/generic.ingress.yaml create mode 100644 seagl2023/k8s.jp.net/example00/Dockerfile create mode 100644 seagl2023/k8s.jp.net/example00/html/index.html create mode 100644 seagl2023/k8s.jp.net/example00/html/seagl.lounging.png create mode 100644 seagl2023/k8s.jp.net/example01/Dockerfile create mode 100644 seagl2023/k8s.jp.net/example01/html/index.html create mode 100644 seagl2023/k8s.jp.net/example01/html/seagl.left.png create mode 100644 seagl2023/k8s.jp.net/example01/html/seagl.right.png create mode 100644 seagl2023/k8s.jp.net/ingress.yaml create mode 100644 seagl2023/k8s.jp.net/seagl00.yaml create mode 100644 seagl2023/k8s.jp.net/seagl01.yaml (limited to 'seagl2023') diff --git a/seagl2023/generic.ingress.yaml b/seagl2023/generic.ingress.yaml new file mode 100644 index 0000000..632bb4c --- /dev/null +++ b/seagl2023/generic.ingress.yaml @@ -0,0 +1,63 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: nginx-ingress-microk8s + annotations: + kubernetes.io/ingress.class: public + ingressclass.kubernetes.io/is-default-class: "true" + cert-manager.io/cluster-issuer: letsencrypt + nginx.ingress.kubernetes.io/enable-modsecurity: "true" + nginx.ingress.kubernetes.io/enable-owasp-core-rules: "true" + nginx.ingress.kubernetes.io/modsecurity-transaction-id: "$request_id" + nginx.ingress.kubernetes.io/modsecurity-snippet: | + SecRuleEngine On +spec: + rules: + - host: "example.com" + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: example-com + port: + number: 80 + tls: + - hosts: + - example.com + secretName: example-com-tls +--- +apiVersion: v1 +kind: Service +metadata: + name: ingress +spec: + selector: + name: nginx-ingress-microk8s + ports: + - name: http + protocol: TCP + port: 80 + targetPort: 80 +--- +apiVersion: cert-manager.io/v1 +kind: ClusterIssuer +metadata: + name: letsencrypt +spec: + acme: + # You must replace this email address with your own. + # Let's Encrypt will use this to contact you about expiring + # certificates, and issues related to your account. + email: seagl2023@jpnc.info + server: https://acme-v02.api.letsencrypt.org/directory + privateKeySecretRef: + # Secret resource that will be used to store the account's private key. + name: letsencrypt-account-key + # Add a single challenge solver, HTTP01 using nginx + solvers: + - http01: + ingress: + class: public diff --git a/seagl2023/k8s.jp.net/example00/Dockerfile b/seagl2023/k8s.jp.net/example00/Dockerfile new file mode 100644 index 0000000..f4f377c --- /dev/null +++ b/seagl2023/k8s.jp.net/example00/Dockerfile @@ -0,0 +1,2 @@ +FROM nginx +COPY html /usr/share/nginx/html diff --git a/seagl2023/k8s.jp.net/example00/html/index.html b/seagl2023/k8s.jp.net/example00/html/index.html new file mode 100644 index 0000000..e56fa18 --- /dev/null +++ b/seagl2023/k8s.jp.net/example00/html/index.html @@ -0,0 +1,16 @@ + + + woah! + + + + +
+

greetings, earthlings of SeaGL

+ + diff --git a/seagl2023/k8s.jp.net/example00/html/seagl.lounging.png b/seagl2023/k8s.jp.net/example00/html/seagl.lounging.png new file mode 100644 index 0000000..fd911e4 Binary files /dev/null and b/seagl2023/k8s.jp.net/example00/html/seagl.lounging.png differ diff --git a/seagl2023/k8s.jp.net/example01/Dockerfile b/seagl2023/k8s.jp.net/example01/Dockerfile new file mode 100644 index 0000000..f4f377c --- /dev/null +++ b/seagl2023/k8s.jp.net/example01/Dockerfile @@ -0,0 +1,2 @@ +FROM nginx +COPY html /usr/share/nginx/html diff --git a/seagl2023/k8s.jp.net/example01/html/index.html b/seagl2023/k8s.jp.net/example01/html/index.html new file mode 100644 index 0000000..695a270 --- /dev/null +++ b/seagl2023/k8s.jp.net/example01/html/index.html @@ -0,0 +1,14 @@ + + + woah! + + + + +

the second example!

+ + diff --git a/seagl2023/k8s.jp.net/example01/html/seagl.left.png b/seagl2023/k8s.jp.net/example01/html/seagl.left.png new file mode 100644 index 0000000..2f05f37 Binary files /dev/null and b/seagl2023/k8s.jp.net/example01/html/seagl.left.png differ diff --git a/seagl2023/k8s.jp.net/example01/html/seagl.right.png b/seagl2023/k8s.jp.net/example01/html/seagl.right.png new file mode 100644 index 0000000..4143fa9 Binary files /dev/null and b/seagl2023/k8s.jp.net/example01/html/seagl.right.png differ diff --git a/seagl2023/k8s.jp.net/ingress.yaml b/seagl2023/k8s.jp.net/ingress.yaml new file mode 100644 index 0000000..444a88e --- /dev/null +++ b/seagl2023/k8s.jp.net/ingress.yaml @@ -0,0 +1,76 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: nginx-ingress-microk8s + annotations: + kubernetes.io/ingress.class: public + ingressclass.kubernetes.io/is-default-class: "true" + cert-manager.io/cluster-issuer: letsencrypt + nginx.ingress.kubernetes.io/enable-modsecurity: "true" + nginx.ingress.kubernetes.io/enable-owasp-core-rules: "true" + nginx.ingress.kubernetes.io/modsecurity-transaction-id: "$request_id" + nginx.ingress.kubernetes.io/modsecurity-snippet: | + SecRuleEngine On +spec: + rules: + - host: "seagl00.k8s.jp.net" + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: seagl00-k8s-jp-net + port: + number: 80 + - host: "seagl01.k8s.jp.net" + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: seagl01-k8s-jp-net + port: + number: 80 + tls: + - hosts: + - seagl00.k8s.jp.net + secretName: seag00-k8s-jp-net-tls + - hosts: + - seagl01.k8s.jp.net + secretName: seag01-k8s-jp-net-tls +--- +apiVersion: v1 +kind: Service +metadata: + name: ingress +spec: + selector: + name: nginx-ingress-microk8s + ports: + - name: http + protocol: TCP + port: 80 + targetPort: 80 +--- +apiVersion: cert-manager.io/v1 +kind: ClusterIssuer +metadata: + name: letsencrypt +spec: + acme: + # You must replace this email address with your own. + # Let's Encrypt will use this to contact you about expiring + # certificates, and issues related to your account. + email: seagl2023@jpnc.info + server: https://acme-v02.api.letsencrypt.org/directory + privateKeySecretRef: + # Secret resource that will be used to store the account's private key. + name: letsencrypt-account-key + # Add a single challenge solver, HTTP01 using nginx + solvers: + - http01: + ingress: + class: public diff --git a/seagl2023/k8s.jp.net/seagl00.yaml b/seagl2023/k8s.jp.net/seagl00.yaml new file mode 100644 index 0000000..a48be57 --- /dev/null +++ b/seagl2023/k8s.jp.net/seagl00.yaml @@ -0,0 +1,37 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: seagl00-k8s-jp-net +spec: + replicas: 1 + selector: + matchLabels: + app: seagl00-k8s-jp-net + template: + metadata: + labels: + app: seagl00-k8s-jp-net + spec: + containers: + - name: seagl00-k8s-jp-net + image: microk8s.sideload/seagl00.k8s.jp.net:v000 + ports: + - name: http + containerPort: 80 + nodeSelector: + kubernetes.io/os: linux +--- +apiVersion: v1 +kind: Service +metadata: + name: seagl00-k8s-jp-net +spec: + ports: + - name: http + port: 80 + protocol: TCP + targetPort: 80 + selector: + app: seagl00-k8s-jp-net + type: ClusterIP diff --git a/seagl2023/k8s.jp.net/seagl01.yaml b/seagl2023/k8s.jp.net/seagl01.yaml new file mode 100644 index 0000000..60bae65 --- /dev/null +++ b/seagl2023/k8s.jp.net/seagl01.yaml @@ -0,0 +1,37 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: seagl01-k8s-jp-net +spec: + replicas: 1 + selector: + matchLabels: + app: seagl01-k8s-jp-net + template: + metadata: + labels: + app: seagl01-k8s-jp-net + spec: + containers: + - name: seagl01-k8s-jp-net + image: microk8s.sideload/seagl01.k8s.jp.net:v000 + ports: + - name: http + containerPort: 80 + nodeSelector: + kubernetes.io/os: linux +--- +apiVersion: v1 +kind: Service +metadata: + name: seagl01-k8s-jp-net +spec: + ports: + - name: http + port: 80 + protocol: TCP + targetPort: 80 + selector: + app: seagl01-k8s-jp-net + type: ClusterIP -- cgit v1.2.3