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
44ca3ea5
Commit
44ca3ea5
authored
Sep 28, 2016
by
Yifan Gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CRI: Add dns option, rename DNSOption to DNSConfig.
parent
1e5e4fdb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
8 deletions
+18
-8
api.pb.go
pkg/kubelet/api/v1alpha1/runtime/api.pb.go
+0
-0
api.proto
pkg/kubelet/api/v1alpha1/runtime/api.proto
+7
-4
docker_sandbox.go
pkg/kubelet/dockershim/docker_sandbox.go
+4
-3
helpers.go
pkg/kubelet/kuberuntime/helpers.go
+5
-0
kuberuntime_sandbox.go
pkg/kubelet/kuberuntime/kuberuntime_sandbox.go
+2
-1
No files found.
pkg/kubelet/api/v1alpha1/runtime/api.pb.go
View file @
44ca3ea5
This diff is collapsed.
Click to expand it.
pkg/kubelet/api/v1alpha1/runtime/api.proto
View file @
44ca3ea5
...
...
@@ -73,12 +73,15 @@ message VersionResponse {
optional
string
runtime_api_version
=
4
;
}
// DNS
Option
specifies the DNS servers and search domains.
message
DNS
Option
{
// DNS
Config
specifies the DNS servers and search domains.
message
DNS
Config
{
// List of DNS servers of the cluster.
repeated
string
servers
=
1
;
// List of DNS search domains of the cluster.
repeated
string
searches
=
2
;
// List of DNS options. See https://linux.die.net/man/5/resolv.conf
// for all available options.
repeated
string
options
=
3
;
}
enum
Protocol
{
...
...
@@ -177,8 +180,8 @@ message PodSandboxConfig {
// https://issues.k8s.io/24677. There *may* be future change of direction
// for logging as the discussion carries on.
optional
string
log_directory
=
3
;
// The DNS
options
for the sandbox.
optional
DNS
Option
dns_options
=
4
;
// The DNS
config
for the sandbox.
optional
DNS
Config
dns_config
=
4
;
// The port mappings for the sandbox.
repeated
PortMapping
port_mappings
=
5
;
// Labels are key value pairs that may be used to scope and select individual resources.
...
...
pkg/kubelet/dockershim/docker_sandbox.go
View file @
44ca3ea5
...
...
@@ -243,9 +243,10 @@ func makeSandboxDockerConfig(c *runtimeApi.PodSandboxConfig, image string) *dock
hc
.
PortBindings
=
portBindings
// Set DNS options.
if
dnsOpts
:=
c
.
GetDnsOptions
();
dnsOpts
!=
nil
{
hc
.
DNS
=
dnsOpts
.
GetServers
()
hc
.
DNSSearch
=
dnsOpts
.
GetSearches
()
if
dnsConfig
:=
c
.
GetDnsConfig
();
dnsConfig
!=
nil
{
hc
.
DNS
=
dnsConfig
.
GetServers
()
hc
.
DNSSearch
=
dnsConfig
.
GetSearches
()
hc
.
DNSOptions
=
dnsConfig
.
GetOptions
()
}
// Apply resource options.
...
...
pkg/kubelet/kuberuntime/helpers.go
View file @
44ca3ea5
...
...
@@ -37,6 +37,11 @@ const (
minQuotaPeriod
=
1000
)
var
(
// The default dns opt strings
defaultDNSOptions
=
[]
string
{
"ndots:5"
}
)
type
podsByID
[]
*
kubecontainer
.
Pod
func
(
b
podsByID
)
Len
()
int
{
return
len
(
b
)
}
...
...
pkg/kubelet/kuberuntime/kuberuntime_sandbox.go
View file @
44ca3ea5
...
...
@@ -69,9 +69,10 @@ func (m *kubeGenericRuntimeManager) generatePodSandboxConfig(pod *api.Pod, attem
if
err
!=
nil
{
return
nil
,
err
}
podSandboxConfig
.
Dns
Options
=
&
runtimeApi
.
DNSOption
{
podSandboxConfig
.
Dns
Config
=
&
runtimeApi
.
DNSConfig
{
Servers
:
dnsServers
,
Searches
:
dnsSearches
,
Options
:
defaultDNSOptions
,
}
// TODO: Add domain support in new runtime interface
hostname
,
_
,
err
:=
m
.
runtimeHelper
.
GeneratePodHostNameAndDomain
(
pod
)
...
...
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