Skip to content

Instantly share code, notes, and snippets.

@Loupeznik
Created August 7, 2023 16:31
Show Gist options
  • Save Loupeznik/2ba97fde333eaa4e477a75e465b5e54a to your computer and use it in GitHub Desktop.
Save Loupeznik/2ba97fde333eaa4e477a75e465b5e54a to your computer and use it in GitHub Desktop.
Laravel app service and deployment sample manifests (partly for Helm)
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "laravel-app.fullname" . }}
labels:
{{- include "laravel-app.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "laravel-app.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "laravel-app.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "laravel-app.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: laravel-app
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "yourregistry.azurecr.io/laravel-app:1"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: /api/healthz
port: http
readinessProbe:
httpGet:
path: /docs
port: http
volumeMounts:
- name: envfile-volume
mountPath: /app/.env
subPath: .env
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: envfile-volume
configMap:
name: laravel-app-envfile
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "laravel-app.fullname" . }}
labels:
{{- include "laravel-app.labels" . | nindent 4 }}
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
selector:
{{- include "laravel-app.selectorLabels" . | nindent 4 }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment