Skip to content

Commit 2ef7516

Browse files
committed
20210924 Portainer - old-menu branch - PR 2 of 3
In [Issue 289](#289), @wijnsema proposed removal of Portainer. There has been additional support for this from @mats-nk. It is coming up to a year since Portainer-CE was added to IOTstack so this PR is my way of saying that I agree with the idea. 1. Remove Portainer service definition. 2. Remove Portainer documentation. 3. Reduce Portainer-CE documentation to a stub pointing to revised documentation on master branch. 4. Remove `directoryfix.sh` (Portainer to Portainer-CE migration aid). 5. Change port number to 9000. Old-menu originally had 9002 (so that it could coexist with Portainer on 9000) but both new menu and experimentatal branch used 9000 for both. This simply harmonises old-menu. 6. Removes references to `portainer` from `menu.sh`.
1 parent 46bbde9 commit 2ef7516

File tree

6 files changed

+2
-255
lines changed

6 files changed

+2
-255
lines changed

.templates/portainer-ce/directoryfix.sh

Lines changed: 0 additions & 36 deletions
This file was deleted.

.templates/portainer-ce/service.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
restart: unless-stopped
55
ports:
66
- "8000:8000"
7-
- "9002:9000"
7+
- "9000:9000"
88
volumes:
99
- /var/run/docker.sock:/var/run/docker.sock
1010
- ./volumes/portainer-ce/data:/data

.templates/portainer/service.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/Containers/Portainer-ce.md

Lines changed: 1 addition & 181 deletions
Original file line numberDiff line numberDiff line change
@@ -1,183 +1,3 @@
11
# Portainer CE
22

3-
## References
4-
5-
- [Docker](https://hub.docker.com/r/portainer/portainer-ce/)
6-
- [Website](https://www.portainer.io/portainer-ce/)
7-
8-
## Definition
9-
10-
- "#yourip" means any of the following:
11-
12-
- the IP address of your Raspberry Pi (eg `192.168.1.10`)
13-
- the multicast domain name of your Raspberry Pi (eg `iot-hub.local`)
14-
- the domain name of your Raspberry Pi (eg `iot-hub.mydomain.com`)
15-
16-
## About *Portainer CE*
17-
18-
*Portainer CE* (Community Edition) is an application for managing Docker. It is a successor to *Portainer*. According to [the *Portainer CE* documentation](https://www.portainer.io/2020/08/portainer-ce-2-0-what-to-expect/)
19-
20-
> Portainer 1.24.x will continue as a separate code branch, released as portainer/portainer:latest, and will receive ongoing security updates until at least 1st Sept 2021. No new features will be added beyond what was available in 1.24.1.
21-
22-
From that it should be clear that *Portainer* is deprecated and that *Portainer CE* is the way forward.
23-
24-
## *Portainer CE* coexistence with *Portainer*
25-
26-
IOTstack has been set up so that *Portainer CE* and *Portainer* can coexist. This is intended as a short-term migration aid rather than a long-term proposition.
27-
28-
If you are a first-time user of IOTstack, you should choose *Portainer CE* and forget about *Portainer*.
29-
30-
## Installing *Portainer CE*
31-
32-
Run the menu:
33-
34-
```
35-
$ cd ~/IOTstack
36-
$ ./menu.sh
37-
```
38-
39-
Choose "Build Stack", select "Portainer-ce", press [TAB] then "\<Ok\>" and follow through to the end of the menu process, typically choosing "Do not overwrite" for any existing services. When the menu finishes:
40-
41-
```
42-
$ docker-compose up -d
43-
```
44-
45-
Ignore any message like this:
46-
47-
> WARNING: Found orphan containers (portainer) for this project …
48-
49-
### <a name="MigrationNote"> Migration note </a>
50-
51-
*Portainer CE* and *Portainer* use different locations for their persistent data:
52-
53-
Edition | Persistent Data Directory | Reference
54-
-------------|---------------------------------|:---------:
55-
Portainer | ~/IOTstack/volumes/portainer | [A]
56-
Portainer CE | ~/IOTstack/volumes/portainer-ce | [B]
57-
58-
If you have been running *Portainer* but have **never** run *Portainer CE* then:
59-
60-
* [A] will exist, but
61-
* [B] will not exist.
62-
63-
Whenever "Portainer-ce" is enabled in `menu.sh`, a check is made for the **presence** of [A] combined with the **absence** [B]. If and only if that situation exists, [B] is initialised as a copy of [A].
64-
65-
This one-time copy is intended to preserve your *Portainer* settings and admin user password for use in *Portainer CE*. Thereafter, any settings you change in *Portainer CE* will not be reflected in *Portainer*, nor vice versa.
66-
67-
## Port Number = 9002
68-
69-
Both *Portainer CE* and *Portainer* are usually configured to listen to port 9000 but, in the IOTstack implementation:
70-
71-
* *Portainer CE* uses port 9002; and
72-
* *Portainer* uses port 9000.
73-
74-
> You can always change the port numbers in your `docker-compose.yml`.
75-
76-
## First run of *Portainer CE*
77-
78-
In your web browser navigate to `#yourip:9002/`.
79-
80-
* If you are migrating from *Portainer*:
81-
82-
- review the [Migration note](#MigrationNote) which explains why your *Portainer* credentials will likely apply to *Portainer CE*, and then
83-
- supply your *Portainer* credentials.
84-
85-
* <a name="NewAccount"> If you are **not** migrating from *Portainer*: </a>
86-
87-
- the first screen will suggest a username of "admin" and ask for a password. Supply those credentials and click "Create User".
88-
- the second screen will ask you to select a connection method. For IOTstack, "Docker (Manage the local Docker environment)" is usually appropriate so click that and then click "Connect".
89-
90-
From there, you can click on the "Local" group and take a look around. One of the things *Portainer CE* can help you do is find unused containers but beware of reading too much into this because, sometimes, an "unused" container is actually the base for another container (eg Node-Red).
91-
92-
There are 'Quick actions' to view logs and other stats. This can all be done from terminal commands but *Portainer CE* makes it easier.
93-
94-
## Ceasing use of Portainer
95-
96-
As soon as you are happy that *Portainer CE* meets your needs, you can dispense with *Portainer*. IOTstack only has limited support for getting rid of unwanted services so you should do the following.
97-
98-
1. Stop Portainer from running and remove its image:
99-
100-
```
101-
$ cd ~/IOTstack
102-
$ docker-compose stop portainer
103-
$ docker-compose rm -f portainer
104-
$ docker rmi portainer/portainer
105-
```
106-
107-
2. Either:
108-
109-
- run `menu.sh`
110-
- choose "Build Stack"
111-
- de-select "portainer", and
112-
- follow through to the end choosing "Do not overwrite" for existing services,
113-
114-
or:
115-
116-
- edit `docker-compose.yml` and remove these lines:
117-
118-
```
119-
portainer:
120-
container_name: portainer
121-
image: portainer/portainer
122-
restart: unless-stopped
123-
ports:
124-
- "9000:9000"
125-
volumes:
126-
- /var/run/docker.sock:/var/run/docker.sock
127-
- ./volumes/portainer/data:/data
128-
```
129-
130-
- edit `services/selection.txt` and remove this line:
131-
132-
```
133-
portainer
134-
```
135-
136-
3. Tidy-up:
137-
138-
```
139-
$ cd ~/IOTstack
140-
$ rm -rf ./services/portainer
141-
$ sudo rm -rf ./volumes/portainer
142-
```
143-
144-
## Setting the Public IP address for your end-point
145-
146-
If you click on a "Published Port" in the "Containers" list, your browser may return an error saying something like "can't connect to server" associated with an IP address of "0.0.0.0".
147-
148-
To fix that problem, proceed as shown below:
149-
150-
![Set Public IP address](./images/portainer-ce-set-public-ip.png)
151-
152-
1. Click "Endpoints" in the left hand panel.
153-
2. Click the name "local" in the list of Endpoints.
154-
3. Click in the "Public IP" field. Enter one of the following:
155-
- The multicast DNS (MDNS) name of your Raspberry Pi (eg `iot-hub.local`)
156-
- The fully-qualified domain name (FQDN) of your Raspberry Pi (eg `iot-hub.mydomain.com`)
157-
- The IP address of your Raspberry Pi (eg `192.168.1.10`)
158-
4. Click "Update endpoint".
159-
160-
> To remove the Public IP address, repeat the above steps but clear the "Public IP" field in step 3.
161-
162-
The reason why you have to tell *Portainer CE* which Public IP address to use is because an instance of *Portainer CE* does not necessarily have to be running on the **same** Raspberry Pi as the Docker containers it is managing.
163-
164-
Keep in mind that clicking on a "Published Port" does not guarantee that your browser can open a connection. For example:
165-
166-
* Port 1883 for Mosquitto expects MQTT packets. It will not respond to HTTP, so any attempt will fail.
167-
* Port 8089 for PiHole will respond to HTTP but PiHole may reject or mis-handle your attempt.
168-
* Port 1880 for NodeRed will respond normally.
169-
170-
> All things considered, you will get more consistent behaviour if you simply bookmark the URLs you want to use for your IOTstack services.
171-
172-
## If you forget your password
173-
174-
If you forget the password you created for *Portainer CE*, you can recover by doing the following:
175-
176-
```
177-
$ cd ~/IOTstack
178-
$ docker-compose stop portainer-ce
179-
$ sudo rm -r ./volumes/portainer-ce
180-
$ docker-compose start portainer-ce
181-
```
182-
183-
Then use your browser to navigate to `#yourip:9002/` and follow the steps in [if you are **not** migrating from *Portainer*](#NewAccount).
3+
This is the old-menu branch documentation. Please refer to [this page of the IOTstack Wiki](https://sensorsiot.github.io/IOTstack/Containers/Portainer-ce/).

docs/Containers/Portainer.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

menu.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ REQ_PYTHON_VERSION=3.6.9
2020
REQ_PYYAML_VERSION=5.3.1
2121

2222
declare -A cont_array=(
23-
[portainer]="Portainer"
2423
[portainer-ce]="Portainer-ce"
2524
[portainer_agent]="Portainer agent"
2625
[nodered]="Node-RED"
@@ -66,7 +65,6 @@ declare -A cont_array=(
6665
)
6766

6867
declare -a armhf_keys=(
69-
"portainer"
7068
"portainer-ce"
7169
"portainer_agent"
7270
"nodered"

0 commit comments

Comments
 (0)