Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM Support #21

Closed
tsmock opened this issue Oct 2, 2020 · 11 comments
Closed

ARM Support #21

tsmock opened this issue Oct 2, 2020 · 11 comments

Comments

@tsmock
Copy link

tsmock commented Oct 2, 2020

Bitnami currently does not support ARM (I would like to use this helm chart on Raspberry Pi's).

If there is interest, I will probably experiment with using the official mariadb docker image instead of the bitnami version.

## Official nextcloud image version
## ref: https://hub.docker.com/r/library/nextcloud/tags/
##
image:
  repository: nextcloud
  tag: 17.0.0-apache
  pullPolicy: IfNotPresent
  # pullSecrets:
  #   - myRegistrKeySecretName

nameOverride: ""
fullnameOverride: ""

# Number of replicas to be deployed
replicaCount: 1

## Allowing use of ingress controllers
## ref: https://kubernetes.io/docs/concepts/services-networking/ingress/
##
ingress:
  enabled: false
  annotations: {}
  #  nginx.ingress.kubernetes.io/proxy-body-size: 4G
  #  kubernetes.io/tls-acme: "true"
  #  certmanager.k8s.io/cluster-issuer: letsencrypt-prod
  #  nginx.ingress.kubernetes.io/server-snippet: |-
  #    server_tokens off;
  #    proxy_hide_header X-Powered-By;

  #    rewrite ^/.well-known/webfinger /public.php?service=webfinger last;
  #    rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
  #    rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json;
  #    location = /.well-known/carddav {
  #      return 301 $scheme://$host/remote.php/dav;
  #    }
  #    location = /.well-known/caldav {
  #      return 301 $scheme://$host/remote.php/dav;
  #    }
  #    location = /robots.txt {
  #      allow all;
  #      log_not_found off;
  #      access_log off;
  #    }
  #    location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
  #      deny all;
  #    }
  #    location ~ ^/(?:autotest|occ|issue|indie|db_|console) {
  #      deny all;
  #    }
  #  tls:
  #    - secretName: nextcloud-tls
  #      hosts:
  #        - nextcloud.kube.home
  labels: {}


# Allow configuration of lifecycle hooks
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/
lifecycle: {}
  # postStartCommand: []
  # preStopCommand: []

nextcloud:
  host: nextcloud.<HOST>
  username: <USER>
  password: <PASSWORD>
  update: 0
  datadir: /var/www/html/data
  tableprefix:
  persistence:
    enabled: true
    existingClaim: "nextcloud-storage"
    accessMode: ReadWriteOnce
    size: 50Gi
  mail:
    enabled: false
    fromAddress: user
    domain: domain.com
    smtp:
      host: domain.com
      secure: ssl
      port: 465
      authtype: LOGIN
      name: user
      password: pass
  # PHP Configuration files
  # Will be injected in /usr/local/etc/php/conf.d
  phpConfigs: {}
  # Default config files
  # IMPORTANT: Will be used only if you put extra configs, otherwise default will come from nextcloud itself
  # Default confgurations can be found here: https://github.com/nextcloud/docker/tree/master/16.0/apache/config
  defaultConfigs:
    # To protect /var/www/html/config
    .htaccess: true
    # Redis default configuration
    redis.config.php: true
    # Apache configuration for rewrite urls
    apache-pretty-urls.config.php: true
    # Define APCu as local cache
    apcu.config.php: true
    # Apps directory configs
    apps.config.php: true
    # Used for auto configure database
    autoconfig.php: true
    # SMTP default configuration
    smtp.config.php: true
  # Extra config files created in /var/www/html/config/
  # ref: https://docs.nextcloud.com/server/15/admin_manual/configuration_server/config_sample_php_parameters.html#multiple-config-php-file
  configs: {}

  # For example, to use S3 as primary storage
  # ref: https://docs.nextcloud.com/server/13/admin_manual/configuration_files/primary_storage.html#simple-storage-service-s3
  #
  #  configs:
  #    s3.config.php: |-
  #      <?php
  #      $CONFIG = array (
  #        'objectstore' => array(
  #          'class' => '\\OC\\Files\\ObjectStore\\S3',
  #          'arguments' => array(
  #            'bucket'     => 'my-bucket',
  #            'autocreate' => true,
  #            'key'        => 'xxx',
  #            'secret'     => 'xxx',
  #            'region'     => 'us-east-1',
  #            'use_ssl'    => true
  #          )
  #        )
  #      );

  ## Strategy used to replace old pods
  ## IMPORTANT: use with care, it is suggested to leave as that for upgrade purposes
  ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
  strategy:
    type: Recreate
    # type: RollingUpdate
    # rollingUpdate:
    #   maxSurge: 1
    #   maxUnavailable: 0

  ##
  ## Extra environment variables
  extraEnv:
  #  - name: SOME_SECRET_ENV
  #    valueFrom:
  #      secretKeyRef:
  #        name: nextcloud
  #        key: secret_key

  # Extra mounts for the pods. Example shown is for connecting a legacy NFS volume
  # to NextCloud pods in Kubernetes. This can then be configured in External Storage
  extraVolumes:
  #  - name: nfs
  #    nfs:
  #      server: "10.0.0.1"
  #      path: "/nextcloud_data"
  #      readOnly: false
  extraVolumeMounts:
  #  - name: nfs
  #    mountPath: "/legacy_data"

nginx:
  ## You need to set an fpm version of the image for nextcloud if you want to use nginx!
  enabled: false
  image:
    repository: nginx
    tag: alpine
    pullPolicy: IfNotPresent

  config:
    # This generates the default nginx config as per the nextcloud documentation
    default: true
    # custom: |-
    #     worker_processes  1;..

  resources: {}

internalDatabase:
  enabled: true
  name: nextcloud

##
## External database configuration
##
externalDatabase:
  enabled: false

  ## Supported database engines: mysql or postgresql
  type: mysql

  ## Database host
  host:

  ## Database user
  user: nextcloud

  ## Database password
  password:

  ## Database name
  database: nextcloud

  ## Use a existing secret
  existingSecret:
    enabled: false
    # secretName: nameofsecret
    # usernameKey: username
    # passwordKey: password

##
## MariaDB chart configuration
##
mariadb:
  ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters
  enabled: true

  db:
    name: nextcloud
    user: nextcloud
    password: <PASSWORD>

  ## Enable persistence using Persistent Volume Claims
  ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
  ##
  persistence:
    enabled: true
    existingClaim: "nextcloud-storage"
    accessMode: ReadWriteOnce
    size: 50Gi

redis:
  enabled: false
  usePassword: false

## Cronjob to execute Nextcloud background tasks
## ref: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#cron-jobs
##
cronjob:
  enabled: false
  # Nexcloud image is used as default but only curl is needed
  image: {}
    # repository: nextcloud
    # tag: 16.0.3-apache
    # pullPolicy: IfNotPresent
    # pullSecrets:
    #   - myRegistrKeySecretName
  # Every 15 minutes
  # Note: Setting this to any any other value than 15 minutes might
  #  cause issues with how nextcloud background jobs are executed
  schedule: "*/15 * * * *"
  annotations: {}
  # Set curl's insecure option if you use e.g. self-signed certificates
  curlInsecure: false
  failedJobsHistoryLimit: 5
  successfulJobsHistoryLimit: 2
  # If not set, nextcloud deployment one will be set
  # resources:
    # We usually recommend not to specify default resources and to leave this as a conscious
    # choice for the user. This also increases chances charts run on environments with little
    # resources, such as Minikube. If you do want to specify resources, uncomment the following
    # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
    # limits:
    #  cpu: 100m
    #  memory: 128Mi
    # requests:
    #  cpu: 100m
    #  memory: 128Mi

  # If not set, nextcloud deployment one will be set
  # nodeSelector: {}

  # If not set, nextcloud deployment one will be set
  # tolerations: []

  # If not set, nextcloud deployment one will be set
  # affinity: {}

service:
  type: ClusterIP
  port: 8080
  loadBalancerIP: nil
  nodePort: nil

## Enable persistence using Persistent Volume Claims
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##
persistence:
  enabled: true
  existingClaim: "nextcloud-storage"
  # Nextcloud Data (/var/www/html)
  annotations: {}
  ## nextcloud data Persistent Volume Storage Class
  ## If defined, storageClassName: <storageClass>
  ## If set to "-", storageClassName: "", which disables dynamic provisioning
  ## If undefined (the default) or set to null, no storageClassName spec is
  ##   set, choosing the default provisioner.  (gp2 on AWS, standard on
  ##   GKE, AWS & OpenStack)
  ##
  # storageClass: "-"

  ## A manually managed Persistent Volume and Claim
  ## Requires persistence.enabled: true
  ## If defined, PVC must be created manually before volume will be bound
  # existingClaim:

  accessMode: ReadWriteOnce
  size: 50Gi

resources: {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  # limits:
  #  cpu: 100m
  #  memory: 128Mi
  # requests:
  #  cpu: 100m
  #  memory: 128Mi

## Liveness and readiness probe values
## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
##
livenessProbe:
  enabled: true
  initialDelaySeconds: 30
  periodSeconds: 15
  timeoutSeconds: 5
  failureThreshold: 3
  successThreshold: 1
readinessProbe:
  enabled: true
  initialDelaySeconds: 30
  periodSeconds: 15
  timeoutSeconds: 5
  failureThreshold: 3
  successThreshold: 1

## Enable pod autoscaling using HorizontalPodAutoscaler
## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
##
hpa:
  enabled: false
  cputhreshold: 60
  minPods: 1
  maxPods: 10

nodeSelector: {}

tolerations: []

affinity: {}


## Prometheus Exporter / Metrics
##
metrics:
  enabled: false

  replicaCount: 1
  # The metrics exporter needs to know how you serve Nextcloud either http or https
  https: false
  timeout: 5s

  image:
    repository: xperimental/nextcloud-exporter
    tag: v0.3.0
    pullPolicy: IfNotPresent

  ## Metrics exporter resource requests and limits
  ## ref: http://kubernetes.io/docs/user-guide/compute-resources/
  ##
  # resources: {}

  ## Metrics exporter pod Annotation and Labels
  # podAnnotations: {}

  # podLabels: {}

  service:
    type: ClusterIP
    ## Use serviceLoadBalancerIP to request a specific static IP,
    ## otherwise leave blank
    # loadBalancerIP:
    annotations:
      prometheus.io/scrape: "true"
      prometheus.io/port: "9205"
    labels: {}
@Skallwar
Copy link

Skallwar commented Nov 5, 2020

Have you succeeded? I'm trying to use PostgreSQL on my side but got an exec format error

@ghudgins
Copy link

for what it's worth i'm interested! you can run this chart using the external DB option but there's no external redis option exposed

@Skallwar
Copy link

I'm trying to use PostgreSQL on my side but got an exec format error

This made it work

postgresql:
  enable=true
  image:
    registry: docker.io
    repository: postgres
    tag: 13.1

@bigbrovar
Copy link

I could not even get it to work with a multi arch cluster. It does not follow affinity rules. This helm chart was badly made tbh

@Clashsoft
Copy link

Clashsoft commented Sep 2, 2021

For anyone who finds this issue, I do not recommend attempting to use this chart for an ARM / Raspberry Pi cluster. There are too many issues with DB and Redis.

Some examples:

  • Using the official postgres image:
    mkdir: cannot create directory ‘/bitnami’: Permission denied
    
  • Using the official redis image (Redis on RPi (arm64) enters in CrashLoopBackOff state #102):
    /opt/bitnami/scripts/start-scripts/start-master.sh: line 21: /run.sh: No such file or directory
    
  • Using the official mariadb image: a ton of errors due to file access problems.

@magsol
Copy link

magsol commented Oct 31, 2021

@Clashsoft So basically, stick with the bitnami images and... don't use arm64?

@snowpoke
Copy link

snowpoke commented Nov 1, 2021

I'm running this chart on a Raspberry Pi successfully, but figuring out the kinks took a while.

Here's an extract from my values file:

internalDatabase: # causes issues with ARM systems and secret management
  enabled: false

externalDatabase:
  enabled: true
  type: postgresql
  host: nextcloud-postgres-postgresql
  database: postgres
  existingSecret:
    enabled: true
    secretName: nextcloud-postgres-auth
    usernameKey: username
    passwordKey: password
    
startupProbe: # without this, install will fail on slower systems
  enabled: true
  initialDelaySeconds: 120

For Postgres, I'm using the cetic/postgresql chart.

(Figuring out that startupProbe bit took me weeks by the way. But I was still learning about Kubernetes, so I was willing to spend the time)

@rubencabrera
Copy link

I tried following @snowpoke's suggestion and Nextcloud runs without issues (so far, it's been a week of not very intense usage) in a Raspberry Pi cluster. The strange thing is that while using:

  values:
    externalDatabase:
      database: postgres
      enabled: true
...REDACTED...
      type: postgresql
    internalDatabase:
      enabled: false
...REDACTED...

My Nextcloud container installs with SQLite:

Installing with SQLite database
starting nextcloud installation
Nextcloud was successfully installed

I've got PostgreSQL in the same namespace from the cetic/postgresql chart too to try and reproduce the same, but that's being completely ignored. If I break that, Nextcloud is still happy with its own SQLite db.

@jessebot
Copy link
Collaborator

There's a couple different issues going on in this thread by a few different people, so I'll do my best to address each one, but put them in collapsible fields so you can click the one relevant to your concern:

Bitnami Charts

I'm not sure we're really married to any given chart provider, but others familiar with this repo are free to chime in as to why bitnami was chosen. It looks like Bitnami started on making ARM work, according to bitnami/charts#7305, but in a bit over a year now, they still don't have their jenkins pipelines working, and the company is mostly focused on tanzu work right now.

SO, in the meantime, if you think it makes sense, and you can test an alternative chart provider, you could always submit a PR and we can review it. It might make sense to open up an Issue or discussion for each bitnami chart affected, to talk further about which charts to use, so the whole community can easily find your thoughts and chime in with additional data that might be relevant to that. We are definitely interested in learning about alternative approaches though and would absolutely review a PR :)

It's also worth noting that some of our chart dependencies may be a bit out of date sometimes while we work out the kinks in our ci/cd process. If there's something wildly out of date, take a look if there's already a dependabot PR opened for it, and if so, you can help by testing to make sure the PR would not break anyone. (example: making sure we're aware of any breaking changes from one version to the next)

