mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2024-11-22 00:03:16 +01:00
cm-and-secret
This commit is contained in:
parent
75ce1f3e7a
commit
8f62f0c812
30
kubernetes/templates/cm-and-secrets/mysql-deploy.yml
Normal file
30
kubernetes/templates/cm-and-secrets/mysql-deploy.yml
Normal file
@ -0,0 +1,30 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mysql
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mysql
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mysql
|
||||
spec:
|
||||
containers:
|
||||
- image: mysql:5.6
|
||||
name: mysql
|
||||
env:
|
||||
- name: MYSQL_ROOT_PASSWORD
|
||||
value: "password-in-cleartext"
|
||||
ports:
|
||||
- name: mysql
|
||||
containerPort: 3306
|
||||
# volumeMounts:
|
||||
# - name: mysql-vol
|
||||
# mountPath: /var/lib/mysql
|
||||
# volumes:
|
||||
# - name: mysql-vol
|
||||
# hostPath:
|
||||
# path: /var/mysql-data
|
7
kubernetes/templates/cm-and-secrets/mysql-secret.yml
Normal file
7
kubernetes/templates/cm-and-secrets/mysql-secret.yml
Normal file
@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: mysql-secret
|
||||
type: Opaque
|
||||
stringData:
|
||||
root-pass: test123
|
21
kubernetes/templates/cm-and-secrets/nginx-http-cm.yml
Normal file
21
kubernetes/templates/cm-and-secrets/nginx-http-cm.yml
Normal file
@ -0,0 +1,21 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: nginx-http-cm
|
||||
data:
|
||||
nginx.conf: |
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
events {
|
||||
worker_connections 10240;
|
||||
}
|
||||
http {
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
}
|
||||
}
|
32
kubernetes/templates/cm-and-secrets/nginx-http-deploy.yml
Normal file
32
kubernetes/templates/cm-and-secrets/nginx-http-deploy.yml
Normal file
@ -0,0 +1,32 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx-http
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: nginx-http
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nginx-http
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx-http
|
||||
image: nginx
|
||||
ports:
|
||||
- name: web
|
||||
containerPort: 80
|
||||
volumeMounts:
|
||||
- name: nginx-http-cm
|
||||
mountPath: /etc/nginx
|
||||
- name: nginx-http-vol
|
||||
mountPath: /usr/share/nginx/html
|
||||
volumes:
|
||||
- name: nginx-http-cm
|
||||
configMap:
|
||||
name: nginx-http-cm
|
||||
- name: nginx-http-vol
|
||||
hostPath:
|
||||
path: /var/nginxserver
|
15
kubernetes/templates/cm-and-secrets/nginx-http-svc.yml
Normal file
15
kubernetes/templates/cm-and-secrets/nginx-http-svc.yml
Normal file
@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx-http-svc
|
||||
labels:
|
||||
app: nginx-http
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 30080
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: nginx-http
|
27
kubernetes/templates/cm-and-secrets/nginx-https-cm.yml
Normal file
27
kubernetes/templates/cm-and-secrets/nginx-https-cm.yml
Normal file
@ -0,0 +1,27 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: nginx-https-cm
|
||||
data:
|
||||
nginx.conf: |
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
events {
|
||||
worker_connections 10240;
|
||||
}
|
||||
http {
|
||||
server {
|
||||
listen 80;
|
||||
listen 443 ssl;
|
||||
|
||||
server_name _;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/server-cert.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/server-key.pem;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
}
|
||||
}
|
38
kubernetes/templates/cm-and-secrets/nginx-https-deploy.yml
Normal file
38
kubernetes/templates/cm-and-secrets/nginx-https-deploy.yml
Normal file
@ -0,0 +1,38 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx-https
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: nginx-https
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nginx-https
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx-https
|
||||
image: nginx
|
||||
ports:
|
||||
- name: secureweb
|
||||
containerPort: 443
|
||||
volumeMounts:
|
||||
- name: nginx-https-cm
|
||||
mountPath: /etc/nginx
|
||||
- name: nginx-https-secret
|
||||
mountPath: /etc/nginx/ssl
|
||||
readOnly: true
|
||||
- name: nginx-https-vol
|
||||
mountPath: /usr/share/nginx/html
|
||||
volumes:
|
||||
- name: nginx-https-cm
|
||||
configMap:
|
||||
name: nginx-https-cm
|
||||
- name: nginx-https-secret
|
||||
secret:
|
||||
secretName: nginx-https-secret
|
||||
- name: nginx-https-vol
|
||||
hostPath:
|
||||
path: /var/nginxserver
|
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: nginx-https-secret
|
||||
type: Opaque
|
||||
stringData:
|
||||
server-cert.pem: |
|
||||
-----BEGIN CERTIFICATE-----
|
||||
...
|
||||
-----END CERTIFICATE-----
|
||||
server-key.pem: |
|
||||
|
19
kubernetes/templates/cm-and-secrets/nginx-https-svc.yml
Normal file
19
kubernetes/templates/cm-and-secrets/nginx-https-svc.yml
Normal file
@ -0,0 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx-https-svc
|
||||
labels:
|
||||
app: nginx-https
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 31080
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
name: http
|
||||
- port: 31443
|
||||
targetPort: 443
|
||||
protocol: TCP
|
||||
name: https
|
||||
selector:
|
||||
app: nginx-https
|
@ -24,4 +24,4 @@ spec:
|
||||
volumes:
|
||||
- name: local
|
||||
hostPath:
|
||||
path: /usr/share/nginx/html
|
||||
path: /var/nginxserver
|
Loading…
Reference in New Issue
Block a user