diff --git a/pages/getting-started/install-memgraph/kubernetes.mdx b/pages/getting-started/install-memgraph/kubernetes.mdx index b6e95081b..aee8ccd45 100644 --- a/pages/getting-started/install-memgraph/kubernetes.mdx +++ b/pages/getting-started/install-memgraph/kubernetes.mdx @@ -201,97 +201,173 @@ endpoints, such as various [client libraries](/client-libraries), command-line interface [`mgconsole`](/getting-started/cli) or visual user interface [Memgraph Lab](/data-visualization). + +#### Monitoring + +Memgraph's standalone chart integrates with Kubernetes monitoring tools through: +- The [`kube-prometheus-stack`](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack) Helm chart +- [Memgraph's Prometheus exporter](https://github.com/memgraph/prometheus-exporter) + +The chart `kube-prometheus-stack` should be installed independently from HA chart with the following command: + +``` +helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack \ + -f kube_prometheus_stack_values.yaml \ + --namespace monitoring \ + --create-namespace +``` + +`kube_prometheus_stack_values.yaml` is optional. A template is available in the upstream [chart's repository](https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml). +If you install the `kube-prometheus-stack` in a non-default namespace, allow cross-namespace scraping. You can allow this by adding the following configuration to your `kube_prometheus_stack_values.yaml` file: + +``` +prometheus: + prometheusSpec: + serviceMonitorSelectorNilUsesHelmValues: false +``` + +In order to use Memgraph's Prometheus exporter and `ServiceMonitor` make sure to update `values.yaml` configuration file: +``` +prometheus: + enabled: true + namespace: monitoring + memgraphExporter: + port: 9115 + pullFrequencySeconds: 5 + repository: memgraph/mg-exporter + tag: 0.2.1 + serviceMonitor: + kubePrometheusStackReleaseName: kube-prometheus-stack + interval: 15s +``` + +If you set `prometheus.enabled` to false, resources from `charts/memgraph/templates/mg-exporter.yaml` will still be installed into the `monitoring` namespace. +Refer to the configuration table later in the document for details on all parameters. + +To uninstall `kube-prometheus-stack`, run: + +``` +helm uninstall kube-prometheus-stack --namespace monitoring +``` + +**NOTE**: The stack's CRDs are not deleted automatically and must be removed manually: + +``` +kubectl delete crd alertmanagerconfigs.monitoring.coreos.com +kubectl delete crd alertmanagers.monitoring.coreos.com +kubectl delete crd podmonitors.monitoring.coreos.com +kubectl delete crd probes.monitoring.coreos.com +kubectl delete crd prometheusagents.monitoring.coreos.com +kubectl delete crd prometheuses.monitoring.coreos.com +kubectl delete crd prometheusrules.monitoring.coreos.com +kubectl delete crd scrapeconfigs.monitoring.coreos.com +kubectl delete crd servicemonitors.monitoring.coreos.com +kubectl delete crd thanosrulers.monitoring.coreos.com +``` + + + #### Configuration options The following table lists the configurable parameters of the Memgraph chart and their default values. -| Parameter | Description | Default | -| --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | -| `image.repository` | Memgraph Docker image repository | `memgraph/memgraph` | -| `image.tag` | Specific tag for the Memgraph Docker image. Overrides the image tag whose default is chart version. | `""` (Defaults to chart's app version) | -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `memgraphUserId` | The user id that is hardcoded in Memgraph and Mage images | `101` | -| `memgraphGroupId` | The group id that is hardcoded in Memgraph and Mage images | `103` | -| `useImagePullSecrets` | Override the default imagePullSecrets | `false` | -| `imagePullSecrets` | Specify image pull secrets | `- name: regcred` | -| `replicaCount` | Number of Memgraph instances to run. Note: no replication or HA support. | `1` | -| `affinity.nodeKey` | Key for node affinity (Preferred) | `""` | -| `affinity.nodeValue` | Value for node affinity (Preferred) | `""` | -| `nodeSelector` | Constrain which nodes your Memgraph pod is eligible to be scheduled on, based on the labels on the nodes. Left empty by default. | `{}` | -| `service.type` | Kubernetes service type | `ClusterIP` | -| `service.enableBolt` | Enable Bolt protocol | `true` | -| `service.boltPort` | Bolt protocol port | `7687` | -| `service.enableWebsocketMonitoring` | Enable WebSocket monitoring | `false` | -| `service.websocketPortMonitoring` | WebSocket monitoring port | `7444` | -| `service.enableHttpMonitoring` | Enable HTTP monitoring | `false` | -| `service.httpPortMonitoring` | HTTP monitoring port | `9091` | -| `service.annotations` | Annotations to add to the service | `{}` | -| `service.labels` | Labels to add to the service | `{}` | -| `persistentVolumeClaim.createStorageClaim` | Enable creation of a Persistent Volume Claim for storage | `true` | -| `persistentVolumeClaim.storageClassName` | Storage class name for the persistent volume claim | `""` | -| `persistentVolumeClaim.storageSize` | Size of the persistent volume claim for storage | `10Gi` | -| `persistentVolumeClaim.libStorageAccessMode` | Access mode for the PVC of the lib storage | `ReadWriteOnce` | -| `persistentVolumeClaim.existingClaim` | Use an existing Persistent Volume Claim | `memgraph-0` | -| `persistentVolumeClaim.storageVolumeName` | Name of an existing Volume to create a PVC for | `""` | -| `persistentVolumeClaim.createLogStorage` | Enable creation of a Persistent Volume Claim for logs | `true` | -| `persistentVolumeClaim.logStorageClassName` | Storage class name for the persistent volume claim for logs | `""` | -| `persistentVolumeClaim.logStorageSize` | Size of the persistent volume claim for logs | `1Gi` | -| `persistentVolumeClaim.createUserClaim` | Create a Dynamic Persistant Volume Claim for Configs, Certificates (e.g. Bolt cert ) and rest of User related files | `false` | -| `persistentVolumeClaim.userStorageClassName` | Storage class name for the persistent volume claim for user storage | `""` | -| `persistentVolumeClaim.userStorageSize` | Size of the persistent volume claim for user storage | `1Gi` | -| `persistentVolumeClaim.userStorageAccessMode` | Storage Class Access Mode. If you need a different pod to add data into Memgraph (e.g. CSV files) set this to "ReadWriteMany" | `ReadWriteOnce` | -| `persistentVolumeClaim.userMountPath` | Where to mount the `userStorageClass` you should set this variable if you are enabling the `UserClaim` | `""` | -| `memgraphConfig` | List of strings defining Memgraph configuration settings | `["--also-log-to-stderr=true"]` | -| `secrets.enabled` | Enable the use of Kubernetes secrets for Memgraph credentials | `false` | -| `secrets.name` | The name of the Kubernetes secret containing Memgraph credentials | `memgraph-secrets` | -| `secrets.userKey` | The key in the Kubernetes secret for the Memgraph user, the value is passed to the `MEMGRAPH_USER` env | `USER` | -| `secrets.passwordKey` | The key in the Kubernetes secret for the Memgraph password, the value is passed to the `MEMGRAPH_PASSWORD` | `PASSWORD` | -| `memgraphEnterpriseLicense` | Memgraph Enterprise License | `""` | -| `memgraphOrganizationName` | Organization name for Memgraph Enterprise License | `""` | -| `statefulSetAnnotations` | Annotations to add to the stateful set | `{}` | -| `podAnnotations` | Annotations to add to the pod | `{}` | -| `resources` | CPU/Memory resource requests/limits. Left empty by default. | `{}` | -| `tolerations` | A toleration is applied to a pod and allows the pod to be scheduled on nodes with matching taints. Left empty by default. | `[]` | -| `serviceAccount.create` | Specifies whether a service account should be created | `true` | -| `serviceAccount.annotations` | Annotations to add to the service account | `{}` | -| `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated. | `""` | -| `container.terminationGracePeriodSeconds` | Grace period for pod termination | `1800` | -| `container.livenessProbe.exec` | If defined, will be used instead of a default K8s's probe. | `""` | -| `container.livenessProbe.tcpSocket.port` | Port used for TCP connection. Should be the same as bolt port. | `7687` | -| `container.livenessProbe.failureThreshold` | Failure threshold for liveness probe | `20` | -| `container.livenessProbe.timeoutSeconds` | Initial delay for readiness probe | `10` | -| `container.livenessProbe.periodSeconds` | Period seconds for readiness probe | `5` | -| `container.readinessProbe.exec` | If defined, will be used instead of a default K8s's probe. | `""` | -| `container.readinessProbe.tcpSocket.port` | Port used for TCP connection. Should be the same as bolt port. | `7687` | -| `container.readinessProbe.failureThreshold` | Failure threshold for readiness probe | `20` | -| `container.readinessProbe.timeoutSeconds` | Initial delay for readiness probe | `10` | -| `container.readinessProbe.periodSeconds` | Period seconds for readiness probe | `5` | -| `container.startupProbe.exec` | If defined, will be used instead of a default K8s's probe. | `""` | -| `container.startupProbe.tcpSocket.port` | Port used for TCP connection. Should be the same as bolt port. | `7687` | -| `container.startupProbe.failureThreshold` | Failure threshold for startup probe | `1440` | -| `container.startupProbe.periodSeconds` | Period seconds for startup probe | `10` | -| `nodeSelectors` | Node selectors for pod. Left empty by default. | `{}` | -| `customQueryModules` | List of custom Query modules that should be mounted to Memgraph Pod | `[]` | -| `storageClass.create` | If set to true, new StorageClass will be created. | `false` | -| `storageClass.name` | Name of the StorageClass | `"memgraph-generic-storage-class"` | -| `storageClass.provisioner` | Provisioner for the StorageClass | `""` | -| `storageClass.storageType` | Type of storage for the StorageClass | `""` | -| `storageClass.fsType` | Filesystem type for the StorageClass | `""` | -| `storageClass.reclaimPolicy` | Reclaim policy for the StorageClass | `Retain` | -| `storageClass.volumeBindingMode` | Volume binding mode for the StorageClass | `Immediate` | -| `initContainers` | User specific init containers | `[]` | -| `sysctlInitContainer.enabled` | Enable the init container to set sysctl parameters | `true` | -| `sysctlInitContainer.maxMapCount` | Value for `vm.max_map_count` to be set by the init container | `262144` | -| `sysctlInitContainer.image.repository` | Busybox image repository | `library/busybox` | -| `sysctlInitContainer.image.tag` | Specific tag for the Busybox Docker image | `latest` | -| `sysctlInitContainer.image.pullPolicy` | Image pull policy for busybox | `IfNotPresent` | -| `lifecycleHooks` | For the memgraph container(s) to automate configuration before or after startup | `[]` | -| `extraVolumes` | Optionally specify extra list of additional volumes | `[]` | -| `extraVolumeMounts` | Optionally specify extra list of additional volumeMounts | `[]` | -| `extraEnv` | Env variables that users can define | `[]` | -| `userContainers.data` | Containers that users can specifiy that will be run aside from the main Memgraph container on data instances. | `[]` | -| `userContainers.coordinators` | Containers that users can specifiy that will be run aside from the main Memgraph container on coordinators. | `[]` | +| Parameter | Description | Default | +| -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | +| `image.repository` | Memgraph Docker image repository | `memgraph/memgraph` | +| `image.tag` | Specific tag for the Memgraph Docker image. Overrides the image tag whose default is chart version. | `""` (Defaults to chart's app version) | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `memgraphUserId` | The user id that is hardcoded in Memgraph and Mage images | `101` | +| `memgraphGroupId` | The group id that is hardcoded in Memgraph and Mage images | `103` | +| `useImagePullSecrets` | Override the default imagePullSecrets | `false` | +| `imagePullSecrets` | Specify image pull secrets | `- name: regcred` | +| `replicaCount` | Number of Memgraph instances to run. Note: no replication or HA support. | `1` | +| `affinity.nodeKey` | Key for node affinity (Preferred) | `""` | +| `affinity.nodeValue` | Value for node affinity (Preferred) | `""` | +| `nodeSelector` | Constrain which nodes your Memgraph pod is eligible to be scheduled on, based on the labels on the nodes. Left empty by default. | `{}` | +| `service.type` | Kubernetes service type | `ClusterIP` | +| `service.enableBolt` | Enable Bolt protocol | `true` | +| `service.boltPort` | Bolt protocol port | `7687` | +| `service.enableWebsocketMonitoring` | Enable WebSocket monitoring | `false` | +| `service.websocketPortMonitoring` | WebSocket monitoring port | `7444` | +| `service.enableHttpMonitoring` | Enable HTTP monitoring | `false` | +| `service.httpPortMonitoring` | HTTP monitoring port | `9091` | +| `service.annotations` | Annotations to add to the service | `{}` | +| `service.labels` | Labels to add to the service | `{}` | +| `persistentVolumeClaim.createStorageClaim` | Enable creation of a Persistent Volume Claim for storage | `true` | +| `persistentVolumeClaim.storageClassName` | Storage class name for the persistent volume claim | `""` | +| `persistentVolumeClaim.storageSize` | Size of the persistent volume claim for storage | `10Gi` | +| `persistentVolumeClaim.libStorageAccessMode` | Access mode for the PVC of the lib storage | `ReadWriteOnce` | +| `persistentVolumeClaim.existingClaim` | Use an existing Persistent Volume Claim | `memgraph-0` | +| `persistentVolumeClaim.storageVolumeName` | Name of an existing Volume to create a PVC for | `""` | +| `persistentVolumeClaim.createLogStorage` | Enable creation of a Persistent Volume Claim for logs | `true` | +| `persistentVolumeClaim.logStorageClassName` | Storage class name for the persistent volume claim for logs | `""` | +| `persistentVolumeClaim.logStorageSize` | Size of the persistent volume claim for logs | `1Gi` | +| `persistentVolumeClaim.createUserClaim` | Create a Dynamic Persistant Volume Claim for Configs, Certificates (e.g. Bolt cert ) and rest of User related files | `false` | +| `persistentVolumeClaim.userStorageClassName` | Storage class name for the persistent volume claim for user storage | `""` | +| `persistentVolumeClaim.userStorageSize` | Size of the persistent volume claim for user storage | `1Gi` | +| `persistentVolumeClaim.userStorageAccessMode` | Storage Class Access Mode. If you need a different pod to add data into Memgraph (e.g. CSV files) set this to "ReadWriteMany" | `ReadWriteOnce` | +| `persistentVolumeClaim.userMountPath` | Where to mount the `userStorageClass` you should set this variable if you are enabling the `UserClaim` | `""` | +| `memgraphConfig` | List of strings defining Memgraph configuration settings | `["--also-log-to-stderr=true"]` | +| `secrets.enabled` | Enable the use of Kubernetes secrets for Memgraph credentials | `false` | +| `secrets.name` | The name of the Kubernetes secret containing Memgraph credentials | `memgraph-secrets` | +| `secrets.userKey` | The key in the Kubernetes secret for the Memgraph user, the value is passed to the `MEMGRAPH_USER` env | `USER` | +| `secrets.passwordKey` | The key in the Kubernetes secret for the Memgraph password, the value is passed to the `MEMGRAPH_PASSWORD` | `PASSWORD` | +| `memgraphEnterpriseLicense` | Memgraph Enterprise License | `""` | +| `memgraphOrganizationName` | Organization name for Memgraph Enterprise License | `""` | +| `statefulSetAnnotations` | Annotations to add to the stateful set | `{}` | +| `podAnnotations` | Annotations to add to the pod | `{}` | +| `resources` | CPU/Memory resource requests/limits. Left empty by default. | `{}` | +| `tolerations` | A toleration is applied to a pod and allows the pod to be scheduled on nodes with matching taints. Left empty by default. | `[]` | +| `serviceAccount.create` | Specifies whether a service account should be created | `true` | +| `serviceAccount.annotations` | Annotations to add to the service account | `{}` | +| `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated. | `""` | +| `container.terminationGracePeriodSeconds` | Grace period for pod termination | `1800` | +| `container.livenessProbe.exec` | If defined, will be used instead of a default K8s's probe. | `""` | +| `container.livenessProbe.tcpSocket.port` | Port used for TCP connection. Should be the same as bolt port. | `7687` | +| `container.livenessProbe.failureThreshold` | Failure threshold for liveness probe | `20` | +| `container.livenessProbe.timeoutSeconds` | Initial delay for readiness probe | `10` | +| `container.livenessProbe.periodSeconds` | Period seconds for readiness probe | `5` | +| `container.readinessProbe.exec` | If defined, will be used instead of a default K8s's probe. | `""` | +| `container.readinessProbe.tcpSocket.port` | Port used for TCP connection. Should be the same as bolt port. | `7687` | +| `container.readinessProbe.failureThreshold` | Failure threshold for readiness probe | `20` | +| `container.readinessProbe.timeoutSeconds` | Initial delay for readiness probe | `10` | +| `container.readinessProbe.periodSeconds` | Period seconds for readiness probe | `5` | +| `container.startupProbe.exec` | If defined, will be used instead of a default K8s's probe. | `""` | +| `container.startupProbe.tcpSocket.port` | Port used for TCP connection. Should be the same as bolt port. | `7687` | +| `container.startupProbe.failureThreshold` | Failure threshold for startup probe | `1440` | +| `container.startupProbe.periodSeconds` | Period seconds for startup probe | `10` | +| `nodeSelectors` | Node selectors for pod. Left empty by default. | `{}` | +| `customQueryModules` | List of custom Query modules that should be mounted to Memgraph Pod | `[]` | +| `storageClass.create` | If set to true, new StorageClass will be created. | `false` | +| `storageClass.name` | Name of the StorageClass | `"memgraph-generic-storage-class"` | +| `storageClass.provisioner` | Provisioner for the StorageClass | `""` | +| `storageClass.storageType` | Type of storage for the StorageClass | `""` | +| `storageClass.fsType` | Filesystem type for the StorageClass | `""` | +| `storageClass.reclaimPolicy` | Reclaim policy for the StorageClass | `Retain` | +| `storageClass.volumeBindingMode` | Volume binding mode for the StorageClass | `Immediate` | +| `initContainers` | User specific init containers | `[]` | +| `sysctlInitContainer.enabled` | Enable the init container to set sysctl parameters | `true` | +| `sysctlInitContainer.maxMapCount` | Value for `vm.max_map_count` to be set by the init container | `262144` | +| `sysctlInitContainer.image.repository` | Busybox image repository | `library/busybox` | +| `sysctlInitContainer.image.tag` | Specific tag for the Busybox Docker image | `latest` | +| `sysctlInitContainer.image.pullPolicy` | Image pull policy for busybox | `IfNotPresent` | +| `lifecycleHooks` | For the memgraph container(s) to automate configuration before or after startup | `[]` | +| `extraVolumes` | Optionally specify extra list of additional volumes | `[]` | +| `extraVolumeMounts` | Optionally specify extra list of additional volumeMounts | `[]` | +| `extraEnv` | Env variables that users can define | `[]` | +| `userContainers.data` | Containers that users can specifiy that will be run aside from the main Memgraph container on data instances. | `[]` | +| `userContainers.coordinators` | Containers that users can specifiy that will be run aside from the main Memgraph container on coordinators. | `[]` | +| `prometheus.enabled` | If set to `true`, K8s resources representing Memgraph’s Prometheus exporter will be deployed. | `false` | +| `prometheus.namespace` | The namespace in which `kube-prometheus-stack` and Memgraph’s Prometheus exporter are installed. | `monitoring` | +| `prometheus.memgraphExporter.port` | The port on which Memgraph’s Prometheus exporter is available. | `9115` | +| `prometheus.memgraphExporter.pullFrequencySeconds` | How often will Memgraph’s Prometheus exporter pull data from Memgraph instances. | `5` | +| `prometheus.memgraphExporter.repository` | The repository where Memgraph’s Prometheus exporter image is available. | `memgraph/prometheus-exporter` | +| `prometheus.memgraphExporter.tag` | The tag of Memgraph’s Prometheus exporter image. | `0.2.1` | +| `prometheus.serviceMonitor.enabled` | If enabled, a `ServiceMonitor` object will be deployed. | `true` | +| `prometheus.serviceMonitor.kubePrometheusStackReleasename` | The release name under which `kube-prometheus-stack` chart is installed. | `kube-prometheus-stack` | +| `prometheus.serviceMonitor.interval` | How often will Prometheus pull data from Memgraph’s Prometheus exporter. | `15s` | + To change the default chart values, provide your own `values.yaml` file during the installation: