{"id":19513308,"url":"https://github.com/portainer/k8s","last_synced_at":"2026-02-10T12:01:07.938Z","repository":{"id":40374041,"uuid":"287420147","full_name":"portainer/k8s","owner":"portainer","description":"How to deploy Portainer inside a Kubernetes environment.","archived":false,"fork":false,"pushed_at":"2025-03-25T03:04:00.000Z","size":263,"stargazers_count":91,"open_issues_count":31,"forks_count":59,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-28T08:17:24.432Z","etag":null,"topics":["kubernetes","portainer"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/portainer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-14T01:59:09.000Z","updated_at":"2025-03-25T03:03:43.000Z","dependencies_parsed_at":"2023-12-06T00:25:17.588Z","dependency_job_id":"c720a4cc-2883-4715-ab52-18c6bb3f3399","html_url":"https://github.com/portainer/k8s","commit_stats":null,"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/portainer%2Fk8s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/portainer%2Fk8s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/portainer%2Fk8s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/portainer%2Fk8s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/portainer","download_url":"https://codeload.github.com/portainer/k8s/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266563,"owners_count":20910836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kubernetes","portainer"],"created_at":"2024-11-10T23:29:31.189Z","updated_at":"2026-02-10T12:01:07.416Z","avatar_url":"https://github.com/portainer.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nThis repo contains helm and YAML for deploying Portainer into a Kubernetes environment. Follow the applicable instructions for your edition / deployment methodology below:\n\n- [Deploying with Helm](#deploying-with-helm)\n  - [Community Edition](#community-edition)\n    - [Using NodePort on a local/remote cluster](#using-nodeport-on-a-localremote-cluster)\n    - [Using a cloud provider's loadbalancer](#using-a-cloud-providers-loadbalancer)\n    - [Using ClusterIP with an ingress](#using-clusterip-with-an-ingress)\n  - [Enterprise Edition](#enterprise-edition)\n    - [Using NodePort on a local/remote cluster](#using-nodeport-on-a-localremote-cluster-1)\n    - [Using a cloud provider's loadbalancer](#using-a-cloud-providers-loadbalancer-1)\n    - [Using ClusterIP with an ingress](#using-clusterip-with-an-ingress-1)\n- [Deploying with manifests](#deploying-with-manifests)\n  - [Community Edition](#community-edition-1)\n    - [Using NodePort on a local/remote cluster](#using-nodeport-on-a-localremote-cluster-2)\n    - [Using a cloud provider's loadbalancer](#using-a-cloud-providers-loadbalancer-2)\n  - [Enterprise Edition](#enterprise-edition-1)\n    - [Using NodePort on a local/remote cluster](#using-nodeport-on-a-localremote-cluster-3)\n    - [Using a cloud provider's loadbalancer](#using-a-cloud-providers-loadbalancer-3)\n- [Note re persisting data](#note-re-persisting-data)\n\n\n\n\n# Deploying with Helm\n\nEnsure you're using at least helm v3.2, which [includes support](https://github.com/helm/helm/pull/7648) for the `--create-namespace` argument.\n\nInstall the repository:\n\n```\nhelm repo add portainer https://portainer.github.io/k8s/\nhelm repo update\n```\n\n## Community Edition\n\nInstall the helm chart:\n\n### Using NodePort on a local/remote cluster\n\n```\nhelm install --create-namespace -n portainer portainer portainer/portainer\n```\n\n###  Using a cloud provider's loadbalancer\n\n```\nhelm install --create-namespace -n portainer portainer portainer/portainer \\\n--set service.type=LoadBalancer\n```\n\n\n### Using ClusterIP with an ingress\n\n```\nhelm install --create-namespace -n portainer portainer portainer/portainer \\\n--set service.type=ClusterIP\n```\n\nFor advanced helm customization, see the [chart README](/charts/portainer/README.md)\n\n## Enterprise Edition\n\n### Using NodePort on a local/remote cluster\n\n```\nhelm install --create-namespace -n portainer portainer portainer/portainer \\\n--set enterpriseEdition.enabled=true \n```\n\n###  Using a cloud provider's loadbalancer\n\n```\nhelm install --create-namespace -n portainer portainer portainer/portainer \\\n--set enterpriseEdition.enabled=true  \\\n--set service.type=LoadBalancer\n```\n\n\n### Using ClusterIP with an ingress\n\n```\nhelm install --create-namespace -n portainer portainer portainer/portainer \\\n--set enterpriseEdition.enabled=true \\\n--set service.type=ClusterIP\n```\n\nFor advanced helm customization, see the [chart README](/charts/portainer/README.md)\n\n# Deploying with manifests\n\nIf you're not using helm, you can install Portainer using manifests directly, as follows\n\n## Community Edition\n\n### Using NodePort on a local/remote cluster\n\n```\nkubectl apply -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer.yaml\n```\n\n###  Using a cloud provider's loadbalancer\n\n```\nkubectl apply -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer-lb.yaml\n```\n\n## Enterprise Edition\n\n### Using NodePort on a local/remote cluster\n\n```\nkubectl apply- f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer-ee.yaml\n```\n\n###  Using a cloud provider's loadbalancer\n\n```\nkubectl apply -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer-lb-ee.yaml\n```\n\n# Note re persisting data\n\nThe charts/manifests will create a persistent volume for storing Portainer data, using the default StorageClass.\n\nIn some Kubernetes clusters (microk8s), the default Storage Class simply creates hostPath volumes, which are not explicitly tied to a particular node. In a multi-node cluster, this can create an issue when the pod is terminated and rescheduled on a different node, \"leaving\" all the persistent data behind and starting the pod with an \"empty\" volume.\n\nWhile this behaviour is inherently a limitation of using hostPath volumes, a suitable workaround is to use add a nodeSelector to the deployment, which effectively \"pins\" the portainer pod to a particular node.\n\nThe nodeSelector can be added in the following ways:\n\n1. Edit your own values.yaml and set the value of nodeSelector like this:\n\n```\nnodeSelector:\n  kubernetes.io/hostname: \u003cYOUR NODE NAME\u003e\n```\n\n2. Explicictly set the target node when deploying/updating the helm chart on the CLI, by including `--set nodeSelector.kubernetes.io/hostname=\u003cYOUR NODE NAME\u003e`\n   \n3. If you've deployed Portainer via manifests, without Helm, run the following one-liner to \"patch\" the deployment, forcing the pod to always be scheduled on the node it's currently running on:\n\n```\nkubectl patch deployments -n portainer portainer -p '{\"spec\": {\"template\": {\"spec\": {\"nodeSelector\": {\"kubernetes.io/hostname\": \"'$(kubectl get pods -n portainer -o jsonpath='{ ..nodeName }')'\"}}}}}' || (echo Failed to identify current node of portainer pod; exit 1)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fportainer%2Fk8s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fportainer%2Fk8s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fportainer%2Fk8s/lists"}