From 2e8fb6c8249c3d44ae9c5d1420b0d8ebab4c0558 Mon Sep 17 00:00:00 2001 From: Marc Duiker Date: Fri, 24 Apr 2026 11:19:26 +0200 Subject: [PATCH 1/2] Revert "Documentation for native-sidecar (#5041)" This reverts commit 15343617f495b5e7f650ebb6313b1e6cb4f38e09. Signed-off-by: Marc Duiker --- .../en/concepts/dapr-services/sidecar.md | 19 ------------------- .../hosting/kubernetes/kubernetes-job.md | 4 +--- .../arguments-annotations-overview.md | 1 - 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/daprdocs/content/en/concepts/dapr-services/sidecar.md b/daprdocs/content/en/concepts/dapr-services/sidecar.md index 9f5dc6f7e6c..18ffeda4484 100644 --- a/daprdocs/content/en/concepts/dapr-services/sidecar.md +++ b/daprdocs/content/en/concepts/dapr-services/sidecar.md @@ -33,25 +33,6 @@ You can find the various arguments that the CLI exposes to configure the sidecar On [Kubernetes]({{% ref kubernetes %}}), the Dapr control plane includes the [dapr-sidecar-injector service]({{% ref kubernetes-overview %}}), which watches for new pods with the `dapr.io/enabled` annotation and injects a container with the `daprd` process within the pod. In this case, sidecar arguments can be passed through annotations as outlined in the **Kubernetes annotations** column in [this table]({{% ref arguments-annotations-overview%}}). -### Native sidecars (Kubernetes 1.28+) - -By default, `daprd` is injected as a regular container alongside your application. With [Kubernetes native sidecars](https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/) ([KEP-753](https://github.com/kubernetes/enhancements/issues/753)), `daprd` is instead injected as an init container with `restartPolicy: Always`. Refer to the [Kubernetes sidecar containers documentation](https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/) for details on behavior and lifecycle semantics. - -Enable native sidecars globally via Helm: - -```yaml -dapr_sidecar_injector: - nativeSidecar: true -``` - -Or per-pod via annotation: - -```yaml -annotations: - dapr.io/enabled: "true" - dapr.io/enable-native-sidecar: "true" -``` - ## Running the sidecar directly In most cases you do not need to run `daprd` explicitly, as the sidecar is either launched by the [CLI]({{% ref cli-overview%}}) (self-hosted mode) or by the dapr-sidecar-injector service (Kubernetes). For advanced use cases (debugging, scripted deployments, etc.) the `daprd` process can be launched directly. diff --git a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-job.md b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-job.md index c25a85b7f5c..685ec0b6090 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-job.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-job.md @@ -8,9 +8,7 @@ description: "Use Dapr API in a Kubernetes Job context" The Dapr sidecar is designed to be a long running process. In the context of a [Kubernetes Job](https://kubernetes.io/docs/concepts/workloads/controllers/job/) this behavior can block your job completion. -{{% alert title="Native sidecars" color="primary" %}} -On Kubernetes 1.28+, you can enable [native sidecars]({{% ref "sidecar.md#native-sidecars-kubernetes-128" %}}) to ensure `daprd` operates as a [Kubernetes native sidecar](https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/) and follows its shutdown semantics. -{{% /alert %}} +To address this issue, the Dapr sidecar has an endpoint to `Shutdown` the sidecar. When running a basic [Kubernetes Job](https://kubernetes.io/docs/concepts/workloads/controllers/job/), you need to call the `/shutdown` endpoint for the sidecar to gracefully stop and the job to be considered `Completed`. diff --git a/daprdocs/content/en/reference/arguments-annotations-overview.md b/daprdocs/content/en/reference/arguments-annotations-overview.md index 3c278207dad..6380480fda1 100644 --- a/daprdocs/content/en/reference/arguments-annotations-overview.md +++ b/daprdocs/content/en/reference/arguments-annotations-overview.md @@ -76,4 +76,3 @@ This table is meant to help users understand the equivalent options for running | `--disable-init-endpoints` | `--disable-init-endpoints` | | `dapr.io/disable-init-endpoints` | Comma-separated list of initialization endpoints to disable. Supported values are `config` (disables `/dapr/config`) and `subscribe` (disables `/dapr/subscribe`). Example: `"config,subscribe"`. By default, this is not set. | | not supported | not supported | | `dapr.io/sidecar-seccomp-profile-type` | Set the sidecar container's `securityContext.seccompProfile.type` to `Unconfined`, `RuntimeDefault`, or `Localhost`. By default, this annotation is not set on the Dapr sidecar, hence the field is omitted from sidecar container. | | not supported | not supported | | `dapr.io/sidecar-svc-annotations` | Custom annotations to be applied to the operator-managed `-dapr` sidecar service. Strings consisting of `key=value` pairs separated by a comma. Read more [here]({{% ref "sidecar-service-annotations.md" %}}). | -| not supported | not supported | | `dapr.io/enable-native-sidecar` | When set to `"true"`, injects daprd as a Kubernetes native sidecar (init container with `restartPolicy: Always`, [KEP-753](https://github.com/kubernetes/enhancements/issues/753)). Overrides the global `dapr_sidecar_injector.nativeSidecar` Helm setting. Requires Kubernetes 1.28+. Default is not set (inherits global Helm value). | From 2d510cf00fca3f1a714ebf7b665c426360afad41 Mon Sep 17 00:00:00 2001 From: Marc Duiker Date: Fri, 24 Apr 2026 19:14:26 +0200 Subject: [PATCH 2/2] Add reo.dev and cookie banner Signed-off-by: Marc Duiker --- daprdocs/layouts/_partials/cookie-banner.html | 11 +++ .../layouts/_partials/hooks/body-end.html | 5 +- .../layouts/_partials/hooks/head-end.html | 39 +++++++- daprdocs/static/css/cookie-banner.css | 89 +++++++++++++++++++ daprdocs/static/js/cookie-banner.js | 72 +++++++++++++++ 5 files changed, 214 insertions(+), 2 deletions(-) create mode 100644 daprdocs/layouts/_partials/cookie-banner.html create mode 100644 daprdocs/static/css/cookie-banner.css create mode 100644 daprdocs/static/js/cookie-banner.js diff --git a/daprdocs/layouts/_partials/cookie-banner.html b/daprdocs/layouts/_partials/cookie-banner.html new file mode 100644 index 00000000000..cc3b20d9a45 --- /dev/null +++ b/daprdocs/layouts/_partials/cookie-banner.html @@ -0,0 +1,11 @@ + diff --git a/daprdocs/layouts/_partials/hooks/body-end.html b/daprdocs/layouts/_partials/hooks/body-end.html index 9111dbbefbc..3419173235f 100644 --- a/daprdocs/layouts/_partials/hooks/body-end.html +++ b/daprdocs/layouts/_partials/hooks/body-end.html @@ -18,4 +18,7 @@ import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs'; mermaid.initialize({ startOnLoad: true }); -{{ end }} \ No newline at end of file +{{ end }} + +{{ partial "cookie-banner.html" . }} + diff --git a/daprdocs/layouts/_partials/hooks/head-end.html b/daprdocs/layouts/_partials/hooks/head-end.html index 26e604a4cfc..114973871dd 100644 --- a/daprdocs/layouts/_partials/hooks/head-end.html +++ b/daprdocs/layouts/_partials/hooks/head-end.html @@ -1,3 +1,40 @@ + + + + + {{ with .Site.Params.search.algolia }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/daprdocs/static/css/cookie-banner.css b/daprdocs/static/css/cookie-banner.css new file mode 100644 index 00000000000..6f49a1d9457 --- /dev/null +++ b/daprdocs/static/css/cookie-banner.css @@ -0,0 +1,89 @@ +.cookie-banner { + box-sizing: border-box; + position: fixed; + left: 0; + right: 0; + bottom: 0; + width: 100%; + z-index: 1000; + background-color: #ffffff; + border-top: 1px solid #dee2e6; + box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08); + font-family: inherit; + color: #212529; + padding-bottom: env(safe-area-inset-bottom, 0); +} + +.cookie-banner[hidden] { + display: none; +} + +.cookie-banner__inner { + box-sizing: border-box; + max-width: 1200px; + width: 100%; + margin: 0 auto; + padding: 24px 16px; + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: center; + gap: 12px; +} + +.cookie-banner__text { + flex: 1 1 320px; + min-width: 0; + margin: 0; + font-size: 0.95rem; + line-height: 1.4; +} + +.cookie-banner__actions { + flex: 0 0 auto; + display: flex; + flex-wrap: wrap; + gap: 8px; + justify-content: center; +} + +.cookie-banner__btn { + width: auto; + min-width: 88px; + height: auto; + padding: 8px 18px; + font-size: 0.9rem; + cursor: pointer; +} + +#cookie-banner-reject.cookie-banner__btn { + background-color: #ffffff; + border-color: #dee2e6; + color: #212529; +} + +#cookie-banner-reject.cookie-banner__btn:hover { + background-color: #f8f9fa; + border-color: #ced4da; + color: #212529; +} + +.cookie-banner__btn:focus-visible { + outline: 2px solid #0d2192; + outline-offset: 2px; +} + +@media (max-width: 640px) { + .cookie-banner__inner { + padding: 20px 14px; + } + + .cookie-banner__text { + flex-basis: 100%; + text-align: center; + } + + .cookie-banner__actions { + flex-basis: 100%; + } +} diff --git a/daprdocs/static/js/cookie-banner.js b/daprdocs/static/js/cookie-banner.js new file mode 100644 index 00000000000..655f46fff45 --- /dev/null +++ b/daprdocs/static/js/cookie-banner.js @@ -0,0 +1,72 @@ +(function () { + var COOKIE_NAME = "dapr_cookie_consent"; + var COOKIE_MAX_AGE = 60 * 60 * 24 * 365; // 12 months in seconds + + function readConsent() { + var prefix = COOKIE_NAME + "="; + var parts = document.cookie ? document.cookie.split("; ") : []; + for (var i = 0; i < parts.length; i++) { + if (parts[i].indexOf(prefix) === 0) { + return parts[i].substring(prefix.length); + } + } + return null; + } + + function writeConsent(value) { + var secure = location.protocol === "https:" ? "; Secure" : ""; + document.cookie = + COOKIE_NAME + "=" + value + + "; Max-Age=" + COOKIE_MAX_AGE + + "; Path=/; SameSite=Lax" + secure; + } + + function hideBanner() { + var el = document.getElementById("cookie-banner"); + if (el) { + el.setAttribute("hidden", ""); + } + } + + function showBanner() { + var el = document.getElementById("cookie-banner"); + if (el) { + el.removeAttribute("hidden"); + } + } + + function onReady(fn) { + if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", fn); + } else { + fn(); + } + } + + onReady(function () { + var consent = readConsent(); + if (consent === null) { + showBanner(); + } + + var acceptBtn = document.getElementById("cookie-banner-accept"); + var rejectBtn = document.getElementById("cookie-banner-reject"); + + if (acceptBtn) { + acceptBtn.addEventListener("click", function () { + writeConsent("accepted"); + hideBanner(); + if (typeof window.daprInjectReo === "function") { + window.daprInjectReo(); + } + }); + } + + if (rejectBtn) { + rejectBtn.addEventListener("click", function () { + writeConsent("rejected"); + hideBanner(); + }); + } + }); +})();