Skip to content

Commit 02269a3

Browse files
committed
feat(terraform): Updates to spec as Azure File is now in chart
1 parent 20d07a3 commit 02269a3

8 files changed

+93
-138
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ Si c'est la première fois que vous contribuez à GitHub, ne vous en faites pas!
2626

2727
### Sécurité
2828

29-
**Ne publiez aucun problème de sécurité sur le dépôt publique!** Voir [SECURITY.md](SECURITY.md)
29+
**Ne publiez aucun problème de sécurité sur le dépôt publique!** Voir [SECURITY.md](SECURITY.md)

LICENSE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Government of Canada - Gouvernement du Canada
3+
Copyright (c) 2020 Government of Canada - Gouvernement du Canada
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

+83-84
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Terraform Kubernetes DrupalWxT
1+
# Terraform Kubernetes for Drupal WxT
22

33
## Introduction
44

@@ -14,7 +14,7 @@ The following security controls can be met through configuration of this templat
1414

1515
* None
1616

17-
## Optional (depending on options configured):
17+
## Optional (depending on options configured)
1818

1919
* None
2020

@@ -24,70 +24,86 @@ The following security controls can be met through configuration of this templat
2424
module "helm_drupalwxt" {
2525
source = "git::https://github.com/drupalwxt/terraform-kubernetes-drupalwxt.git"
2626
27-
chart_version = "0.2.2"
27+
chart_version = "0.6.8"
2828
dependencies = [
29-
"${module.namespace_drupal.depended_on}",
29+
module.namespace_drupal.depended_on,
30+
module.drupal_database.depended_on,
3031
]
3132
32-
helm_service_account = "tiller"
33-
helm_namespace = "drupal"
34-
helm_repository = "drupalwxt"
35-
36-
enable_azurefile = "${var.enable_azurefile}"
37-
azurefile_location_name = "${var.azurefile_location_name}"
38-
azurefile_storage_account_name = "${var.azurefile_storage_account_name}"
33+
helm_namespace = "drupal"
34+
helm_repository = "https://drupalwxt.github.io/helm-drupal"
3935
4036
values = <<EOF
4137
ingress:
4238
enabled: true
4339
annotations:
44-
# kubernetes.io/ingress.class: nginx
45-
# kubernetes.io/tls-acme: "true"
40+
kubernetes.io/ingress.class: nginx
41+
kubernetes.io/tls-acme: "true"
4642
kubernetes.io/ingress.class: istio
4743
path: /*
4844
hosts:
49-
- drupalwxt.${var.ingress_domain}
50-
tls: []
51-
# - secretName: chart-example-tls
52-
# hosts:
53-
# - chart-example.local
45+
- drupal.${var.ingress_domain}
5446
5547
drupal:
48+
## Drupal image version
49+
## ref: https://hub.docker.com/drupalwxt/site-wxt/tags/
50+
##
51+
image: drupalwxt/site-wxt
52+
53+
## Note that by default we use appVersion to get image tag
5654
tag: 4.0.0-rc3
5755
56+
## Site configuration
57+
##
58+
profile: wxt
59+
siteEmail: [email protected]
60+
siteName: Drupal Install Profile (WxT)
61+
5862
## User of the application
5963
##
6064
username: admin
6165
6266
## Application password
6367
##
64-
password: Password2019
68+
password: ${var.drupal_password}
6569
6670
# php-fpm healthcheck
6771
# Requires https://github.com/renatomefi/php-fpm-healthcheck in the container.
6872
# (note: official images do not contain this feature yet)
6973
healthcheck:
7074
enabled: true
7175
72-
# Switch to canada.ca theme
76+
# Switch to canada.ca theme (only used if install and/or reconfigure are enabled)
7377
# Common options include: theme-wet-boew, theme-gcweb-legacy
7478
wxtTheme: theme-gcweb
7579
7680
## Extra settings.php settings
7781
##
78-
extraSettings: ''
82+
extraSettings: |-
83+
$settings['trusted_host_patterns'] = ['^drupal\.example\.ca$', '^drupalwxt-nginx$'];
84+
85+
## Extra CLI scripts
86+
##
87+
extraInstallScripts: ''
7988
# |-
80-
# $settings['trusted_host_patterns'] = ['^example\.com$'];
89+
# drush config-set system.performance js.preprocess 0 -y;
90+
# drush config-set system.performance css.preprocess 0 -y;
8191
82-
# Run the site install
92+
# Install Drupal automatically
8393
install: true
8494
85-
# Run the default migrations
95+
# Run migrations for default content
8696
migrate: true
8797
88-
# Reconfigure the site
98+
# Reconfigure on upgrade
8999
reconfigure: true
90100
101+
# php-fpm healthcheck
102+
# Requires https://github.com/renatomefi/php-fpm-healthcheck in the container.
103+
# (note: official images do not contain this feature yet)
104+
healthcheck:
105+
enabled: true
106+
91107
# Allows custom /var/www/html/sites/default/files and /var/www/private mounts
92108
disableDefaultFilesMount: true
93109
@@ -108,8 +124,20 @@ drupal:
108124
- name: files-private
109125
mountPath: /var/www/private
110126
127+
initContainers:
128+
# Pre-create the media-icons folder
129+
- name: init-media-icons-folder
130+
image: alpine:3.10
131+
command:
132+
- mkdir
133+
- -p
134+
- /files/media-icons/generic
135+
volumeMounts:
136+
- name: files-public
137+
mountPath: /files
138+
111139
nginx:
112-
tag: 4.0.0-rc3-nginx
140+
tag: 4.0.0-rc3
113141
114142
# Set your cluster's DNS resolution service here
115143
resolver: 10.0.0.10
@@ -125,67 +153,39 @@ nginx:
125153
- name: files-public
126154
mountPath: /var/www/html/sites/default/files
127155
128-
mysql:
129-
imageTag: 5.7.28
156+
external:
157+
enabled: true
158+
driver: pgsql
159+
port: 5432
160+
host: 127.0.0.1
161+
database: drupal
162+
user: ${module.drupal_database.administrator_login}@${module.drupal_database.name}
163+
password: ${var.managed_postgresql_password}
164+
165+
files:
166+
provider: none
130167
131-
mysqlPassword: SUPERsecureMYSQLpassword
132-
mysqlRootPassword: SUPERsecureMYSQLrootPASSWORD
133-
persistence:
134-
enabled: true
135-
storageClass: managed-premium
136-
size: 256Gi
137-
138-
# Custom mysql configuration files used to override default mysql settings
139-
configurationFiles:
140-
mysql.cnf: |-
141-
[mysqld]
142-
max_allowed_packet = 256M
143-
innodb_buffer_pool_size = 4096M
144-
innodb_buffer_pool_instances = 4
145-
table_definition_cache = 4096
146-
table_open_cache = 8192
147-
innodb_flush_log_at_trx_commit=2
148-
149-
##
150-
## MINIO-ONLY EXAMPLE
151-
##
152168
minio:
153169
enabled: false
154170
155-
##
156-
## AZURE EXAMPLE
157-
##
158-
# files:
159-
# cname:
160-
# enabled: true
161-
# hostname: wxt.blob.core.windows.net
162-
files:
163-
provider: none
171+
mysql:
172+
enabled: false
173+
174+
postgresql:
175+
enabled: false
176+
pgbouncer:
177+
enabled: true
178+
host: ${module.drupal_database.name}.postgres.database.azure.com
179+
user: ${module.drupal_database.administrator_login}@${module.drupal_database.name}
180+
password: ${var.managed_postgresql_password}
181+
poolSize: 25
182+
maxClientConnections: 500
164183
165-
# minio:
166-
# clusterDomain: cluster.cumulonimbus.zacharyseguin.ca
167-
# # Enable the Azure Gateway mode
168-
# azuregateway:
169-
# enabled: true
170-
171-
# # Access Key should be set to the Azure Storage Account name
172-
# # Secret Key should be set to the Azure Storage Account access key
173-
# accessKey: STORAGE_ACCOUNT_NAME
174-
# secretKey: STORAGE_ACCOUNT_ACCESS_KEY
175-
176-
# # Disable creation of default bucket.
177-
# # You should pre-create the bucket in Azure.
178-
# defaultBucket:
179-
# enabled: false
180-
# name: wxt
181-
182-
# # We want a cluster ip assigned
183-
# service:
184-
# clusterIP: ''
185-
186-
# # We don't need a persistent volume, since it's stored in Azure
187-
# persistence:
188-
# enabled: false
184+
redis:
185+
enabled: true
186+
187+
varnish:
188+
enabled: true
189189
EOF
190190
}
191191
```
@@ -196,7 +196,6 @@ EOF
196196
| -------------------- | ------ | -------- | --------------------------------------------------- |
197197
| chart_version | string | yes | Version of the Helm Chart |
198198
| dependencies | string | yes | Dependency name refering to namespace module |
199-
| helm_service_account | string | yes | The service account for Helm to use |
200199
| helm_namespace | string | yes | The namespace Helm will install the chart under |
201200
| helm_repository | string | yes | The repository where the Helm chart is stored |
202201
| values | list | no | Values to be passed to the Helm Chart |
@@ -205,5 +204,5 @@ EOF
205204

206205
| Date | Release | Change |
207206
| -------- | ---------- | ---------------------------------------------------------- |
208-
| 20190729 | 20190729.1 | Improvements to documentation and formatting |
209207
| 20190909 | 20190909.1 | 1st release |
208+
| 20191220 | 20191220.1 | Updates to specification as Azure File is now in chart |

SECURITY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ ______________________
99

1010
## Sécurité
1111

12-
TBD
12+
TBD

values/.gitkeep config/.gitkeep

File renamed without changes.

config/azurefile.yaml

-14
This file was deleted.

main.tf

+3-19
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,12 @@ resource "null_resource" "dependency_getter" {
1717
}
1818
}
1919

20-
resource "local_file" "storageclass_azurefile" {
21-
content = "${templatefile("${path.module}/config/azurefile.yaml", {
22-
azurefile_location_name = "${var.azurefile_location_name}"
23-
azurefile_storage_account_name = "${var.azurefile_storage_account_name}"
24-
})}"
25-
26-
filename = "${path.module}/generated/azurefile.yaml"
27-
}
28-
29-
resource "null_resource" "storageclass_azurefile" {
30-
count = "${var.enable_azurefile ? 1 : 0}"
31-
32-
provisioner "local-exec" {
33-
command = "kubectl apply -f ${local_file.storageclass_azurefile.filename}"
34-
}
35-
}
36-
3720
resource "helm_release" "drupalwxt" {
3821
version = "${var.chart_version}"
22+
3923
name = "drupalwxt"
4024
chart = "drupal"
25+
4126
repository = "${var.helm_repository}"
4227
namespace = "${var.helm_namespace}"
4328

@@ -48,8 +33,7 @@ resource "helm_release" "drupalwxt" {
4833
]
4934

5035
depends_on = [
51-
"null_resource.dependency_getter",
52-
"null_resource.storageclass_azurefile"
36+
"null_resource.dependency_getter"
5337
]
5438
}
5539

variables.tf

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
1-
variable "enable_azurefile" {
2-
default = "0"
3-
type = "string"
4-
}
51

6-
variable "azurefile_location_name" {
7-
default = "canadacentral"
8-
type = "string"
9-
}
2+
variable "chart_version" {}
103

11-
variable "azurefile_storage_account_name" {
12-
default = ""
13-
type = "string"
4+
variable "dependencies" {
5+
type = "list"
146
}
157

168
variable "helm_namespace" {}
179

1810
variable "helm_repository" {}
1911

20-
variable "chart_version" {}
21-
22-
variable "dependencies" {
23-
type = "list"
24-
}
25-
2612
variable "values" {
2713
default = ""
2814
type = "string"

0 commit comments

Comments
 (0)