This repository contains the Shopware Operator for Kubernetes. The Operator is a Kubernetes controller that manages Shopware installations in a Kubernetes cluster.
Below you find a descriptions how to deploy the Operator using helm or kubectl.
The validating webhook is enabled by default and requires cert-manager to issue and rotate its certificate. Helm installations can disable it with --set webhook.enabled=false; this also removes the cert-manager dependency, but container overrides will no longer receive webhook validation.
For Helm installations, the webhook validates Store resources only in the
operator's release namespace by default. This allows multiple operator versions
to be installed in separate namespaces without their webhooks affecting one
another. A custom webhook.namespaceSelector can be configured when an operator
needs to manage additional namespaces. The default value {} means “use the
operator's release namespace”; to select all namespaces explicitly, configure
namespaceSelector.matchExpressions: [].
For a helm installation check out our charts repository
-
Install the custom resource definitions (cdr) for your cluster:
kubectl apply -f https://github.com/shopware/shopware-operator/releases/latest/download/crd.yaml --server-side
-
Deploy the operator itself from
manager.yamlinto thedefaultnamespace:kubectl apply -f https://github.com/shopware/shopware-operator/releases/latest/download/manager.yaml
Important
The released manager.yaml wires its cluster-scoped webhook configuration to the default namespace. Use the Helm chart or a Kustomize overlay for installations in another namespace.
For a source-based Kustomize installation without the webhook or cert-manager resources, use:
kubectl apply -k config/no-webhookTo set up a local development environment, you must have the following components in place:
- A valid Store custom resource
- A MySQL-compatible database
- An S3-compatible object storage
These are required for a basic Shopware deployment within a Kubernetes cluster.
We recommend using the Shopware Helm Chart, which includes a Percona-based MySQL database and an S3-compatible interface provided by MinIO.To run the operator within your cluster, execute the following command:
NAMESPACE=default make runThe local controller runs without the validating webhook because cert-manager only provisions its TLS certificate for in-cluster deployments. Admission validation remains enabled by default for Helm and Kustomize installations that include the webhook resources.
Important
Ensure that you are using the correct Kubernetes context before running the command.
When using sidecars, please ensure they are properly terminated. Unfortunately, Kubernetes does not provide a reliable mechanism for managing the shutdown of jobs (such as setup and migration jobs). As a result, we cannot guarantee that containers within the pod will be stopped correctly. To address this, the job will be deleted once the operator container has completed its task.
Shopware welcomes community contributions to help improving the Shopware Operator. If you found a bug or want to change something create an issue before fixing/changing it.
Another good place to discuss the Shopware Operator with developers and other community members is the Slack channel: https://shopwarecommunity.slack.com/channels/shopware6-kubernetes