...

Source file src/k8s.io/kubernetes/pkg/kubeapiserver/options/serving.go

Documentation: k8s.io/kubernetes/pkg/kubeapiserver/options

     1  /*
     2  Copyright 2017 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  // Package options contains flags and options for initializing kube-apiserver
    18  package options
    19  
    20  import (
    21  	genericoptions "k8s.io/apiserver/pkg/server/options"
    22  	netutils "k8s.io/utils/net"
    23  )
    24  
    25  // NewSecureServingOptions gives default values for the kube-apiserver which are not the options wanted by
    26  // "normal" API servers running on the platform
    27  func NewSecureServingOptions() *genericoptions.SecureServingOptionsWithLoopback {
    28  	o := genericoptions.SecureServingOptions{
    29  		BindAddress: netutils.ParseIPSloppy("0.0.0.0"),
    30  		BindPort:    6443,
    31  		Required:    true,
    32  		ServerCert: genericoptions.GeneratableKeyCert{
    33  			PairName:      "apiserver",
    34  			CertDirectory: "/var/run/kubernetes",
    35  		},
    36  	}
    37  	return o.WithLoopback()
    38  }
    39  

View as plain text