Skip to content

Instantly share code, notes, and snippets.

@abhishek9686
Last active November 20, 2022 01:45
Show Gist options
  • Save abhishek9686/287563a848932f59768989f054025b37 to your computer and use it in GitHub Desktop.
Save abhishek9686/287563a848932f59768989f054025b37 to your computer and use it in GitHub Desktop.
Netmaker v0.16.1 Upgrade Notes
On Server:-
1. docker-compose down
2. wget -O /root/mosquitto.conf https://raw.githubusercontent.com/gravitl/netmaker/release_v0.16.1/docker/mosquitto.conf
3. wget -O /root/wait.sh https://raw.githubusercontent.com/gravitl/netmaker/release_v0.16.1/docker/wait.sh
4. RUN chmod +x /root/wait.sh
5. Docker-Compose Updates
-> Change image tags to v0.16.1
-> Service - netmaker
i. volumes:
CHANGE - shared_certs:/etc/netmaker --> - mosquitto_data:/etc/netmaker
ii. environment:
--> add your own password for MQ admin client
ADD MQ_ADMIN_PASSWORD: "REPLACE_MQ_ADMIN_PASSWORD"
-> Service - mq
i. ADD command: ["/mosquitto/config/wait.sh"]
ii. environment:
ADD NETMAKER_SERVER_HOST: "https://api.NETMAKER_BASE_DOMAIN"
iii. volumes:
ADD - /root/wait.sh:/mosquitto/config/wait.sh
iv. replace all traefik lables with:
- traefik.enable=true
- traefik.tcp.routers.mqtt.rule=HostSNI(`broker.NETMAKER_BASE_DOMAIN`)
- traefik.tcp.routers.mqtt.tls.certresolver=http
- traefik.tcp.services.mqtt.loadbalancer.server.port=8883
- traefik.tcp.routers.mqtt.entrypoints=websecure
***** IF ENTERPRISE VERSION *****
-> Service - grafana
i. environment
ADD - LICENSE_KEY: "YOUR_LICENSE_KEY"
ii. volumes
ADD - grafana_data:/var/lib/grafana ( and add `grafana_data: {}` to docker-compose volumes section)
-> Service - prometheus
i. environment
ADD - LICENSE_KEY: "YOUR_LICENSE_KEY"
-> Service - netmaker-exporter
i. environment
ADD - LICENSE_KEY: "YOUR_LICENSE_KEY"
6. RUN docker-compose up -d
7. confirm working:
i) docker logs mq
--> On successful startup of mq you should be able to see logs like -
Waiting for netmaker server to startup
Waiting for netmaker server to startup
Waiting for netmaker server to startup
Waiting for netmaker server to startup
Waiting for netmaker server to startup
Waiting for netmaker server to startup
Waiting for netmaker server to startup
Waiting for netmaker server to startup
Starting MQ...
1665067766: mosquitto version 2.0.11 starting
1665067766: Config loaded from /mosquitto/config/mosquitto.conf.
1665067766: Loading plugin: /usr/lib/mosquitto_dynamic_security.so
1665067766: Opening ipv4 listen socket on port 8883.
1665067766: Opening ipv6 listen socket on port 8883.
1665067766: Opening ipv4 listen socket on port 1883.
1665067766: Opening ipv6 listen socket on port 1883.
1665067766: mosquitto version 2.0.11 running
1665067769: New connection from 172.21.0.2:34004 on port 1883.
1665067769: New client connected from 172.21.0.2:34004 as L0vUDgN0IZFru9VaS6HoRL5 (p2, c1, k60, u'Netmaker-Admin').
1665067769: New connection from 172.21.0.2:34006 on port 1883.
1665067769: New client connected from 172.21.0.2:34006 as ydmOjmIcw9nNaT1GB1q97Se (p2, c1, k60, u'Netmaker-Server').
--> If you see the below logs repeatedly even after a while after startup:
Waiting for netmaker server to startup
Waiting for netmaker server to startup
Waiting for netmaker server to startup
Waiting for netmaker server to startup
Waiting for netmaker server to startup
Waiting for netmaker server to startup
--> check if traefik certs are generated correctly if any errors in traefik logs about certs,
to resolve try [docker restart traefik]
ii) docker logs netmaker (check to make sure start is successful)
On Client :-
1) Upgrade your client to v0.16.1
2) netclient --version (confirm it’s the correct version)
3) netclient pull
UPGRADE FLOWS :-
1) Upgrade server first - (RECOMMENDED WAY)
-> after making the above changes mentioned for the server and upgrading to v0.16.1
---> All existing clients will go to a warning state since they won't be able to connect to mq
---> All the clients should be upgraded to v0.16.1 by following the steps mentioned above for client upgrade
2) Upgrade client first
-> If you upgrade the client first, your daemon won't be able to connect to mq unless the server is upgraded
-> So upgrade server and then on client machine RUN netclient pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment