mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #22898 from nikhiljindal/apiserverexampleport
Auto commit by PR queue bot
This commit is contained in:
commit
4b7e74ceeb
@ -32,6 +32,13 @@ import (
|
|||||||
_ "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup/install"
|
_ "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testdata/apis/testgroup/install"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Ports on which to run the server.
|
||||||
|
// Explicitly setting these to a different value than the default values, to prevent this from clashing with a local cluster.
|
||||||
|
InsecurePort = 8081
|
||||||
|
SecurePort = 6444
|
||||||
|
)
|
||||||
|
|
||||||
func newStorageDestinations(groupName string, groupMeta *apimachinery.GroupMeta) (*genericapiserver.StorageDestinations, error) {
|
func newStorageDestinations(groupName string, groupMeta *apimachinery.GroupMeta) (*genericapiserver.StorageDestinations, error) {
|
||||||
storageDestinations := genericapiserver.NewStorageDestinations()
|
storageDestinations := genericapiserver.NewStorageDestinations()
|
||||||
var storageConfig etcdstorage.EtcdStorageConfig
|
var storageConfig etcdstorage.EtcdStorageConfig
|
||||||
@ -85,6 +92,9 @@ func Run() error {
|
|||||||
if err := s.InstallAPIGroups([]genericapiserver.APIGroupInfo{apiGroupInfo}); err != nil {
|
if err := s.InstallAPIGroups([]genericapiserver.APIGroupInfo{apiGroupInfo}); err != nil {
|
||||||
return fmt.Errorf("Error in installing API: %v", err)
|
return fmt.Errorf("Error in installing API: %v", err)
|
||||||
}
|
}
|
||||||
s.Run(genericapiserver.NewServerRunOptions())
|
serverOptions := genericapiserver.NewServerRunOptions()
|
||||||
|
serverOptions.InsecurePort = InsecurePort
|
||||||
|
serverOptions.SecurePort = SecurePort
|
||||||
|
s.Run(serverOptions)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
)
|
)
|
||||||
|
|
||||||
var serverIP = "http://localhost:8080"
|
var serverIP = fmt.Sprintf("http://localhost:%d", InsecurePort)
|
||||||
|
|
||||||
var groupVersion = v1.SchemeGroupVersion
|
var groupVersion = v1.SchemeGroupVersion
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user