fix
This commit is contained in:
@@ -117,6 +117,21 @@ options:
|
|||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
type: object
|
type: object
|
||||||
|
config:
|
||||||
|
default:
|
||||||
|
admin_name: wordpress_admin
|
||||||
|
is_debug: false
|
||||||
|
examples:
|
||||||
|
- admin_name: wordpress_admin
|
||||||
|
is_debug: false
|
||||||
|
properties:
|
||||||
|
admin_name:
|
||||||
|
default: wordpress_admin
|
||||||
|
type: string
|
||||||
|
is_debug:
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
type: object
|
||||||
domain:
|
domain:
|
||||||
default: your-company
|
default: your-company
|
||||||
examples:
|
examples:
|
||||||
|
|||||||
@@ -34,6 +34,12 @@ resource "kubectl_manifest" "wordpress_files" {
|
|||||||
labels: ${jsonencode(local.common_labels)}
|
labels: ${jsonencode(local.common_labels)}
|
||||||
namespace: ${var.namespace}
|
namespace: ${var.namespace}
|
||||||
data:
|
data:
|
||||||
|
"vynil-configurator.sh": |-
|
||||||
|
#!/bin/sh
|
||||||
|
if [ -z $(wp core is-installed) ]; then
|
||||||
|
echo Should configure....
|
||||||
|
fi
|
||||||
|
env
|
||||||
wp-cli: |-
|
wp-cli: |-
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
WP_PATH=/var/www/html/
|
WP_PATH=/var/www/html/
|
||||||
|
|||||||
@@ -38,6 +38,16 @@ resource "random_password" "NONCE_SALT" {
|
|||||||
special = false
|
special = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "random_password" "NONCE_SALT" {
|
||||||
|
length = 32
|
||||||
|
special = false
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "random_password" "ADM_PASS" {
|
||||||
|
length = 18
|
||||||
|
special = false
|
||||||
|
}
|
||||||
|
|
||||||
resource "kubectl_manifest" "secret" {
|
resource "kubectl_manifest" "secret" {
|
||||||
yaml_body = <<-EOF
|
yaml_body = <<-EOF
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
@@ -56,6 +66,8 @@ resource "kubectl_manifest" "secret" {
|
|||||||
WORDPRESS_LOGGED_IN_SALT: "${random_password.LOGGED_IN_SALT.result}"
|
WORDPRESS_LOGGED_IN_SALT: "${random_password.LOGGED_IN_SALT.result}"
|
||||||
WORDPRESS_NONCE_SALT: "${random_password.NONCE_SALT.result}"
|
WORDPRESS_NONCE_SALT: "${random_password.NONCE_SALT.result}"
|
||||||
WORDPRESS_DB_PASSWORD: "${random_password.mysql_comp_pass.result}"
|
WORDPRESS_DB_PASSWORD: "${random_password.mysql_comp_pass.result}"
|
||||||
|
WORDPRESS_ADMIN_NAME: "${var.config.admin_name}"
|
||||||
|
WORDPRESS_ADMIN_PASSWORD: "${random_password.ADM_PASS.result}"
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,33 @@ resource "kubectl_manifest" "Deployment_wordpress" {
|
|||||||
- mountPath: /wordpress-data/wp-content/
|
- mountPath: /wordpress-data/wp-content/
|
||||||
name: wordpress-data
|
name: wordpress-data
|
||||||
subPath: wp-content
|
subPath: wp-content
|
||||||
|
- name: wordpress-config
|
||||||
|
image: ${var.images.wordpress.registry}/${var.images.wordpress.repository}:${var.images.wordpress.tag}
|
||||||
|
imagePullPolicy: ${var.images.wordpress.pull_policy}
|
||||||
|
command: [/usr/local/bin/vynil-configurator]
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
|
privileged: false
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: "${kubectl_manifest.wordpress_cfg.name}"
|
||||||
|
- secretRef:
|
||||||
|
name: "${kubectl_manifest.secret.name}"
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /var/www/html/
|
||||||
|
name: wordpress-app
|
||||||
|
- name: wordpress-data
|
||||||
|
mountPath: /var/www/html/wp-content/
|
||||||
|
subPath: wp-content
|
||||||
|
- name: wordpress-scripts
|
||||||
|
mountPath: /usr/local/bin/wp
|
||||||
|
subPath: wp-cli
|
||||||
|
- name: wordpress-scripts
|
||||||
|
mountPath: /usr/local/bin/vynil-configurator
|
||||||
|
subPath: "vynil-configurator.sh"
|
||||||
containers:
|
containers:
|
||||||
- name: wordpress
|
- name: wordpress
|
||||||
image: ${var.images.wordpress.registry}/${var.images.wordpress.repository}:${var.images.wordpress.tag}
|
image: ${var.images.wordpress.registry}/${var.images.wordpress.repository}:${var.images.wordpress.tag}
|
||||||
@@ -101,10 +128,10 @@ resource "kubectl_manifest" "Deployment_wordpress" {
|
|||||||
- name: wordpress-config
|
- name: wordpress-config
|
||||||
mountPath: /usr/local/etc/php/conf.d/opcache-recommended.ini
|
mountPath: /usr/local/etc/php/conf.d/opcache-recommended.ini
|
||||||
subPath: php-opcache-recommended.ini
|
subPath: php-opcache-recommended.ini
|
||||||
- name: wordpress-config
|
# - name: wordpress-config
|
||||||
mountPath: /usr/local/etc/php/conf.d/docker-php-ext-redis.ini
|
# mountPath: /usr/local/etc/php/conf.d/docker-php-ext-redis.ini
|
||||||
subPath: docker-php-ext-redis.ini
|
# subPath: docker-php-ext-redis.ini
|
||||||
- name: wordpress-config
|
- name: wordpress-scripts
|
||||||
mountPath: /usr/local/bin/wp
|
mountPath: /usr/local/bin/wp
|
||||||
subPath: wp-cli
|
subPath: wp-cli
|
||||||
- name: nginx
|
- name: nginx
|
||||||
@@ -154,6 +181,15 @@ resource "kubectl_manifest" "Deployment_wordpress" {
|
|||||||
volumes:
|
volumes:
|
||||||
- name: wordpress-app
|
- name: wordpress-app
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
|
- name: wordpress-scripts
|
||||||
|
configMap:
|
||||||
|
defaultMode: 0755
|
||||||
|
name: ${kubectl_manifest.wordpress_files.name}
|
||||||
|
items:
|
||||||
|
- key: "vynil-configurator.sh"
|
||||||
|
path: "vynil-configurator.sh"
|
||||||
|
- key: "wp-cli"
|
||||||
|
path: "wp-cli"
|
||||||
- name: wordpress-config
|
- name: wordpress-config
|
||||||
configMap:
|
configMap:
|
||||||
name: ${kubectl_manifest.wordpress_files.name}
|
name: ${kubectl_manifest.wordpress_files.name}
|
||||||
|
|||||||
Reference in New Issue
Block a user