External Redis

It looks like, currently, our only mention of redis outside of providing the bitnami redis chart dependency values is this:

redis.config.php: true

but a closer look through the nextcloud docs shows that you should be able to configure that block with the instructions here: https://docs.nextcloud.com/server/19/admin_manual/configuration_server/caching_configuration.html#id2

We're happy to review a PR submitted by anyone in the community to improve the helm templates and expose a better parameter set instead of just the config param we currently have :) If you do submit a PR, please remember to provide, in additional to updating the helm template, both comments in the values.yaml and an update to the chart's README to add the additional parameters to the configuration table, so everyone knows how to use it in the future.

PostgreSQL not being seen by NextCloud

This can be for a couple of reasons, but it looks like you have externalDatabase.enabled set to true and internalDatabase.enabled set to false so that's half the battle :) The next thing is making sure the parameters for externalDatabase are all configured correctly, so all of the following, which you may already have configured, but I can't see all of your values.yaml:

  # External database configuration
  externalDatabase:
    enabled: true
    ## Supported database engines: mysql or postgresql
    type: postgresql
    host: localhost:5432
    # Database name
    database: nextcloud
    ## Use a existing secret for credentials (optional, but without this, you must provide password/usersname params above)
    existingSecret:
      enabled: true
      secretName: nextcloud-pgsql-credentials
      usernameKey: username
      passwordKey: nextcloudPassword

