Skip to content

Commit ebda249

Browse files
Merge pull request #30 from rishabjasrotia/rishabjasrotia-patch-6
Minikube Changes
2 parents 915b7ea + 54e64f0 commit ebda249

File tree

6 files changed

+62
-2
lines changed

6 files changed

+62
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323

2424
## Kubernetes MiniKube
2525

26-
- Kubectl apply -f iac/docker/helm
27-
- minikube service ngnix --url
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

app/web/sites/default/settings.local.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,19 @@
44
$config['system.performance']['js']['preprocess'] = FALSE;
55

66
$settings['config_sync_directory'] = '../config/sync';
7+
8+
if (getenv('K8S') == '1') {
9+
$databases['default']['default'] = [
10+
'database' => 'drupal',
11+
'username' => 'drupal_database_user',
12+
'password' => 'drupal_database_password',
13+
'prefix' => '',
14+
'host' => 'mysql.default.svc.cluster.local:3306',
15+
'port' => '3306',
16+
'isolation_level' => 'READ COMMITTED',
17+
'namespace' => 'Drupal\\mysql\\Driver\\Database\\mysql',
18+
'driver' => 'mysql',
19+
'autoload' => 'core/modules/mysql/src/Driver/Database/mysql/',
20+
];
21+
}
22+

iac/docker/helm/drupal/drupal-fpm-deployment.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ spec:
6868
configMapKeyRef:
6969
key: SITE_NAME
7070
name: env
71+
- name: KS
72+
valueFrom:
73+
configMapKeyRef:
74+
key: KS
75+
name: env
7176
image: rishabgit/drupal-docker:php-fpm
7277
name: drupal-fpm
7378
resources: {}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
annotations:
5+
kompose.cmd: kompose convert
6+
kompose.version: 1.26.0 (40646f47)
7+
creationTimestamp: null
8+
labels:
9+
io.kompose.service: drupal-fpm
10+
name: drupal-fpm
11+
spec:
12+
ports:
13+
- name: "9000"
14+
port: 9000
15+
targetPort: 9000
16+
selector:
17+
io.kompose.service: drupal-fpm
18+
status:
19+
loadBalancer: {}

iac/docker/helm/env-configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ data:
88
MYSQL_ROOT_PASSWORD: root_password
99
MYSQL_USER: drupal_database_user
1010
SITE_NAME: Drupal10
11+
KS: "1"
1112
kind: ConfigMap
1213
metadata:
1314
creationTimestamp: null

iac/docker/helm/nginx/ingress.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: Ingress
3+
metadata:
4+
name: ngnix-ingress
5+
annotations:
6+
nginx.ingress.kubernetes.io/rewrite-target: /$1
7+
spec:
8+
rules:
9+
- host: drupal-local.info
10+
http:
11+
paths:
12+
- path: /
13+
pathType: Prefix
14+
backend:
15+
service:
16+
name: ngnix
17+
port:
18+
number: 8080

0 commit comments

Comments
 (0)