mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Adding the dnsprovider flags to federation-controller-manager
This commit is contained in:
parent
64b4967774
commit
3f3a2c14d1
@ -52,6 +52,20 @@ function create-federation-api-objects {
|
|||||||
export FEDERATION_CONTROLLER_MANAGER_IMAGE_REPO="${FEDERATION_PUSH_REPO_BASE}/federation-controller-manager"
|
export FEDERATION_CONTROLLER_MANAGER_IMAGE_REPO="${FEDERATION_PUSH_REPO_BASE}/federation-controller-manager"
|
||||||
export FEDERATION_CONTROLLER_MANAGER_IMAGE_TAG="${FEDERATION_IMAGE_TAG:-$(cat ${KUBE_ROOT}/_output/${KUBE_BUILD_STAGE}/server/${KUBE_PLATFORM}-${KUBE_ARCH}/kubernetes/server/bin/federation-controller-manager.docker_tag)}"
|
export FEDERATION_CONTROLLER_MANAGER_IMAGE_TAG="${FEDERATION_IMAGE_TAG:-$(cat ${KUBE_ROOT}/_output/${KUBE_BUILD_STAGE}/server/${KUBE_PLATFORM}-${KUBE_ARCH}/kubernetes/server/bin/federation-controller-manager.docker_tag)}"
|
||||||
|
|
||||||
|
if [[ -z "${FEDERATION_DNS_PROVIDER:-}" ]]; then
|
||||||
|
# Set the appropriate value based on cloud provider.
|
||||||
|
if [[ "$KUBERNETES_PROVIDER" == "gce" || "${KUBERNETES_PROVIDER}" == "gke" ]]; then
|
||||||
|
echo "setting dns provider to google-clouddns"
|
||||||
|
export FEDERATION_DNS_PROVIDER="google-clouddns"
|
||||||
|
elif [[ "${KUBERNETES_PROVIDER}" == "aws" ]]; then
|
||||||
|
echo "setting dns provider to aws-route53"
|
||||||
|
export FEDERATION_DNS_PROVIDER="aws-route53"
|
||||||
|
else
|
||||||
|
echo "Must set FEDERATION_DNS_PROVIDER env var"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
export FEDERATION_SERVICE_CIDR=${FEDERATION_SERVICE_CIDR:-"10.10.0.0/24"}
|
export FEDERATION_SERVICE_CIDR=${FEDERATION_SERVICE_CIDR:-"10.10.0.0/24"}
|
||||||
|
|
||||||
#Only used for providers that require a nodeport service (vagrant for now)
|
#Only used for providers that require a nodeport service (vagrant for now)
|
||||||
|
@ -19,9 +19,12 @@ limitations under the License.
|
|||||||
package options
|
package options
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
|
|
||||||
|
"k8s.io/kubernetes/federation/pkg/dnsprovider"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||||
"k8s.io/kubernetes/pkg/client/leaderelection"
|
"k8s.io/kubernetes/pkg/client/leaderelection"
|
||||||
@ -35,7 +38,7 @@ type ControllerManagerConfiguration struct {
|
|||||||
// dnsProvider is the provider for dns services.
|
// dnsProvider is the provider for dns services.
|
||||||
DnsProvider string `json:"dnsProvider"`
|
DnsProvider string `json:"dnsProvider"`
|
||||||
// dnsConfigFile is the path to the dns provider configuration file.
|
// dnsConfigFile is the path to the dns provider configuration file.
|
||||||
DnsConfigFile string `json:"ndsConfigFile"`
|
DnsConfigFile string `json:"dnsConfigFile"`
|
||||||
// concurrentServiceSyncs is the number of services that are
|
// concurrentServiceSyncs is the number of services that are
|
||||||
// allowed to sync concurrently. Larger number = more responsive service
|
// allowed to sync concurrently. Larger number = more responsive service
|
||||||
// management, but more CPU (and network) load.
|
// management, but more CPU (and network) load.
|
||||||
@ -95,5 +98,7 @@ func (s *CMServer) AddFlags(fs *pflag.FlagSet) {
|
|||||||
fs.StringVar(&s.ContentType, "kube-api-content-type", s.ContentType, "ContentType of requests sent to apiserver. Passing application/vnd.kubernetes.protobuf is an experimental feature now.")
|
fs.StringVar(&s.ContentType, "kube-api-content-type", s.ContentType, "ContentType of requests sent to apiserver. Passing application/vnd.kubernetes.protobuf is an experimental feature now.")
|
||||||
fs.Float32Var(&s.APIServerQPS, "federated-api-qps", s.APIServerQPS, "QPS to use while talking with federation apiserver")
|
fs.Float32Var(&s.APIServerQPS, "federated-api-qps", s.APIServerQPS, "QPS to use while talking with federation apiserver")
|
||||||
fs.IntVar(&s.APIServerBurst, "federated-api-burst", s.APIServerBurst, "Burst to use while talking with federation apiserver")
|
fs.IntVar(&s.APIServerBurst, "federated-api-burst", s.APIServerBurst, "Burst to use while talking with federation apiserver")
|
||||||
|
fs.StringVar(&s.DnsProvider, "dns-provider", s.DnsProvider, "DNS provider. Valid values are: "+fmt.Sprintf("%q", dnsprovider.RegisteredDnsProviders()))
|
||||||
|
fs.StringVar(&s.DnsConfigFile, "dns-provider-config", s.DnsConfigFile, "Path to config file for configuring DNS provider.")
|
||||||
leaderelection.BindFlags(&s.LeaderElection, fs)
|
leaderelection.BindFlags(&s.LeaderElection, fs)
|
||||||
}
|
}
|
||||||
|
26
federation/cmd/federation-controller-manager/app/plugins.go
Normal file
26
federation/cmd/federation-controller-manager/app/plugins.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||||
|
|
||||||
|
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 app
|
||||||
|
|
||||||
|
// This file exists to force the desired plugin implementations to be linked.
|
||||||
|
// This should probably be part of some configuration fed into the build for a
|
||||||
|
// given binary target.
|
||||||
|
import (
|
||||||
|
// DNS providers
|
||||||
|
_ "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/aws/route53"
|
||||||
|
_ "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns"
|
||||||
|
)
|
@ -19,6 +19,8 @@ spec:
|
|||||||
command:
|
command:
|
||||||
- /usr/local/bin/federation-controller-manager
|
- /usr/local/bin/federation-controller-manager
|
||||||
- --master=https://{{.FEDERATION_APISERVER_DEPLOYMENT_NAME}}:443
|
- --master=https://{{.FEDERATION_APISERVER_DEPLOYMENT_NAME}}:443
|
||||||
|
- --dns-provider={{.FEDERATION_DNS_PROVIDER}}
|
||||||
|
- --dns-provider-config={{.FEDERATION_DNS_PROVIDER_CONFIG}}
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 443
|
- containerPort: 443
|
||||||
name: https
|
name: https
|
||||||
|
@ -62,6 +62,17 @@ func GetDnsProvider(name string, config io.Reader) (Interface, error) {
|
|||||||
return f(config)
|
return f(config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns a list of registered dns providers.
|
||||||
|
func RegisteredDnsProviders() []string {
|
||||||
|
registeredProviders := make([]string, len(providers))
|
||||||
|
i := 0
|
||||||
|
for provider := range providers {
|
||||||
|
registeredProviders[i] = provider
|
||||||
|
i = i + 1
|
||||||
|
}
|
||||||
|
return registeredProviders
|
||||||
|
}
|
||||||
|
|
||||||
// InitDnsProvider creates an instance of the named DNS provider.
|
// InitDnsProvider creates an instance of the named DNS provider.
|
||||||
func InitDnsProvider(name string, configFilePath string) (Interface, error) {
|
func InitDnsProvider(name string, configFilePath string) (Interface, error) {
|
||||||
var dns Interface
|
var dns Interface
|
||||||
|
@ -99,6 +99,8 @@ deserialization-cache-size
|
|||||||
dest-file
|
dest-file
|
||||||
disable-filter
|
disable-filter
|
||||||
dns-port
|
dns-port
|
||||||
|
dns-provider
|
||||||
|
dns-provider-config
|
||||||
docker-email
|
docker-email
|
||||||
docker-endpoint
|
docker-endpoint
|
||||||
docker-exec-handler
|
docker-exec-handler
|
||||||
|
Loading…
Reference in New Issue
Block a user