From 41f1ce0a4de486bfc2ae07365eb2150052250511 Mon Sep 17 00:00:00 2001 From: Sergii Date: Thu, 10 Nov 2022 20:36:41 +0200 Subject: [PATCH] working version --- README.md | 7 +++++ application.yml | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 README.md create mode 100644 application.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..968da3d --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Nginx lab +Original source: https://github.com/codemowers/lab-05-nginx + +In this example: + +* Nginx is deployed with some sample content to serve the static portion of an + web application. diff --git a/application.yml b/application.yml new file mode 100644 index 0000000..21a7143 --- /dev/null +++ b/application.yml @@ -0,0 +1,81 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-content +data: + index.html: | + + + + Hello worldik + blaba + + + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx +spec: + revisionHistoryLimit: 0 + replicas: 2 + selector: + matchLabels: + app: nginx + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: library/nginx + ports: + - name: nginx + containerPort: 80 + volumeMounts: + - name: nginx-content + mountPath: /usr/share/nginx/html + volumes: + - name: nginx-content + configMap: + name: nginx-content +--- +apiVersion: v1 +kind: Service +metadata: + name: nginx + labels: + app: nginx +spec: + selector: + app: nginx + ports: + - protocol: TCP + port: 80 +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: nginx + annotations: + kubernetes.io/ingress.class: shared + traefik.ingress.kubernetes.io/router.entrypoints: websecure + traefik.ingress.kubernetes.io/router.tls: "true" + external-dns.alpha.kubernetes.io/target: traefik.codemowers.ee +spec: + rules: + - host: venyae.codemowers.ee + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: nginx + port: + number: 80 + tls: + - hosts: + - "*.codemowers.ee"