Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
dd5f9706
Commit
dd5f9706
authored
Sep 02, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13446 from fgrzadkowski/fix_docker_multinode_doc
Auto commit by PR queue bot
parents
77e2d4f9
1a9b0d60
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
10 deletions
+23
-10
Dockerfile
cluster/images/hyperkube/Dockerfile
+6
-3
docker.md
docs/getting-started-guides/docker.md
+12
-3
nsenter_mount.go
pkg/util/mount/nsenter_mount.go
+5
-4
No files found.
cluster/images/hyperkube/Dockerfile
View file @
dd5f9706
FROM
google/debian:wheezy
FROM
debian:jessie
RUN
apt-get update
RUN
apt-get update
RUN
apt-get
-yy
-q
install
iptables ca-certificates
RUN
apt-get
-yy
-q
install
iptables ca-certificates file util-linux
RUN
cp
/usr/bin/nsenter /nsenter
COPY
hyperkube /hyperkube
COPY
hyperkube /hyperkube
RUN
chmod
a+rx /hyperkube
RUN
chmod
a+rx /hyperkube
COPY
master-multi.json /etc/kubernetes/manifests-multi/master.json
COPY
master-multi.json /etc/kubernetes/manifests-multi/master.json
COPY
master.json /etc/kubernetes/manifests/master.json
COPY
master.json /etc/kubernetes/manifests/master.json
COPY
safe_format_and_mount /usr/share/google/safe_format_and_mount
COPY
safe_format_and_mount /usr/share/google/safe_format_and_mount
RUN
chmod
a+rx /usr/share/google/safe_format_and_mount
RUN
chmod
a+rx /usr/share/google/safe_format_and_mount
docs/getting-started-guides/docker.md
View file @
dd5f9706
...
@@ -92,15 +92,24 @@ docker run --net=host -d gcr.io/google_containers/etcd:2.0.12 /usr/local/bin/etc
...
@@ -92,15 +92,24 @@ docker run --net=host -d gcr.io/google_containers/etcd:2.0.12 /usr/local/bin/etc
### Step Two: Run the master
### Step Two: Run the master
```
sh
```
sh
docker run
--net
=
host
--privileged
-d
-v
/sys:/sys:ro
-v
/var/run/docker.sock:/var/run/docker.sock gcr.io/google_containers/hyperkube:v1.0.1 /hyperkube kubelet
--api-servers
=
http://localhost:8080
--v
=
2
--address
=
0.0.0.0
--enable-server
--hostname-override
=
127.0.0.1
--config
=
/etc/kubernetes/manifests
docker run
\
--volume
=
/:/rootfs:ro
\
--volume
=
/sys:/sys:ro
\
--volume
=
/dev:/dev
\
--volume
=
/var/lib/docker/:/var/lib/docker:ro
\
--volume
=
/var/lib/kubelet/:/var/lib/kubelet:rw
\
--volume
=
/var/run:/var/run:rw
\
--net
=
host
\
--privileged
=
true
\
-d
\
gcr.io/google_containers/hyperkube:v1.0.1
\
/hyperkube kubelet
--containerized
--hostname-override
=
"127.0.0.1"
--address
=
"0.0.0.0"
--api-servers
=
http://localhost:8080
--config
=
/etc/kubernetes/manifests
```
```
This actually runs the kubelet, which in turn runs a
[
pod
](
../user-guide/pods.md
)
that contains the other master components.
This actually runs the kubelet, which in turn runs a
[
pod
](
../user-guide/pods.md
)
that contains the other master components.
### Step Three: Run the service proxy
### Step Three: Run the service proxy
*Note, this could be combined with master above, but it requires --privileged for iptables manipulation*
```
sh
```
sh
docker run
-d
--net
=
host
--privileged
gcr.io/google_containers/hyperkube:v1.0.1 /hyperkube proxy
--master
=
http://127.0.0.1:8080
--v
=
2
docker run
-d
--net
=
host
--privileged
gcr.io/google_containers/hyperkube:v1.0.1 /hyperkube proxy
--master
=
http://127.0.0.1:8080
--v
=
2
```
```
...
...
pkg/util/mount/nsenter_mount.go
View file @
dd5f9706
...
@@ -71,8 +71,8 @@ func NewNsenterMounter() *NsenterMounter {
...
@@ -71,8 +71,8 @@ func NewNsenterMounter() *NsenterMounter {
// default to root
// default to root
m
.
paths
[
binary
]
=
filepath
.
Join
(
"/"
,
binary
)
m
.
paths
[
binary
]
=
filepath
.
Join
(
"/"
,
binary
)
for
_
,
path
:=
range
[]
string
{
"/bin"
,
"/usr/sbin"
,
"/usr/bin"
}
{
for
_
,
path
:=
range
[]
string
{
"/bin"
,
"/usr/sbin"
,
"/usr/bin"
}
{
binPath
:=
filepath
.
Join
(
hostRootFsPath
,
path
,
binary
)
binPath
:=
filepath
.
Join
(
path
,
binary
)
if
_
,
err
:=
os
.
Stat
(
binPath
);
err
!=
nil
{
if
_
,
err
:=
os
.
Stat
(
filepath
.
Join
(
hostRootFsPath
,
binPath
)
);
err
!=
nil
{
continue
continue
}
}
m
.
paths
[
binary
]
=
binPath
m
.
paths
[
binary
]
=
binPath
...
@@ -176,8 +176,9 @@ func (n *NsenterMounter) IsLikelyNotMountPoint(file string) (bool, error) {
...
@@ -176,8 +176,9 @@ func (n *NsenterMounter) IsLikelyNotMountPoint(file string) (bool, error) {
exec
:=
exec
.
New
()
exec
:=
exec
.
New
()
out
,
err
:=
exec
.
Command
(
nsenterPath
,
args
...
)
.
CombinedOutput
()
out
,
err
:=
exec
.
Command
(
nsenterPath
,
args
...
)
.
CombinedOutput
()
if
err
!=
nil
{
if
err
!=
nil
{
// If findmnt didn't run, just claim it's not a mount point.
// If the command itself is correct, then if we encountered error
return
true
,
nil
// then most likely this means that the directory does not exist.
return
true
,
os
.
ErrNotExist
}
}
strOut
:=
strings
.
TrimSuffix
(
string
(
out
),
"
\n
"
)
strOut
:=
strings
.
TrimSuffix
(
string
(
out
),
"
\n
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment