add yamls

main
Федоров Дмитрий 2023-11-07 18:38:27 +03:00
parent e8dba5bade
commit 23243ae0fe
5 changed files with 149 additions and 0 deletions

View File

@ -0,0 +1,21 @@
---
kind: ConfigMap
apiVersion: v1
metadata:
name: openresty-conf
data:
default.conf: |
server {
listen 80;
server_name localhost;
location / {
root /usr/local/openresty/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/openresty/nginx/html;
}
}

View File

@ -0,0 +1,38 @@
---
kind: ConfigMap
apiVersion: v1
metadata:
name: openresty-html
data:
index.html: |
<html>
<head>
<title>Тестовая страница</title>
<meta charset="UTF-8">
</head>
<body>
<h1>Тестовая страница</h1>
</body>
</html>
50x.html: |
<!DOCTYPE html>
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<title>Error</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>An error occurred.</h1>
<p>Sorry, the page you are looking for is currently unavailable.<br/>
Please try again later.</p>
</body>
</html>

View File

@ -0,0 +1,60 @@
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: openresty
labels:
k8s-app: openresty
annotations:
reloader.stakater.com/auto: "true"
configmap.reloader.stakater.com/reload: "openresty"
spec:
replicas: 2
revisionHistoryLimit: 3
selector:
matchLabels:
k8s-app: openresty
template:
metadata:
labels:
k8s-app: openresty
spec:
containers:
- name: openresty
image: openresty/openresty:centos-rpm
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
name: http
readinessProbe:
httpGet:
path: /index.html
port: http
initialDelaySeconds: 5
periodSeconds: 15
livenessProbe:
httpGet:
path: /index.html
port: http
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
resources:
limits:
cpu: "0.2"
memory: "400Mi"
requests:
cpu: "0.1"
memory: "200Mi"
volumeMounts:
- name: html
mountPath: /usr/local/openresty/nginx/html/
- name: config
mountPath: /etc/nginx/conf.d/
volumes:
- name: html
configMap:
name: openresty-html
- name: config
configMap:
name: openresty-conf

View File

@ -0,0 +1,20 @@
---
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: application
annotations:
kubernetes.io/ingress.class: "system-ingress"
certmanager.k8s.io/cluster-issuer: monitoring-issuer
spec:
rules:
- host: "application.kryukov.local"
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: openresty
port:
number: 80

View File

@ -0,0 +1,10 @@
kind: Service
apiVersion: v1
metadata:
name: openresty
spec:
ports:
- port: 80
targetPort: 80
selector:
k8s-app: openresty