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
26b3bacb
Commit
26b3bacb
authored
Jul 06, 2018
by
wojtekt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make proxier params configurable in kubemark
parent
86b9a532
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
21 deletions
+29
-21
config-default.sh
cluster/kubemark/gce/config-default.sh
+5
-5
config-default.sh
cluster/kubemark/pre-existing/config-default.sh
+0
-1
hollow-node.go
cmd/kubemark/hollow-node.go
+16
-8
hollow_proxy.go
pkg/kubemark/hollow_proxy.go
+4
-2
hollow-node_template.yaml
test/kubemark/resources/hollow-node_template.yaml
+2
-2
start-kubemark.sh
test/kubemark/start-kubemark.sh
+2
-3
No files found.
cluster/kubemark/gce/config-default.sh
View file @
26b3bacb
...
...
@@ -73,11 +73,12 @@ STORAGE_MEDIA_TYPE=${STORAGE_MEDIA_TYPE:-}
# Default Log level for all components in test clusters and variables to override it in specific components.
TEST_CLUSTER_LOG_LEVEL
=
"
${
TEST_CLUSTER_LOG_LEVEL
:-
--v=4
}
"
KUBELET_TEST_LOG_LEVEL
=
"
${
KUBELET_TEST_LOG_LEVEL
:-
$TEST_CLUSTER_LOG_LEVEL
}
"
API_SERVER_TEST_LOG_LEVEL
=
"
${
API_SERVER_TEST_LOG_LEVEL
:-
$TEST_CLUSTER_LOG_LEVEL
}
"
CONTROLLER_MANAGER_TEST_LOG_LEVEL
=
"
${
CONTROLLER_MANAGER_TEST_LOG_LEVEL
:-
$TEST_CLUSTER_LOG_LEVEL
}
"
SCHEDULER_TEST_LOG_LEVEL
=
"
${
SCHEDULER_TEST_LOG_LEVEL
:-
$TEST_CLUSTER_LOG_LEVEL
}
"
KUBEPROXY_TEST_LOG_LEVEL
=
"
${
KUBEPROXY_TEST_LOG_LEVEL
:-
$TEST_CLUSTER_LOG_LEVEL
}
"
HOLLOW_KUBELET_TEST_LOG_LEVEL
=
"
${
HOLLOW_KUBELET_TEST_LOG_LEVEL
:-
$TEST_CLUSTER_LOG_LEVEL
}
"
HOLLOW_PROXY_TEST_LOG_LEVEL
=
"
${
HOLLOW_PROXY_TEST_LOG_LEVEL
:-
$TEST_CLUSTER_LOG_LEVEL
}
"
TEST_CLUSTER_DELETE_COLLECTION_WORKERS
=
"
${
TEST_CLUSTER_DELETE_COLLECTION_WORKERS
:-
--delete-collection-workers=16
}
"
TEST_CLUSTER_MAX_REQUESTS_INFLIGHT
=
"
${
TEST_CLUSTER_MAX_REQUESTS_INFLIGHT
:-}
"
...
...
@@ -96,9 +97,8 @@ CONTROLLER_MANAGER_TEST_ARGS="${KUBEMARK_CONTROLLER_MANAGER_TEST_ARGS:-} ${CONTR
SCHEDULER_TEST_ARGS
=
"
${
KUBEMARK_SCHEDULER_TEST_ARGS
:-}
${
SCHEDULER_TEST_LOG_LEVEL
}
${
TEST_CLUSTER_API_CONTENT_TYPE
}
${
KUBEMARK_MASTER_COMPONENTS_QPS_LIMITS
}
"
# Hollow-node components' test arguments.
KUBELET_TEST_ARGS
=
"--max-pods=100
$TEST_CLUSTER_LOG_LEVEL
${
TEST_CLUSTER_API_CONTENT_TYPE
}
"
KUBEPROXY_TEST_ARGS
=
"
${
KUBEPROXY_TEST_LOG_LEVEL
}
${
TEST_CLUSTER_API_CONTENT_TYPE
}
"
USE_REAL_PROXIER
=
${
USE_REAL_PROXIER
:-
true
}
# for hollow-proxy
HOLLOW_KUBELET_TEST_ARGS
=
"
${
HOLLOW_KUBELET_TEST_ARGS
:-}
${
HOLLOW_KUBELET_TEST_LOG_LEVEL
}
"
HOLLOW_PROXY_TEST_ARGS
=
"
${
HOLLOW_PROXY_TEST_ARGS
:-}
${
HOLLOW_PROXY_TEST_LOG_LEVEL
}
"
SERVICE_CLUSTER_IP_RANGE
=
"10.0.0.0/16"
# formerly PORTAL_NET
ALLOCATE_NODE_CIDRS
=
true
...
...
cluster/kubemark/pre-existing/config-default.sh
View file @
26b3bacb
...
...
@@ -36,4 +36,3 @@ TEST_CLUSTER_API_CONTENT_TYPE="${TEST_CLUSTER_API_CONTENT_TYPE:-}"
KUBELET_TEST_LOG_LEVEL
=
"
${
KUBELET_TEST_LOG_LEVEL
:-}
"
KUBEPROXY_TEST_LOG_LEVEL
=
"
${
KUBEPROXY_TEST_LOG_LEVEL
:-}
"
MASTER_NAME
=
"
${
MASTER_NAME
:-}
"
USE_REAL_PROXIER
=
"
${
USE_REAL_PROXIER
:-
true
}
"
cmd/kubemark/hollow-node.go
View file @
26b3bacb
...
...
@@ -51,14 +51,16 @@ import (
)
type
HollowNodeConfig
struct
{
KubeconfigPath
string
KubeletPort
int
KubeletReadOnlyPort
int
Morph
string
NodeName
string
ServerPort
int
ContentType
string
UseRealProxier
bool
KubeconfigPath
string
KubeletPort
int
KubeletReadOnlyPort
int
Morph
string
NodeName
string
ServerPort
int
ContentType
string
UseRealProxier
bool
ProxierSyncPeriod
time
.
Duration
ProxierMinSyncPeriod
time
.
Duration
}
const
(
...
...
@@ -66,6 +68,8 @@ const (
podsPerCore
=
0
)
// TODO(#45650): Refactor hollow-node into hollow-kubelet and hollow-proxy
// and make the config driven.
var
knownMorphs
=
sets
.
NewString
(
"kubelet"
,
"proxy"
)
func
(
c
*
HollowNodeConfig
)
addFlags
(
fs
*
pflag
.
FlagSet
)
{
...
...
@@ -77,6 +81,8 @@ func (c *HollowNodeConfig) addFlags(fs *pflag.FlagSet) {
fs
.
StringVar
(
&
c
.
Morph
,
"morph"
,
""
,
fmt
.
Sprintf
(
"Specifies into which Hollow component this binary should morph. Allowed values: %v"
,
knownMorphs
.
List
()))
fs
.
StringVar
(
&
c
.
ContentType
,
"kube-api-content-type"
,
"application/vnd.kubernetes.protobuf"
,
"ContentType of requests sent to apiserver."
)
fs
.
BoolVar
(
&
c
.
UseRealProxier
,
"use-real-proxier"
,
true
,
"Set to true if you want to use real proxier inside hollow-proxy."
)
fs
.
DurationVar
(
&
c
.
ProxierSyncPeriod
,
"proxier-sync-period"
,
30
*
time
.
Second
,
"Period that proxy rules are refreshed in hollow-proxy."
)
fs
.
DurationVar
(
&
c
.
ProxierMinSyncPeriod
,
"proxier-min-sync-period"
,
0
,
"Minimum period that proxy rules are refreshed in hollow-proxy."
)
}
func
(
c
*
HollowNodeConfig
)
createClientConfigFromFile
()
(
*
restclient
.
Config
,
error
)
{
...
...
@@ -198,6 +204,8 @@ func run(config *HollowNodeConfig) {
eventBroadcaster
,
recorder
,
config
.
UseRealProxier
,
config
.
ProxierSyncPeriod
,
config
.
ProxierMinSyncPeriod
,
)
if
err
!=
nil
{
glog
.
Fatalf
(
"Failed to create hollowProxy instance: %v"
,
err
)
...
...
pkg/kubemark/hollow_proxy.go
View file @
26b3bacb
...
...
@@ -70,6 +70,8 @@ func NewHollowProxyOrDie(
broadcaster
record
.
EventBroadcaster
,
recorder
record
.
EventRecorder
,
useRealProxier
bool
,
proxierSyncPeriod
time
.
Duration
,
proxierMinSyncPeriod
time
.
Duration
,
)
(
*
HollowProxy
,
error
)
{
// Create proxier and service/endpoint handlers.
var
proxier
proxy
.
ProxyProvider
...
...
@@ -83,8 +85,8 @@ func NewHollowProxyOrDie(
iptInterface
,
sysctl
,
execer
,
30
*
time
.
Secon
d
,
5
*
time
.
Secon
d
,
proxierSyncPerio
d
,
proxierMinSyncPerio
d
,
false
,
0
,
"10.0.0.0/8"
,
...
...
test/kubemark/resources/hollow-node_template.yaml
View file @
26b3bacb
...
...
@@ -53,7 +53,7 @@ spec:
command
:
-
/bin/sh
-
-c
-
/kubemark --morph=kubelet --name=$(NODE_NAME)
--kubeconfig=/kubeconfig/kubelet.kubeconfig $(CONTENT_TYPE) --alsologtostderr {{kubelet_verbosity_level}}
1>>/var/log/kubelet-$(NODE_NAME).log 2>&1
-
/kubemark --morph=kubelet --name=$(NODE_NAME)
{{hollow_kubelet_params}} --kubeconfig=/kubeconfig/kubelet.kubeconfig $(CONTENT_TYPE) --alsologtostderr
1>>/var/log/kubelet-$(NODE_NAME).log 2>&1
volumeMounts
:
-
name
:
kubeconfig-volume
mountPath
:
/kubeconfig
...
...
@@ -81,7 +81,7 @@ spec:
command
:
-
/bin/sh
-
-c
-
/kubemark --morph=proxy --name=$(NODE_NAME)
--use-real-proxier={{use_real_proxier}} --kubeconfig=/kubeconfig/kubeproxy.kubeconfig $(CONTENT_TYPE) --alsologtostderr {{kubeproxy_verbosity_level}}
1>>/var/log/kubeproxy-$(NODE_NAME).log 2>&1
-
/kubemark --morph=proxy --name=$(NODE_NAME)
{{hollow_proxy_params}} --kubeconfig=/kubeconfig/kubeproxy.kubeconfig $(CONTENT_TYPE) --alsologtostderr
1>>/var/log/kubeproxy-$(NODE_NAME).log 2>&1
volumeMounts
:
-
name
:
kubeconfig-volume
mountPath
:
/kubeconfig
...
...
test/kubemark/start-kubemark.sh
View file @
26b3bacb
...
...
@@ -405,9 +405,8 @@ current-context: kubemark-context")
sed
-i
''
-e
"s'{{kubemark_image_registry}}'
${
KUBEMARK_IMAGE_REGISTRY
}
'g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
sed
-i
''
-e
"s/{{kubemark_image_tag}}/
${
KUBEMARK_IMAGE_TAG
}
/g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
sed
-i
''
-e
"s/{{master_ip}}/
${
MASTER_IP
}
/g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
sed
-i
''
-e
"s/{{kubelet_verbosity_level}}/
${
KUBELET_TEST_LOG_LEVEL
}
/g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
sed
-i
''
-e
"s/{{kubeproxy_verbosity_level}}/
${
KUBEPROXY_TEST_LOG_LEVEL
}
/g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
sed
-i
''
-e
"s/{{use_real_proxier}}/
${
USE_REAL_PROXIER
}
/g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
sed
-i
''
-e
"s/{{hollow_kubelet_params}}/
${
HOLLOW_KUBELET_TEST_ARGS
}
/g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
sed
-i
''
-e
"s/{{hollow_proxy_params}}/
${
HOLLOW_PROXY_TEST_ARGS
}
/g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
sed
-i
''
-e
"s'{{kubemark_mig_config}}'
${
KUBEMARK_MIG_CONFIG
:-}
'g"
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
"
${
KUBECTL
}
"
create
-f
"
${
RESOURCE_DIRECTORY
}
/hollow-node.yaml"
--namespace
=
"kubemark"
...
...
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