bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
9.04k stars 9.22k forks source link

Add Wordpress custom plugins and themes #30537

Open pedrodsrodrigues opened 1 day ago

pedrodsrodrigues commented 1 day ago

Name and Version

bitnami/wordpress 24.0.4

What architecture are you using?

arm64

What steps will reproduce the bug?

  1. The environment I'm using consists mainly of the following:
    • EKS
    • Terraform
    • Helm
    • bitnami/wordpress helm chart
    • Repository: https://charts.bitnami.com/bitnami
    • Chart: wordpress
    • Version: 24.0.4
    • ingress-nginx (https://kubernetes.github.io/ingress-nginx) helm chart
  2. I have a manifest to create the ingress, instead of using bitnami/wordpress's helm chart, since I need to give a specific secretName and I don't see any way where I can do that through the values.yml file
  3. I'm installing the helm_release through Terraform, and everything works just fine. I'm able to have the deployment up and running.

    resource "helm_release" "test" {
    create_namespace = true
    name             = "test"
    chart            = "wordpress"
    namespace        = local.commons.namespace
    version          = "24.0.4"
    repository       = "https://charts.bitnami.com/bitnami"
    
    values = [
    templatefile(
      "${path.module}/helm/test/values.yml",
      merge(local.commons, local.applications.test, {
        app_image = "${data.aws_ecr_repository.test_provider.repository_url}:latest"
      })
    )
    ]
    }

Are you using any custom parameters or values?

commonLabels:
  app: "test-wordpress"
clusterDomain: "${site_domain}"
image:
  registry: docker.io
  repository: bitnami/wordpress
  tag: 6.5.3-debian-12-r6
  digest: ""
  pullPolicy: IfNotPresent
  pullSecrets: []
  debug: true
wordpressUsername: "${wp_username}"
wordpressPassword: "${wp_password}"
wordpressEmail: "${wp_email}"
wordpressFirstName: "First"
wordpressLastName: "Last"
wordpressBlogName: "${site_name}"
wordpressTablePrefix: ""
wordpressScheme: https
wordpressSkipInstall: false
wordpressPlugins: none
allowEmptyPassword: false
replicaCount: 1
extraVolumeMounts:
- mountPath: /bitnami/wordpress
  name: wordpress-data
  subPath: wordress
initContainers:
- name: plugins-and-themes
  image: ${app_image}
  imagePullPolicy: Always
  securityContext:
    runAsNonRoot: true
    runAsUser: 1001
    runAsGroup: 1001
  command: ['sh', '-c', 'echo "wordpress: " && (ls -l /bitnami/wordpress || true) && echo "wp-content: " && (ls -l /bitnami/wordpress/wp-content || true) && echo "plugins: " && (ls -l /bitnami/wordpress/wp-content/plugins || true) && mkdir -p /bitnami/wordpress/wp-content/plugins && cp -RT /wp-app/wp-content/plugins/ /bitnami/wordpress/wp-content/plugins && echo "plugins after copy: " && ls /bitnami/wordpress/wp-content/plugins']
  # command: ['sh', '-c', 'echo "wordpress: " && (ls -l /bitnami/wordpress || true) && echo "wp-content: " && (ls -l /bitnami/wordpress/wp-content || true) && echo "plugins: " && (ls -l /bitnami/wordpress/wp-content/plugins || true)']
  # command: ['sh', '-c', 'mkdir -p /bitnami/wordpress/wp-content && cp -RT /wp-app/wp-content/ /bitnami/wordpress/wp-content && ls /bitnami/wordpress/wp-content/plugins']
  # command: ['sh', '-c', 'cp -r /var/www/html/wp-content /bitnami/wordpress/wp-content']
  volumeMounts:
  - mountPath: /bitnami/wordpress
    name: wordpress-data
    subPath: wordress
podAntiAffinityPreset: soft
nodeAffinityPreset:
  type: "hard"
  key: "kubernetes.io/arch"
  values:
  - "arm64"
tolerations:
- key: "arch"
  operator: "Equal"
  value: "amd64"
  effect: "NoExecute"
resourcesPreset: "micro"
service:
  type: ClusterIP
  ports:
    http: 80
    https: 443
  httpsTargetPort: https
  sessionAffinity: None
  sessionAffinityConfig: {}
  clusterIP: ""
  externalTrafficPolicy: Cluster
  extraPorts: []
persistence:
  enabled: false
autoscaling:
  enabled: false
metrics:
  enabled: true
  serviceMonitor:
    enabled: true
mariadb:
  enabled: false
externalDatabase:
  host: "${db_host}"
  port: 3306
  user: "${db_user}"
  password: "${db_password}"
  database: "${db_name}"

What is the expected behavior?

Being able to see my plugins (in the filesystem, and browser). I expected something like the following, inside the wordpress container, when executing ls /bitnami/wordpress/wp-content/plugins:

$ ls /bitnami/wordpress/wp-content/plugins
advanced-custom-fields-pro test-simulators google-reviews gravityforms

What do you see instead?

Inside the wordpress container:

$ ls /bitnami/wordpress/wp-content/plugins
akismet  all-in-one-seo-pack  all-in-one-wp-migration  amp  google-analytics-for-wordpress  hello.php  index.php  jetpack  simple-tags  w3-total-cache  wp-mail-smtp

Additional information

I have been the whole day trying to add custom plugins and themes and reading docs and issues regarding this topic, but to no avail. I have noticed I'm far from being the only one with difficulties regarding adding custom plugins and themes, so it would be great to have a practical example of how to do it... I hope this issue will be solved and that it will help other people with the same problem. I know I put more information than is probably needed, but I think it can help debug the issue and maybe even help others who are in the same situation.

Logs