Pruebas con queue ! intento de configuracion de ssl tambien
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
./vendor/
|
./vendor/
|
||||||
./node_modules/
|
./node_modules/
|
||||||
./git
|
./git
|
||||||
|
deploy/
|
||||||
.env
|
.env
|
||||||
compose.yml
|
compose.yml
|
||||||
|
|||||||
21
app/Jobs/QueueTest.php
Normal file
21
app/Jobs/QueueTest.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Jobs;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
use Illuminate\Foundation\Queue\Queueable;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
|
class QueueTest implements ShouldQueue
|
||||||
|
{
|
||||||
|
use Queueable;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handle(): void
|
||||||
|
{
|
||||||
|
Log::info("Probando que la queue funciona correctamente");
|
||||||
|
}
|
||||||
|
}
|
||||||
7
build.sh
Executable file
7
build.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
docker build -t git.skrd.fun/skrd/laravel-k3s:0.2 .
|
||||||
|
docker tag git.skrd.fun/skrd/laravel-k3s:0.2 git.skrd.fun/skrd/laravel-k3s:latest
|
||||||
|
|
||||||
|
docker push git.skrd.fun/skrd/laravel-k3s:0.2
|
||||||
|
docker push git.skrd.fun/skrd/laravel-k3s:latest
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: laravel-app-configmap
|
name: laravel-configmap
|
||||||
data:
|
data:
|
||||||
APP_KEY: base64:6R8+UR+AyBhv9HTlVW7qP+DCAdq6XP8r+uqEE1ahtqI=
|
APP_KEY: base64:6R8+UR+AyBhv9HTlVW7qP+DCAdq6XP8r+uqEE1ahtqI=
|
||||||
APP_DEBUG: "true"
|
APP_DEBUG: "true"
|
||||||
28
deploy/laravel/laravel-deployment.yaml
Normal file
28
deploy/laravel/laravel-deployment.yaml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: laravel
|
||||||
|
name: laravel
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: laravel
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: laravel
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: git.skrd.fun/skrd/laravel-k3s:0.2
|
||||||
|
name: laravel
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: laravel-configmap
|
||||||
|
- secretRef:
|
||||||
|
name: laravel-secret
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 200Mi
|
||||||
|
cpu: 500m
|
||||||
23
deploy/laravel/laravel-ingress.yaml
Normal file
23
deploy/laravel/laravel-ingress.yaml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: laravel-ingress
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: letsencrypt-certificate
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
tls:
|
||||||
|
- secretName: laravel.letsencrypt.key.tls
|
||||||
|
hosts:
|
||||||
|
- laravel.skrd.fun
|
||||||
|
rules:
|
||||||
|
- host: laravel.skrd.fun
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: laravel-service
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
29
deploy/laravel/laravel-schedule-deployment.yaml
Normal file
29
deploy/laravel/laravel-schedule-deployment.yaml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: laravel-scheduler
|
||||||
|
name: laravel-scheduler
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: laravel-scheduler
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: laravel-scheduler
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: git.skrd.fun/skrd/laravel-k3s:0.2
|
||||||
|
name: laravel-schedule
|
||||||
|
command: ["php", "artisan", "schedule:work"]
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: laravel-configmap
|
||||||
|
- secretRef:
|
||||||
|
name: laravel-secret
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 200Mi
|
||||||
|
cpu: 500m
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
name: laravel-app-secret
|
name: laravel-secret
|
||||||
type: Opaque
|
type: Opaque
|
||||||
stringData:
|
stringData:
|
||||||
DB_PASSWORD: l#Scim@HiebS3U
|
DB_PASSWORD: l#Scim@HiebS3U
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: laravel-app-service
|
name: laravel-service
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: laravel-app
|
app: laravel
|
||||||
ports:
|
ports:
|
||||||
- protocol: TCP
|
- protocol: TCP
|
||||||
port: 80
|
port: 80
|
||||||
29
deploy/laravel/laravel-worker-deployment.yaml
Normal file
29
deploy/laravel/laravel-worker-deployment.yaml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: laravel-worker
|
||||||
|
name: laravel-worker
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: laravel-worker
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: laravel-worker
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: git.skrd.fun/skrd/laravel-k3s:0.2
|
||||||
|
name: laravel-worker
|
||||||
|
command: ["php", "artisan", "queue:work"]
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: laravel-configmap
|
||||||
|
- secretRef:
|
||||||
|
name: laravel-secret
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 200Mi
|
||||||
|
cpu: 500m
|
||||||
9
deploy/longhorn/longhorn-backup-secret.yaml
Normal file
9
deploy/longhorn/longhorn-backup-secret.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: aws-secret
|
||||||
|
namespace: longhorn-system
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
AWS_ACCESS_KEY_ID: AKIARB5YXNE6MKSF7OWH
|
||||||
|
AWS_SECRET_ACCESS_KEY: yiterqhL8065ZfEZ+f3GT/DJWQ/MZ0GlMnWli69k
|
||||||
17
deploy/longhorn/longhorn-ingress.yaml
Normal file
17
deploy/longhorn/longhorn-ingress.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: longhorn-ingress
|
||||||
|
namespace: longhorn-system
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
rules:
|
||||||
|
- http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: longhorn-frontend
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
@@ -5,4 +5,4 @@ metadata:
|
|||||||
data:
|
data:
|
||||||
POSTGRES_DB: laravel
|
POSTGRES_DB: laravel
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
PGDATA: /var/lib/postgres/data/pgdata
|
PGDATA: /var/lib/postgresql/data/pgdata
|
||||||
@@ -32,5 +32,5 @@ spec:
|
|||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 5Gi
|
storage: 2Gi
|
||||||
storageClassName: do-block-storage
|
storageClassName: longhorn
|
||||||
16
deploy/ssl/certs.yaml
Normal file
16
deploy/ssl/certs.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: cert-manager.io/v1
|
||||||
|
kind: ClusterIssuer
|
||||||
|
metadata:
|
||||||
|
name: letsencrypt-certificate
|
||||||
|
namespace: cert-manager
|
||||||
|
spec:
|
||||||
|
acme:
|
||||||
|
server: https://acme-v02.api.letsencrypt.org/directory
|
||||||
|
email: hola@danielcortes.xyz
|
||||||
|
privateKeySecretRef:
|
||||||
|
name: laravel.letsencrypt.key.tls
|
||||||
|
solvers:
|
||||||
|
- selector: {}
|
||||||
|
http01:
|
||||||
|
ingress:
|
||||||
|
class: traefik
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Jobs\QueueTest;
|
||||||
use Illuminate\Foundation\Inspiring;
|
use Illuminate\Foundation\Inspiring;
|
||||||
use Illuminate\Support\Facades\Artisan;
|
use Illuminate\Support\Facades\Artisan;
|
||||||
|
use Illuminate\Support\Facades\Schedule;
|
||||||
|
|
||||||
Artisan::command('inspire', function () {
|
Artisan::command('inspire', function () {
|
||||||
$this->comment(Inspiring::quote());
|
$this->comment(Inspiring::quote());
|
||||||
})->purpose('Display an inspiring quote')->hourly();
|
})->purpose('Display an inspiring quote')->hourly();
|
||||||
|
|
||||||
|
Schedule::job(new QueueTest)->everySecond();
|
||||||
|
|||||||
Reference in New Issue
Block a user