File tree Expand file tree Collapse file tree 7 files changed +65
-5
lines changed Expand file tree Collapse file tree 7 files changed +65
-5
lines changed Original file line number Diff line number Diff line change 1
1
build :
2
2
docker compose up -d
3
3
docker exec -it drupal-fpm sh
4
+
5
+ build-minikube :
6
+ minikube start
7
+ Kubectl apply -f iac/docker/helm
8
+ Kubectl apply -f iac/docker/helm/nginx
9
+ Kubectl apply -f iac/docker/helm/drupal
10
+ Kubectl apply -f iac/docker/helm/mysql
11
+
12
+ build-tunnel :
13
+ minikube tunnel
14
+
15
+ run-minikube :
16
+ minikube service ngnix
17
+
18
+ deploy-minikube :
19
+ cd app && composer install && cd ..
20
+ chmod +x scripts/deploy-k8s && scripts/deploy-k8s
21
+
22
+ update-minikube :
23
+ cd app && composer install && cd ..
24
+ chmod +x scripts/deploy-k8s && scripts/deploy-k8s
Original file line number Diff line number Diff line change 1
1
2
- ** Docker Base Drupal 10 Container Setup**
2
+ ** Docker Base Drupal 10 Container Setup with Kubernetes Support **
3
3
4
4
## How to setup
5
5
- Build the setup using following command ``` make build ```
23
23
24
24
## Kubernetes MiniKube
25
25
26
- - Kubectl apply -f iac/docker/helm && Kubectl apply -f iac/docker/helm/nginx && Kubectl apply -f iac/docker/drupal && Kubectl apply -f iac/docker/mysql
27
- - Add domain to local host i.e. /etc/host file
28
- - minikube tunnel
26
+ - Build Minikube Helm Files:
27
+ - ```make build-minikube```
28
+ - Deploy code to minkube containers:
29
+ - ```make deploy-minikube```
30
+ - Run Minikube Tunnel and expose Nginx container port:
31
+ - ```make build-tunnel```
32
+ - ```make run-minikube```
33
+ - Add domain to local host i.e. ``` /etc/host ``` file
34
+
35
+ ## Post Deployment to minikube
36
+ - We can use following command to just update drupal & nginx containers files:
37
+ - ```make update-minikube```
Original file line number Diff line number Diff line change 5
5
6
6
$ settings ['config_sync_directory ' ] = '../config/sync ' ;
7
7
8
- if (getenv ('K8S ' ) == '1 ' ) {
8
+ if (getenv ('KS ' ) == '1 ' ) {
9
9
$ databases ['default ' ]['default ' ] = [
10
10
'database ' => 'drupal ' ,
11
11
'username ' => 'drupal_database_user ' ,
Original file line number Diff line number Diff line change 25
25
io.kompose.network/external : " true"
26
26
io.kompose.network/internal : " true"
27
27
io.kompose.service : drupal-fpm
28
+ app : drupal-fpm
28
29
spec :
29
30
containers :
30
31
- env :
Original file line number Diff line number Diff line change 24
24
labels :
25
25
io.kompose.network/external : " true"
26
26
io.kompose.service : ngnix
27
+ app : ngnix
27
28
spec :
28
29
containers :
29
30
- image : nginx:alpine-perl
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ POD=$( kubectl get pods -l app=drupal-fpm -o custom-columns=:metadata.name)
4
+ echo $POD
5
+ kubectl exec $POD -- /bin/sh -c " rm -rf /var/www/html/*"
6
+ kubectl cp app/ $POD :/var/www/html/ -c drupal-fpm -n default
7
+ kubectl exec $POD -- bash -c " mv /var/www/html/app/* /var/www/html/."
8
+ kubectl exec $POD -- bash -c " cd /var/www/html && make build-drupal"
9
+
10
+ POD=$( kubectl get pods -l app=ngnix -o custom-columns=:metadata.name)
11
+ echo $POD
12
+ kubectl exec $POD -- /bin/sh -c " rm -rf /var/www/html/*"
13
+ kubectl cp app/ $POD :/var/www/html/ -c ngnix -n default
14
+ kubectl exec $POD -- /bin/sh -c " mv /var/www/html/app/* /var/www/html/."
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ POD=$( kubectl get pods -l app=drupal-fpm -o custom-columns=:metadata.name)
4
+ echo $POD
5
+ kubectl exec $POD -- /bin/sh -c " rm -rf /var/www/html/*"
6
+ kubectl cp app/ $POD :/var/www/html/ -c drupal-fpm -n default
7
+ kubectl exec $POD -- bash -c " mv /var/www/html/app/* /var/www/html/."
8
+ kubectl exec $POD -- bash -c " cd /var/www/html && make drupal-update"
9
+
10
+ POD=$( kubectl get pods -l app=ngnix -o custom-columns=:metadata.name)
11
+ echo $POD
12
+ kubectl exec $POD -- /bin/sh -c " rm -rf /var/www/html/*"
13
+ kubectl cp app/ $POD :/var/www/html/ -c ngnix -n default
14
+ kubectl exec $POD -- /bin/sh -c " mv /var/www/html/app/* /var/www/html/."
You can’t perform that action at this time.
0 commit comments