Upgrade Kubernetes Deployment
Steps to upgrade Portainer and or Portainer agent deployed into Kubernetes. Upgrade method depends on the original install method used.
Using Helm
Add Portianer helm repo running the following, ignore any warning about the repo being there already.
helm repo add portainer https://portainer.github.io/k8s/
helm repo update
Run the command below to upgrade to latest version of Portainer
helm upgrade -n portainer portainer portainer/portainer --reuse-values
Using YAML Manifest
Method 1:
Easiest way to upgrade is to use Portainer UI and use manifest files..
Copy the contents of manifest file from
For NodePort
https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer.yaml
Agent Only
https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/agent/portainer-agent-k8s-nodeport.yaml
For LoadBalancer
https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer-lb.yaml
Agent Only
https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/agent/portainer-agent-k8s-lb.yaml
Login to portainer, in Kubernetes endpoint where portainer is installed go to Applications --> Advanced Deployment. Paste the yaml content.
Paste the yaml content and click Deploy. Portainer should come back to a login page in a few seconds.
Method 2:
For NodePort
kubectl apply -n portainer -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer.yaml
Agent Only
kubectl apply -n portainer -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/agent/portainer-agent-k8s-nodeport.yaml
For Load Balancer
kubectl apply -n portainer -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer-lb.yaml
Agent Only
kubectl apply -n portainer -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/agent/portainer-agent-k8s-lb.yaml
Now you can go to portainer url and login. You should notice that the bottom left corner looks different than it did before. There is no more update nag and the version is no longer shown next to the Portainer logo.