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
e5b98839
Commit
e5b98839
authored
Nov 21, 2014
by
Joe Beda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 32bit build
parent
9f5ebef3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
6 deletions
+29
-6
controller-manager.go
cmd/kube-controller-manager/controller-manager.go
+17
-4
standalone.go
pkg/standalone/standalone.go
+12
-2
No files found.
cmd/kube-controller-manager/controller-manager.go
View file @
e5b98839
...
@@ -22,6 +22,7 @@ package main
...
@@ -22,6 +22,7 @@ package main
import
(
import
(
"flag"
"flag"
"math"
"net"
"net"
"net/http"
"net/http"
"strconv"
"strconv"
...
@@ -50,8 +51,8 @@ var (
...
@@ -50,8 +51,8 @@ var (
minionRegexp
=
flag
.
String
(
"minion_regexp"
,
""
,
"If non empty, and -cloud_provider is specified, a regular expression for matching minion VMs."
)
minionRegexp
=
flag
.
String
(
"minion_regexp"
,
""
,
"If non empty, and -cloud_provider is specified, a regular expression for matching minion VMs."
)
machineList
util
.
StringList
machineList
util
.
StringList
// TODO: Discover these by pinging the host machines, and rip out these flags.
// TODO: Discover these by pinging the host machines, and rip out these flags.
nodeMilliCPU
=
flag
.
Int
(
"node_milli_cpu"
,
1000
,
"The amount of MilliCPU provisioned on each node"
)
nodeMilliCPU
=
flag
.
Int
64
(
"node_milli_cpu"
,
1000
,
"The amount of MilliCPU provisioned on each node"
)
nodeMemory
=
flag
.
Int
(
"node_memory"
,
3
*
1024
*
1024
*
1024
,
"The amount of memory (in bytes) provisioned on each node"
)
nodeMemory
=
flag
.
Int
64
(
"node_memory"
,
3
*
1024
*
1024
*
1024
,
"The amount of memory (in bytes) provisioned on each node"
)
)
)
func
init
()
{
func
init
()
{
...
@@ -89,6 +90,18 @@ func main() {
...
@@ -89,6 +90,18 @@ func main() {
glog
.
Fatalf
(
"Invalid API configuration: %v"
,
err
)
glog
.
Fatalf
(
"Invalid API configuration: %v"
,
err
)
}
}
if
int64
(
int
(
*
nodeMilliCPU
))
!=
*
nodeMilliCPU
{
glog
.
Warningf
(
"node_milli_cpu is too big for platform. Clamping: %d -> %d"
,
*
nodeMilliCPU
,
math
.
MaxInt32
)
*
nodeMilliCPU
=
math
.
MaxInt32
}
if
int64
(
int
(
*
nodeMemory
))
!=
*
nodeMemory
{
glog
.
Warningf
(
"node_memory is too big for platform. Clamping: %d -> %d"
,
*
nodeMemory
,
math
.
MaxInt32
)
*
nodeMemory
=
math
.
MaxInt32
}
go
http
.
ListenAndServe
(
net
.
JoinHostPort
(
address
.
String
(),
strconv
.
Itoa
(
*
port
)),
nil
)
go
http
.
ListenAndServe
(
net
.
JoinHostPort
(
address
.
String
(),
strconv
.
Itoa
(
*
port
)),
nil
)
endpoints
:=
service
.
NewEndpointController
(
kubeClient
)
endpoints
:=
service
.
NewEndpointController
(
kubeClient
)
...
@@ -100,8 +113,8 @@ func main() {
...
@@ -100,8 +113,8 @@ func main() {
cloud
:=
cloudprovider
.
InitCloudProvider
(
*
cloudProvider
,
*
cloudConfigFile
)
cloud
:=
cloudprovider
.
InitCloudProvider
(
*
cloudProvider
,
*
cloudConfigFile
)
nodeResources
:=
&
api
.
NodeResources
{
nodeResources
:=
&
api
.
NodeResources
{
Capacity
:
api
.
ResourceList
{
Capacity
:
api
.
ResourceList
{
resources
.
CPU
:
util
.
NewIntOrStringFromInt
(
*
nodeMilliCPU
),
resources
.
CPU
:
util
.
NewIntOrStringFromInt
(
int
(
*
nodeMilliCPU
)
),
resources
.
Memory
:
util
.
NewIntOrStringFromInt
(
*
nodeMemory
),
resources
.
Memory
:
util
.
NewIntOrStringFromInt
(
int
(
*
nodeMemory
)
),
},
},
}
}
minionController
:=
minionControllerPkg
.
NewMinionController
(
cloud
,
*
minionRegexp
,
machineList
,
nodeResources
,
kubeClient
)
minionController
:=
minionControllerPkg
.
NewMinionController
(
cloud
,
*
minionRegexp
,
machineList
,
nodeResources
,
kubeClient
)
...
...
pkg/standalone/standalone.go
View file @
e5b98839
...
@@ -18,6 +18,7 @@ package standalone
...
@@ -18,6 +18,7 @@ package standalone
import
(
import
(
"fmt"
"fmt"
"math"
"net"
"net"
"net/http"
"net/http"
"os"
"os"
...
@@ -112,9 +113,18 @@ func RunScheduler(cl *client.Client) {
...
@@ -112,9 +113,18 @@ func RunScheduler(cl *client.Client) {
// RunControllerManager starts a controller
// RunControllerManager starts a controller
func
RunControllerManager
(
machineList
[]
string
,
cl
*
client
.
Client
,
nodeMilliCPU
,
nodeMemory
int64
)
{
func
RunControllerManager
(
machineList
[]
string
,
cl
*
client
.
Client
,
nodeMilliCPU
,
nodeMemory
int64
)
{
if
int64
(
int
(
nodeMilliCPU
))
!=
nodeMilliCPU
||
int64
(
int
(
nodeMemory
))
!=
nodeMemory
{
if
int64
(
int
(
nodeMilliCPU
))
!=
nodeMilliCPU
{
glog
.
Fatalf
(
"Overflow, nodeCPU or nodeMemory too large for the platform"
)
glog
.
Warningf
(
"node_milli_cpu is too big for platform. Clamping: %d -> %d"
,
nodeMilliCPU
,
math
.
MaxInt32
)
nodeMilliCPU
=
math
.
MaxInt32
}
}
if
int64
(
int
(
nodeMemory
))
!=
nodeMemory
{
glog
.
Warningf
(
"node_memory is too big for platform. Clamping: %d -> %d"
,
nodeMemory
,
math
.
MaxInt32
)
nodeMemory
=
math
.
MaxInt32
}
nodeResources
:=
&
api
.
NodeResources
{
nodeResources
:=
&
api
.
NodeResources
{
Capacity
:
api
.
ResourceList
{
Capacity
:
api
.
ResourceList
{
resources
.
CPU
:
util
.
NewIntOrStringFromInt
(
int
(
nodeMilliCPU
)),
resources
.
CPU
:
util
.
NewIntOrStringFromInt
(
int
(
nodeMilliCPU
)),
...
...
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