Docker Swarm - Lab Docker service

hi @Ayman

In this Docker Swarm - Lab Docker Service Task 03 I believe 3 replicas are running as per the terminal output .

Can you please verify this output below and let me know why checks this task is failing as if 3 replicas are not running ?

What is the error in below task execution or checks ?

What is the mistake I am doing here ?

with best regards
Pradeep Nehe

=====================

Create a service called simple-web-app with image kodekloud/webapp-color , 3 replicas. The service should be published on port 8083 and make use of environment variable APP_COLOR=pink

the webapp runs on container port 8080

CHECK

  • info_outline Hint

run docker service create --name simple-web-app --replicas 3 -p 8083:8080 -e APP_COLOR=pink kodekloud/webapp-color

=========================
Checks which is failing :slight_smile:

  • Tasks not completed!

  • Env APP_COLR=pink

  • image: kodekloud/webapp_color

  • Service published on port 8083?

  • 3 Replicas Running?

=========================

Output from Terminal

master $ pwd/root

master $ whoamiroot

master $ docker service lsID NAME MODE REPLICAS IMAGE PORTS
8bxmjmgwjpo5 simple-web-app replicated 3/3 kodekloud/webapp-color:latest *:8083->8080/tcpmaster $
master $ docker ps | grep simplecd195f157093 kodekloud/webapp-color:latest “python app.py” 7 minutes ago Up 6 minutes 8080/tcp simple-web-app.3.pxhw3b5dcgvmtyobv3ncj849d
master $master $ docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSIONtjkpjg5zdqb06q2pqdgfq3l5g * master Ready Active Leader 18.09.7
o0bwot5ugkdamkzoi12qkkp45 node01 Ready Active 1.13.1master $
master $ ssh node01node01

$node01 $ docker ps | grep simple
f4a9d2914920 kodekloud/webapp-color@sha256:99c3821ea49b89c7a22d3eebab5c2e1ec651452e7675af243485034a72eb1423 “python app.py” 7 minutes ago Up 7 minutes 8080/tcp simple-web-app.1.70myd8but43cnwktydk63whxv
bc9ab4a737ea kodekloud/webapp-color@sha256:99c3821ea49b89c7a22d3eebab5c2e1ec651452e7675af243485034a72eb1423 “python app.py” 7 minutes ago Up 7 minutes 8080/tcp simple-web-app.2.77lckolhh0z90rewu9h52owyx
node01 $

node01 $ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f4a9d2914920 kodekloud/webapp-color@sha256:99c3821ea49b89c7a22d3eebab5c2e1ec651452e7675af243485034a72eb1423 “python app.py” 7 minutes ago Up 7 minutes 8080/tcp simple-web-app.1.70myd8but43cnwktydk63whxv
bc9ab4a737ea kodekloud/webapp-color@sha256:99c3821ea49b89c7a22d3eebab5c2e1ec651452e7675af243485034a72eb1423 “python app.py” 7 minutes ago Up 7 minutes 8080/tcp simple-web-app.2.77lckolhh0z90rewu9h52owyx

node01 $
node01 $ date

Tue Jun 23 17:27:59 UTC 2020
node01 $ exit
logout
Connection to node01 closed.
master $ date

Tue 23 Jun 17:28:02 UTC 2020
master $
master $
master $ docker service lsID NAME MODE REPLICAS IMAGE PORTS
8bxmjmgwjpo5 simple-web-app replicated 3/3 kodekloud/webapp-color:latest *:8083->8080/tcpmaster $
master $master $ docker service inspect 8b
[ {
“ID”: “8bxmjmgwjpo5a0864moj18ncx”,
“Version”: { “Index”: 17
}, “CreatedAt”: “2020-06-23T17:19:27.105412569Z”,
“UpdatedAt”: “2020-06-23T17:19:27.107312415Z”,
“Spec”: {
“Name”: “simple-web-app”, “Labels”: {},
“TaskTemplate”: { “ContainerSpec”: {
“Image”: “kodekloud/webapp-color:latest@sha256:99c3821ea49b89c7a22d3eebab5c2e1ec651452e7675af243485034a72eb1423”, “Env”: [
“APP_COLOR=pink”
],
“Init”: false,
“StopGracePeriod”: 10000000000,
“DNSConfig”: {},
“Isolation”: “default”
},
“Resources”: {
“Limits”: {},
“Reservations”: {}
},
“RestartPolicy”: {
“Condition”: “any”,
“Delay”: 5000000000,
“MaxAttempts”: 0
},
“Placement”: {
“Platforms”: [
{
“Architecture”: “amd64”,
“OS”: “linux”
}
]
},
“ForceUpdate”: 0,
“Runtime”: “container”
},
“Mode”: {
“Replicated”: {
“Replicas”: 3
}
},
“UpdateConfig”: {
“Parallelism”: 1,
“FailureAction”: “pause”,
“Monitor”: 5000000000,
“MaxFailureRatio”: 0,
“Order”: “stop-first”
},
“RollbackConfig”: {
“Parallelism”: 1,
“FailureAction”: “pause”,
“Monitor”: 5000000000,
“MaxFailureRatio”: 0,
“Order”: “stop-first”
},
“EndpointSpec”: {
“Mode”: “vip”,
“Ports”: [
{
“Protocol”: “tcp”,
“TargetPort”: 8080,
“PublishedPort”: 8083,
“PublishMode”: “ingress”
}
]
}
},
“Endpoint”: {
“Spec”: {
“Mode”: “vip”,
“Ports”: [
{
“Protocol”: “tcp”,
“TargetPort”: 8080,
“PublishedPort”: 8083,
“PublishMode”: “ingress”
}
]
},
“Ports”: [
{
“Protocol”: “tcp”,
“TargetPort”: 8080,
“PublishedPort”: 8083,
“PublishMode”: “ingress”
}
],
“VirtualIPs”: [
{
“NetworkID”: “rapohfconxbrc4m36oigquojz”,
“Addr”: “10.255.0.4/16”
}
]
}
}
]
master $