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
5bb7eec5
Commit
5bb7eec5
authored
May 26, 2015
by
gmarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use salt pillars to pass test arguments during cluster creation.
parent
b0d31fb7
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
99 additions
and
1 deletion
+99
-1
config-test.sh
cluster/gce/config-test.sh
+8
-0
configure-vm.sh
cluster/gce/configure-vm.sh
+26
-0
helper.sh
cluster/gce/debian/helper.sh
+30
-0
kube-apiserver.manifest
cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest
+5
-0
kube-controller-manager.manifest
.../kube-controller-manager/kube-controller-manager.manifest
+5
-0
default
cluster/saltbase/salt/kube-proxy/default
+9
-0
kube-scheduler.manifest
cluster/saltbase/salt/kube-scheduler/kube-scheduler.manifest
+8
-1
default
cluster/saltbase/salt/kubelet/default
+8
-0
No files found.
cluster/gce/config-test.sh
View file @
5bb7eec5
...
...
@@ -53,6 +53,14 @@ SERVICE_CLUSTER_IP_RANGE="10.0.0.0/16" # formerly PORTAL_NET
# google - Heapster, Google Cloud Monitoring, and Google Cloud Logging
ENABLE_CLUSTER_MONITORING
=
"
${
KUBE_ENABLE_CLUSTER_MONITORING
:-
influxdb
}
"
TEST_CLUSTER_LOG_LEVEL
=
"
${
TEST_CLUSTER_LOG_LEVEL
:-
--v=4
}
"
KUBELET_TEST_ARGS
=
"--max-pods=100
$TEST_CLUSTER_LOG_LEVEL
"
APISERVER_TEST_ARGS
=
"TEST_CLUSTER_LOG_LEVEL"
CONTROLLER_MANAGER_TEST_ARGS
=
"TEST_CLUSTER_LOG_LEVEL"
SCHEDULER_TEST_ARGS
=
"TEST_CLUSTER_LOG_LEVEL"
KUBEPROXY_TEST_ARGS
=
"TEST_CLUSTER_LOG_LEVEL"
# Optional: Enable node logging.
ENABLE_NODE_LOGGING
=
"
${
KUBE_ENABLE_NODE_LOGGING
:-
true
}
"
LOGGING_DESTINATION
=
"
${
KUBE_LOGGING_DESTINATION
:-
elasticsearch
}
"
# options: elasticsearch, gcp
...
...
cluster/gce/configure-vm.sh
View file @
5bb7eec5
...
...
@@ -277,6 +277,32 @@ dns_server: '$(echo "$DNS_SERVER_IP" | sed -e "s/'/''/g")'
dns_domain: '
$(
echo
"
$DNS_DOMAIN
"
|
sed
-e
"s/'/''/g"
)
'
admission_control: '
$(
echo
"
$ADMISSION_CONTROL
"
|
sed
-e
"s/'/''/g"
)
'
EOF
if
[
-n
"
${
APISERVER_TEST_ARGS
:-}
"
]
;
then
cat
<<
EOF
>>/srv/salt-overlay/pillar/cluster-params.sls
apiserver_test_args: '
$(
echo
"
$APISERVER_TEST_ARGS
"
|
sed
-e
"s/'/''/g"
)
'
EOF
fi
if
[
-n
"
${
KUBELET_TEST_ARGS
:-}
"
]
;
then
cat
<<
EOF
>>/srv/salt-overlay/pillar/cluster-params.sls
kubelet_test_args: '
$(
echo
"
$KUBELET_TEST_ARGS
"
|
sed
-e
"s/'/''/g"
)
'
EOF
fi
if
[
-n
"
${
CONTROLLER_MANAGER_TEST_ARGS
:-}
"
]
;
then
cat
<<
EOF
>>/srv/salt-overlay/pillar/cluster-params.sls
controller_manager_test_args: '
$(
echo
"
$CONTROLLER_MANAGER_TEST_ARGS
"
|
sed
-e
"s/'/''/g"
)
'
EOF
fi
if
[
-n
"
${
SCHEDULER_TEST_ARGS
:-}
"
]
;
then
cat
<<
EOF
>>/srv/salt-overlay/pillar/cluster-params.sls
scheduler_test_args: '
$(
echo
"
$SCHEDULER_TEST_ARGS
"
|
sed
-e
"s/'/''/g"
)
'
EOF
fi
if
[
-n
"
${
KUBEPROXY_TEST_ARGS
:-}
"
]
;
then
cat
<<
EOF
>>/srv/salt-overlay/pillar/cluster-params.sls
kubeproxy_test_args: '
$(
echo
"
$KUBEPROXY_TEST_ARGS
"
|
sed
-e
"s/'/''/g"
)
'
EOF
fi
}
# This should only happen on cluster initialization.
...
...
cluster/gce/debian/helper.sh
View file @
5bb7eec5
...
...
@@ -67,6 +67,26 @@ MASTER_KEY: $(yaml-quote ${MASTER_KEY_BASE64:-})
KUBECFG_CERT:
$(
yaml-quote
${
KUBECFG_CERT_BASE64
:-})
KUBECFG_KEY:
$(
yaml-quote
${
KUBECFG_KEY_BASE64
:-})
EOF
if
[
-n
"
${
APISERVER_TEST_ARGS
:-}
"
]
;
then
cat
>>
$file
<<
EOF
APISERVER_TEST_ARGS:
$(
yaml-quote
${
APISERVER_TEST_ARGS
})
EOF
fi
if
[
-n
"
${
KUBELET_TEST_ARGS
:-}
"
]
;
then
cat
>>
$file
<<
EOF
KUBELET_TEST_ARGS:
$(
yaml-quote
${
KUBELET_TEST_ARGS
})
EOF
fi
if
[
-n
"
${
CONTROLLER_MANAGER_TEST_ARGS
:-}
"
]
;
then
cat
>>
$file
<<
EOF
CONTROLLER_MANAGER_TEST_ARGS:
$(
yaml-quote
${
CONTROLLER_MANAGER_TEST_ARGS
})
EOF
fi
if
[
-n
"
${
SCHEDULER_TEST_ARGS
:-}
"
]
;
then
cat
>>
$file
<<
EOF
SCHEDULER_TEST_ARGS:
$(
yaml-quote
${
SCHEDULER_TEST_ARGS
})
EOF
fi
else
# Node-only env vars.
cat
>>
$file
<<
EOF
...
...
@@ -76,6 +96,16 @@ EXTRA_DOCKER_OPTS: $(yaml-quote ${EXTRA_DOCKER_OPTS:-})
KUBELET_CERT:
$(
yaml-quote
${
KUBELET_CERT_BASE64
:-})
KUBELET_KEY:
$(
yaml-quote
${
KUBELET_KEY_BASE64
:-})
EOF
if
[
-n
"
${
KUBELET_TEST_ARGS
:-}
"
]
;
then
cat
>>
$file
<<
EOF
KUBELET_TEST_ARGS:
$(
yaml-quote
${
KUBELET_TEST_ARGS
})
EOF
fi
if
[
-n
"
${
KUBEPROXY_TEST_ARGS
:-}
"
]
;
then
cat
>>
$file
<<
EOF
KUBEPROXY_TEST_ARGS:
$(
yaml-quote
${
KUBEPROXY_TEST_ARGS
})
EOF
fi
fi
}
...
...
cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest
View file @
5bb7eec5
...
...
@@ -91,6 +91,11 @@
{% set params = address + " " + etcd_servers + " " + cloud_provider + " " + cloud_config + " " + runtime_config + " " + admission_control + " " + service_cluster_ip_range + " " + client_ca_file + " " + basic_auth_file + " " + min_request_timeout -%}
{% set params = params + " " + cluster_name + " " + cert_file + " " + key_file + " --secure_port=" + secure_port + " " + token_auth_file + " " + bind_address + " " + pillar['log_level'] + " " + advertise_address + " " + proxy_ssh_options -%}
# test_args has to be kept at the end, so they'll overwrite any prior configuration
{% if pillar['apiserver_test_args'] is defined -%}
{% set params = params + " " + pillar['apiserver_test_args'] -%}
{% endif -%}
{
"apiVersion": "v1",
"kind": "Pod",
...
...
cluster/saltbase/salt/kube-controller-manager/kube-controller-manager.manifest
View file @
5bb7eec5
...
...
@@ -36,6 +36,11 @@
{% set params = "--master=127.0.0.1:8080" + " " + cluster_name + " " + cluster_cidr + " " + allocate_node_cidrs + " " + cloud_provider + " " + cloud_config + service_account_key + pillar['log_level'] + " " + root_ca_file -%}
# test_args has to be kept at the end, so they'll overwrite any prior configuration
{% if pillar['controller_manager_test_args'] is defined -%}
{% set params = params + " " + pillar['controller_manager_test_args'] -%}
{% endif -%}
{
"apiVersion": "v1",
"kind": "Pod",
...
...
cluster/saltbase/salt/kube-proxy/default
View file @
5bb7eec5
...
...
@@ -25,4 +25,13 @@
{% endif -%}
{% endif -%}
{% set test_args = "" -%}
{% if pillar['kubeproxy_test_args'] is defined -%}
{% set test_args=pillar['kubeproxy_test_args'] %}
{% endif -%}
DAEMON_ARGS="{{daemon_args}} {{api_servers_with_port}} {{kubeconfig}} {{pillar['log_level']}}"
# test_args has to be kept at the end, so they'll overwrite any prior configuration
DAEMON_ARGS="$DAEMON_ARGS + {{test_args}}"
cluster/saltbase/salt/kube-scheduler/kube-scheduler.manifest
View file @
5bb7eec5
{% set params = "{{pillar['log_level']}}" -%}
# test_args has to be kept at the end, so they'll overwrite any prior configuration
{% if pillar['scheduler_test_args'] is defined -%}
{% set params = params + " " + pillar['scheduler_test_args'] -%}
{% endif -%}
{
"apiVersion": "v1",
"kind": "Pod",
...
...
@@ -16,7 +23,7 @@
"command": [
"/bin/sh",
"-c",
"/usr/local/bin/kube-scheduler --master=127.0.0.1:8080 {{p
illar['log_level']
}} 1>>/var/log/kube-scheduler.log 2>&1"
"/usr/local/bin/kube-scheduler --master=127.0.0.1:8080 {{p
arams
}} 1>>/var/log/kube-scheduler.log 2>&1"
],
"livenessProbe": {
"httpGet": {
...
...
cluster/saltbase/salt/kubelet/default
View file @
5bb7eec5
...
...
@@ -90,4 +90,12 @@
{% set pod_cidr = "--pod-cidr=" + grains['cbr-cidr'] %}
{% endif %}
{% set test_args = "" -%}
{% if pillar['kubelet_test_args'] is defined -%}
{% set test_args=pillar['kubelet_test_args'] %}
{% endif -%}
DAEMON_ARGS="{{daemon_args}} {{api_servers_with_port}} {{debugging_handlers}} {{hostname_override}} {{cloud_provider}} {{config}} {{manifest_url}} --allow_privileged={{pillar['allow_privileged']}} {{pillar['log_level']}} {{cluster_dns}} {{cluster_domain}} {{docker_root}} {{kubelet_root}} {{configure_cbr0}} {{cgroup_root}} {{system_container}} {{pod_cidr}}"
# test_args has to be kept at the end, so they'll overwrite any prior configuration
DAEMON_ARGS="$DAEMON_ARGS + {{test_args}}"
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