If after that, you're still getting issues, please anonymize your values.yaml and open a new issue with that and other info about your environment, so we can take a further look. In your journeys, if you find any helpful info, please feel free to submit a PR and we can review it to make sure it helps others.

Code of Conduct and Contributing

Please remember that this repo is maintained by volunteers in the open source community, and we're doing our best. Be sure to read the official Nextcloud Code of Conduct. You can also read some of our contributing guidelines to get a feel for what's required in a given PR.

We are happy to help out when we have time, but open source work takes a community of people working together, so if something is broken or not working as expected, please be kind about reporting your issues, and please also feel free to help make it better. We're always happy to review PRs if you have found a solution or even just want to add documentation (even comments in the values.yaml can be really helpful!). If you encountered an issue, chances are others have as well, so it's always worth trying to submit a PR, even if it isn't perfect the first time around. We can collaborate together and iterate on it over time :)

@jessebot jessebot added the discussion Being discussed label Jan 27, 2023
@jessebot
Copy link
Collaborator

Looks like bitnami started supporting ARM :) bitnami/charts#7305 (comment)

@jessebot
Copy link
Collaborator

jessebot commented Apr 10, 2023

Bitnami now has arm architecture support for Redis, Postgres, and Mariadb, so I am going to close this. If you have further questions about anything else that was asked here, please feel free to open a new issue, or a PR if you'd like to change anything about our README/values.yaml.

Note: You can still submit a PR to change the bitnami charts to better charts if you have suggestions and have tested the alternatives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants