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
612a8faf
Commit
612a8faf
authored
Feb 16, 2017
by
deads2k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add kube-aggregator to hyperkube
parent
2509ab0c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
16 deletions
+81
-16
BUILD
cmd/hyperkube/BUILD
+2
-0
kube-aggregator.go
cmd/hyperkube/kube-aggregator.go
+51
-0
main.go
cmd/hyperkube/main.go
+1
-0
start.go
staging/src/k8s.io/kube-aggregator/pkg/cmd/server/start.go
+26
-16
BUILD
vendor/BUILD
+1
-0
No files found.
cmd/hyperkube/BUILD
View file @
612a8faf
...
...
@@ -32,6 +32,7 @@ go_library(
"federation-apiserver.go",
"federation-controller-manager.go",
"hyperkube.go",
"kube-aggregator.go",
"kube-apiserver.go",
"kube-controller-manager.go",
"kube-proxy.go",
...
...
@@ -67,6 +68,7 @@ go_library(
"//vendor:k8s.io/apiserver/pkg/server/healthz",
"//vendor:k8s.io/apiserver/pkg/util/flag",
"//vendor:k8s.io/apiserver/pkg/util/logs",
"//vendor:k8s.io/kube-aggregator/pkg/cmd/server",
],
)
...
...
cmd/hyperkube/kube-aggregator.go
0 → 100644
View file @
612a8faf
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
main
import
(
"os"
"k8s.io/kube-aggregator/pkg/cmd/server"
)
// NewKubeAggregator creates a new hyperkube Server object that includes the
// description and flags.
func
NewKubeAggregator
()
*
Server
{
o
:=
server
.
NewDefaultOptions
(
os
.
Stdout
,
os
.
Stderr
)
hks
:=
Server
{
name
:
"aggregator"
,
AlternativeName
:
"kube-aggregator"
,
SimpleUsage
:
"aggregator"
,
Long
:
"Aggregator for Kubernetes-style API servers: dynamic registration, discovery summarization, secure proxy."
,
Run
:
func
(
_
*
Server
,
args
[]
string
)
error
{
if
err
:=
o
.
Complete
();
err
!=
nil
{
return
err
}
if
err
:=
o
.
Validate
(
args
);
err
!=
nil
{
return
err
}
if
err
:=
o
.
RunAggregator
();
err
!=
nil
{
return
err
}
return
nil
},
}
o
.
AddFlags
(
hks
.
Flags
())
return
&
hks
}
cmd/hyperkube/main.go
View file @
612a8faf
...
...
@@ -38,6 +38,7 @@ func main() {
hk
.
AddServer
(
NewScheduler
())
hk
.
AddServer
(
NewKubelet
())
hk
.
AddServer
(
NewKubeProxy
())
hk
.
AddServer
(
NewKubeAggregator
())
//Federation servers
hk
.
AddServer
(
NewFederationAPIServer
())
...
...
staging/src/k8s.io/kube-aggregator/pkg/cmd/server/start.go
View file @
612a8faf
...
...
@@ -22,6 +22,7 @@ import (
"io/ioutil"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/wait"
...
...
@@ -32,9 +33,8 @@ import (
"k8s.io/client-go/pkg/api"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/kube-aggregator/pkg/apiserver"
"k8s.io/kube-aggregator/pkg/apis/apiregistration/v1alpha1"
"k8s.io/kube-aggregator/pkg/apiserver"
)
const
defaultEtcdPathPrefix
=
"/registry/kube-aggregator.kubernetes.io/"
...
...
@@ -55,15 +55,9 @@ type AggregatorOptions struct {
StdErr
io
.
Writer
}
// NewCommandStart
Maste
r provides a CLI handler for 'start master' command
// NewCommandStart
Aggregato
r provides a CLI handler for 'start master' command
func
NewCommandStartAggregator
(
out
,
err
io
.
Writer
)
*
cobra
.
Command
{
o
:=
&
AggregatorOptions
{
RecommendedOptions
:
genericoptions
.
NewRecommendedOptions
(
defaultEtcdPathPrefix
,
api
.
Scheme
,
api
.
Codecs
.
LegacyCodec
(
v1alpha1
.
SchemeGroupVersion
)),
StdOut
:
out
,
StdErr
:
err
,
}
o
.
RecommendedOptions
.
SecureServing
.
ServingOptions
.
BindPort
=
443
o
:=
NewDefaultOptions
(
out
,
err
)
cmd
:=
&
cobra
.
Command
{
Short
:
"Launch a API aggregator and proxy server"
,
...
...
@@ -82,14 +76,30 @@ func NewCommandStartAggregator(out, err io.Writer) *cobra.Command {
},
}
flags
:=
cmd
.
Flags
()
o
.
RecommendedOptions
.
AddFlags
(
flags
)
flags
.
StringVar
(
&
o
.
ProxyClientCertFile
,
"proxy-client-cert-file"
,
o
.
ProxyClientCertFile
,
"client certificate used identify the proxy to the API server"
)
flags
.
StringVar
(
&
o
.
ProxyClientKeyFile
,
"proxy-client-key-file"
,
o
.
ProxyClientKeyFile
,
"client certificate key used identify the proxy to the API server"
)
flags
.
StringVar
(
&
o
.
CoreAPIKubeconfig
,
"core-kubeconfig"
,
o
.
CoreAPIKubeconfig
,
""
+
o
.
AddFlags
(
cmd
.
Flags
())
return
cmd
}
// AddFlags is necessary because hyperkube doesn't work using cobra, so we have to have different registration and execution paths
func
(
o
*
AggregatorOptions
)
AddFlags
(
fs
*
pflag
.
FlagSet
)
{
o
.
RecommendedOptions
.
AddFlags
(
fs
)
fs
.
StringVar
(
&
o
.
ProxyClientCertFile
,
"proxy-client-cert-file"
,
o
.
ProxyClientCertFile
,
"client certificate used identify the proxy to the API server"
)
fs
.
StringVar
(
&
o
.
ProxyClientKeyFile
,
"proxy-client-key-file"
,
o
.
ProxyClientKeyFile
,
"client certificate key used identify the proxy to the API server"
)
fs
.
StringVar
(
&
o
.
CoreAPIKubeconfig
,
"core-kubeconfig"
,
o
.
CoreAPIKubeconfig
,
""
+
"kubeconfig file pointing at the 'core' kubernetes server with enough rights to get,list,watch "
+
" services,endpoints. If not set, the in-cluster config is used"
)
return
cmd
}
// NewDefaultOptions builds a "normal" set of options. You wouldn't normally expose this, but hyperkube isn't cobra compatible
func
NewDefaultOptions
(
out
,
err
io
.
Writer
)
*
AggregatorOptions
{
o
:=
&
AggregatorOptions
{
RecommendedOptions
:
genericoptions
.
NewRecommendedOptions
(
defaultEtcdPathPrefix
,
api
.
Scheme
,
api
.
Codecs
.
LegacyCodec
(
v1alpha1
.
SchemeGroupVersion
)),
StdOut
:
out
,
StdErr
:
err
,
}
o
.
RecommendedOptions
.
SecureServing
.
ServingOptions
.
BindPort
=
443
return
o
}
func
(
o
AggregatorOptions
)
Validate
(
args
[]
string
)
error
{
...
...
vendor/BUILD
View file @
612a8faf
...
...
@@ -16793,6 +16793,7 @@ go_library(
tags = ["automanaged"],
deps = [
"//vendor:github.com/spf13/cobra",
"//vendor:github.com/spf13/pflag",
"//vendor:k8s.io/apimachinery/pkg/util/sets",
"//vendor:k8s.io/apimachinery/pkg/util/wait",
"//vendor:k8s.io/apiserver/pkg/server",
...
...
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