Commit inicial creo
This commit is contained in:
11
deploy/laravel-configmap.yaml
Normal file
11
deploy/laravel-configmap.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: laravel-app-configmap
|
||||
data:
|
||||
APP_KEY: base64:6R8+UR+AyBhv9HTlVW7qP+DCAdq6XP8r+uqEE1ahtqI=
|
||||
APP_DEBUG: "true"
|
||||
DB_CONNECTION: pgsql
|
||||
DB_HOST: postgres-service
|
||||
DB_USERNAME: postgres
|
||||
DB_PASSWORD: secret
|
||||
26
deploy/laravel-deployment.yaml
Normal file
26
deploy/laravel-deployment.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: laravel-app
|
||||
name: laravel-app
|
||||
spec:
|
||||
replicas: 4
|
||||
selector:
|
||||
matchLabels:
|
||||
app: laravel-app
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app:
|
||||
laravel-app
|
||||
spec:
|
||||
containers:
|
||||
- image: registry.digitalocean.com/k8s-testing-laravel/laravel-k8s:latest
|
||||
name: laravel-app
|
||||
imagePullPolicy: Always
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: laravel-app-configmap
|
||||
- secretRef:
|
||||
name: laravel-app-secret
|
||||
18
deploy/laravel-ingress.yaml
Normal file
18
deploy/laravel-ingress.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: laravel-app-ingress
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: laravel.internal
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: laravel-app-service
|
||||
port:
|
||||
number: 80
|
||||
|
||||
7
deploy/laravel-secret.yaml
Normal file
7
deploy/laravel-secret.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: laravel-app-secret
|
||||
type: Opaque
|
||||
stringData:
|
||||
DB_PASSWORD: l#Scim@HiebS3U
|
||||
11
deploy/laravel-service.yaml
Normal file
11
deploy/laravel-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: laravel-app-service
|
||||
spec:
|
||||
selector:
|
||||
app: laravel-app
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
||||
8
deploy/postgres-configmap.yaml
Normal file
8
deploy/postgres-configmap.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: postgres-configmap
|
||||
data:
|
||||
POSTGRES_DB: laravel
|
||||
POSTGRES_USER: postgres
|
||||
PGDATA: /var/lib/postgres/data/pgdata
|
||||
7
deploy/postgres-secret.yaml
Normal file
7
deploy/postgres-secret.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: postgres-secret
|
||||
type: Opaque
|
||||
stringData:
|
||||
POSTGRES_PASSWORD: l#Scim@HiebS3U
|
||||
12
deploy/postgres-service.yaml
Normal file
12
deploy/postgres-service.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgres-service
|
||||
spec:
|
||||
selector:
|
||||
app: postgres
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 5432
|
||||
targetPort: 5432
|
||||
|
||||
36
deploy/postgres-statefulset.yaml
Normal file
36
deploy/postgres-statefulset.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: postgres
|
||||
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: postgres
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: postgres
|
||||
spec:
|
||||
containers:
|
||||
- name: postgres
|
||||
image: postgres:latest
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: postgres-configmap
|
||||
- secretRef:
|
||||
name: postgres-secret
|
||||
volumeMounts:
|
||||
- mountPath: /var/lib/postgresql/data
|
||||
name: postgres-data
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: postgres-data
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
storageClassName: do-block-storage
|
||||
Reference in New Issue
Block a user