packer and kubernetes changes
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
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
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mysql-secret
|
||||
key: root-pass
|
||||
ports:
|
||||
- name: mysql
|
||||
containerPort: 3306
|
||||
# volumeMounts:
|
||||
# - name: mysql-vol
|
||||
# mountPath: /var/lib/mysql
|
||||
# volumes:
|
||||
# - name: mysql-vol
|
||||
# hostPath:
|
||||
# path: /var/mysql-data
|
||||
@@ -1,7 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: mysql-secret
|
||||
type: Opaque
|
||||
stringData:
|
||||
root-pass: test123
|
||||
@@ -1,28 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: nginx-http-cm
|
||||
data:
|
||||
# key: value
|
||||
# file: |
|
||||
# content
|
||||
# ---
|
||||
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;
|
||||
}
|
||||
location /test {
|
||||
return 401;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
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
|
||||
@@ -1,15 +0,0 @@
|
||||
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
|
||||
@@ -1,27 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
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: web
|
||||
containerPort: 80
|
||||
- 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
|
||||
---
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: nginx-https-secret
|
||||
type: Opaque
|
||||
stringData:
|
||||
server-cert.pem: |
|
||||
-----BEGIN CERTIFICATE-----
|
||||
...
|
||||
-----END CERTIFICATE-----
|
||||
server-key.pem: |
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
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
|
||||
@@ -1,41 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: appname # Name of the deployment
|
||||
namespace: namespace # Name of the namespace
|
||||
labels:
|
||||
app: appname # Name of your application
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: appname # Name of your application
|
||||
replicas: 1 # Number of replicas
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: appname # Name of your application
|
||||
spec:
|
||||
containers:
|
||||
# Containers are the individual pieces of your application that you want
|
||||
# to run.
|
||||
- name: helloworld # Name of the container
|
||||
image: helloworld:latest # The image you want to run
|
||||
# resources:
|
||||
# limits:
|
||||
# memory: 512Mi
|
||||
# cpu: "1"
|
||||
# requests:
|
||||
# memory: 256Mi
|
||||
# cpu: "0.2"
|
||||
ports:
|
||||
# Ports are the ports that your application uses.
|
||||
- containerPort: 8080 # The port that your application uses
|
||||
volumeMounts:
|
||||
# VolumeMounts are the volumes that your application uses.
|
||||
- mountPath: /var/www/html # The path that your application uses
|
||||
name: vol0 # Name of the volume
|
||||
volumes:
|
||||
# Volumes are the persistent storage that your application uses.
|
||||
- name: vol0 # Name of the volume
|
||||
persistentVolumeClaim:
|
||||
claimName: pvc0 # Name of the persistent volume claim
|
||||
@@ -1,29 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: pvc0
|
||||
namespace: namespace
|
||||
labels:
|
||||
app: namespace
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
# ---
|
||||
# Digital Ocean
|
||||
# storageClassName: do-block-storage
|
||||
# ---
|
||||
# AWS
|
||||
# storageClassName: aws-ebs
|
||||
# ---
|
||||
# Azure
|
||||
# storageClassName: azure-disk
|
||||
# ---
|
||||
# GCE PD
|
||||
# storageClassName: gce-pd
|
||||
# ---
|
||||
# CIVO
|
||||
# storageClassName: civo-volume
|
||||
# ---
|
||||
@@ -1,11 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: civo
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: civo-volume
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
@@ -1,27 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: civo-web
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: civo-web
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: civo-web
|
||||
spec:
|
||||
containers:
|
||||
- name: civo-web
|
||||
image: nginx
|
||||
ports:
|
||||
- name: web
|
||||
containerPort: 80
|
||||
volumeMounts:
|
||||
- name: civo
|
||||
mountPath: /usr/share/nginx/html
|
||||
volumes:
|
||||
- name: civo
|
||||
persistentVolumeClaim:
|
||||
claimName: civo
|
||||
@@ -1,27 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: local-web
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: local-web
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: local-web
|
||||
spec:
|
||||
containers:
|
||||
- name: local-web
|
||||
image: nginx
|
||||
ports:
|
||||
- name: web
|
||||
containerPort: 80
|
||||
volumeMounts:
|
||||
- name: local
|
||||
mountPath: /usr/share/nginx/html
|
||||
volumes:
|
||||
- name: local
|
||||
hostPath:
|
||||
path: /var/nginxserver
|
||||
@@ -1,13 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: nfs
|
||||
spec:
|
||||
capacity:
|
||||
storage: 500Mi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
storageClassName: nfs
|
||||
nfs:
|
||||
server: 192.168.1.7
|
||||
path: "/srv/nfs"
|
||||
@@ -1,11 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: nfs
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
storageClassName: nfs
|
||||
resources:
|
||||
requests:
|
||||
storage: 100Mi
|
||||
@@ -1,27 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nfs-web
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: nfs-web
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nfs-web
|
||||
spec:
|
||||
containers:
|
||||
- name: nfs-web
|
||||
image: nginx
|
||||
ports:
|
||||
- name: web
|
||||
containerPort: 80
|
||||
volumeMounts:
|
||||
- name: nfs
|
||||
mountPath: /usr/share/nginx/html
|
||||
volumes:
|
||||
- name: nfs
|
||||
persistentVolumeClaim:
|
||||
claimName: nfs
|
||||
@@ -1,32 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: servicename
|
||||
namespace: namespace
|
||||
spec:
|
||||
selector:
|
||||
app: appname
|
||||
# ---
|
||||
# type: ClusterIP
|
||||
# ClusterIP means this service can be accessed by any pod in the cluster
|
||||
# ports:
|
||||
# - name: http
|
||||
# port: 8080
|
||||
# targetPort: 80
|
||||
# protocol: TCP # optional protocol
|
||||
# ---
|
||||
# type: NodePort
|
||||
# NodePort means this service is only accessible by pods in the same namespace
|
||||
# ports:
|
||||
# - name: http
|
||||
# port: 80
|
||||
# nodePort: 30001
|
||||
# protocol: TCP # optional protocol
|
||||
# ---
|
||||
# type: LoadBalancer
|
||||
# LoadBalancer means this service is load-balanced across all nodes in the cluster
|
||||
# ports:
|
||||
# - name: http
|
||||
# port: 80
|
||||
# targetPort: 30001
|
||||
# protocol: TCP # optional protocol
|
||||
Reference in New Issue
Block a user