-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00fd8bd
commit 89dd90e
Showing
8 changed files
with
316 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: cert-manager.io/v1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: letsencrypt | ||
namespace: cert-manager | ||
spec: | ||
acme: | ||
server: https://acme-v02.api.letsencrypt.org/directory | ||
email: [email protected] | ||
privateKeySecretRef: | ||
name: letsencrypt-tls | ||
solvers: | ||
- http01: | ||
ingress: | ||
class: nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: projectname-config | ||
namespace: projectname | ||
data: | ||
APP_NAME: "Filament K8s Demo" | ||
APP_ENV: local | ||
APP_KEY: base64:41O0zXX5PDtUAfz2FBXAKG1LRPp9lUzy+kZxTpu3wKo= | ||
APP_DEBUG: "true" | ||
APP_URL: http://localhost:8000 | ||
|
||
LOG_CHANNEL: stdout | ||
LOG_DEPRECATIONS_CHANNEL: "null" | ||
LOG_LEVEL: debug | ||
|
||
DB_CONNECTION: mysql | ||
DB_HOST: mysql | ||
DB_PORT: "3306" | ||
DB_DATABASE: workshop_k8s | ||
DB_USERNAME: workshop_k8s | ||
DB_PASSWORD: secret | ||
|
||
BROADCAST_DRIVER: log | ||
CACHE_DRIVER: redis | ||
FILESYSTEM_DISK: local | ||
QUEUE_CONNECTION: redis | ||
SESSION_DRIVER: redis | ||
SESSION_LIFETIME: "120" | ||
|
||
MEMCACHED_HOST: "127.0.0.1" | ||
|
||
REDIS_HOST: redis | ||
REDIS_PASSWORD: secret | ||
REDIS_PORT: "6379" | ||
|
||
MAIL_MAILER: smtp | ||
MAIL_HOST: mailpit | ||
MAIL_PORT: "1025" | ||
MAIL_USERNAME: "null" | ||
MAIL_PASSWORD: "null" | ||
MAIL_ENCRYPTION: "null" | ||
MAIL_FROM_ADDRESS: "[email protected]" | ||
MAIL_FROM_NAME: "${APP_NAME}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: projectname | ||
name: projectname | ||
namespace: projectname | ||
spec: | ||
minReadySeconds: 5 | ||
replicas: 3 | ||
revisionHistoryLimit: 1 | ||
selector: | ||
matchLabels: | ||
app: projectname | ||
# strategy: | ||
# rollingUpdate: | ||
# maxSurge: 1 | ||
# maxUnavailable: 50% | ||
# type: RollingUpdate | ||
template: | ||
metadata: | ||
labels: | ||
app: projectname | ||
spec: | ||
affinity: | ||
podAntiAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- podAffinityTerm: | ||
labelSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- projectname | ||
topologyKey: kubernetes.io/hostname | ||
weight: 100 | ||
initContainers: | ||
- args: | ||
- /bin/bash | ||
- -c | ||
- (php /var/www/html/artisan config:cache || true) && (php /var/www/html/artisan view:clear || true) && (php /var/www/html/artisan migrate --force || true) | ||
envFrom: | ||
- configMapRef: | ||
name: projectname-config | ||
env: | ||
- name: ENABLE_PHPFPM | ||
value: "false" | ||
- name: ENABLE_NGINX | ||
value: "false" | ||
image: ghcr.io/lighttecnologia/cartoriosmaranhao-new/central:develop | ||
imagePullPolicy: Always | ||
name: artisan | ||
volumeMounts: | ||
- mountPath: /var/www/storage | ||
name: vultr-volume | ||
|
||
containers: | ||
- name: app | ||
envFrom: | ||
- configMapRef: | ||
name: projectname-config | ||
image: ghcr.io/lighttecnologia/cartoriosmaranhao-new/central:develop | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 80 | ||
livenessProbe: | ||
initialDelaySeconds: 10 | ||
periodSeconds: 15 | ||
tcpSocket: | ||
port: 80 | ||
timeoutSeconds: 30 | ||
readinessProbe: | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
tcpSocket: | ||
port: 80 | ||
resources: {} | ||
volumeMounts: | ||
- mountPath: /var/www/storage | ||
name: vultr-volume | ||
|
||
imagePullSecrets: | ||
- name: dockerconfigjson-github-com | ||
|
||
volumes: | ||
- name: vultr-volume | ||
persistentVolumeClaim: | ||
claimName: projectname-pvc | ||
|
||
--- | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: projectname-worker | ||
name: projectname-worker | ||
namespace: projectname | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 1 | ||
selector: | ||
matchLabels: | ||
app: projectname-worker | ||
template: | ||
metadata: | ||
labels: | ||
app: projectname-worker | ||
spec: | ||
containers: | ||
- name: projectname-worker | ||
image: ghcr.io/lighttecnologia/cartoriosmaranhao-new/central:develop | ||
imagePullPolicy: Always | ||
command: | ||
- php | ||
args: | ||
- artisan | ||
- queue:work | ||
- --queue=default | ||
- --max-jobs=200 | ||
envFrom: | ||
- configMapRef: | ||
name: projectname-config | ||
env: | ||
- name: ENABLE_PHPFPM | ||
value: "false" | ||
- name: ENABLE_NGINX | ||
value: "false" | ||
resources: {} | ||
|
||
--- | ||
|
||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: projectname-cron | ||
namespace: projectname | ||
spec: | ||
concurrencyPolicy: Replace | ||
failedJobsHistoryLimit: 1 | ||
jobTemplate: | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
app: cron | ||
spec: | ||
containers: | ||
- args: | ||
- /bin/bash | ||
- -c | ||
- php artisan schedule:run | ||
envFrom: | ||
- configMapRef: | ||
name: projectname-config | ||
env: | ||
- name: ENABLE_PHPFPM | ||
value: "false" | ||
- name: ENABLE_NGINX | ||
value: "false" | ||
image: ghcr.io/lighttecnologia/cartoriosmaranhao-new/central:develop | ||
imagePullPolicy: Always | ||
name: artisan-schedule | ||
resources: {} | ||
restartPolicy: Never | ||
imagePullSecrets: | ||
- name: dockerconfigjson-github-com | ||
schedule: "* * * * *" | ||
startingDeadlineSeconds: 30 | ||
successfulJobsHistoryLimit: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: projectname-ingress | ||
namespace: projectname | ||
annotations: | ||
cert-manager.io/cluster-issuer: "letsencrypt" | ||
ingress.kubernetes.io/force-ssl-redirect: "true" | ||
spec: | ||
ingressClassName: nginx | ||
rules: | ||
- host: "projectname.example.com" | ||
http: | ||
paths: | ||
- pathType: Prefix | ||
path: "/" | ||
backend: | ||
service: | ||
name: projectname-svc | ||
port: | ||
number: 80 | ||
tls: | ||
- hosts: | ||
- "projectname.example.com" | ||
secretName: letsencrypt-tls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: projectname-pvc | ||
namespace: projectname | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 40Gi | ||
storageClassName: vultr-block-storage-hdd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: projectname | ||
name: projectname-svc | ||
namespace: projectname | ||
spec: | ||
selector: | ||
app: projectname | ||
type: ClusterIP | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 |