Hits: 1843
Overview

Updated: 07.12.2022 – etc/hosts step added, all metada-name with release.name refactored, hostPath in values.yaml defined.
Continue reading “Simple Private Docker Registry via Helm (as Helm Chart)”Developer, Maker.
Hits: 1843
Updated: 07.12.2022 – etc/hosts step added, all metada-name with release.name refactored, hostPath in values.yaml defined.
Continue reading “Simple Private Docker Registry via Helm (as Helm Chart)”Hits: 557
Install Ubuntu on WSL2 on Windows
After the Docker Desktop installation we need to enable the following WSL integrations at Docker Desktop:
Hits: 63
Get Podname via selector in bash, for example for port-forwarding
kubectl port-forward $(kubectl get pods --selector "app.kubernetes.io/name=traefik" --output=name) 9000:9000
Scale to 0 all deployment in whole namespace
kubectl scale deploy -n <namespace> --replicas=0 --all
Hits: 604
SPX is a PHP Extension for Profiling, also open source, very simple, multimetric capable and with out-of-box web UI for listing, sorting and report details.
For installation, we need to build our extension. We can of course put the building phases directly into our Dockerfile, but I want to know, what things (extension file, webUI Files and configuration changes) need to come through the extension. For this reason, I make a seperate build process in my Dockerfile and copy everything this extension needs.
I follow the steps from official documentation (Timestamp: 20.05.2022), please check, if new or old steps were published, after this blog article)
Continue reading “PHP Profiler SPX – A Another Simple Profiling Tool”Hits: 155
Actually Docker Desktop App as default sharing Users, private etc. folder with Docker Images.
Github Repo for Example Project: https://github.com/kzorluoglu/localphp8nginxwithhelm
But Minikube need minikube mount bidirectional folder sync. From this reason i will say, use your own simple folder structure for Minikube hostPath Solution. For example:
Macbook Folder: $home/minikubeprojects
Minikube Cluster: mnt1/minikubeprojects
For mounting, you need after minikube start only this
korayzorluoglu@MBP-von-Koray ~ % minikube mount $HOME/minikubeprojects:/mnt1/minikubeprojects
Example Configuration
Project / chart / values.yaml
mountPath: /var/www/html nginx: image: nginx:1.14.2 php: image: php:8.1-rc-fpm-alpine
Project / chart / templates / deployments.yaml
apiVersion: apps/v1 kind: Deployment metadata: name: php8-project-deployment labels: app: php8-project-deployment spec: replicas: 1 selector: matchLabels: app: php8-project-deployment template: metadata: labels: app: php8-project-deployment spec: volumes: # Create the shared files volume to be used in both pods - name: php8-project-pv-storage persistentVolumeClaim: claimName: php8-project-pv-claim # Add the ConfigMap we declared above as a volume for the pod - name: nginx-config-volume configMap: name: php8-project-nginx-config containers: - name: php8-project-nginx image: {{ .Values.nginx.image }} ports: - containerPort: 80 volumeMounts: - name: php8-project-pv-storage mountPath: {{ .Values.mountPath }} - name: nginx-config-volume mountPath: /etc/nginx/nginx.conf subPath: nginx.conf # Just spin & wait forever command: [ "/bin/bash", "-c", "--" ] args: [ "while true; do sleep 30; done;" ] - name: php image: {{ .Values.php.image }} volumeMounts: - name: php8-project-pv-storage mountPath: {{ .Values.mountPath }}
Project / chart / templates / volume.yaml
kind: PersistentVolume apiVersion: v1 metadata: name: php8-project-pv-volume labels: type: local spec: storageClassName: manual capacity: storage: 10Gi accessModes: - ReadWriteMany hostPath: path: "/mnt1/minikubeprojects/php8/app" --- kind: PersistentVolumeClaim apiVersion: v1 metadata: name: php8-project-pv-claim spec: storageClassName: manual accessModes: - ReadWriteMany resources: requests: storage: 3Gi
Project / chart / templates / configmap.yaml
kind: ConfigMap apiVersion: v1 metadata: name: php8-project-nginx-config data: nginx.conf: | events { } http { server { listen 80 default_server; listen [::]:80 default_server; # Set nginx to serve files from the shared volume! root {{ .Values.mountPath }}; server_name _; location / { try_files $uri $uri/ =404; } location ~ \.php$ { include fastcgi_params; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; } } }
do you need mount directoy check? for that, check the minikube directory and pod directory, or the pod details via kubectl pod describe your-chart-name
korayzorluoglu@MBP-von-Koray chart % minikube ssh && cd /mnt1/minikubeprojects && tree
Enjoy!