{"id":3793,"date":"2024-09-20T20:00:55","date_gmt":"2024-09-20T18:00:55","guid":{"rendered":"https:\/\/www.openmediavault.org\/?p=3793"},"modified":"2024-09-21T14:10:46","modified_gmt":"2024-09-21T12:10:46","slug":"make-use-of-the-dsl-in-the-openmediavault-k8s-plugin","status":"publish","type":"post","link":"https:\/\/www.openmediavault.org\/?p=3793","title":{"rendered":"Make use of the DSL in the openmediavault-k8s plugin"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The recipe editor of the openmediavault-k8s has a DSL (Domain Specific Language) that supports the user in getting specific information from their openmediavault host system in Kubernetes manifests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The following functions are currently available:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>hostname()<\/code> &#8211; Get the hostname of the host.<\/li>\n\n\n\n<li><code>domain()<\/code> &#8211; Get the domain name of the host.<\/li>\n\n\n\n<li><code>fqdn()<\/code> &#8211; Get the FQDN of the host.<\/li>\n\n\n\n<li><code>ipaddr(name=NULL)<\/code> &#8211; Get the IPv4 address of the specified network interface. If not set, the IPv4 address of the interface of the first default route is used.<\/li>\n\n\n\n<li><code>ipaddr6(name=NULL)<\/code> &#8211; Get the IPv6 address of the specified network interface. If not set, the IPv6 address of the interface of the first default route is used.<\/li>\n\n\n\n<li><code>uid(name)<\/code> &#8211; Get the UID of the specified user.<\/li>\n\n\n\n<li><code>gid(name)<\/code> &#8211; Get the GID of the specified group.<\/li>\n\n\n\n<li><code>sharedfolder_path(name)<\/code> &#8211; Get the full path of the specified shared folder.<\/li>\n\n\n\n<li><code>conf_get(id, uuid=NULL)<\/code> &#8211; Get the specified database configuration object.<\/li>\n\n\n\n<li><code>tz()<\/code> &#8211; Get the time zone of the host.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The following filters are currently available:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>get(key, default=NULL)<\/code> &#8211; Get the specified key, e.g. <code>foo.bar.baz<\/code> from a dictionary.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For the built-in features of the used template engine please have a look here:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/twig.symfony.com\/doc\/3.x\/templates.html\" target=\"_blank\" rel=\"noopener nofollow\" title=\"\">Basic knowledge<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/twig.symfony.com\/doc\/3.x\/filters\/index.html\" target=\"_blank\" rel=\"noopener nofollow\" title=\"\">Filters<\/a> and <a href=\"https:\/\/twig.symfony.com\/doc\/3.x\/functions\/index.html\" target=\"_blank\" rel=\"noopener nofollow\" title=\"\">functions<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Here are several examples that make use of the DSL:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: apps\/v1\nkind: Deployment\nmetadata:\n  labels:\n    app.kubernetes.io\/instance: wetty\n    app.kubernetes.io\/name: wetty\n  name: wetty\n  namespace: wetty-app\nspec:\n  ...\n  template:\n    ...\n    spec:\n      containers:\n        - image: docker.io\/wettyoss\/wetty:latest\n          imagePullPolicy: IfNotPresent\n          name: wetty\n          ports:\n            - containerPort: 3000\n          securityContext:\n            runAsNonRoot: true\n            runAsUser: {{ uid('nobody') }}\n            runAsGroup: {{ gid('nogroup') }}\n          args:\n            - \"--port=3000\"\n            - \"--base=\/\"\n            - \"--force-ssh\"\n            - \"--ssh-port={{ conf_get('conf.service.ssh') | get('port') }}\"\n            - \"--ssh-host={{ hostname() }}\"\n      restartPolicy: Always<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>...\npersistence:\n    import:\n        enabled: true\n        type: hostPath\n        readOnly: true\n        mountPath: \/srv\/import\n        hostPath: {{ sharedfolder_path('images') }}\n        hostPathType: Directory<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: v1\nkind: PersistentVolume\nmetadata:\n  name: config-dir\n  labels:\n    app.kubernetes.io\/instance: plex-media-server\n    app.kubernetes.io\/name: plex-media-server\nspec:\n  storageClassName: shared-folder\n  capacity:\n    storage: 2Gi\n  hostPath:\n    path: {{ sharedfolder_path('media') }}\n    type: Directory\n  accessModes:\n    - ReadWriteMany<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: traefik.containo.us\/v1alpha1\nkind: IngressRoute\nmetadata:\n  name: immich-websecure\n  namespace: immich-app\n  ...\nspec:\n  entryPoints:\n    - websecure\n  routes:\n    - match: Host(`immich.{{ ipaddr() }}.sslip.io`)\n      kind: Rule\n      services:\n        - name: immich-server\n          port: 3001<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The recipe editor of the openmediavault-k8s has a DSL (Domain Specific Language) that supports the user in getting specific information from their openmediavault host system in Kubernetes manifests. The following functions are currently available: The following filters are currently available: For the built-in features of the used template engine please have a look here: Here &#8230; <a title=\"Make use of the DSL in the openmediavault-k8s plugin\" class=\"read-more\" href=\"https:\/\/www.openmediavault.org\/?p=3793\" aria-label=\"Read more about Make use of the DSL in the openmediavault-k8s plugin\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3793","post","type-post","status-publish","format-standard","hentry","category-common"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"volker\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.openmediavault.org\/?p=3793\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=3793#article\",\"name\":\"Make use of the DSL in the openmediavault-k8s plugin | openmediavault\",\"headline\":\"Make use of the DSL in the openmediavault-k8s plugin\",\"author\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?author=2#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.openmediavault.org\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/header_logo.svg\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/#articleImage\",\"width\":330,\"height\":42},\"datePublished\":\"2024-09-20T20:00:55+02:00\",\"dateModified\":\"2024-09-21T14:10:46+02:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=3793#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=3793#webpage\"},\"articleSection\":\"Common\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=3793#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.openmediavault.org#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.openmediavault.org\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?cat=1#listItem\",\"name\":\"Common\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?cat=1#listItem\",\"position\":2,\"name\":\"Common\",\"item\":\"https:\\\/\\\/www.openmediavault.org\\\/?cat=1\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=3793#listItem\",\"name\":\"Make use of the DSL in the openmediavault-k8s plugin\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.openmediavault.org#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=3793#listItem\",\"position\":3,\"name\":\"Make use of the DSL in the openmediavault-k8s plugin\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?cat=1#listItem\",\"name\":\"Common\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/#organization\",\"name\":\"openmediavault\",\"description\":\"DATA SOVEREIGNTY MADE EASY\",\"url\":\"https:\\\/\\\/www.openmediavault.org\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.openmediavault.org\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/header_logo.svg\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=3793\\\/#organizationLogo\",\"width\":330,\"height\":42},\"image\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=3793\\\/#organizationLogo\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?author=2#author\",\"url\":\"https:\\\/\\\/www.openmediavault.org\\\/?author=2\",\"name\":\"volker\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=3793#webpage\",\"url\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=3793\",\"name\":\"Make use of the DSL in the openmediavault-k8s plugin | openmediavault\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?p=3793#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?author=2#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/?author=2#author\"},\"datePublished\":\"2024-09-20T20:00:55+02:00\",\"dateModified\":\"2024-09-21T14:10:46+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/#website\",\"url\":\"https:\\\/\\\/www.openmediavault.org\\\/\",\"name\":\"openmediavault\",\"description\":\"DATA SOVEREIGNTY MADE EASY\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.openmediavault.org\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Make use of the DSL in the openmediavault-k8s plugin | openmediavault","description":"","canonical_url":"https:\/\/www.openmediavault.org\/?p=3793","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.openmediavault.org\/?p=3793#article","name":"Make use of the DSL in the openmediavault-k8s plugin | openmediavault","headline":"Make use of the DSL in the openmediavault-k8s plugin","author":{"@id":"https:\/\/www.openmediavault.org\/?author=2#author"},"publisher":{"@id":"https:\/\/www.openmediavault.org\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.openmediavault.org\/wp-content\/uploads\/2025\/10\/header_logo.svg","@id":"https:\/\/www.openmediavault.org\/#articleImage","width":330,"height":42},"datePublished":"2024-09-20T20:00:55+02:00","dateModified":"2024-09-21T14:10:46+02:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.openmediavault.org\/?p=3793#webpage"},"isPartOf":{"@id":"https:\/\/www.openmediavault.org\/?p=3793#webpage"},"articleSection":"Common"},{"@type":"BreadcrumbList","@id":"https:\/\/www.openmediavault.org\/?p=3793#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.openmediavault.org#listItem","position":1,"name":"Home","item":"https:\/\/www.openmediavault.org","nextItem":{"@type":"ListItem","@id":"https:\/\/www.openmediavault.org\/?cat=1#listItem","name":"Common"}},{"@type":"ListItem","@id":"https:\/\/www.openmediavault.org\/?cat=1#listItem","position":2,"name":"Common","item":"https:\/\/www.openmediavault.org\/?cat=1","nextItem":{"@type":"ListItem","@id":"https:\/\/www.openmediavault.org\/?p=3793#listItem","name":"Make use of the DSL in the openmediavault-k8s plugin"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.openmediavault.org#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.openmediavault.org\/?p=3793#listItem","position":3,"name":"Make use of the DSL in the openmediavault-k8s plugin","previousItem":{"@type":"ListItem","@id":"https:\/\/www.openmediavault.org\/?cat=1#listItem","name":"Common"}}]},{"@type":"Organization","@id":"https:\/\/www.openmediavault.org\/#organization","name":"openmediavault","description":"DATA SOVEREIGNTY MADE EASY","url":"https:\/\/www.openmediavault.org\/","logo":{"@type":"ImageObject","url":"https:\/\/www.openmediavault.org\/wp-content\/uploads\/2025\/10\/header_logo.svg","@id":"https:\/\/www.openmediavault.org\/?p=3793\/#organizationLogo","width":330,"height":42},"image":{"@id":"https:\/\/www.openmediavault.org\/?p=3793\/#organizationLogo"}},{"@type":"Person","@id":"https:\/\/www.openmediavault.org\/?author=2#author","url":"https:\/\/www.openmediavault.org\/?author=2","name":"volker"},{"@type":"WebPage","@id":"https:\/\/www.openmediavault.org\/?p=3793#webpage","url":"https:\/\/www.openmediavault.org\/?p=3793","name":"Make use of the DSL in the openmediavault-k8s plugin | openmediavault","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.openmediavault.org\/#website"},"breadcrumb":{"@id":"https:\/\/www.openmediavault.org\/?p=3793#breadcrumblist"},"author":{"@id":"https:\/\/www.openmediavault.org\/?author=2#author"},"creator":{"@id":"https:\/\/www.openmediavault.org\/?author=2#author"},"datePublished":"2024-09-20T20:00:55+02:00","dateModified":"2024-09-21T14:10:46+02:00"},{"@type":"WebSite","@id":"https:\/\/www.openmediavault.org\/#website","url":"https:\/\/www.openmediavault.org\/","name":"openmediavault","description":"DATA SOVEREIGNTY MADE EASY","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.openmediavault.org\/#organization"}}]}},"aioseo_meta_data":{"post_id":"3793","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"limit_modified_date":false,"ai":null,"created":"2024-09-20 17:45:47","updated":"2024-09-21 12:10:46","breadcrumb_settings":null,"seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.openmediavault.org\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.openmediavault.org\/?cat=1\" title=\"Common\">Common<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tMake use of the DSL in the openmediavault-k8s plugin\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.openmediavault.org"},{"label":"Common","link":"https:\/\/www.openmediavault.org\/?cat=1"},{"label":"Make use of the DSL in the openmediavault-k8s plugin","link":"https:\/\/www.openmediavault.org\/?p=3793"}],"_links":{"self":[{"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=\/wp\/v2\/posts\/3793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3793"}],"version-history":[{"count":18,"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=\/wp\/v2\/posts\/3793\/revisions"}],"predecessor-version":[{"id":3816,"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=\/wp\/v2\/posts\/3793\/revisions\/3816"}],"wp:attachment":[{"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.openmediavault.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}