Merge pull request #8431 from johngmyers/remove-v1alpha1

Remove v1alpha1 API
This commit is contained in:
Kubernetes Prow Robot 2020-03-29 15:49:53 -07:00 committed by GitHub
commit b09a6920cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
85 changed files with 31 additions and 15526 deletions

View File

@ -596,25 +596,20 @@ apimachinery: apimachinery-codegen goimports
.PHONY: apimachinery-codegen
apimachinery-codegen:
sh -c hack/make-apimachinery.sh
${GOPATH}/bin/conversion-gen ${API_OPTIONS} --skip-unsafe=true --input-dirs k8s.io/kops/pkg/apis/kops/v1alpha1 --v=0 --output-file-base=zz_generated.conversion \
--go-header-file "hack/boilerplate/boilerplate.go.txt"
${GOPATH}/bin/conversion-gen ${API_OPTIONS} --skip-unsafe=true --input-dirs k8s.io/kops/pkg/apis/kops/v1alpha2 --v=0 --output-file-base=zz_generated.conversion \
--go-header-file "hack/boilerplate/boilerplate.go.txt"
${GOPATH}/bin/deepcopy-gen ${API_OPTIONS} --input-dirs k8s.io/kops/pkg/apis/kops --v=0 --output-file-base=zz_generated.deepcopy \
--go-header-file "hack/boilerplate/boilerplate.go.txt"
${GOPATH}/bin/deepcopy-gen ${API_OPTIONS} --input-dirs k8s.io/kops/pkg/apis/kops/v1alpha1 --v=0 --output-file-base=zz_generated.deepcopy \
${GOPATH}/bin/deepcopy-gen ${API_OPTIONS} --input-dirs k8s.io/kops/pkg/apis/kops/v1alpha2 --v=0 --output-file-base=zz_generated.deepcopy \
--go-header-file "hack/boilerplate/boilerplate.go.txt"
${GOPATH}/bin/defaulter-gen ${API_OPTIONS} --input-dirs k8s.io/kops/pkg/apis/kops/v1alpha1 --v=0 --output-file-base=zz_generated.defaults \
--go-header-file "hack/boilerplate/boilerplate.go.txt"
${GOPATH}/bin/defaulter-gen ${API_OPTIONS} --input-dirs k8s.io/kops/pkg/apis/kops/v1alpha2 --v=0 --output-file-base=zz_generated.defaults \
--go-header-file "hack/boilerplate/boilerplate.go.txt"
#go install github.com/ugorji/go/codec/codecgen
# codecgen works only if invoked from directory where the file is located.
#cd pkg/apis/kops/ && ~/k8s/bin/codecgen -d 1234 -o types.generated.go instancegroup.go cluster.go
${GOPATH}/bin/client-gen ${API_OPTIONS} --input-base k8s.io/kops/pkg/apis/ --input="kops/,kops/v1alpha1,kops/v1alpha2" --clientset-path k8s.io/kops/pkg/client/clientset_generated/ \
${GOPATH}/bin/client-gen ${API_OPTIONS} --input-base k8s.io/kops/pkg/apis/ --input="kops/,kops/v1alpha2" --clientset-path k8s.io/kops/pkg/client/clientset_generated/ \
--go-header-file "hack/boilerplate/boilerplate.go.txt"
${GOPATH}/bin/client-gen ${API_OPTIONS} --clientset-name="clientset" --input-base k8s.io/kops/pkg/apis/ --input="kops/,kops/v1alpha1,kops/v1alpha2" --clientset-path k8s.io/kops/pkg/client/clientset_generated/ \
${GOPATH}/bin/client-gen ${API_OPTIONS} --clientset-name="clientset" --input-base k8s.io/kops/pkg/apis/ --input="kops/,kops/v1alpha2" --clientset-path k8s.io/kops/pkg/client/clientset_generated/ \
--go-header-file "hack/boilerplate/boilerplate.go.txt"
.PHONY: verify-apimachinery

View File

@ -64,7 +64,6 @@ go_library(
"//pkg/apis/kops/model:go_default_library",
"//pkg/apis/kops/registry:go_default_library",
"//pkg/apis/kops/util:go_default_library",
"//pkg/apis/kops/v1alpha1:go_default_library",
"//pkg/apis/kops/validation:go_default_library",
"//pkg/assets:go_default_library",
"//pkg/bundle:go_default_library",
@ -113,7 +112,6 @@ go_library(
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
"//vendor/k8s.io/cli-runtime/pkg/genericclioptions:go_default_library",

View File

@ -23,11 +23,9 @@ import (
"github.com/spf13/cobra"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/klog"
"k8s.io/kops/cmd/kops/util"
kopsapi "k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/apis/kops/v1alpha1"
"k8s.io/kops/pkg/featureflag"
"k8s.io/kops/pkg/kopscodecs"
"k8s.io/kops/upup/pkg/fi/cloudup"
@ -137,11 +135,7 @@ func RunCreate(f *util.Factory, out io.Writer, c *CreateOptions) error {
// TODO: this does not support a JSON array
sections := text.SplitContentToSections(contents)
for _, section := range sections {
defaults := &schema.GroupVersionKind{
Group: v1alpha1.SchemeGroupVersion.Group,
Version: v1alpha1.SchemeGroupVersion.Version,
}
o, gvk, err := kopscodecs.Decode(section, defaults)
o, gvk, err := kopscodecs.Decode(section, nil)
if err != nil {
return fmt.Errorf("error parsing file %q: %v", f, err)
}

View File

@ -43,7 +43,6 @@ var MagicTimestamp = metav1.Time{Time: time.Date(2017, 1, 1, 0, 0, 0, 0, time.UT
// TestCreateClusterMinimal runs kops create cluster minimal.example.com --zones us-test-1a
func TestCreateClusterMinimal(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal", "v1alpha1")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal", "v1alpha2")
}
@ -59,9 +58,7 @@ func TestCreateClusterComplex(t *testing.T) {
// TestCreateClusterHA runs kops create cluster ha.example.com --zones us-test-1a,us-test-1b,us-test-1c --master-zones us-test-1a,us-test-1b,us-test-1c
func TestCreateClusterHA(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ha", "v1alpha1")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ha", "v1alpha2")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ha_encrypt", "v1alpha1")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ha_encrypt", "v1alpha2")
}
@ -72,49 +69,41 @@ func TestCreateClusterHAGCE(t *testing.T) {
// TestCreateClusterHASharedZones tests kops create cluster when the master count is bigger than the number of zones
func TestCreateClusterHASharedZones(t *testing.T) {
// Cannot be expressed in v1alpha1 API: runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ha_shared_zones", "v1alpha1")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ha_shared_zones", "v1alpha2")
}
// TestCreateClusterPrivate runs kops create cluster private.example.com --zones us-test-1a --master-zones us-test-1a
func TestCreateClusterPrivate(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/private", "v1alpha1")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/private", "v1alpha2")
}
// TestCreateClusterWithNGWSpecified runs kops create cluster private.example.com --zones us-test-1a --master-zones us-test-1a
func TestCreateClusterWithNGWSpecified(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ngwspecified", "v1alpha1")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ngwspecified", "v1alpha2")
}
// TestCreateClusterWithINGWSpecified runs kops create cluster private.example.com --zones us-test-1a --master-zones us-test-1a
func TestCreateClusterWithINGWSpecified(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ingwspecified", "v1alpha1")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ingwspecified", "v1alpha2")
}
// TestCreateClusterSharedVPC runs kops create cluster vpc.example.com --zones us-test-1a --master-zones us-test-1a --vpc vpc-12345678
func TestCreateClusterSharedVPC(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/shared_vpc", "v1alpha1")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/shared_vpc", "v1alpha2")
}
// TestCreateClusterSharedSubnets runs kops create cluster subnet.example.com --zones us-test-1a --master-zones us-test-1a --vpc vpc-12345678 --subnets subnet-1
func TestCreateClusterSharedSubnets(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/shared_subnets", "v1alpha1")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/shared_subnets", "v1alpha2")
}
// TestCreateClusterSharedSubnetsVpcLookup runs kops create cluster subnet.example.com --zones us-test-1a --master-zones us-test-1a --vpc --subnets subnet-1
func TestCreateClusterSharedSubnetsVpcLookup(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/shared_subnets_vpc_lookup", "v1alpha1")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/shared_subnets_vpc_lookup", "v1alpha2")
}
// TestCreateClusterPrivateSharedSubnets runs kops create cluster private-subnet.example.com --zones us-test-1a --master-zones us-test-1a --vpc vpc-12345678 --subnets subnet-1 --utility-subnets subnet-2
func TestCreateClusterPrivateSharedSubnets(t *testing.T) {
// Cannot be expressed in v1alpha1 API: runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/private_shared_subnets", "v1alpha1")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/private_shared_subnets", "v1alpha2")
}

View File

@ -21,12 +21,10 @@ import (
"io"
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/klog"
"k8s.io/kops/cmd/kops/util"
kopsapi "k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/apis/kops/v1alpha1"
"k8s.io/kops/pkg/kopscodecs"
"k8s.io/kops/pkg/sshcredentials"
"k8s.io/kops/util/pkg/text"
@ -115,11 +113,7 @@ func RunDelete(factory *util.Factory, out io.Writer, d *DeleteOptions) error {
sections := text.SplitContentToSections(contents)
for _, section := range sections {
defaults := &schema.GroupVersionKind{
Group: v1alpha1.SchemeGroupVersion.Group,
Version: v1alpha1.SchemeGroupVersion.Version,
}
o, gvk, err := kopscodecs.Decode(section, defaults)
o, gvk, err := kopscodecs.Decode(section, nil)
if err != nil {
return fmt.Errorf("error parsing file %q: %v", f, err)
}

View File

@ -52,8 +52,6 @@ const updateClusterTestBase = "../../tests/integration/update_cluster/"
// TestMinimal runs the test on a minimum configuration, similar to kops create cluster minimal.example.com --zones us-west-1a
func TestMinimal(t *testing.T) {
runTestAWS(t, "minimal.example.com", "minimal", "v1alpha0", false, 1, true, false, nil, true, false)
runTestAWS(t, "minimal.example.com", "minimal", "v1alpha1", false, 1, true, false, nil, true, false)
runTestAWS(t, "minimal.example.com", "minimal", "v1alpha2", false, 1, true, false, nil, true, false)
}
@ -69,7 +67,6 @@ func TestRestrictAccess(t *testing.T) {
// TestHA runs the test on a simple HA configuration, similar to kops create cluster minimal.example.com --zones us-west-1a,us-west-1b,us-west-1c --master-count=3
func TestHA(t *testing.T) {
runTestAWS(t, "ha.example.com", "ha", "v1alpha1", false, 3, true, false, nil, true, false)
runTestAWS(t, "ha.example.com", "ha", "v1alpha2", false, 3, true, false, nil, true, false)
}
@ -138,36 +135,27 @@ func TestMinimal_json(t *testing.T) {
featureflag.ParseFlags("-TerraformJSON")
}
defer unsetFeaureFlag()
runTestAWS(t, "minimal-json.example.com", "minimal-json", "v1alpha0", false, 1, true, false, nil, true, true)
}
// TestMinimal_141 runs the test on a configuration from 1.4.1 release
func TestMinimal_141(t *testing.T) {
runTestAWS(t, "minimal-141.example.com", "minimal-141", "v1alpha0", false, 1, true, false, nil, true, false)
runTestAWS(t, "minimal-json.example.com", "minimal-json", "v1alpha2", false, 1, true, false, nil, true, true)
}
// TestPrivateWeave runs the test on a configuration with private topology, weave networking
func TestPrivateWeave(t *testing.T) {
runTestAWS(t, "privateweave.example.com", "privateweave", "v1alpha1", true, 1, true, false, nil, true, false)
runTestAWS(t, "privateweave.example.com", "privateweave", "v1alpha2", true, 1, true, false, nil, true, false)
}
// TestPrivateFlannel runs the test on a configuration with private topology, flannel networking
func TestPrivateFlannel(t *testing.T) {
runTestAWS(t, "privateflannel.example.com", "privateflannel", "v1alpha1", true, 1, true, false, nil, true, false)
runTestAWS(t, "privateflannel.example.com", "privateflannel", "v1alpha2", true, 1, true, false, nil, true, false)
}
// TestPrivateCalico runs the test on a configuration with private topology, calico networking
func TestPrivateCalico(t *testing.T) {
runTestAWS(t, "privatecalico.example.com", "privatecalico", "v1alpha1", true, 1, true, false, nil, true, false)
runTestAWS(t, "privatecalico.example.com", "privatecalico", "v1alpha2", true, 1, true, false, nil, true, false)
runTestCloudformation(t, "privatecalico.example.com", "privatecalico", "v1alpha2", true, nil, true)
}
// TestPrivateCanal runs the test on a configuration with private topology, canal networking
func TestPrivateCanal(t *testing.T) {
runTestAWS(t, "privatecanal.example.com", "privatecanal", "v1alpha1", true, 1, true, false, nil, true, false)
runTestAWS(t, "privatecanal.example.com", "privatecanal", "v1alpha2", true, 1, true, false, nil, true, false)
}

View File

@ -6,7 +6,7 @@ jump through some hoops to use it.
Recommended reading: [kubernetes API convention doc](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md) and [kubernetes API changes doc](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api_changes.md).
The kops APIs live in [pkg/apis/kops](https://github.com/kubernetes/kops/tree/master/pkg/apis/kops), both in
that directory directly (the unversioned API) and in the versioned subdirectories (`v1alpha1`, `v1alpha2`).
that directory directly (the unversioned API) and in the versioned subdirectory (`v1alpha2`).
## Updating the generated API code
@ -19,7 +19,7 @@ need for `&& make`.
The most common task you will do will be to add a new field. This is relatively straightforward, because
it is backwards compatible (you have to make sure that the field is optional).
* Add the field to pkg/apis/kops, and then also to each versioned copy: pkg/apis/kops/v1alpha1, pkg/apis/kops/v1alpha2, etc
* Add the field to pkg/apis/kops, and then also to each versioned copy: pkg/apis/kops/v1alpha2, etc
* Run the apimachinery update as above (`make apimachinery && make crds && make`)
* You likely want to update the validation logic
* You likely want to update the defaulting logic

View File

@ -26,6 +26,8 @@
* A controller is now used to apply labels to nodes. If you are not using AWS, GCE or OpenStack your (non-master) nodes may not have labels applied correctly.
* The `kops/v1alpha1` API has been removed. Users of `kops replace` will need to supply v1alpha2 resources.
* Please see the notes in the 1.15 release about the apiGroup changing from kops to kops.k8s.io
# Required Actions

View File

@ -52,7 +52,6 @@ k8s.io/kops/pkg/apis/kops/install
k8s.io/kops/pkg/apis/kops/model
k8s.io/kops/pkg/apis/kops/registry
k8s.io/kops/pkg/apis/kops/util
k8s.io/kops/pkg/apis/kops/v1alpha1
k8s.io/kops/pkg/apis/kops/v1alpha2
k8s.io/kops/pkg/apis/kops/validation
k8s.io/kops/pkg/apis/nodeup
@ -64,8 +63,6 @@ k8s.io/kops/pkg/client/clientset_generated/clientset/fake
k8s.io/kops/pkg/client/clientset_generated/clientset/scheme
k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/internalversion
k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake
k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1
k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake
k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2
k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake
k8s.io/kops/pkg/client/clientset_generated/internalclientset
@ -73,8 +70,6 @@ k8s.io/kops/pkg/client/clientset_generated/internalclientset/fake
k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme
k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion
k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake
k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1
k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake
k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2
k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake
k8s.io/kops/pkg/client/simple

View File

@ -7,7 +7,6 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/kops:go_default_library",
"//pkg/apis/kops/v1alpha1:go_default_library",
"//pkg/apis/kops/v1alpha2:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library",

View File

@ -22,13 +22,11 @@ import (
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/apis/kops/v1alpha1"
"k8s.io/kops/pkg/apis/kops/v1alpha2"
)
func Install(scheme *runtime.Scheme) {
utilruntime.Must(kops.AddToScheme(scheme))
utilruntime.Must(v1alpha1.AddToScheme(scheme))
utilruntime.Must(v1alpha2.AddToScheme(scheme))
utilruntime.Must(scheme.SetVersionPriority(v1alpha2.SchemeGroupVersion, v1alpha1.SchemeGroupVersion))
utilruntime.Must(scheme.SetVersionPriority(v1alpha2.SchemeGroupVersion))
}

View File

@ -1,35 +0,0 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"bastion.go",
"cluster.go",
"componentconfig.go",
"containerdconfig.go",
"conversion.go",
"defaults.go",
"doc.go",
"dockerconfig.go",
"instancegroup.go",
"networking.go",
"register.go",
"sshcredential.go",
"topology.go",
"zz_generated.conversion.go",
"zz_generated.deepcopy.go",
"zz_generated.defaults.go",
],
importpath = "k8s.io/kops/pkg/apis/kops/v1alpha1",
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/kops:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
],
)

View File

@ -1,29 +0,0 @@
/*
Copyright 2019 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 v1alpha1
// +k8s:conversion-gen=false
type BastionSpec struct {
// Controls if a private topology should deploy a bastion host or not
// The bastion host is designed to be a simple, and secure bridge between
// the public subnet and the private subnet
Enable bool `json:"enable,omitempty"`
MachineType string `json:"machineType,omitempty"`
PublicName string `json:"name,omitempty"`
// IdleTimeout is the bastion's Loadbalancer idle timeout
IdleTimeout *int64 `json:"idleTimeout,omitempty"`
}

View File

@ -1,597 +0,0 @@
/*
Copyright 2019 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 v1alpha1
import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Cluster is a specific cluster wrapper
type Cluster struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec defines the behavior of a Cluster.
Spec ClusterSpec `json:"spec,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ClusterList is a list of clusters
type ClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Cluster `json:"items"`
}
// ClusterSpec defines the configuration for a cluster
type ClusterSpec struct {
// Channel we are following
Channel string `json:"channel,omitempty"`
// Additional addons that should be installed on the cluster
Addons []AddonSpec `json:"addons,omitempty"`
// ConfigBase is the path where we store configuration for the cluster
// This might be different that the location when the cluster spec itself is stored,
// both because this must be accessible to the cluster,
// and because it might be on a different cloud or storage system (etcd vs S3)
ConfigBase string `json:"configBase,omitempty"`
// The CloudProvider to use (aws or gce)
CloudProvider string `json:"cloudProvider,omitempty"`
// GossipConfig for the cluster assuming the use of gossip DNS
GossipConfig *GossipConfig `json:"gossipConfig,omitempty"`
// Container runtime to use for Kubernetes
ContainerRuntime string `json:"containerRuntime,omitempty"`
// The version of kubernetes to install (optional, and can be a "spec" like stable)
KubernetesVersion string `json:"kubernetesVersion,omitempty"`
// Configuration of zones we are targeting
Zones []*ClusterZoneSpec `json:"zones,omitempty"`
// Project is the cloud project we should use, required on GCE
Project string `json:"project,omitempty"`
// MasterPublicName is the external DNS name for the master nodes
MasterPublicName string `json:"masterPublicName,omitempty"`
// MasterInternalName is the internal DNS name for the master nodes
MasterInternalName string `json:"masterInternalName,omitempty"`
// NetworkCIDR is the CIDR used for the AWS VPC Network, or otherwise allocated to k8s
// This is a real CIDR, not the internal k8s network
// On AWS, it maps to the VPC CIDR. It is not required on GCE.
NetworkCIDR string `json:"networkCIDR,omitempty"`
// AdditionalNetworkCIDRs is a list of additional CIDR used for the AWS VPC
// or otherwise allocated to k8s. This is a real CIDR, not the internal k8s network
// On AWS, it maps to any additional CIDRs added to a VPC.
AdditionalNetworkCIDRs []string `json:"additionalNetworkCIDRs,omitempty"`
// NetworkID is an identifier of a network, if we want to reuse/share an existing network (e.g. an AWS VPC)
NetworkID string `json:"networkID,omitempty"`
// Topology defines the type of network topology to use on the cluster - default public
// This is heavily weighted towards AWS for the time being, but should also be agnostic enough
// to port out to GCE later if needed
Topology *TopologySpec `json:"topology,omitempty"`
// SecretStore is the VFS path to where secrets are stored
SecretStore string `json:"secretStore,omitempty"`
// KeyStore is the VFS path to where SSL keys and certificates are stored
KeyStore string `json:"keyStore,omitempty"`
// ConfigStore is the VFS path to where the configuration (Cluster, InstanceGroups etc) is stored
ConfigStore string `json:"configStore,omitempty"`
// DNSZone is the DNS zone we should use when configuring DNS
// This is because some clouds let us define a managed zone foo.bar, and then have
// kubernetes.dev.foo.bar, without needing to define dev.foo.bar as a hosted zone.
// DNSZone will probably be a suffix of the MasterPublicName and MasterInternalName
// Note that DNSZone can either by the host name of the zone (containing dots),
// or can be an identifier for the zone.
DNSZone string `json:"dnsZone,omitempty"`
// DNSControllerGossipConfig for the cluster assuming the use of gossip DNS
DNSControllerGossipConfig *DNSControllerGossipConfig `json:"dnsControllerGossipConfig,omitempty"`
// AdditionalSANs adds additional Subject Alternate Names to apiserver cert that kops generates
AdditionalSANs []string `json:"additionalSans,omitempty"`
// ClusterDNSDomain is the suffix we use for internal DNS names (normally cluster.local)
ClusterDNSDomain string `json:"clusterDNSDomain,omitempty"`
// ClusterName is a unique identifier for the cluster, and currently must be a DNS name
//ClusterName string `json:",omitempty"`
Multizone *bool `json:"multizone,omitempty"`
// ServiceClusterIPRange is the CIDR, from the internal network, where we allocate IPs for services
ServiceClusterIPRange string `json:"serviceClusterIPRange,omitempty"`
// PodCIDR is the CIDR from which we allocate IPs for pods
PodCIDR string `json:"podCIDR,omitempty"`
// NonMasqueradeCIDR is the CIDR for the internal k8s network (on which pods & services live)
// It cannot overlap ServiceClusterIPRange
NonMasqueradeCIDR string `json:"nonMasqueradeCIDR,omitempty"`
// AdminAccess determines the permitted access to the admin endpoints (SSH & master HTTPS)
// Currently only a single CIDR is supported (though a richer grammar could be added in future)
AdminAccess []string `json:"adminAccess,omitempty"`
// IsolateMasters determines whether we should lock down masters so that they are not on the pod network.
// true is the kube-up behaviour, but it is very surprising: it means that daemonsets only work on the master
// if they have hostNetwork=true.
// false is now the default, and it will:
// * give the master a normal PodCIDR
// * run kube-proxy on the master
// * enable debugging handlers on the master, so kubectl logs works
IsolateMasters *bool `json:"isolateMasters,omitempty"`
// UpdatePolicy determines the policy for applying upgrades automatically.
// Valid values:
// 'external' do not apply updates automatically - they are applied manually or by an external system
// missing: default policy (currently OS security upgrades that do not require a reboot)
UpdatePolicy *string `json:"updatePolicy,omitempty"`
// ExternalPolicies allows the insertion of pre-existing managed policies on IG Roles
ExternalPolicies *map[string][]string `json:"externalPolicies,omitempty"`
// Additional policies to add for roles
AdditionalPolicies *map[string]string `json:"additionalPolicies,omitempty"`
// A collection of files assets for deployed cluster wide
FileAssets []FileAssetSpec `json:"fileAssets,omitempty"`
// HTTPProxy defines connection information to support use of a private cluster behind an forward HTTP Proxy
EgressProxy *EgressProxySpec `json:"egressProxy,omitempty"`
// SSHKeyName specifies a preexisting SSH key to use
SSHKeyName *string `json:"sshKeyName,omitempty"`
// EtcdClusters stores the configuration for each cluster
EtcdClusters []*EtcdClusterSpec `json:"etcdClusters,omitempty"`
// Component configurations
Containerd *ContainerdConfig `json:"containerd,omitempty"`
Docker *DockerConfig `json:"docker,omitempty"`
KubeDNS *KubeDNSConfig `json:"kubeDNS,omitempty"`
KubeAPIServer *KubeAPIServerConfig `json:"kubeAPIServer,omitempty"`
KubeControllerManager *KubeControllerManagerConfig `json:"kubeControllerManager,omitempty"`
ExternalCloudControllerManager *CloudControllerManagerConfig `json:"cloudControllerManager,omitempty"`
KubeScheduler *KubeSchedulerConfig `json:"kubeScheduler,omitempty"`
KubeProxy *KubeProxyConfig `json:"kubeProxy,omitempty"`
Kubelet *KubeletConfigSpec `json:"kubelet,omitempty"`
MasterKubelet *KubeletConfigSpec `json:"masterKubelet,omitempty"`
CloudConfig *CloudConfiguration `json:"cloudConfig,omitempty"`
ExternalDNS *ExternalDNSConfig `json:"externalDns,omitempty"`
// Networking configuration
Networking *NetworkingSpec `json:"networking,omitempty"`
// API field controls how the API is exposed outside the cluster
API *AccessSpec `json:"api,omitempty"`
// Authentication field controls how the cluster is configured for authentication
Authentication *AuthenticationSpec `json:"authentication,omitempty"`
// Authorization field controls how the cluster is configured for authorization
Authorization *AuthorizationSpec `json:"authorization,omitempty"`
// NodeAuthorization defined the custom node authorization configuration
NodeAuthorization *NodeAuthorizationSpec `json:"nodeAuthorization,omitempty"`
// Tags for AWS instance groups
CloudLabels map[string]string `json:"cloudLabels,omitempty"`
// Hooks for custom actions e.g. on first installation
Hooks []HookSpec `json:"hooks,omitempty"`
// Alternative locations for files and containers
Assets *Assets `json:"assets,omitempty"`
// IAM field adds control over the IAM security policies applied to resources
IAM *IAMSpec `json:"iam,omitempty"`
// EncryptionConfig holds the encryption config
EncryptionConfig *bool `json:"encryptionConfig,omitempty"`
// DisableSubnetTags controls if subnets are tagged in AWS
DisableSubnetTags bool `json:"DisableSubnetTags,omitempty"`
// Target allows for us to nest extra config for targets such as terraform
Target *TargetSpec `json:"target,omitempty"`
// UseHostCertificates will mount /etc/ssl/certs to inside needed containers.
// This is needed if some APIs do have self-signed certs
UseHostCertificates *bool `json:"useHostCertificates,omitempty"`
// SysctlParameters will configure kernel parameters using sysctl(8). When
// specified, each parameter must follow the form variable=value, the way
// it would appear in sysctl.conf.
SysctlParameters []string `json:"sysctlParameters,omitempty"`
// RollingUpdate defines the default rolling-update settings for instance groups
RollingUpdate *RollingUpdate `json:"rollingUpdate,omitempty"`
}
// NodeAuthorizationSpec is used to node authorization
type NodeAuthorizationSpec struct {
// NodeAuthorizer defined the configuration for the node authorizer
NodeAuthorizer *NodeAuthorizerSpec `json:"nodeAuthorizer,omitempty"`
}
// NodeAuthorizerSpec defines the configuration for a node authorizer
type NodeAuthorizerSpec struct {
// Authorizer is the authorizer to use
Authorizer string `json:"authorizer,omitempty"`
// Features is a series of authorizer features to enable or disable
Features *[]string `json:"features,omitempty"`
// Image is the location of container
Image string `json:"image,omitempty"`
// NodeURL is the node authorization service url
NodeURL string `json:"nodeURL,omitempty"`
// Port is the port the service is running on the master
Port int `json:"port,omitempty"`
// Interval the time between retires for authorization request
Interval *metav1.Duration `json:"interval,omitempty"`
// Timeout the max time for authorization request
Timeout *metav1.Duration `json:"timeout,omitempty"`
// TokenTTL is the max ttl for an issued token
TokenTTL *metav1.Duration `json:"tokenTTL,omitempty"`
}
// AddonSpec defines an addon that we want to install in the cluster
type AddonSpec struct {
// Manifest is a path to the manifest that defines the addon
Manifest string `json:"manifest,omitempty"`
}
// FileAssetSpec defines the structure for a file asset
type FileAssetSpec struct {
// Name is a shortened reference to the asset
Name string `json:"name,omitempty"`
// Path is the location this file should reside
Path string `json:"path,omitempty"`
// Roles is a list of roles the file asset should be applied, defaults to all
Roles []InstanceGroupRole `json:"roles,omitempty"`
// Content is the contents of the file
Content string `json:"content,omitempty"`
// IsBase64 indicates the contents is base64 encoded
IsBase64 bool `json:"isBase64,omitempty"`
}
// Assets defined the privately hosted assets
type Assets struct {
// ContainerRegistry is a url for to a docker registry
ContainerRegistry *string `json:"containerRegistry,omitempty"`
// FileRepository is the url for a private file serving repository
FileRepository *string `json:"fileRepository,omitempty"`
// ContainerProxy is a url for a pull-through proxy of a docker registry
ContainerProxy *string `json:"containerProxy,omitempty"`
}
// IAMSpec adds control over the IAM security policies applied to resources
type IAMSpec struct {
Legacy bool `json:"legacy"`
AllowContainerRegistry bool `json:"allowContainerRegistry,omitempty"`
}
// HookSpec is a definition hook
type HookSpec struct {
// Name is an optional name for the hook, otherwise the name is kops-hook-<index>
Name string `json:"name,omitempty"`
// Disabled indicates if you want the unit switched off
Disabled bool `json:"disabled,omitempty"`
// Roles is an optional list of roles the hook should be rolled out to, defaults to all
Roles []InstanceGroupRole `json:"roles,omitempty"`
// Requires is a series of systemd units the action requires
Requires []string `json:"requires,omitempty"`
// Before is a series of systemd units which this hook must run before
Before []string `json:"before,omitempty"`
// ExecContainer is the image itself
ExecContainer *ExecContainerAction `json:"execContainer,omitempty"`
// Manifest is a raw systemd unit file
Manifest string `json:"manifest,omitempty"`
// UseRawManifest indicates that the contents of Manifest should be used as the contents
// of the systemd unit, unmodified. Before and Requires are ignored when used together
// with this value (and validation shouldn't allow them to be set)
UseRawManifest bool `json:"useRawManifest,omitempty"`
}
// ExecContainerAction defines an hood action
type ExecContainerAction struct {
// Image is the docker image
Image string `json:"image,omitempty" `
// Command is the command supplied to the above image
Command []string `json:"command,omitempty"`
// Environment is a map of environment variables added to the hook
Environment map[string]string `json:"environment,omitempty"`
}
type AuthenticationSpec struct {
Kopeio *KopeioAuthenticationSpec `json:"kopeio,omitempty"`
Aws *AwsAuthenticationSpec `json:"aws,omitempty"`
}
func (s *AuthenticationSpec) IsEmpty() bool {
return s.Kopeio == nil && s.Aws == nil
}
type KopeioAuthenticationSpec struct {
}
type AwsAuthenticationSpec struct {
// Image is the AWS IAM Authenticator docker image to use
Image string `json:"image,omitempty"`
// MemoryRequest memory request of AWS IAM Authenticator container. Default 20Mi
MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"`
// CPURequest CPU request of AWS IAM Authenticator container. Default 10m
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
// MemoryLimit memory limit of AWS IAM Authenticator container. Default 20Mi
MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"`
// CPULimit CPU limit of AWS IAM Authenticator container. Default 10m
CPULimit *resource.Quantity `json:"cpuLimit,omitempty"`
}
type AuthorizationSpec struct {
AlwaysAllow *AlwaysAllowAuthorizationSpec `json:"alwaysAllow,omitempty"`
RBAC *RBACAuthorizationSpec `json:"rbac,omitempty"`
}
func (s *AuthorizationSpec) IsEmpty() bool {
return s.RBAC == nil && s.AlwaysAllow == nil
}
type RBACAuthorizationSpec struct {
}
type AlwaysAllowAuthorizationSpec struct {
}
// AccessSpec provides configuration details related to kubeapi dns and ELB access
type AccessSpec struct {
// DNS will be used to provide config on kube-apiserver ELB DNS
DNS *DNSAccessSpec `json:"dns,omitempty"`
// LoadBalancer is the configuration for the kube-apiserver ELB
LoadBalancer *LoadBalancerAccessSpec `json:"loadBalancer,omitempty"`
}
func (s *AccessSpec) IsEmpty() bool {
return s.DNS == nil && s.LoadBalancer == nil
}
type DNSAccessSpec struct {
}
// LoadBalancerType string describes LoadBalancer types (public, internal)
type LoadBalancerType string
const (
LoadBalancerTypePublic LoadBalancerType = "Public"
LoadBalancerTypeInternal LoadBalancerType = "Internal"
)
// LoadBalancerAccessSpec provides configuration details related to API LoadBalancer and its access
type LoadBalancerAccessSpec struct {
// Type of load balancer to create may Public or Internal.
Type LoadBalancerType `json:"type,omitempty"`
// IdleTimeoutSeconds sets the timeout of the api loadbalancer.
IdleTimeoutSeconds *int64 `json:"idleTimeoutSeconds,omitempty"`
// SecurityGroupOverride overrides the default Kops created SG for the load balancer.
SecurityGroupOverride *string `json:"securityGroupOverride,omitempty"`
// AdditionalSecurityGroups attaches additional security groups (e.g. sg-123456).
AdditionalSecurityGroups []string `json:"additionalSecurityGroups,omitempty"`
// UseForInternalApi indicates whether the LB should be used by the kubelet
UseForInternalApi bool `json:"useForInternalApi,omitempty"`
// SSLCertificate allows you to specify the ACM cert to be used the LB
SSLCertificate string `json:"sslCertificate,omitempty"`
// CrossZoneLoadBalancing allows you to enable the cross zone load balancing
CrossZoneLoadBalancing *bool `json:"crossZoneLoadBalancing,omitempty"`
}
// KubeDNSConfig defines the kube dns configuration
type KubeDNSConfig struct {
// CacheMaxSize is the maximum entries to keep in dnsmasq
CacheMaxSize int `json:"cacheMaxSize,omitempty"`
// CacheMaxConcurrent is the maximum number of concurrent queries for dnsmasq
CacheMaxConcurrent int `json:"cacheMaxConcurrent,omitempty"`
// CoreDNSImage is used to override the default image used for CoreDNS
CoreDNSImage string `json:"coreDNSImage,omitempty"`
// Domain is the dns domain
Domain string `json:"domain,omitempty"`
// ExternalCoreFile is used to provide a complete CoreDNS CoreFile by the user - ignores other provided flags which modify the CoreFile.
ExternalCoreFile string `json:"externalCoreFile,omitempty"`
// Image is the name of the docker image to run - @deprecated as this is now in the addon
Image string `json:"image,omitempty"`
// Replicas is the number of pod replicas - @deprecated as this is now in the addon, and controlled by autoscaler
Replicas int `json:"replicas,omitempty"`
// Provider indicates whether CoreDNS or kube-dns will be the default service discovery.
Provider string `json:"provider,omitempty"`
// ServerIP is the server ip
ServerIP string `json:"serverIP,omitempty"`
// StubDomains redirects a domains to another DNS service
StubDomains map[string][]string `json:"stubDomains,omitempty"`
// UpstreamNameservers sets the upstream nameservers for queries not on the cluster domain
UpstreamNameservers []string `json:"upstreamNameservers,omitempty"`
// MemoryRequest specifies the memory requests of each dns container in the cluster. Default 70m.
MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"`
// CPURequest specifies the cpu requests of each dns container in the cluster. Default 100m.
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
// MemoryLimit specifies the memory limit of each dns container in the cluster. Default 170m.
MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"`
}
// ExternalDNSConfig are options of the dns-controller
type ExternalDNSConfig struct {
// Disable indicates we do not wish to run the dns-controller addon
Disable bool `json:"disable,omitempty"`
// WatchIngress indicates you want the dns-controller to watch and create dns entries for ingress resources
WatchIngress *bool `json:"watchIngress,omitempty"`
// WatchNamespace is namespace to watch, defaults to all (use to control whom can creates dns entries)
WatchNamespace string `json:"watchNamespace,omitempty"`
}
// EtcdProviderType describes etcd cluster provisioning types (Standalone, Manager)
type EtcdProviderType string
const (
EtcdProviderTypeManager EtcdProviderType = "Manager"
EtcdProviderTypeLegacy EtcdProviderType = "Legacy"
)
// EtcdClusterSpec is the etcd cluster specification
type EtcdClusterSpec struct {
// Name is the name of the etcd cluster (main, events etc)
Name string `json:"name,omitempty"`
// Provider is the provider used to run etcd: standalone, manager.
// We default to manager for kubernetes 1.11 or if the manager is configured; otherwise standalone.
Provider EtcdProviderType `json:"provider,omitempty"`
// Members stores the configurations for each member of the cluster (including the data volume)
Members []*EtcdMemberSpec `json:"etcdMembers,omitempty"`
// EnableTLSAuth indicates client and peer TLS auth should be enforced
EnableTLSAuth bool `json:"enableTLSAuth,omitempty"`
// EnableEtcdTLS indicates the etcd service should use TLS between peers and clients
EnableEtcdTLS bool `json:"enableEtcdTLS,omitempty"`
// Version is the version of etcd to run i.e. 2.1.2, 3.0.17 etcd
Version string `json:"version,omitempty"`
// LeaderElectionTimeout is the time (in milliseconds) for an etcd leader election timeout
LeaderElectionTimeout *metav1.Duration `json:"leaderElectionTimeout,omitempty"`
// HeartbeatInterval is the time (in milliseconds) for an etcd heartbeat interval
HeartbeatInterval *metav1.Duration `json:"heartbeatInterval,omitempty"`
// Image is the etcd docker image to use. Setting this will ignore the Version specified.
Image string `json:"image,omitempty"`
// Backups describes how we do backups of etcd
Backups *EtcdBackupSpec `json:"backups,omitempty"`
// Manager describes the manager configuration
Manager *EtcdManagerSpec `json:"manager,omitempty"`
// MemoryRequest specifies the memory requests of each etcd container in the cluster.
MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"`
// CPURequest specifies the cpu requests of each etcd container in the cluster.
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
}
// EtcdBackupSpec describes how we want to do backups of etcd
type EtcdBackupSpec struct {
// BackupStore is the VFS path where we will read/write backup data
BackupStore string `json:"backupStore,omitempty"`
// Image is the etcd backup manager image to use. Setting this will create a sidecar container in the etcd pod with the specified image.
Image string `json:"image,omitempty"`
}
// EtcdManagerSpec describes how we configure the etcd manager
type EtcdManagerSpec struct {
// Image is the etcd manager image to use.
Image string `json:"image,omitempty"`
// Env allows users to pass in env variables to the etcd-manager container.
// Variables starting with ETCD_ will be further passed down to the etcd process.
// This allows etcd setting to be configured/overwriten. No config validation is done.
// A list of etcd config ENV vars can be found at https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/configuration.md
Env []EnvVar `json:"env,omitempty"`
}
// EtcdMemberSpec is a specification for a etcd member
type EtcdMemberSpec struct {
// Name is the name of the member within the etcd cluster
Name string `json:"name,omitempty"`
// Zone is the zone the member lives
Zone *string `json:"zone,omitempty"`
// VolumeType is the underlying cloud storage class
VolumeType *string `json:"volumeType,omitempty"`
// If volume type is io1, then we need to specify the number of Iops.
VolumeIops *int32 `json:"volumeIops,omitempty"`
// VolumeSize is the underlying cloud volume size
VolumeSize *int32 `json:"volumeSize,omitempty"`
// KmsKeyId is a AWS KMS ID used to encrypt the volume
KmsKeyId *string `json:"kmsKeyId,omitempty"`
// EncryptedVolume indicates you want to encrypt the volume
EncryptedVolume *bool `json:"encryptedVolume,omitempty"`
}
type ClusterZoneSpec struct {
Name string `json:"name,omitempty"`
// For Private network topologies we need to have 2
// CIDR blocks.
// 1 - Utility (Public) Subnets
// 2 - Operating (Private) Subnets
PrivateCIDR string `json:"privateCIDR,omitempty"`
CIDR string `json:"cidr,omitempty"`
// ProviderID is the cloud provider id for the objects associated with the zone (the subnet on AWS)
ProviderID string `json:"id,omitempty"`
// Egress defines the method of traffic egress for this subnet
Egress string `json:"egress,omitempty"`
}
type EgressProxySpec struct {
HTTPProxy HTTPProxy `json:"httpProxy,omitempty"`
ProxyExcludes string `json:"excludes,omitempty"`
}
type HTTPProxy struct {
Host string `json:"host,omitempty"`
Port int `json:"port,omitempty"`
// TODO #3070
// User string `json:"user,omitempty"`
// Password string `json:"password,omitempty"`
}
// TargetSpec allows for specifying target config in an extensible way
type TargetSpec struct {
Terraform *TerraformSpec `json:"terraform,omitempty"`
}
func (t *TargetSpec) IsEmpty() bool {
return t.Terraform == nil
}
// TerraformSpec allows us to specify terraform config in an extensible way
type TerraformSpec struct {
// ProviderExtraConfig contains key/value pairs to add to the rendered terraform "provider" block
ProviderExtraConfig *map[string]string `json:"providerExtraConfig,omitempty"`
}
func (t *TerraformSpec) IsEmpty() bool {
return t.ProviderExtraConfig == nil
}
// EnvVar represents an environment variable present in a Container.
type EnvVar struct {
// Name of the environment variable. Must be a C_IDENTIFIER.
Name string `json:"name"`
// Variable references $(VAR_NAME) are expanded
// using the previous defined environment variables in the container and
// any service environment variables. If a variable cannot be resolved,
// the reference in the input string will be unchanged. The $(VAR_NAME)
// syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped
// references will never be expanded, regardless of whether the variable
// exists or not.
// Defaults to "".
// +optional
Value string `json:"value,omitempty"`
}
type GossipConfig struct {
Protocol *string `json:"protocol,omitempty"`
Listen *string `json:"listen,omitempty"`
Secret *string `json:"secret,omitempty"`
Secondary *GossipConfig `json:"secondary,omitempty"`
}
type DNSControllerGossipConfig struct {
Protocol *string `json:"protocol,omitempty"`
Listen *string `json:"listen,omitempty"`
Secret *string `json:"secret,omitempty"`
Secondary *DNSControllerGossipConfig `json:"secondary,omitempty"`
Seed *string `json:"seed,omitempty"`
}
type RollingUpdate struct {
// MaxUnavailable is the maximum number of nodes that can be unavailable during the update.
// The value can be an absolute number (for example 5) or a percentage of desired
// nodes (for example 10%).
// The absolute number is calculated from a percentage by rounding down.
// A value of 0 for both this and MaxSurge disables rolling updates.
// Defaults to 1 if MaxSurge is 0, otherwise defaults to 0.
// Example: when this is set to 30%, the InstanceGroup can be scaled
// down to 70% of desired nodes immediately when the rolling update
// starts. Once new nodes are ready, more old nodes can be drained,
// ensuring that the total number of nodes available at all times
// during the update is at least 70% of desired nodes.
// +optional
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
// MaxSurge is the maximum number of extra nodes that can be created
// during the update.
// The value can be an absolute number (for example 5) or a percentage of
// desired machines (for example 10%).
// The absolute number is calculated from a percentage by rounding up.
// A value of 0 for both this and MaxUnavailable disables rolling updates.
// Has no effect on instance groups with role "Master".
// Defaults to 1 on AWS, 0 otherwise.
// Example: when this is set to 30%, the InstanceGroup can be scaled
// up immediately when the rolling update starts, such that the total
// number of old and new nodes do not exceed 130% of desired
// nodes.
// +optional
MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"`
}

View File

@ -1,735 +0,0 @@
/*
Copyright 2019 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 v1alpha1
import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// KubeletConfigSpec defines the kubelet configuration
type KubeletConfigSpec struct {
// APIServers is not used for clusters version 1.6 and later - flag removed
APIServers string `json:"apiServers,omitempty" flag:"api-servers"`
// AnonymousAuth permits you to control auth to the kubelet api
AnonymousAuth *bool `json:"anonymousAuth,omitempty" flag:"anonymous-auth"`
// AuthorizationMode is the authorization mode the kubelet is running in
AuthorizationMode string `json:"authorizationMode,omitempty" flag:"authorization-mode"`
// BootstrapKubeconfig is the path to a kubeconfig file that will be used to get client certificate for kube
BootstrapKubeconfig string `json:"bootstrapKubeconfig,omitempty" flag:"bootstrap-kubeconfig"`
// ClientCAFile is the path to a CA certificate
ClientCAFile string `json:"clientCaFile,omitempty" flag:"client-ca-file"`
// TODO: Remove unused TLSCertFile
TLSCertFile string `json:"tlsCertFile,omitempty" flag:"tls-cert-file"`
// TODO: Remove unused TLSPrivateKeyFile
TLSPrivateKeyFile string `json:"tlsPrivateKeyFile,omitempty" flag:"tls-private-key-file"`
// TLSCipherSuites indicates the allowed TLS cipher suite
TLSCipherSuites []string `json:"tlsCipherSuites,omitempty" flag:"tls-cipher-suites"`
// TLSMinVersion indicates the minimum TLS version allowed
TLSMinVersion string `json:"tlsMinVersion,omitempty" flag:"tls-min-version"`
// KubeconfigPath is the path of kubeconfig for the kubelet
KubeconfigPath string `json:"kubeconfigPath,omitempty" flag:"kubeconfig"`
// RequireKubeconfig indicates a kubeconfig is required
RequireKubeconfig *bool `json:"requireKubeconfig,omitempty" flag:"require-kubeconfig"`
// LogLevel is the logging level of the kubelet
LogLevel *int32 `json:"logLevel,omitempty" flag:"v" flag-empty:"0"`
// config is the path to the config file or directory of files
PodManifestPath string `json:"podManifestPath,omitempty" flag:"pod-manifest-path"`
// HostnameOverride is the hostname used to identify the kubelet instead of the actual hostname.
HostnameOverride string `json:"hostnameOverride,omitempty" flag:"hostname-override"`
// PodInfraContainerImage is the image whose network/ipc containers in each pod will use.
PodInfraContainerImage string `json:"podInfraContainerImage,omitempty" flag:"pod-infra-container-image"`
// SeccompProfileRoot is the directory path for seccomp profiles.
SeccompProfileRoot *string `json:"seccompProfileRoot,omitempty" flag:"seccomp-profile-root"`
// AllowPrivileged enables containers to request privileged mode (defaults to false)
AllowPrivileged *bool `json:"allowPrivileged,omitempty" flag:"allow-privileged"`
// EnableDebuggingHandlers enables server endpoints for log collection and local running of containers and commands
EnableDebuggingHandlers *bool `json:"enableDebuggingHandlers,omitempty" flag:"enable-debugging-handlers"`
// RegisterNode enables automatic registration with the apiserver.
RegisterNode *bool `json:"registerNode,omitempty" flag:"register-node"`
// NodeStatusUpdateFrequency Specifies how often kubelet posts node status to master (default 10s)
// must work with nodeMonitorGracePeriod in KubeControllerManagerConfig.
NodeStatusUpdateFrequency *metav1.Duration `json:"nodeStatusUpdateFrequency,omitempty" flag:"node-status-update-frequency"`
// ClusterDomain is the DNS domain for this cluster
ClusterDomain string `json:"clusterDomain,omitempty" flag:"cluster-domain"`
// ClusterDNS is the IP address for a cluster DNS server
ClusterDNS string `json:"clusterDNS,omitempty" flag:"cluster-dns"`
// NetworkPluginName is the name of the network plugin to be invoked for various events in kubelet/pod lifecycle
NetworkPluginName string `json:"networkPluginName,omitempty" flag:"network-plugin"`
// CloudProvider is the provider for cloud services.
CloudProvider string `json:"cloudProvider,omitempty" flag:"cloud-provider"`
// KubeletCgroups is the absolute name of cgroups to isolate the kubelet in.
KubeletCgroups string `json:"kubeletCgroups,omitempty" flag:"kubelet-cgroups"`
// Cgroups that container runtime is expected to be isolated in.
RuntimeCgroups string `json:"runtimeCgroups,omitempty" flag:"runtime-cgroups"`
// ReadOnlyPort is the port used by the kubelet api for read-only access (default 10255)
ReadOnlyPort *int32 `json:"readOnlyPort,omitempty" flag:"read-only-port"`
// SystemCgroups is absolute name of cgroups in which to place
// all non-kernel processes that are not already in a container. Empty
// for no container. Rolling back the flag requires a reboot.
SystemCgroups string `json:"systemCgroups,omitempty" flag:"system-cgroups"`
// cgroupRoot is the root cgroup to use for pods. This is handled by the container runtime on a best effort basis.
CgroupRoot string `json:"cgroupRoot,omitempty" flag:"cgroup-root"`
// configureCBR0 enables the kubelet to configure cbr0 based on Node.Spec.PodCIDR.
ConfigureCBR0 *bool `json:"configureCbr0,omitempty" flag:"configure-cbr0"`
// How should the kubelet configure the container bridge for hairpin packets.
// Setting this flag allows endpoints in a Service to loadbalance back to
// themselves if they should try to access their own Service. Values:
// "promiscuous-bridge": make the container bridge promiscuous.
// "hairpin-veth": set the hairpin flag on container veth interfaces.
// "none": do nothing.
// Setting --configure-cbr0 to false implies that to achieve hairpin NAT
// one must set --hairpin-mode=veth-flag, because bridge assumes the
// existence of a container bridge named cbr0.
HairpinMode string `json:"hairpinMode,omitempty" flag:"hairpin-mode"`
// The node has babysitter process monitoring docker and kubelet. Removed as of 1.7
BabysitDaemons *bool `json:"babysitDaemons,omitempty" flag:"babysit-daemons"`
// MaxPods is the number of pods that can run on this Kubelet.
MaxPods *int32 `json:"maxPods,omitempty" flag:"max-pods"`
// NvidiaGPUs is the number of NVIDIA GPU devices on this node.
NvidiaGPUs int32 `json:"nvidiaGPUs,omitempty" flag:"experimental-nvidia-gpus" flag-empty:"0"`
// PodCIDR is the CIDR to use for pod IP addresses, only used in standalone mode.
// In cluster mode, this is obtained from the master.
PodCIDR string `json:"podCIDR,omitempty" flag:"pod-cidr"`
// ResolverConfig is the resolver configuration file used as the basis for the container DNS resolution configuration."), []
ResolverConfig *string `json:"resolvConf,omitempty" flag:"resolv-conf" flag-include-empty:"true"`
// ReconcileCIDR is Reconcile node CIDR with the CIDR specified by the
// API server. No-op if register-node or configure-cbr0 is false.
ReconcileCIDR *bool `json:"reconcileCIDR,omitempty" flag:"reconcile-cidr"`
// registerSchedulable tells the kubelet to register the node as schedulable. No-op if register-node is false.
RegisterSchedulable *bool `json:"registerSchedulable,omitempty" flag:"register-schedulable"`
//// SerializeImagePulls when enabled, tells the Kubelet to pull images one
//// at a time. We recommend *not* changing the default value on nodes that
//// run docker daemon with version < 1.9 or an Aufs storage backend.
//// Issue #10959 has more details.
SerializeImagePulls *bool `json:"serializeImagePulls,omitempty" flag:"serialize-image-pulls"`
// NodeLabels to add when registering the node in the cluster.
NodeLabels map[string]string `json:"nodeLabels,omitempty" flag:"node-labels"`
// NonMasqueradeCIDR configures masquerading: traffic to IPs outside this range will use IP masquerade.
NonMasqueradeCIDR string `json:"nonMasqueradeCIDR,omitempty" flag:"non-masquerade-cidr"`
// Enable gathering custom metrics.
EnableCustomMetrics *bool `json:"enableCustomMetrics,omitempty" flag:"enable-custom-metrics"`
// NetworkPluginMTU is the MTU to be passed to the network plugin,
// and overrides the default MTU for cases where it cannot be automatically
// computed (such as IPSEC).
NetworkPluginMTU *int32 `json:"networkPluginMTU,omitempty" flag:"network-plugin-mtu"`
// ImageGCHighThresholdPercent is the percent of disk usage after which
// image garbage collection is always run.
ImageGCHighThresholdPercent *int32 `json:"imageGCHighThresholdPercent,omitempty" flag:"image-gc-high-threshold"`
// ImageGCLowThresholdPercent is the percent of disk usage before which
// image garbage collection is never run. Lowest disk usage to garbage
// collect to.
ImageGCLowThresholdPercent *int32 `json:"imageGCLowThresholdPercent,omitempty" flag:"image-gc-low-threshold"`
// ImagePullProgressDeadline is the timeout for image pulls
// If no pulling progress is made before this deadline, the image pulling will be cancelled. (default 1m0s)
ImagePullProgressDeadline *metav1.Duration `json:"imagePullProgressDeadline,omitempty" flag:"image-pull-progress-deadline"`
// Comma-delimited list of hard eviction expressions. For example, 'memory.available<300Mi'.
EvictionHard *string `json:"evictionHard,omitempty" flag:"eviction-hard"`
// Comma-delimited list of soft eviction expressions. For example, 'memory.available<300Mi'.
EvictionSoft string `json:"evictionSoft,omitempty" flag:"eviction-soft"`
// Comma-delimited list of grace periods for each soft eviction signal. For example, 'memory.available=30s'.
EvictionSoftGracePeriod string `json:"evictionSoftGracePeriod,omitempty" flag:"eviction-soft-grace-period"`
// Duration for which the kubelet has to wait before transitioning out of an eviction pressure condition.
EvictionPressureTransitionPeriod *metav1.Duration `json:"evictionPressureTransitionPeriod,omitempty" flag:"eviction-pressure-transition-period" flag-empty:"0s"`
// Maximum allowed grace period (in seconds) to use when terminating pods in response to a soft eviction threshold being met.
EvictionMaxPodGracePeriod int32 `json:"evictionMaxPodGracePeriod,omitempty" flag:"eviction-max-pod-grace-period" flag-empty:"0"`
// Comma-delimited list of minimum reclaims (e.g. imagefs.available=2Gi) that describes the minimum amount of resource the kubelet will reclaim when performing a pod eviction if that resource is under pressure.
EvictionMinimumReclaim string `json:"evictionMinimumReclaim,omitempty" flag:"eviction-minimum-reclaim"`
// The full path of the directory in which to search for additional third party volume plugins (this path must be writeable, dependent on your choice of OS)
VolumePluginDirectory string `json:"volumePluginDirectory,omitempty" flag:"volume-plugin-dir"`
// Taints to add when registering a node in the cluster
Taints []string `json:"taints,omitempty" flag:"register-with-taints"`
// FeatureGates is set of key=value pairs that describe feature gates for alpha/experimental features.
FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"`
// Resource reservation for kubernetes system daemons like the kubelet, container runtime, node problem detector, etc.
KubeReserved map[string]string `json:"kubeReserved,omitempty" flag:"kube-reserved"`
// Control group for kube daemons.
KubeReservedCgroup string `json:"kubeReservedCgroup,omitempty" flag:"kube-reserved-cgroup"`
// Capture resource reservation for OS system daemons like sshd, udev, etc.
SystemReserved map[string]string `json:"systemReserved,omitempty" flag:"system-reserved"`
// Parent control group for OS system daemons.
SystemReservedCgroup string `json:"systemReservedCgroup,omitempty" flag:"system-reserved-cgroup"`
// Enforce Allocatable across pods whenever the overall usage across all pods exceeds Allocatable.
EnforceNodeAllocatable string `json:"enforceNodeAllocatable,omitempty" flag:"enforce-node-allocatable"`
// RuntimeRequestTimeout is timeout for runtime requests on - pull, logs, exec and attach
RuntimeRequestTimeout *metav1.Duration `json:"runtimeRequestTimeout,omitempty" flag:"runtime-request-timeout"`
// VolumeStatsAggPeriod is the interval for kubelet to calculate and cache the volume disk usage for all pods and volumes
VolumeStatsAggPeriod *metav1.Duration `json:"volumeStatsAggPeriod,omitempty" flag:"volume-stats-agg-period"`
// Tells the Kubelet to fail to start if swap is enabled on the node.
FailSwapOn *bool `json:"failSwapOn,omitempty" flag:"fail-swap-on"`
// ExperimentalAllowedUnsafeSysctls are passed to the kubelet config to whitelist allowable sysctls
// Was promoted to beta and renamed. https://github.com/kubernetes/kubernetes/pull/63717
ExperimentalAllowedUnsafeSysctls []string `json:"experimentalAllowedUnsafeSysctls,omitempty" flag:"experimental-allowed-unsafe-sysctls"`
// AllowedUnsafeSysctls are passed to the kubelet config to whitelist allowable sysctls
AllowedUnsafeSysctls []string `json:"allowedUnsafeSysctls,omitempty" flag:"allowed-unsafe-sysctls"`
// StreamingConnectionIdleTimeout is the maximum time a streaming connection can be idle before the connection is automatically closed
StreamingConnectionIdleTimeout *metav1.Duration `json:"streamingConnectionIdleTimeout,omitempty" flag:"streaming-connection-idle-timeout"`
// DockerDisableSharedPID uses a shared PID namespace for containers in a pod.
DockerDisableSharedPID *bool `json:"dockerDisableSharedPID,omitempty" flag:"docker-disable-shared-pid"`
// RootDir is the directory path for managing kubelet files (volume mounts,etc)
RootDir string `json:"rootDir,omitempty" flag:"root-dir"`
// AuthenticationTokenWebhook uses the TokenReview API to determine authentication for bearer tokens.
AuthenticationTokenWebhook *bool `json:"authenticationTokenWebhook,omitempty" flag:"authentication-token-webhook"`
// AuthenticationTokenWebhook sets the duration to cache responses from the webhook token authenticator. Default is 2m. (default 2m0s)
AuthenticationTokenWebhookCacheTTL *metav1.Duration `json:"authenticationTokenWebhookCacheTtl,omitempty" flag:"authentication-token-webhook-cache-ttl"`
// CPUCFSQuota enables CPU CFS quota enforcement for containers that specify CPU limits
CPUCFSQuota *bool `json:"cpuCFSQuota,omitempty" flag:"cpu-cfs-quota"`
// CPUCFSQuotaPeriod sets CPU CFS quota period value, cpu.cfs_period_us, defaults to Linux Kernel default
CPUCFSQuotaPeriod *metav1.Duration `json:"cpuCFSQuotaPeriod,omitempty" flag:"cpu-cfs-quota-period"`
// CpuManagerPolicy allows for changing the default policy of None to static
CpuManagerPolicy string `json:"cpuManagerPolicy,omitempty" flag:"cpu-manager-policy"`
// RegistryPullQPS if > 0, limit registry pull QPS to this value. If 0, unlimited. (default 5)
RegistryPullQPS *int32 `json:"registryPullQPS,omitempty" flag:"registry-qps"`
//RegistryBurst Maximum size of a bursty pulls, temporarily allows pulls to burst to this number, while still not exceeding registry-qps. Only used if --registry-qps > 0 (default 10)
RegistryBurst *int32 `json:"registryBurst,omitempty" flag:"registry-burst"`
// rotateCertificates enables client certificate rotation.
RotateCertificates *bool `json:"rotateCertificates,omitempty" flag:"rotate-certificates"`
}
// KubeProxyConfig defines the configuration for a proxy
type KubeProxyConfig struct {
Image string `json:"image,omitempty"`
// TODO: Better type ?
// CPURequest, cpu request compute resource for kube proxy e.g. "20m"
CPURequest string `json:"cpuRequest,omitempty"`
// CPULimit, cpu limit compute resource for kube proxy e.g. "30m"
CPULimit string `json:"cpuLimit,omitempty"`
// MemoryRequest, memory request compute resource for kube proxy e.g. "30Mi"
MemoryRequest string `json:"memoryRequest,omitempty"`
// MemoryLimit, memory limit compute resource for kube proxy e.g. "30Mi"
MemoryLimit string `json:"memoryLimit,omitempty"`
// LogLevel is the logging level of the proxy
LogLevel int32 `json:"logLevel,omitempty" flag:"v"`
// ClusterCIDR is the CIDR range of the pods in the cluster
ClusterCIDR string `json:"clusterCIDR,omitempty" flag:"cluster-cidr"`
// HostnameOverride, if non-empty, will be used as the identity instead of the actual hostname.
HostnameOverride string `json:"hostnameOverride,omitempty" flag:"hostname-override"`
// BindAddress is IP address for the proxy server to serve on
BindAddress string `json:"bindAddress,omitempty" flag:"bind-address"`
// Master is the address of the Kubernetes API server (overrides any value in kubeconfig)
Master string `json:"master,omitempty" flag:"master"`
// MetricsBindAddress is the IP address for the metrics server to serve on
MetricsBindAddress *string `json:"metricsBindAddress,omitempty" flag:"metrics-bind-address"`
// Enabled allows enabling or disabling kube-proxy
Enabled *bool `json:"enabled,omitempty"`
// Which proxy mode to use: (userspace, iptables(default), ipvs)
ProxyMode string `json:"proxyMode,omitempty" flag:"proxy-mode"`
// IPVSExcludeCIDRS is comma-separated list of CIDR's which the ipvs proxier should not touch when cleaning up IPVS rules
IPVSExcludeCIDRS []string `json:"ipvsExcludeCidrs,omitempty" flag:"ipvs-exclude-cidrs"`
// IPVSMinSyncPeriod is the minimum interval of how often the ipvs rules can be refreshed as endpoints and services change (e.g. '5s', '1m', '2h22m')
IPVSMinSyncPeriod *metav1.Duration `json:"ipvsMinSyncPeriod,omitempty" flag:"ipvs-min-sync-period"`
// IPVSScheduler is the ipvs scheduler type when proxy mode is ipvs
IPVSScheduler *string `json:"ipvsScheduler,omitempty" flag:"ipvs-scheduler"`
// IPVSSyncPeriod duration is the maximum interval of how often ipvs rules are refreshed
IPVSSyncPeriod *metav1.Duration `json:"ipvsSyncPeriod,omitempty" flag:"ipvs-sync-period"`
// FeatureGates is a series of key pairs used to switch on features for the proxy
FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"`
// Maximum number of NAT connections to track per CPU core (default: 131072)
ConntrackMaxPerCore *int32 `json:"conntrackMaxPerCore,omitempty" flag:"conntrack-max-per-core"`
// Minimum number of conntrack entries to allocate, regardless of conntrack-max-per-core
ConntrackMin *int32 `json:"conntrackMin,omitempty" flag:"conntrack-min"`
}
// KubeAPIServerConfig defines the configuration for the kube api
type KubeAPIServerConfig struct {
// Image is the docker container used
Image string `json:"image,omitempty"`
// DisableBasicAuth removes the --basic-auth-file flag
DisableBasicAuth bool `json:"disableBasicAuth,omitempty"`
// LogLevel is the logging level of the api
LogLevel int32 `json:"logLevel,omitempty" flag:"v" flag-empty:"0"`
// CloudProvider is the name of the cloudProvider we are using, aws, gce etcd
CloudProvider string `json:"cloudProvider,omitempty" flag:"cloud-provider"`
// SecurePort is the port the kube runs on
SecurePort int32 `json:"securePort,omitempty" flag:"secure-port"`
// InsecurePort is the port the insecure api runs
InsecurePort int32 `json:"insecurePort,omitempty" flag:"insecure-port"`
// Address is the binding address for the kube api: Deprecated - use insecure-bind-address and bind-address
Address string `json:"address,omitempty" flag:"address"`
// BindAddress is the binding address for the secure kubernetes API
BindAddress string `json:"bindAddress,omitempty" flag:"bind-address"`
// InsecureBindAddress is the binding address for the InsecurePort for the insecure kubernetes API
InsecureBindAddress string `json:"insecureBindAddress,omitempty" flag:"insecure-bind-address"`
// EnableBootstrapAuthToken enables 'bootstrap.kubernetes.io/token' in the 'kube-system' namespace to be used for TLS bootstrapping authentication
EnableBootstrapAuthToken *bool `json:"enableBootstrapTokenAuth,omitempty" flag:"enable-bootstrap-token-auth"`
// EnableAggregatorRouting enables aggregator routing requests to endpoints IP rather than cluster IP
EnableAggregatorRouting *bool `json:"enableAggregatorRouting,omitempty" flag:"enable-aggregator-routing"`
// AdmissionControl is a list of admission controllers to use: Deprecated - use enable-admission-plugins instead
AdmissionControl []string `json:"admissionControl,omitempty" flag:"admission-control"`
// AppendAdmissionPlugins appends list of enabled admission plugins
AppendAdmissionPlugins []string `json:"appendAdmissionPlugins,omitempty"`
// EnableAdmissionPlugins is a list of enabled admission plugins
EnableAdmissionPlugins []string `json:"enableAdmissionPlugins,omitempty" flag:"enable-admission-plugins"`
// DisableAdmissionPlugins is a list of disabled admission plugins
DisableAdmissionPlugins []string `json:"disableAdmissionPlugins,omitempty" flag:"disable-admission-plugins"`
// AdmissionControlConfigFile is the location of the admission-control-config-file
AdmissionControlConfigFile string `json:"admissionControlConfigFile,omitempty" flag:"admission-control-config-file"`
// ServiceClusterIPRange is the service address range
ServiceClusterIPRange string `json:"serviceClusterIPRange,omitempty" flag:"service-cluster-ip-range"`
// Passed as --service-node-port-range to kube-apiserver. Expects 'startPort-endPort' format e.g. 30000-33000
ServiceNodePortRange string `json:"serviceNodePortRange,omitempty" flag:"service-node-port-range"`
// EtcdServers is a list of the etcd service to connect
EtcdServers []string `json:"etcdServers,omitempty" flag:"etcd-servers"`
// EtcdServersOverrides is per-resource etcd servers overrides, comma separated. The individual override format: group/resource#servers, where servers are http://ip:port, semicolon separated
EtcdServersOverrides []string `json:"etcdServersOverrides,omitempty" flag:"etcd-servers-overrides"`
// EtcdCAFile is the path to a ca certificate
EtcdCAFile string `json:"etcdCaFile,omitempty" flag:"etcd-cafile"`
// EtcdCertFile is the path to a certificate
EtcdCertFile string `json:"etcdCertFile,omitempty" flag:"etcd-certfile"`
// EtcdKeyFile is the path to a private key
EtcdKeyFile string `json:"etcdKeyFile,omitempty" flag:"etcd-keyfile"`
// TODO: Remove unused BasicAuthFile
BasicAuthFile string `json:"basicAuthFile,omitempty" flag:"basic-auth-file"`
// TODO: Remove unused ClientCAFile
ClientCAFile string `json:"clientCAFile,omitempty" flag:"client-ca-file"`
// TODO: Remove unused TLSCertFile
TLSCertFile string `json:"tlsCertFile,omitempty" flag:"tls-cert-file"`
// TODO: Remove unused TLSPrivateKeyFile
TLSPrivateKeyFile string `json:"tlsPrivateKeyFile,omitempty" flag:"tls-private-key-file"`
// TLSCipherSuites indicates the allowed TLS cipher suite
TLSCipherSuites []string `json:"tlsCipherSuites,omitempty" flag:"tls-cipher-suites"`
// TLSMinVersion indicates the minimum TLS version allowed
TLSMinVersion string `json:"tlsMinVersion,omitempty" flag:"tls-min-version"`
// TODO: Remove unused TokenAuthFile
TokenAuthFile string `json:"tokenAuthFile,omitempty" flag:"token-auth-file"`
// AllowPrivileged indicates if we can run privileged containers
AllowPrivileged *bool `json:"allowPrivileged,omitempty" flag:"allow-privileged"`
// APIServerCount is the number of api servers
APIServerCount *int32 `json:"apiServerCount,omitempty" flag:"apiserver-count"`
// RuntimeConfig is a series of keys/values are parsed into the `--runtime-config` parameters
RuntimeConfig map[string]string `json:"runtimeConfig,omitempty" flag:"runtime-config"`
// KubeletClientCertificate is the path of a certificate for secure communication between api and kubelet
KubeletClientCertificate string `json:"kubeletClientCertificate,omitempty" flag:"kubelet-client-certificate"`
// KubeletCertificateAuthority is the path of a certificate authority for secure communication between api and kubelet.
KubeletCertificateAuthority string `json:"kubeletCertificateAuthority,omitempty" flag:"kubelet-certificate-authority"`
// KubeletClientKey is the path of a private to secure communication between api and kubelet
KubeletClientKey string `json:"kubeletClientKey,omitempty" flag:"kubelet-client-key"`
// AnonymousAuth indicates if anonymous authentication is permitted
AnonymousAuth *bool `json:"anonymousAuth,omitempty" flag:"anonymous-auth"`
// KubeletPreferredAddressTypes is a list of the preferred NodeAddressTypes to use for kubelet connections
KubeletPreferredAddressTypes []string `json:"kubeletPreferredAddressTypes,omitempty" flag:"kubelet-preferred-address-types"`
// StorageBackend is the backend storage
StorageBackend *string `json:"storageBackend,omitempty" flag:"storage-backend"`
// OIDCUsernameClaim is the OpenID claim to use as the user name.
// Note that claims other than the default ('sub') is not guaranteed to be
// unique and immutable.
OIDCUsernameClaim *string `json:"oidcUsernameClaim,omitempty" flag:"oidc-username-claim"`
// OIDCUsernamePrefix is the prefix prepended to username claims to prevent
// clashes with existing names (such as 'system:' users).
OIDCUsernamePrefix *string `json:"oidcUsernamePrefix,omitempty" flag:"oidc-username-prefix"`
// OIDCGroupsClaim if provided, the name of a custom OpenID Connect claim for
// specifying user groups.
// The claim value is expected to be a string or array of strings.
OIDCGroupsClaim *string `json:"oidcGroupsClaim,omitempty" flag:"oidc-groups-claim"`
// OIDCGroupsPrefix is the prefix prepended to group claims to prevent
// clashes with existing names (such as 'system:' groups)
OIDCGroupsPrefix *string `json:"oidcGroupsPrefix,omitempty" flag:"oidc-groups-prefix"`
// OIDCIssuerURL is the URL of the OpenID issuer, only HTTPS scheme will
// be accepted.
// If set, it will be used to verify the OIDC JSON Web Token (JWT).
OIDCIssuerURL *string `json:"oidcIssuerURL,omitempty" flag:"oidc-issuer-url"`
// OIDCClientID is the client ID for the OpenID Connect client, must be set
// if oidc-issuer-url is set.
OIDCClientID *string `json:"oidcClientID,omitempty" flag:"oidc-client-id"`
// A key=value pair that describes a required claim in the ID Token.
// If set, the claim is verified to be present in the ID Token with a matching value.
// Repeat this flag to specify multiple claims.
OIDCRequiredClaim []string `json:"oidcRequiredClaim,omitempty" flag:"oidc-required-claim,repeat"`
// OIDCCAFile if set, the OpenID server's certificate will be verified by one
// of the authorities in the oidc-ca-file
OIDCCAFile *string `json:"oidcCAFile,omitempty" flag:"oidc-ca-file"`
// The apiserver's client certificate used for outbound requests.
ProxyClientCertFile *string `json:"proxyClientCertFile,omitempty" flag:"proxy-client-cert-file"`
// The apiserver's client key used for outbound requests.
ProxyClientKeyFile *string `json:"proxyClientKeyFile,omitempty" flag:"proxy-client-key-file"`
// AuditLogFormat flag specifies the format type for audit log files.
AuditLogFormat *string `json:"auditLogFormat,omitempty" flag:"audit-log-format"`
// If set, all requests coming to the apiserver will be logged to this file.
AuditLogPath *string `json:"auditLogPath,omitempty" flag:"audit-log-path"`
// The maximum number of days to retain old audit log files based on the timestamp encoded in their filename.
AuditLogMaxAge *int32 `json:"auditLogMaxAge,omitempty" flag:"audit-log-maxage"`
// The maximum number of old audit log files to retain.
AuditLogMaxBackups *int32 `json:"auditLogMaxBackups,omitempty" flag:"audit-log-maxbackup"`
// The maximum size in megabytes of the audit log file before it gets rotated. Defaults to 100MB.
AuditLogMaxSize *int32 `json:"auditLogMaxSize,omitempty" flag:"audit-log-maxsize"`
// AuditPolicyFile is the full path to a advanced audit configuration file e.g. /srv/kubernetes/audit.conf
AuditPolicyFile string `json:"auditPolicyFile,omitempty" flag:"audit-policy-file"`
// AuditWebhookBatchBufferSize is The size of the buffer to store events before batching and writing. Only used in batch mode. (default 10000)
AuditWebhookBatchBufferSize *int32 `json:"auditWebhookBatchBufferSize,omitempty" flag:"audit-webhook-batch-buffer-size"`
// AuditWebhookBatchMaxSize is The maximum size of a batch. Only used in batch mode. (default 400)
AuditWebhookBatchMaxSize *int32 `json:"auditWebhookBatchMaxSize,omitempty" flag:"audit-webhook-batch-max-size"`
// AuditWebhookBatchMaxWait is The amount of time to wait before force writing the batch that hadn't reached the max size. Only used in batch mode. (default 30s)
AuditWebhookBatchMaxWait *metav1.Duration `json:"auditWebhookBatchMaxWait,omitempty" flag:"audit-webhook-batch-max-wait"`
// AuditWebhookBatchThrottleBurst is Maximum number of requests sent at the same moment if ThrottleQPS was not utilized before. Only used in batch mode. (default 15)
AuditWebhookBatchThrottleBurst *int32 `json:"auditWebhookBatchThrottleBurst,omitempty" flag:"audit-webhook-batch-throttle-burst"`
// AuditWebhookBatchThrottleEnable is Whether batching throttling is enabled. Only used in batch mode. (default true)
AuditWebhookBatchThrottleEnable *bool `json:"auditWebhookBatchThrottleEnable,omitempty" flag:"audit-webhook-batch-throttle-enable"`
// AuditWebhookBatchThrottleQps is Maximum average number of batches per second. Only used in batch mode. (default 10)
AuditWebhookBatchThrottleQps *resource.Quantity `json:"auditWebhookBatchThrottleQps,omitempty" flag:"audit-webhook-batch-throttle-qps"`
// AuditWebhookConfigFile is Path to a kubeconfig formatted file that defines the audit webhook configuration. Requires the 'AdvancedAuditing' feature gate.
AuditWebhookConfigFile string `json:"auditWebhookConfigFile,omitempty" flag:"audit-webhook-config-file"`
// AuditWebhookInitialBackoff is The amount of time to wait before retrying the first failed request. (default 10s)
AuditWebhookInitialBackoff *metav1.Duration `json:"auditWebhookInitialBackoff,omitempty" flag:"audit-webhook-initial-backoff"`
// AuditWebhookMode is Strategy for sending audit events. Blocking indicates sending events should block server responses. Batch causes the backend to buffer and write events asynchronously. Known modes are batch,blocking. (default "batch")
AuditWebhookMode string `json:"auditWebhookMode,omitempty" flag:"audit-webhook-mode"`
// File with webhook configuration for token authentication in kubeconfig format. The API server will query the remote service to determine authentication for bearer tokens.
AuthenticationTokenWebhookConfigFile *string `json:"authenticationTokenWebhookConfigFile,omitempty" flag:"authentication-token-webhook-config-file"`
// The duration to cache responses from the webhook token authenticator. Default is 2m. (default 2m0s)
AuthenticationTokenWebhookCacheTTL *metav1.Duration `json:"authenticationTokenWebhookCacheTtl,omitempty" flag:"authentication-token-webhook-cache-ttl"`
// AuthorizationMode is the authorization mode the kubeapi is running in
AuthorizationMode *string `json:"authorizationMode,omitempty" flag:"authorization-mode"`
// File with webhook configuration for authorization in kubeconfig format. The API server will query the remote service to determine whether to authorize the request.
AuthorizationWebhookConfigFile *string `json:"authorizationWebhookConfigFile,omitempty" flag:"authorization-webhook-config-file"`
// The duration to cache authorized responses from the webhook token authorizer. Default is 5m. (default 5m0s)
AuthorizationWebhookCacheAuthorizedTTL *metav1.Duration `json:"authorizationWebhookCacheAuthorizedTtl,omitempty" flag:"authorization-webhook-cache-authorized-ttl"`
// The duration to cache authorized responses from the webhook token authorizer. Default is 30s. (default 30s)
AuthorizationWebhookCacheUnauthorizedTTL *metav1.Duration `json:"authorizationWebhookCacheUnauthorizedTtl,omitempty" flag:"authorization-webhook-cache-unauthorized-ttl"`
// AuthorizationRBACSuperUser is the name of the superuser for default rbac
AuthorizationRBACSuperUser *string `json:"authorizationRbacSuperUser,omitempty" flag:"authorization-rbac-super-user"`
// EncryptionProviderConfig enables encryption at rest for secrets.
EncryptionProviderConfig *string `json:"encryptionProviderConfig,omitempty" flag:"encryption-provider-config"`
// ExperimentalEncryptionProviderConfig enables encryption at rest for secrets.
ExperimentalEncryptionProviderConfig *string `json:"experimentalEncryptionProviderConfig,omitempty" flag:"experimental-encryption-provider-config"`
// List of request headers to inspect for usernames. X-Remote-User is common.
RequestheaderUsernameHeaders []string `json:"requestheaderUsernameHeaders,omitempty" flag:"requestheader-username-headers"`
// List of request headers to inspect for groups. X-Remote-Group is suggested.
RequestheaderGroupHeaders []string `json:"requestheaderGroupHeaders,omitempty" flag:"requestheader-group-headers"`
// List of request header prefixes to inspect. X-Remote-Extra- is suggested.
RequestheaderExtraHeaderPrefixes []string `json:"requestheaderExtraHeaderPrefixes,omitempty" flag:"requestheader-extra-headers-prefix"`
//Root certificate bundle to use to verify client certificates on incoming requests before trusting usernames in headers specified by --requestheader-username-headers
RequestheaderClientCAFile string `json:"requestheaderClientCAFile,omitempty" flag:"requestheader-client-ca-file"`
// List of client certificate common names to allow to provide usernames in headers specified by --requestheader-username-headers. If empty, any client certificate validated by the authorities in --requestheader-client-ca-file is allowed.
RequestheaderAllowedNames []string `json:"requestheaderAllowedNames,omitempty" flag:"requestheader-allowed-names"`
// FeatureGates is set of key=value pairs that describe feature gates for alpha/experimental features.
FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"`
// MaxRequestsInflight The maximum number of non-mutating requests in flight at a given time.
MaxRequestsInflight int32 `json:"maxRequestsInflight,omitempty" flag:"max-requests-inflight" flag-empty:"0"`
// MaxMutatingRequestsInflight The maximum number of mutating requests in flight at a given time. Defaults to 200
MaxMutatingRequestsInflight int32 `json:"maxMutatingRequestsInflight,omitempty" flag:"max-mutating-requests-inflight" flag-empty:"0"`
// HTTP2MaxStreamsPerConnection sets the limit that the server gives to clients for the maximum number of streams in an HTTP/2 connection. Zero means to use golang's default.
HTTP2MaxStreamsPerConnection *int32 `json:"http2MaxStreamsPerConnection,omitempty" flag:"http2-max-streams-per-connection"`
// EtcdQuorumRead configures the etcd-quorum-read flag, which forces consistent reads from etcd
EtcdQuorumRead *bool `json:"etcdQuorumRead,omitempty" flag:"etcd-quorum-read"`
// MinRequestTimeout configures the minimum number of seconds a handler must keep a request open before timing it out.
// Currently only honored by the watch request handler
MinRequestTimeout *int32 `json:"minRequestTimeout,omitempty" flag:"min-request-timeout"`
// Memory limit for apiserver in MB (used to configure sizes of caches, etc.)
TargetRamMb int32 `json:"targetRamMb,omitempty" flag:"target-ram-mb" flag-empty:"0"`
// File containing PEM-encoded x509 RSA or ECDSA private or public keys, used to verify ServiceAccount tokens.
// The specified file can contain multiple keys, and the flag can be specified multiple times with different files.
// If unspecified, --tls-private-key-file is used.
ServiceAccountKeyFile []string `json:"serviceAccountKeyFile,omitempty" flag:"service-account-key-file,repeat"`
// Path to the file that contains the current private key of the service account token issuer.
// The issuer will sign issued ID tokens with this private key. (Requires the 'TokenRequest' feature gate.)
ServiceAccountSigningKeyFile *string `json:"serviceAccountSigningKeyFile,omitempty" flag:"service-account-signing-key-file"`
// Identifier of the service account token issuer. The issuer will assert this identifier
// in "iss" claim of issued tokens. This value is a string or URI.
ServiceAccountIssuer *string `json:"serviceAccountIssuer,omitempty" flag:"service-account-issuer"`
// Identifiers of the API. The service account token authenticator will validate that
// tokens used against the API are bound to at least one of these audiences. If the
// --service-account-issuer flag is configured and this flag is not, this field
// defaults to a single element list containing the issuer URL.
APIAudiences []string `json:"apiAudiences,omitempty" flag:"api-audiences"`
// CPURequest, cpu request compute resource for api server. Defaults to "150m"
CPURequest string `json:"cpuRequest,omitempty"`
// Amount of time to retain Kubernetes events
EventTTL *metav1.Duration `json:"eventTTL,omitempty" flag:"event-ttl"`
// AuditDynamicConfiguration enables dynamic audit configuration via AuditSinks
AuditDynamicConfiguration *bool `json:"auditDynamicConfiguration,omitempty" flag:"audit-dynamic-configuration"`
}
// KubeControllerManagerConfig is the configuration for the controller
type KubeControllerManagerConfig struct {
// Master is the url for the kube api master
Master string `json:"master,omitempty" flag:"master"`
// LogLevel is the defined logLevel
LogLevel int32 `json:"logLevel,omitempty" flag:"v" flag-empty:"0"`
// ServiceAccountPrivateKeyFile the location for a certificate for service account signing
ServiceAccountPrivateKeyFile string `json:"serviceAccountPrivateKeyFile,omitempty" flag:"service-account-private-key-file"`
// Image is the docker image to use
Image string `json:"image,omitempty"`
// CloudProvider is the provider for cloud services.
CloudProvider string `json:"cloudProvider,omitempty" flag:"cloud-provider"`
// ClusterName is the instance prefix for the cluster.
ClusterName string `json:"clusterName,omitempty" flag:"cluster-name"`
// ClusterCIDR is CIDR Range for Pods in cluster.
ClusterCIDR string `json:"clusterCIDR,omitempty" flag:"cluster-cidr"`
// AllocateNodeCIDRs enables CIDRs for Pods to be allocated and, if ConfigureCloudRoutes is true, to be set on the cloud provider.
AllocateNodeCIDRs *bool `json:"allocateNodeCIDRs,omitempty" flag:"allocate-node-cidrs"`
// NodeCIDRMaskSize set the size for the mask of the nodes.
NodeCIDRMaskSize *int32 `json:"nodeCIDRMaskSize,omitempty" flag:"node-cidr-mask-size"`
// ConfigureCloudRoutes enables CIDRs allocated with to be configured on the cloud provider.
ConfigureCloudRoutes *bool `json:"configureCloudRoutes,omitempty" flag:"configure-cloud-routes"`
// Controllers is a list of controllers to enable on the controller-manager
Controllers []string `json:"controllers,omitempty" flag:"controllers"`
// CIDRAllocatorType specifies the type of CIDR allocator to use.
CIDRAllocatorType *string `json:"cidrAllocatorType,omitempty" flag:"cidr-allocator-type"`
// rootCAFile is the root certificate authority will be included in service account's token secret. This must be a valid PEM-encoded CA bundle.
RootCAFile string `json:"rootCAFile,omitempty" flag:"root-ca-file"`
// LeaderElection defines the configuration of leader election client.
LeaderElection *LeaderElectionConfiguration `json:"leaderElection,omitempty"`
// ReconcilerSyncLoopPeriod is the amount of time the reconciler sync states loop
// wait between successive executions. Is set to 1 min by kops by default
AttachDetachReconcileSyncPeriod *metav1.Duration `json:"attachDetachReconcileSyncPeriod,omitempty" flag:"attach-detach-reconcile-sync-period"`
// TerminatedPodGCThreshold is the number of terminated pods that can exist
// before the terminated pod garbage collector starts deleting terminated pods.
// If <= 0, the terminated pod garbage collector is disabled.
TerminatedPodGCThreshold *int32 `json:"terminatedPodGCThreshold,omitempty" flag:"terminated-pod-gc-threshold"`
// NodeMonitorPeriod is the period for syncing NodeStatus in NodeController. (default 5s)
NodeMonitorPeriod *metav1.Duration `json:"nodeMonitorPeriod,omitempty" flag:"node-monitor-period"`
// NodeMonitorGracePeriod is the amount of time which we allow running Node to be unresponsive before marking it unhealthy. (default 40s)
// Must be N-1 times more than kubelet's nodeStatusUpdateFrequency, where N means number of retries allowed for kubelet to post node status.
NodeMonitorGracePeriod *metav1.Duration `json:"nodeMonitorGracePeriod,omitempty" flag:"node-monitor-grace-period"`
// PodEvictionTimeout is the grace period for deleting pods on failed nodes. (default 5m0s)
PodEvictionTimeout *metav1.Duration `json:"podEvictionTimeout,omitempty" flag:"pod-eviction-timeout"`
// UseServiceAccountCredentials controls whether we use individual service account credentials for each controller.
UseServiceAccountCredentials *bool `json:"useServiceAccountCredentials,omitempty" flag:"use-service-account-credentials"`
// HorizontalPodAutoscalerSyncPeriod is the amount of time between syncs
// During each period, the controller manager queries the resource utilization
// against the metrics specified in each HorizontalPodAutoscaler definition.
HorizontalPodAutoscalerSyncPeriod *metav1.Duration `json:"horizontalPodAutoscalerSyncPeriod,omitempty" flag:"horizontal-pod-autoscaler-sync-period"`
// HorizontalPodAutoscalerDownscaleDelay is a duration that specifies
// how long the autoscaler has to wait before another downscale
// operation can be performed after the current one has completed.
HorizontalPodAutoscalerDownscaleDelay *metav1.Duration `json:"horizontalPodAutoscalerDownscaleDelay,omitempty" flag:"horizontal-pod-autoscaler-downscale-delay"`
// HorizontalPodAutoscalerDownscaleStabilization is the period for which
// autoscaler will look backwards and not scale down below any
// recommendation it made during that period.
HorizontalPodAutoscalerDownscaleStabilization *metav1.Duration `json:"horizontalPodAutoscalerDownscaleStabilization,omitempty" flag:"horizontal-pod-autoscaler-downscale-stabilization"`
// HorizontalPodAutoscalerUpscaleDelay is a duration that specifies how
// long the autoscaler has to wait before another upscale operation can
// be performed after the current one has completed.
HorizontalPodAutoscalerUpscaleDelay *metav1.Duration `json:"horizontalPodAutoscalerUpscaleDelay,omitempty" flag:"horizontal-pod-autoscaler-upscale-delay"`
// HorizontalPodAutoscalerTolerance is the minimum change (from 1.0) in the
// desired-to-actual metrics ratio for the horizontal pod autoscaler to
// consider scaling.
HorizontalPodAutoscalerTolerance *resource.Quantity `json:"horizontalPodAutoscalerTolerance,omitempty" flag:"horizontal-pod-autoscaler-tolerance"`
// HorizontalPodAutoscalerUseRestClients determines if the new-style clients
// should be used if support for custom metrics is enabled.
HorizontalPodAutoscalerUseRestClients *bool `json:"horizontalPodAutoscalerUseRestClients,omitempty" flag:"horizontal-pod-autoscaler-use-rest-clients"`
// ExperimentalClusterSigningDuration is the duration that determines
// the length of duration that the signed certificates will be given. (default 8760h0m0s)
ExperimentalClusterSigningDuration *metav1.Duration `json:"experimentalClusterSigningDuration,omitempty" flag:"experimental-cluster-signing-duration"`
// FeatureGates is set of key=value pairs that describe feature gates for alpha/experimental features.
FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"`
// TLSCipherSuites indicates the allowed TLS cipher suite
TLSCipherSuites []string `json:"tlsCipherSuites,omitempty" flag:"tls-cipher-suites"`
// TLSMinVersion indicates the minimum TLS version allowed
TLSMinVersion string `json:"tlsMinVersion,omitempty" flag:"tls-min-version"`
// MinResyncPeriod indicates the resync period in reflectors.
// The resync period will be random between MinResyncPeriod and 2*MinResyncPeriod. (default 12h0m0s)
MinResyncPeriod string `json:"minResyncPeriod,omitempty" flag:"min-resync-period"`
// KubeAPIQPS QPS to use while talking with kubernetes apiserver. (default 20)
KubeAPIQPS *resource.Quantity `json:"kubeAPIQPS,omitempty" flag:"kube-api-qps"`
// KubeAPIBurst Burst to use while talking with kubernetes apiserver. (default 30)
KubeAPIBurst *int32 `json:"kubeAPIBurst,omitempty" flag:"kube-api-burst"`
// The number of deployment objects that are allowed to sync concurrently.
ConcurrentDeploymentSyncs *int32 `json:"concurrentDeploymentSyncs,omitempty" flag:"concurrent-deployment-syncs"`
// The number of endpoint objects that are allowed to sync concurrently.
ConcurrentEndpointSyncs *int32 `json:"concurrentEndpointSyncs,omitempty" flag:"concurrent-endpoint-syncs"`
// The number of namespace objects that are allowed to sync concurrently.
ConcurrentNamespaceSyncs *int32 `json:"concurrentNamespaceSyncs,omitempty" flag:"concurrent-namespace-syncs"`
// The number of replicaset objects that are allowed to sync concurrently.
ConcurrentReplicasetSyncs *int32 `json:"concurrentReplicasetSyncs,omitempty" flag:"concurrent-replicaset-syncs"`
// The number of service objects that are allowed to sync concurrently.
ConcurrentServiceSyncs *int32 `json:"concurrentServiceSyncs,omitempty" flag:"concurrent-service-syncs"`
// The number of resourcequota objects that are allowed to sync concurrently.
ConcurrentResourceQuotaSyncs *int32 `json:"concurrentResourceQuotaSyncs,omitempty" flag:"concurrent-resource-quota-syncs"`
// The number of serviceaccount objects that are allowed to sync concurrently to create tokens.
ConcurrentServiceaccountTokenSyncs *int32 `json:"concurrentServiceaccountTokenSyncs,omitempty" flag:"concurrent-serviceaccount-token-syncs"`
// The number of replicationcontroller objects that are allowed to sync concurrently.
ConcurrentRcSyncs *int32 `json:"concurrentRcSyncs,omitempty" flag:"concurrent-rc-syncs"`
}
// CloudControllerManagerConfig is the configuration of the cloud controller
type CloudControllerManagerConfig struct {
// Master is the url for the kube api master.
Master string `json:"master,omitempty" flag:"master"`
// LogLevel is the verbosity of the logs.
LogLevel int32 `json:"logLevel,omitempty" flag:"v" flag-empty:"0"`
// Image is the OCI image of the cloud controller manager.
Image string `json:"image,omitempty"`
// CloudProvider is the provider for cloud services.
CloudProvider string `json:"cloudProvider,omitempty" flag:"cloud-provider"`
// ClusterName is the instance prefix for the cluster.
ClusterName string `json:"clusterName,omitempty" flag:"cluster-name"`
// ClusterCIDR is CIDR Range for Pods in cluster.
ClusterCIDR string `json:"clusterCIDR,omitempty" flag:"cluster-cidr"`
// AllocateNodeCIDRs enables CIDRs for Pods to be allocated and, if
// ConfigureCloudRoutes is true, to be set on the cloud provider.
AllocateNodeCIDRs *bool `json:"allocateNodeCIDRs,omitempty" flag:"allocate-node-cidrs"`
// ConfigureCloudRoutes enables CIDRs allocated with to be configured on the cloud provider.
ConfigureCloudRoutes *bool `json:"configureCloudRoutes,omitempty" flag:"configure-cloud-routes"`
// CIDRAllocatorType specifies the type of CIDR allocator to use.
CIDRAllocatorType *string `json:"cidrAllocatorType,omitempty" flag:"cidr-allocator-type"`
// LeaderElection defines the configuration of leader election client.
LeaderElection *LeaderElectionConfiguration `json:"leaderElection,omitempty"`
// UseServiceAccountCredentials controls whether we use individual service account credentials for each controller.
UseServiceAccountCredentials *bool `json:"useServiceAccountCredentials,omitempty" flag:"use-service-account-credentials"`
}
// KubeSchedulerConfig is the configuration for the kube-scheduler
type KubeSchedulerConfig struct {
// Master is a url to the kube master
Master string `json:"master,omitempty" flag:"master"`
// LogLevel is the logging level
LogLevel int32 `json:"logLevel,omitempty" flag:"v"`
// Image is the docker image to use
Image string `json:"image,omitempty"`
// LeaderElection defines the configuration of leader election client.
LeaderElection *LeaderElectionConfiguration `json:"leaderElection,omitempty"`
// UsePolicyConfigMap enable setting the scheduler policy from a configmap
UsePolicyConfigMap *bool `json:"usePolicyConfigMap,omitempty"`
// FeatureGates is set of key=value pairs that describe feature gates for alpha/experimental features.
FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"`
// MaxPersistentVolumes changes the maximum number of persistent volumes the scheduler will scheduler onto the same
// node. Only takes into affect if value is positive. This corresponds to the KUBE_MAX_PD_VOLS environment variable,
// which has been supported as far back as Kubernetes 1.7. The default depends on the version and the cloud provider
// as outlined: https://kubernetes.io/docs/concepts/storage/storage-limits/
MaxPersistentVolumes *int32 `json:"maxPersistentVolumes,omitempty"`
// Qps sets the maximum qps to send to apiserver after the burst quota is exhausted
Qps *resource.Quantity `json:"qps,omitempty" configfile:"ClientConnection.QPS"`
// Burst sets the maximum qps to send to apiserver after the burst quota is exhausted
Burst int32 `json:"burst,omitempty" configfile:"ClientConnection.Burst"`
}
// LeaderElectionConfiguration defines the configuration of leader election
// clients for components that can run with leader election enabled.
type LeaderElectionConfiguration struct {
// leaderElect enables a leader election client to gain leadership
// before executing the main loop. Enable this when running replicated
// components for high availability.
LeaderElect *bool `json:"leaderElect,omitempty" flag:"leader-elect"`
// leaderElectLeaseDuration is the length in time non-leader candidates
// will wait after observing a leadership renewal until attempting to acquire
// leadership of a led but unrenewed leader slot. This is effectively the
// maximum duration that a leader can be stopped before it is replaced by another candidate
LeaderElectLeaseDuration *metav1.Duration `json:"leaderElectLeaseDuration,omitempty" flag:"leader-elect-lease-duration"`
// LeaderElectRenewDeadlineDuration is the interval between attempts by the acting master to
// renew a leadership slot before it stops leading. This must be less than or equal to the lease duration.
LeaderElectRenewDeadlineDuration *metav1.Duration `json:"leaderElectRenewDeadlineDuration,omitempty" flag:"leader-elect-renew-deadline"`
// LeaderElectResourceLock is the type of resource object that is used for locking during
// leader election. Supported options are endpoints (default) and `configmaps`.
LeaderElectResourceLock *string `json:"leaderElectResourceLock,omitempty" flag:"leader-elect-resource-lock"`
// LeaderElectResourceName is the name of resource object that is used for locking during leader election.
LeaderElectResourceName *string `json:"leaderElectResourceName,omitempty" flag:"leader-elect-resource-name"`
// LeaderElectResourceNamespace is the namespace of resource object that is used for locking during leader election.
LeaderElectResourceNamespace *string `json:"leaderElectResourceNamespace,omitempty" flag:"leader-elect-resource-namespace"`
// LeaderElectRetryPeriod is The duration the clients should wait between attempting acquisition
// and renewal of a leadership. This is only applicable if leader election is enabled.
LeaderElectRetryPeriod *metav1.Duration `json:"leaderElectRetryPeriod,omitempty" flag:"leader-elect-retry-period"`
}
// OpenstackLoadbalancerConfig defines the config for a neutron loadbalancer
type OpenstackLoadbalancerConfig struct {
Method *string `json:"method,omitempty"`
Provider *string `json:"provider,omitempty"`
UseOctavia *bool `json:"useOctavia,omitempty"`
FloatingNetwork *string `json:"floatingNetwork,omitempty"`
FloatingNetworkID *string `json:"floatingNetworkID,omitempty"`
FloatingSubnet *string `json:"floatingSubnet,omitempty"`
SubnetID *string `json:"subnetID,omitempty"`
ManageSecGroups *bool `json:"manageSecurityGroups,omitempty"`
}
type OpenstackBlockStorageConfig struct {
Version *string `json:"bs-version,omitempty"`
IgnoreAZ *bool `json:"ignore-volume-az,omitempty"`
OverrideAZ *string `json:"override-volume-az,omitempty"`
}
// OpenstackMonitor defines the config for a health monitor
type OpenstackMonitor struct {
Delay *string `json:"delay,omitempty"`
Timeout *string `json:"timeout,omitempty"`
MaxRetries *int `json:"maxRetries,omitempty"`
}
// OpenstackRouter defines the config for a router
type OpenstackRouter struct {
ExternalNetwork *string `json:"externalNetwork,omitempty"`
DNSServers *string `json:"dnsServers,omitempty"`
ExternalSubnet *string `json:"externalSubnet,omitempty"`
}
// OpenstackConfiguration defines cloud config elements for the openstack cloud provider
type OpenstackConfiguration struct {
Loadbalancer *OpenstackLoadbalancerConfig `json:"loadbalancer,omitempty"`
Monitor *OpenstackMonitor `json:"monitor,omitempty"`
Router *OpenstackRouter `json:"router,omitempty"`
BlockStorage *OpenstackBlockStorageConfig `json:"blockStorage,omitempty"`
InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
}
// CloudConfiguration defines the cloud provider configuration
type CloudConfiguration struct {
// GCE cloud-config options
Multizone *bool `json:"multizone,omitempty"`
NodeTags *string `json:"nodeTags,omitempty"`
NodeInstancePrefix *string `json:"nodeInstancePrefix,omitempty"`
// AWS cloud-config options
DisableSecurityGroupIngress *bool `json:"disableSecurityGroupIngress,omitempty"`
ElbSecurityGroup *string `json:"elbSecurityGroup,omitempty"`
// vSphere cloud-config specs
VSphereUsername *string `json:"vSphereUsername,omitempty"`
VSpherePassword *string `json:"vSpherePassword,omitempty"`
VSphereServer *string `json:"vSphereServer,omitempty"`
VSphereDatacenter *string `json:"vSphereDatacenter,omitempty"`
VSphereResourcePool *string `json:"vSphereResourcePool,omitempty"`
VSphereDatastore *string `json:"vSphereDatastore,omitempty"`
VSphereCoreDNSServer *string `json:"vSphereCoreDNSServer,omitempty"`
// Spotinst cloud-config specs
SpotinstProduct *string `json:"spotinstProduct,omitempty"`
SpotinstOrientation *string `json:"spotinstOrientation,omitempty"`
// Openstack cloud-config options
Openstack *OpenstackConfiguration `json:"openstack,omitempty"`
}
// HasAdmissionController checks if a specific admission controller is enabled
func (c *KubeAPIServerConfig) HasAdmissionController(name string) bool {
for _, x := range c.AdmissionControl {
if x == name {
return true
}
}
for _, x := range c.DisableAdmissionPlugins {
if x == name {
return false
}
}
for _, x := range c.EnableAdmissionPlugins {
if x == name {
return true
}
}
return false
}

View File

@ -1,35 +0,0 @@
/*
Copyright 2019 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 v1alpha1
// ContainerdConfig is the configuration for containerd
type ContainerdConfig struct {
// Address of containerd's GRPC server (default "/run/containerd/containerd.sock")
Address *string `json:"address,omitempty" flag:"address"`
// Complete containerd config file provided by the user
ConfigOverride *string `json:"configOverride,omitempty"`
// Logging level [trace, debug, info, warn, error, fatal, panic] (default "info")
LogLevel *string `json:"logLevel,omitempty" flag:"log-level"`
// Directory for persistent data (default "/var/lib/containerd")
Root *string `json:"root,omitempty" flag:"root"`
// Prevents kops from installing and modifying containerd in any way (default "false")
SkipInstall bool `json:"skipInstall,omitempty"`
// Directory for execution state files (default "/run/containerd")
State *string `json:"state,omitempty" flag:"state"`
// Consumed by nodeup and used to pick the containerd version
Version *string `json:"version,omitempty"`
}

View File

@ -1,303 +0,0 @@
/*
Copyright 2019 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 v1alpha1
import (
"fmt"
"reflect"
"sort"
"strings"
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/kops/pkg/apis/kops"
)
func Convert_v1alpha1_BastionSpec_To_kops_BastionSpec(in *BastionSpec, out *kops.BastionSpec, s conversion.Scope) error {
out.BastionPublicName = in.PublicName
out.IdleTimeoutSeconds = in.IdleTimeout
if !in.Enable {
out.BastionPublicName = ""
out.IdleTimeoutSeconds = nil
}
return nil
}
func Convert_kops_BastionSpec_To_v1alpha1_BastionSpec(in *kops.BastionSpec, out *BastionSpec, s conversion.Scope) error {
out.PublicName = in.BastionPublicName
out.IdleTimeout = in.IdleTimeoutSeconds
out.Enable = true
out.MachineType = ""
return nil
}
func Convert_v1alpha1_ClusterSpec_To_kops_ClusterSpec(in *ClusterSpec, out *kops.ClusterSpec, s conversion.Scope) error {
topologyPrivate := false
if in.Topology != nil && in.Topology.Masters == TopologyPrivate {
topologyPrivate = true
}
if in.Zones != nil {
for _, z := range in.Zones {
if topologyPrivate {
// A private zone is mapped to a private- and a utility- subnet
if z.PrivateCIDR != "" {
out.Subnets = append(out.Subnets, kops.ClusterSubnetSpec{
Name: z.Name,
CIDR: z.PrivateCIDR,
ProviderID: z.ProviderID,
Zone: z.Name,
Type: kops.SubnetTypePrivate,
Egress: z.Egress,
})
}
if z.CIDR != "" {
out.Subnets = append(out.Subnets, kops.ClusterSubnetSpec{
Name: "utility-" + z.Name,
CIDR: z.CIDR,
Zone: z.Name,
Type: kops.SubnetTypeUtility,
Egress: z.Egress,
})
}
} else {
out.Subnets = append(out.Subnets, kops.ClusterSubnetSpec{
Name: z.Name,
CIDR: z.CIDR,
ProviderID: z.ProviderID,
Zone: z.Name,
Type: kops.SubnetTypePublic,
Egress: z.Egress,
})
}
}
} else {
out.Subnets = nil
}
adminAccess := in.AdminAccess
if len(adminAccess) == 0 {
// The default in v1alpha1 was 0.0.0.0/0
adminAccess = []string{"0.0.0.0/0"}
}
out.SSHAccess = adminAccess
out.KubernetesAPIAccess = adminAccess
return autoConvert_v1alpha1_ClusterSpec_To_kops_ClusterSpec(in, out, s)
}
// ByName implements sort.Interface for []*ClusterZoneSpec on the Name field.
type ByName []*ClusterZoneSpec
func (a ByName) Len() int {
return len(a)
}
func (a ByName) Swap(i, j int) {
a[i], a[j] = a[j], a[i]
}
func (a ByName) Less(i, j int) bool {
return a[i].Name < a[j].Name
}
func Convert_kops_ClusterSpec_To_v1alpha1_ClusterSpec(in *kops.ClusterSpec, out *ClusterSpec, s conversion.Scope) error {
topologyPrivate := false
if in.Topology != nil && in.Topology.Masters == TopologyPrivate {
topologyPrivate = true
}
if in.Subnets != nil {
zoneMap := make(map[string]*ClusterZoneSpec)
for _, s := range in.Subnets {
zoneName := s.Name
if s.Type == kops.SubnetTypeUtility {
if !strings.HasPrefix(zoneName, "utility-") {
return fmt.Errorf("cannot convert subnet to v1alpha1 when subnet with Type=utility does not have name starting with utility-: %q", zoneName)
}
zoneName = strings.TrimPrefix(zoneName, "utility-")
}
if s.Zone != zoneName {
return fmt.Errorf("cannot convert to v1alpha1 when subnet Zone != Name: %q != %q", s.Zone, s.Name)
}
zone := zoneMap[zoneName]
if zone == nil {
zone = &ClusterZoneSpec{
Name: s.Zone,
}
zoneMap[zoneName] = zone
}
if topologyPrivate {
subnetType := s.Type
if subnetType == "" {
subnetType = kops.SubnetTypePrivate
}
switch subnetType {
case kops.SubnetTypePrivate:
if zone.PrivateCIDR != "" || zone.ProviderID != "" {
return fmt.Errorf("cannot convert to v1alpha1: duplicate zone: %v", zone)
}
zone.PrivateCIDR = s.CIDR
zone.Egress = s.Egress
zone.ProviderID = s.ProviderID
case kops.SubnetTypeUtility:
if zone.CIDR != "" {
return fmt.Errorf("cannot convert to v1alpha1: duplicate zone: %v", zone)
}
zone.CIDR = s.CIDR
// We simple can't express this in v1alpha1
if s.ProviderID != "" {
return fmt.Errorf("cannot convert to v1alpha1: utility subnet had ProviderID %v", s.Name)
}
case kops.SubnetTypePublic:
return fmt.Errorf("cannot convert to v1alpha1 when subnet type is public")
default:
return fmt.Errorf("unknown SubnetType: %v", subnetType)
}
} else {
if zone.CIDR != "" || zone.ProviderID != "" {
return fmt.Errorf("cannot convert to v1alpha1: duplicate zone: %v", zone)
}
zone.CIDR = s.CIDR
zone.Egress = s.Egress
zone.ProviderID = s.ProviderID
}
}
for _, z := range zoneMap {
out.Zones = append(out.Zones, z)
}
sort.Sort(ByName(out.Zones))
} else {
out.Zones = nil
}
if !reflect.DeepEqual(in.SSHAccess, in.KubernetesAPIAccess) {
return fmt.Errorf("cannot convert to v1alpha1: SSHAccess != KubernetesAPIAccess")
}
out.AdminAccess = in.SSHAccess
return autoConvert_kops_ClusterSpec_To_v1alpha1_ClusterSpec(in, out, s)
}
func Convert_v1alpha1_EtcdMemberSpec_To_kops_EtcdMemberSpec(in *EtcdMemberSpec, out *kops.EtcdMemberSpec, s conversion.Scope) error {
if in.Zone != nil {
instanceGroup := "master-" + *in.Zone
out.InstanceGroup = &instanceGroup
} else {
out.InstanceGroup = nil
}
return autoConvert_v1alpha1_EtcdMemberSpec_To_kops_EtcdMemberSpec(in, out, s)
}
func Convert_kops_EtcdMemberSpec_To_v1alpha1_EtcdMemberSpec(in *kops.EtcdMemberSpec, out *EtcdMemberSpec, s conversion.Scope) error {
err := autoConvert_kops_EtcdMemberSpec_To_v1alpha1_EtcdMemberSpec(in, out, s)
if err != nil {
return err
}
if in.InstanceGroup != nil {
zone := *in.InstanceGroup
if !strings.HasPrefix(zone, "master-") {
return fmt.Errorf("cannot convert etc instance group name %q to v1alpha1: need master- prefix", zone)
}
zone = strings.TrimPrefix(zone, "master-")
out.Zone = &zone
} else {
out.Zone = nil
}
return nil
}
func Convert_v1alpha1_InstanceGroupSpec_To_kops_InstanceGroupSpec(in *InstanceGroupSpec, out *kops.InstanceGroupSpec, s conversion.Scope) error {
err := autoConvert_v1alpha1_InstanceGroupSpec_To_kops_InstanceGroupSpec(in, out, s)
if err != nil {
return err
}
out.Subnets = in.Zones
out.Zones = nil // Those zones are not the same as v1alpha1 zones
return nil
}
func Convert_kops_InstanceGroupSpec_To_v1alpha1_InstanceGroupSpec(in *kops.InstanceGroupSpec, out *InstanceGroupSpec, s conversion.Scope) error {
err := autoConvert_kops_InstanceGroupSpec_To_v1alpha1_InstanceGroupSpec(in, out, s)
if err != nil {
return err
}
out.Zones = in.Subnets
return nil
}
func Convert_v1alpha1_TopologySpec_To_kops_TopologySpec(in *TopologySpec, out *kops.TopologySpec, s conversion.Scope) error {
out.Masters = in.Masters
out.Nodes = in.Nodes
if in.Bastion != nil && in.Bastion.Enable {
out.Bastion = new(kops.BastionSpec)
if err := Convert_v1alpha1_BastionSpec_To_kops_BastionSpec(in.Bastion, out.Bastion, s); err != nil {
return err
}
} else {
out.Bastion = nil
}
if in.DNS != nil {
out.DNS = new(kops.DNSSpec)
if err := Convert_v1alpha1_DNSSpec_To_kops_DNSSpec(in.DNS, out.DNS, s); err != nil {
return err
}
} else {
out.DNS = nil
}
return nil
}
func Convert_kops_TopologySpec_To_v1alpha1_TopologySpec(in *kops.TopologySpec, out *TopologySpec, s conversion.Scope) error {
out.Masters = in.Masters
out.Nodes = in.Nodes
if in.Bastion != nil {
out.Bastion = new(BastionSpec)
if err := Convert_kops_BastionSpec_To_v1alpha1_BastionSpec(in.Bastion, out.Bastion, s); err != nil {
return err
}
} else {
out.Bastion = nil
}
if in.DNS != nil {
out.DNS = new(DNSSpec)
if err := Convert_kops_DNSSpec_To_v1alpha1_DNSSpec(in.DNS, out.DNS, s); err != nil {
return err
}
} else {
out.DNS = nil
}
return nil
}

View File

@ -1,93 +0,0 @@
/*
Copyright 2019 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 v1alpha1
import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/klog"
)
func addDefaultingFuncs(scheme *runtime.Scheme) error {
return RegisterDefaults(scheme)
}
func SetDefaults_ClusterSpec(obj *ClusterSpec) {
if obj.Topology == nil {
obj.Topology = &TopologySpec{}
}
if obj.Topology.Masters == "" {
obj.Topology.Masters = TopologyPublic
}
if obj.Topology.Nodes == "" {
obj.Topology.Nodes = TopologyPublic
}
if obj.Topology.DNS == nil {
obj.Topology.DNS = &DNSSpec{}
}
if obj.Topology.DNS.Type == "" {
obj.Topology.DNS.Type = DNSTypePublic
}
if obj.API == nil {
obj.API = &AccessSpec{}
}
if obj.API.IsEmpty() {
switch obj.Topology.Masters {
case TopologyPublic:
obj.API.DNS = &DNSAccessSpec{}
case TopologyPrivate:
obj.API.LoadBalancer = &LoadBalancerAccessSpec{}
default:
klog.Infof("unknown master topology type: %q", obj.Topology.Masters)
}
}
if obj.API.LoadBalancer != nil && obj.API.LoadBalancer.Type == "" {
obj.API.LoadBalancer.Type = LoadBalancerTypePublic
}
if obj.Authorization == nil {
obj.Authorization = &AuthorizationSpec{}
}
if obj.Authorization.IsEmpty() {
// Before the Authorization field was introduced, the behaviour was alwaysAllow
obj.Authorization.AlwaysAllow = &AlwaysAllowAuthorizationSpec{}
}
if obj.IAM == nil {
obj.IAM = &IAMSpec{
Legacy: true,
}
}
if obj.Networking != nil {
if obj.Networking.Flannel != nil {
if obj.Networking.Flannel.Backend == "" {
// Populate with legacy default value; new clusters will be created with vxlan by create cluster
obj.Networking.Flannel.Backend = "udp"
}
}
}
}

View File

@ -1,23 +0,0 @@
/*
Copyright 2019 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.
*/
// +k8s:openapi-gen=true
// +k8s:conversion-gen=k8s.io/kops/pkg/apis/kops
// +k8s:deepcopy-gen=package,register
// +k8s:defaulter-gen=TypeMeta
// +groupName=kops.k8s.io
package v1alpha1

View File

@ -1,73 +0,0 @@
/*
Copyright 2019 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 v1alpha1
// DockerConfig is the configuration for docker
type DockerConfig struct {
// AuthorizationPlugins is a list of authorization plugins
AuthorizationPlugins []string `json:"authorizationPlugins,omitempty" flag:"authorization-plugin,repeat"`
// Bridge is the network interface containers should bind onto
Bridge *string `json:"bridge,omitempty" flag:"bridge"`
// BridgeIP is a specific IP address and netmask for the docker0 bridge, using standard CIDR notation
BridgeIP *string `json:"bridgeIP,omitempty" flag:"bip"`
// DataRoot is the root directory of persistent docker state (default "/var/lib/docker")
DataRoot *string `json:"dataRoot,omitempty" flag:"data-root"`
// DefaultUlimit is the ulimits for containers
DefaultUlimit []string `json:"defaultUlimit,omitempty" flag:"default-ulimit,repeat"`
// ExecOpt is a series of options passed to the runtime
ExecOpt []string `json:"execOpt,omitempty" flag:"exec-opt,repeat"`
// ExecRoot is the root directory for execution state files (default "/var/run/docker")
ExecRoot *string `json:"execRoot,omitempty" flag:"exec-root"`
// Experimental features permits enabling new features such as dockerd metrics
Experimental *bool `json:"experimental,omitempty" flag:"experimental"`
// HealthCheck enables the periodic health-check service
HealthCheck bool `json:"healthCheck,omitempty"`
// Hosts enables you to configure the endpoints the docker daemon listens on i.e. tcp://0.0.0.0.2375 or unix:///var/run/docker.sock etc
Hosts []string `json:"hosts,omitempty" flag:"host,repeat"`
// IPMasq enables ip masquerading for containers
IPMasq *bool `json:"ipMasq,omitempty" flag:"ip-masq"`
// IPtables enables addition of iptables rules
IPTables *bool `json:"ipTables,omitempty" flag:"iptables"`
// InsecureRegistry enable insecure registry communication @question according to dockers this a list??
InsecureRegistry *string `json:"insecureRegistry,omitempty" flag:"insecure-registry"`
// InsecureRegistries enables multiple insecure docker registry communications
InsecureRegistries []string `json:"insecureRegistries,omitempty" flag:"insecure-registry"`
// LiveRestore enables live restore of docker when containers are still running
LiveRestore *bool `json:"liveRestore,omitempty" flag:"live-restore"`
// LogDriver is the default driver for container logs (default "json-file")
LogDriver *string `json:"logDriver,omitempty" flag:"log-driver"`
// LogLevel is the logging level ("debug", "info", "warn", "error", "fatal") (default "info")
LogLevel *string `json:"logLevel,omitempty" flag:"log-level"`
// Logopt is a series of options given to the log driver options for containers
LogOpt []string `json:"logOpt,omitempty" flag:"log-opt,repeat"`
// Metrics address is the endpoint to serve with Prometheus format metrics
MetricsAddress *string `json:"metricsAddress,omitempty" flag:"metrics-addr"`
// MTU is the containers network MTU
MTU *int32 `json:"mtu,omitempty" flag:"mtu"`
// RegistryMirrors is a referred list of docker registry mirror
RegistryMirrors []string `json:"registryMirrors,omitempty" flag:"registry-mirror,repeat"`
// SkipInstall when set to true will prevent kops from installing and modifying Docker in any way
SkipInstall bool `json:"skipInstall,omitempty"`
// Storage is the docker storage driver to use
Storage *string `json:"storage,omitempty" flag:"storage-driver"`
// StorageOpts is a series of options passed to the storage driver
StorageOpts []string `json:"storageOpts,omitempty" flag:"storage-opt,repeat"`
// UserNamespaceRemap sets the user namespace remapping option for the docker daemon
UserNamespaceRemap string `json:"userNamespaceRemap,omitempty" flag:"userns-remap"`
// Version is consumed by the nodeup and used to pick the docker version
Version *string `json:"version,omitempty"`
}

View File

@ -1,247 +0,0 @@
/*
Copyright 2019 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 v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// InstanceGroup represents a group of instances (either nodes or masters) with the same configuration
type InstanceGroup struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec InstanceGroupSpec `json:"spec,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// InstanceGroupList is a list of instance groups
type InstanceGroupList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []InstanceGroup `json:"items"`
}
// InstanceGroupRole string describes the roles of the nodes in this InstanceGroup (master or nodes)
type InstanceGroupRole string
const (
// InstanceGroupRoleMaster is a master role
InstanceGroupRoleMaster InstanceGroupRole = "Master"
// InstanceGroupRoleNode is a node role
InstanceGroupRoleNode InstanceGroupRole = "Node"
// InstanceGroupRoleBastion is a bastion role
InstanceGroupRoleBastion InstanceGroupRole = "Bastion"
)
// AllInstanceGroupRoles is a slice of all valid InstanceGroupRole values
var AllInstanceGroupRoles = []InstanceGroupRole{
InstanceGroupRoleNode,
InstanceGroupRoleMaster,
InstanceGroupRoleBastion,
}
const (
// BtfsFilesystem indicates a btfs filesystem
BtfsFilesystem = "btfs"
// Ext4Filesystem indicates a ext3 filesystem
Ext4Filesystem = "ext4"
// XFSFilesystem indicates a xfs filesystem
XFSFilesystem = "xfs"
)
var (
// SupportedFilesystems is a list of supported filesystems to format as
SupportedFilesystems = []string{BtfsFilesystem, Ext4Filesystem, XFSFilesystem}
)
// InstanceGroupSpec is the specification for a instanceGroup
type InstanceGroupSpec struct {
// Type determines the role of instances in this group: masters or nodes
Role InstanceGroupRole `json:"role,omitempty"`
// Image is the instance (ami etc) we should use
Image string `json:"image,omitempty"`
// MinSize is the minimum size of the pool
MinSize *int32 `json:"minSize,omitempty"`
// MaxSize is the maximum size of the pool
MaxSize *int32 `json:"maxSize,omitempty"`
// MachineType is the instance class
MachineType string `json:"machineType,omitempty"`
// RootVolumeSize is the size of the EBS root volume to use, in GB
RootVolumeSize *int32 `json:"rootVolumeSize,omitempty"`
// RootVolumeType is the type of the EBS root volume to use (e.g. gp2)
RootVolumeType *string `json:"rootVolumeType,omitempty"`
// If volume type is io1, then we need to specify the number of Iops.
RootVolumeIops *int32 `json:"rootVolumeIops,omitempty"`
// RootVolumeOptimization enables EBS optimization for an instance
RootVolumeOptimization *bool `json:"rootVolumeOptimization,omitempty"`
// RootVolumeDeleteOnTermination configures root volume retention policy upon instance termination.
// The root volume is deleted by default. Cluster deletion does not remove retained root volumes.
// NOTE: This setting applies only to the Launch Configuration and does not affect Launch Templates.
RootVolumeDeleteOnTermination *bool `json:"rootVolumeDeleteOnTermination,omitempty"`
// Volumes is a collection of additional volumes to create for instances within this InstanceGroup
Volumes []*VolumeSpec `json:"volumes,omitempty"`
// VolumeMounts a collection of volume mounts
VolumeMounts []*VolumeMountSpec `json:"volumeMounts,omitempty"`
// Hooks is a list of hooks for this instanceGroup, note: these can override the cluster wide ones if required
Hooks []HookSpec `json:"hooks,omitempty"`
// MaxPrice indicates this is a spot-pricing group, with the specified value as our max-price bid
MaxPrice *string `json:"maxPrice,omitempty"`
// AssociatePublicIP is true if we want instances to have a public IP
AssociatePublicIP *bool `json:"associatePublicIp,omitempty"`
// AdditionalSecurityGroups attaches additional security groups (e.g. i-123456)
AdditionalSecurityGroups []string `json:"additionalSecurityGroups,omitempty"`
// CloudLabels indicates the labels for instances in this group, at the AWS level
CloudLabels map[string]string `json:"cloudLabels,omitempty"`
// NodeLabels indicates the kubernetes labels for nodes in this group
NodeLabels map[string]string `json:"nodeLabels,omitempty"`
// A collection of files assets for deployed cluster wide
FileAssets []FileAssetSpec `json:"fileAssets,omitempty"`
// Describes the tenancy of the instance group. Can be either default or dedicated.
// Currently only applies to AWS.
Tenancy string `json:"tenancy,omitempty"`
// Kubelet overrides kubelet config from the ClusterSpec
Kubelet *KubeletConfigSpec `json:"kubelet,omitempty"`
// Taints indicates the kubernetes taints for nodes in this group
Taints []string `json:"taints,omitempty"`
// MixedInstancesPolicy defined a optional backing of an AWS ASG by a EC2 Fleet (AWS Only)
MixedInstancesPolicy *MixedInstancesPolicySpec `json:"mixedInstancesPolicy,omitempty"`
// AdditionalUserData is any additional user-data to be passed to the host
AdditionalUserData []UserData `json:"additionalUserData,omitempty"`
// Zones is the names of the Zones where machines in this instance group should be placed
// This is needed for regional subnets (e.g. GCE), to restrict placement to particular zones
Zones []string `json:"zones,omitempty"`
// SuspendProcesses disables the listed Scaling Policies
SuspendProcesses []string `json:"suspendProcesses,omitempty"`
// ExternalLoadBalancers define loadbalancers that should be attached to the instancegroup
ExternalLoadBalancers []LoadBalancer `json:"externalLoadBalancers,omitempty"`
// DetailedInstanceMonitoring defines if detailed-monitoring is enabled (AWS only)
DetailedInstanceMonitoring *bool `json:"detailedInstanceMonitoring,omitempty"`
// IAMProfileSpec defines the identity of the cloud group IAM profile (AWS only).
IAM *IAMProfileSpec `json:"iam,omitempty"`
// SecurityGroupOverride overrides the default security group created by Kops for this IG (AWS only).
SecurityGroupOverride *string `json:"securityGroupOverride,omitempty"`
// InstanceProtection makes new instances in an autoscaling group protected from scale in
InstanceProtection *bool `json:"instanceProtection,omitempty"`
// SysctlParameters will configure kernel parameters using sysctl(8). When
// specified, each parameter must follow the form variable=value, the way
// it would appear in sysctl.conf.
SysctlParameters []string `json:"sysctlParameters,omitempty"`
// RollingUpdate defines the rolling-update behavior
RollingUpdate *RollingUpdate `json:"rollingUpdate,omitempty"`
}
const (
// SpotAllocationStrategyLowestPrices indicates a lowest-price strategy
SpotAllocationStrategyLowestPrices = "lowest-price"
// SpotAllocationStrategyDiversified indicates a diversified strategy
SpotAllocationStrategyDiversified = "diversified"
// SpotAllocationStrategyCapacityOptimized indicates a capacity optimized strategy
SpotAllocationStrategyCapacityOptimized = "capacity-optimized"
)
// SpotAllocationStrategies is a collection of supported strategies
var SpotAllocationStrategies = []string{SpotAllocationStrategyLowestPrices, SpotAllocationStrategyDiversified, SpotAllocationStrategyCapacityOptimized}
// MixedInstancesPolicySpec defines the specification for an autoscaling backed by a ec2 fleet
type MixedInstancesPolicySpec struct {
// Instances is a list of instance types which we are willing to run in the EC2 fleet
Instances []string `json:"instances,omitempty"`
// OnDemandAllocationStrategy indicates how to allocate instance types to fulfill On-Demand capacity
OnDemandAllocationStrategy *string `json:"onDemandAllocationStrategy,omitempty"`
// OnDemandBase is the minimum amount of the Auto Scaling group's capacity that must be
// fulfilled by On-Demand Instances. This base portion is provisioned first as your group scales.
OnDemandBase *int64 `json:"onDemandBase,omitempty"`
// OnDemandAboveBase controls the percentages of On-Demand Instances and Spot Instances for your
// additional capacity beyond OnDemandBase. The range is 0100. The default value is 100. If you
// leave this parameter set to 100, the percentages are 100% for On-Demand Instances and 0% for
// Spot Instances.
OnDemandAboveBase *int64 `json:"onDemandAboveBase,omitempty"`
// SpotAllocationStrategy diversifies your Spot capacity across multiple instance types to
// find the best pricing. Higher Spot availability may result from a larger number of
// instance types to choose from.
SpotAllocationStrategy *string `json:"spotAllocationStrategy,omitempty"`
// SpotInstancePools is the number of Spot pools to use to allocate your Spot capacity (defaults to 2)
// pools are determined from the different instance types in the Overrides array of LaunchTemplate
SpotInstancePools *int64 `json:"spotInstancePools,omitempty"`
}
// IAMProfileSpec is the AWS IAM Profile to attach to instances in this instance
// group. Specify the ARN for the IAM instance profile (AWS only).
type IAMProfileSpec struct {
// Profile of the cloud group IAM profile. In aws this is the arn
// for the iam instance profile
Profile *string `json:"profile,omitempty"`
}
// UserData defines a user-data section
type UserData struct {
// Name is the name of the user-data
Name string `json:"name,omitempty"`
// Type is the type of user-data
Type string `json:"type,omitempty"`
// Content is the user-data content
Content string `json:"content,omitempty"`
}
// VolumeSpec defined the spec for an additional volume attached to the instance group
type VolumeSpec struct {
// DeleteOnTermination configures volume retention policy upon instance termination.
// The volume is deleted by default. Cluster deletion does not remove retained volumes.
// NOTE: This setting applies only to the Launch Configuration and does not affect Launch Templates.
DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"`
// Device is an optional device name of the block device
Device string `json:"device,omitempty"`
// Encrypted indicates you want to encrypt the volume
Encrypted *bool `json:"encrypted,omitempty"`
// Iops is the provision iops for this iops (think io1 in aws)
Iops *int64 `json:"iops,omitempty"`
// Size is the size of the volume in GB
Size int64 `json:"size,omitempty"`
// Type is the type of volume to create and is cloud specific
Type string `json:"type,omitempty"`
}
// VolumeMountSpec defines the specification for mounting a device
type VolumeMountSpec struct {
// Device is the device name to provision and mount
Device string `json:"device,omitempty"`
// Filesystem is the filesystem to mount
Filesystem string `json:"filesystem,omitempty"`
// FormatOptions is a collection of options passed when formatting the device
FormatOptions []string `json:"formatOptions,omitempty"`
// MountOptions is a collection of mount options
MountOptions []string `json:"mountOptions,omitempty"`
// Path is the location to mount the device
Path string `json:"path,omitempty"`
}
// Ext4FileSystemSpec defines a specification for a ext4 filesystem on a instancegroup volume
type Ext4FileSystemSpec struct{}
// LoadBalancer defines a load balancer
type LoadBalancer struct {
// LoadBalancerName to associate with this instance group (AWS ELB)
LoadBalancerName *string `json:"loadBalancerName,omitempty"`
// TargetGroupARN to associate with this instance group (AWS ALB/NLB)
TargetGroupARN *string `json:"targetGroupArn,omitempty"`
}

View File

@ -1,439 +0,0 @@
/*
Copyright 2019 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 v1alpha1
import "k8s.io/apimachinery/pkg/api/resource"
// NetworkingSpec allows selection and configuration of a networking plugin
type NetworkingSpec struct {
Classic *ClassicNetworkingSpec `json:"classic,omitempty"`
Kubenet *KubenetNetworkingSpec `json:"kubenet,omitempty"`
External *ExternalNetworkingSpec `json:"external,omitempty"`
CNI *CNINetworkingSpec `json:"cni,omitempty"`
Kopeio *KopeioNetworkingSpec `json:"kopeio,omitempty"`
Weave *WeaveNetworkingSpec `json:"weave,omitempty"`
Flannel *FlannelNetworkingSpec `json:"flannel,omitempty"`
Calico *CalicoNetworkingSpec `json:"calico,omitempty"`
Canal *CanalNetworkingSpec `json:"canal,omitempty"`
Kuberouter *KuberouterNetworkingSpec `json:"kuberouter,omitempty"`
Romana *RomanaNetworkingSpec `json:"romana,omitempty"`
AmazonVPC *AmazonVPCNetworkingSpec `json:"amazonvpc,omitempty"`
Cilium *CiliumNetworkingSpec `json:"cilium,omitempty"`
LyftVPC *LyftVPCNetworkingSpec `json:"lyftvpc,omitempty"`
GCE *GCENetworkingSpec `json:"gce,omitempty"`
}
// ClassicNetworkingSpec is the specification of classic networking mode, integrated into kubernetes
type ClassicNetworkingSpec struct {
}
// KubenetNetworkingSpec is the specification for kubenet networking, largely integrated but intended to replace classic
type KubenetNetworkingSpec struct {
}
// ExternalNetworkingSpec is the specification for networking that is implemented by a Daemonset
// It also uses kubenet
type ExternalNetworkingSpec struct {
}
// CNINetworkingSpec is the specification for networking that is implemented by a Daemonset
// Networking is not managed by kops - we can create options here that directly configure e.g. weave
// but this is useful for arbitrary network modes or for modes that don't need additional configuration.
type CNINetworkingSpec struct {
UsesSecondaryIP bool `json:"usesSecondaryIP,omitempty"`
}
// KopeioNetworkingSpec declares that we want Kopeio networking
type KopeioNetworkingSpec struct {
}
// WeaveNetworkingSpec declares that we want Weave networking
type WeaveNetworkingSpec struct {
MTU *int32 `json:"mtu,omitempty"`
ConnLimit *int32 `json:"connLimit,omitempty"`
NoMasqLocal *int32 `json:"noMasqLocal,omitempty"`
// MemoryRequest memory request of weave container. Default 200Mi
MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"`
// CPURequest CPU request of weave container. Default 50m
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
// MemoryLimit memory limit of weave container. Default 200Mi
MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"`
// CPULimit CPU limit of weave container.
CPULimit *resource.Quantity `json:"cpuLimit,omitempty"`
// NetExtraArgs are extra arguments that are passed to weave-kube.
NetExtraArgs string `json:"netExtraArgs,omitempty"`
// NPCMemoryRequest memory request of weave npc container. Default 200Mi
NPCMemoryRequest *resource.Quantity `json:"npcMemoryRequest,omitempty"`
// NPCCPURequest CPU request of weave npc container. Default 50m
NPCCPURequest *resource.Quantity `json:"npcCPURequest,omitempty"`
// NPCMemoryLimit memory limit of weave npc container. Default 200Mi
NPCMemoryLimit *resource.Quantity `json:"npcMemoryLimit,omitempty"`
// NPCCPULimit CPU limit of weave npc container
NPCCPULimit *resource.Quantity `json:"npcCPULimit,omitempty"`
// NPCExtraArgs are extra arguments that are passed to weave-npc.
NPCExtraArgs string `json:"npcExtraArgs,omitempty"`
}
// FlannelNetworkingSpec declares that we want Flannel networking
type FlannelNetworkingSpec struct {
// Backend is the backend overlay type we want to use (vxlan or udp)
Backend string `json:"backend,omitempty"`
// IptablesResyncSeconds sets resync period for iptables rules, in seconds
IptablesResyncSeconds *int32 `json:"iptablesResyncSeconds,omitempty"`
}
// CalicoNetworkingSpec declares that we want Calico networking
type CalicoNetworkingSpec struct {
CrossSubnet bool `json:"crossSubnet,omitempty"` // Enables Calico's cross-subnet mode when set to true
// LogSeverityScreen lets us set the desired log level. (Default: info)
LogSeverityScreen string `json:"logSeverityScreen,omitempty"`
// MTU to be set in the cni-network-config for calico.
MTU *int32 `json:"mtu,omitempty"`
// PrometheusMetricsEnabled can be set to enable the experimental Prometheus
// metrics server (default: false)
PrometheusMetricsEnabled bool `json:"prometheusMetricsEnabled,omitempty"`
// PrometheusMetricsPort is the TCP port that the experimental Prometheus
// metrics server should bind to (default: 9091)
PrometheusMetricsPort int32 `json:"prometheusMetricsPort,omitempty"`
// PrometheusGoMetricsEnabled enables Prometheus Go runtime metrics collection
PrometheusGoMetricsEnabled bool `json:"prometheusGoMetricsEnabled,omitempty"`
// PrometheusProcessMetricsEnabled enables Prometheus process metrics collection
PrometheusProcessMetricsEnabled bool `json:"prometheusProcessMetricsEnabled,omitempty"`
// MajorVersion is the version of Calico to use
MajorVersion string `json:"majorVersion,omitempty"`
// IptablesBackend controls which variant of iptables binary Felix uses
// Default: Auto (other options: Legacy, NFT)
IptablesBackend string `json:"iptablesBackend,omitempty"`
// IPIPMode is mode for CALICO_IPV4POOL_IPIP
IPIPMode string `json:"ipipMode,omitempty"`
// TyphaPrometheusMetricsEnabled enables Prometheus metrics collection from Typha
// (default: false)
TyphaPrometheusMetricsEnabled bool `json:"typhaPrometheusMetricsEnabled,omitempty"`
// TyphaPrometheusMetricsPort is the TCP port the typha Prometheus metrics server
// should bind to (default: 9093)
TyphaPrometheusMetricsPort int32 `json:"typhaPrometheusMetricsPort,omitempty"`
// TyphaReplicas is the number of replicas of Typha to deploy
TyphaReplicas int32 `json:"typhaReplicas,omitempty"`
}
// CanalNetworkingSpec declares that we want Canal networking
type CanalNetworkingSpec struct {
// ChainInsertMode controls whether Felix inserts rules to the top of iptables chains, or
// appends to the bottom. Leaving the default option is safest to prevent accidentally
// breaking connectivity. Default: 'insert' (other options: 'append')
ChainInsertMode string `json:"chainInsertMode,omitempty"`
// DefaultEndpointToHostAction allows users to configure the default behaviour
// for traffic between pod to host after calico rules have been processed.
// Default: ACCEPT (other options: DROP, RETURN)
DefaultEndpointToHostAction string `json:"defaultEndpointToHostAction,omitempty"`
// DisableFlannelForwardRules configures Flannel to NOT add the
// default ACCEPT traffic rules to the iptables FORWARD chain
DisableFlannelForwardRules bool `json:"disableFlannelForwardRules,omitempty"`
// IptablesBackend controls which variant of iptables binary Felix uses
// Default: Auto (other options: Legacy, NFT)
IptablesBackend string `json:"iptablesBackend,omitempty"`
// LogSeveritySys the severity to set for logs which are sent to syslog
// Default: INFO (other options: DEBUG, WARNING, ERROR, CRITICAL, NONE)
LogSeveritySys string `json:"logSeveritySys,omitempty"`
// MTU to be set in the cni-network-config (default: 1500)
MTU *int32 `json:"mtu,omitempty"`
// PrometheusGoMetricsEnabled enables Prometheus Go runtime metrics collection
PrometheusGoMetricsEnabled bool `json:"prometheusGoMetricsEnabled,omitempty"`
// PrometheusMetricsEnabled can be set to enable the experimental Prometheus
// metrics server (default: false)
PrometheusMetricsEnabled bool `json:"prometheusMetricsEnabled,omitempty"`
// PrometheusMetricsPort is the TCP port that the experimental Prometheus
// metrics server should bind to (default: 9091)
PrometheusMetricsPort int32 `json:"prometheusMetricsPort,omitempty"`
// PrometheusProcessMetricsEnabled enables Prometheus process metrics collection
PrometheusProcessMetricsEnabled bool `json:"prometheusProcessMetricsEnabled,omitempty"`
// TyphaPrometheusMetricsEnabled enables Prometheus metrics collection from Typha
// (default: false)
TyphaPrometheusMetricsEnabled bool `json:"typhaPrometheusMetricsEnabled,omitempty"`
// TyphaPrometheusMetricsPort is the TCP port the typha Prometheus metrics server
// should bind to (default: 9093)
TyphaPrometheusMetricsPort int32 `json:"typhaPrometheusMetricsPort,omitempty"`
// TyphaReplicas is the number of replicas of Typha to deploy
TyphaReplicas int32 `json:"typhaReplicas,omitempty"`
}
// KuberouterNetworkingSpec declares that we want Kube-router networking
type KuberouterNetworkingSpec struct {
}
// RomanaNetworkingSpec declares that we want Romana networking
type RomanaNetworkingSpec struct {
// DaemonServiceIP is the Kubernetes Service IP for the romana-daemon pod
DaemonServiceIP string `json:"daemonServiceIP,omitempty"`
// EtcdServiceIP is the Kubernetes Service IP for the etcd backend used by Romana
EtcdServiceIP string `json:"etcdServiceIP,omitempty"`
}
// AmazonVPCNetworkingSpec declares that we want Amazon VPC CNI networking
type AmazonVPCNetworkingSpec struct {
// The container image name to use
ImageName string `json:"imageName,omitempty"`
// Env is a list of environment variables to set in the container.
Env []EnvVar `json:"env,omitempty"`
}
// CiliumNetworkingSpec declares that we want Cilium networking
type CiliumNetworkingSpec struct {
// Version is the version of the Cilium agent and the Cilium Operator.
Version string `json:"version,omitempty"`
// AccessLog is not implemented and may be removed in the future.
// Setting this has no effect.
AccessLog string `json:"accessLog,omitempty"`
// AgentLabels is not implemented and may be removed in the future.
// Setting this has no effect.
AgentLabels []string `json:"agentLabels,omitempty"`
// AgentPrometheusPort is the port to listen to for Prometheus metrics.
// Defaults to 9090.
AgentPrometheusPort int `json:"agentPrometheusPort,omitempty"`
// AllowLocalhost is not implemented and may be removed in the future.
// Setting this has no effect.
AllowLocalhost string `json:"allowLocalhost,omitempty"`
// AutoIpv6NodeRoutes is not implemented and may be removed in the future.
// Setting this has no effect.
AutoIpv6NodeRoutes bool `json:"autoIpv6NodeRoutes,omitempty"`
// BPFRoot is not implemented and may be removed in the future.
// Setting this has no effect.
BPFRoot string `json:"bpfRoot,omitempty"`
// ContainerRuntime is not implemented and may be removed in the future.
// Setting this has no effect.
ContainerRuntime []string `json:"containerRuntime,omitempty"`
// ContainerRuntimeEndpoint is not implemented and may be removed in the future.
// Setting this has no effect.
ContainerRuntimeEndpoint map[string]string `json:"containerRuntimeEndpoint,omitempty"`
// Debug runs Cilium in debug mode.
Debug bool `json:"debug,omitempty"`
// DebugVerbose is not implemented and may be removed in the future.
// Setting this has no effect.
DebugVerbose []string `json:"debugVerbose,omitempty"`
// Device is not implemented and may be removed in the future.
// Setting this has no effect.
Device string `json:"device,omitempty"`
// DisableConntrack is not implemented and may be removed in the future.
// Setting this has no effect.
DisableConntrack bool `json:"disableConntrack,omitempty"`
// DisableIpv4 is deprecated: Use EnableIpv4 instead.
// Setting this flag has no effect.
DisableIpv4 bool `json:"disableIpv4,omitempty"`
// DisableK8sServices is not implemented and may be removed in the future.
// Setting this has no effect.
DisableK8sServices bool `json:"disableK8sServices,omitempty"`
// EnablePolicy specifies the policy enforcement mode.
// "default": Follows Kubernetes policy enforcement.
// "always": Cilium restricts all traffic if no policy is in place.
// "never": Cilium allows all traffic regardless of policies in place.
// If unspecified, "default" policy mode will be used.
EnablePolicy string `json:"enablePolicy,omitempty"`
// EnableTracing is not implemented and may be removed in the future.
// Setting this has no effect.
EnableTracing bool `json:"enableTracing,omitempty"`
// EnablePrometheusMetrics enables the Cilium "/metrics" endpoint for both the agent and the operator.
EnablePrometheusMetrics bool `json:"enablePrometheusMetrics,omitempty"`
// EnvoyLog is not implemented and may be removed in the future.
// Setting this has no effect.
EnvoyLog string `json:"envoyLog,omitempty"`
// Ipv4ClusterCIDRMaskSize is not implemented and may be removed in the future.
// Setting this has no effect.
Ipv4ClusterCIDRMaskSize int `json:"ipv4ClusterCidrMaskSize,omitempty"`
// Ipv4Node is not implemented and may be removed in the future.
// Setting this has no effect.
Ipv4Node string `json:"ipv4Node,omitempty"`
// Ipv4Range is not implemented and may be removed in the future.
// Setting this has no effect.
Ipv4Range string `json:"ipv4Range,omitempty"`
// Ipv4ServiceRange is not implemented and may be removed in the future.
// Setting this has no effect.
Ipv4ServiceRange string `json:"ipv4ServiceRange,omitempty"`
// Ipv6ClusterAllocCidr is not implemented and may be removed in the future.
// Setting this has no effect.
Ipv6ClusterAllocCidr string `json:"ipv6ClusterAllocCidr,omitempty"`
// Ipv6Node is not implemented and may be removed in the future.
// Setting this has no effect.
Ipv6Node string `json:"ipv6Node,omitempty"`
// Ipv6Range is not implemented and may be removed in the future.
// Setting this has no effect.
Ipv6Range string `json:"ipv6Range,omitempty"`
// Ipv6ServiceRange is not implemented and may be removed in the future.
// Setting this has no effect.
Ipv6ServiceRange string `json:"ipv6ServiceRange,omitempty"`
// K8sAPIServer is not implemented and may be removed in the future.
// Setting this has no effect.
K8sAPIServer string `json:"k8sApiServer,omitempty"`
// K8sKubeconfigPath is not implemented and may be removed in the future.
// Setting this has no effect.
K8sKubeconfigPath string `json:"k8sKubeconfigPath,omitempty"`
// KeepBPFTemplates is not implemented and may be removed in the future.
// Setting this has no effect.
KeepBPFTemplates bool `json:"keepBpfTemplates,omitempty"`
// KeepConfig is not implemented and may be removed in the future.
// Setting this has no effect.
KeepConfig bool `json:"keepConfig,omitempty"`
// LabelPrefixFile is not implemented and may be removed in the future.
// Setting this has currently no effect
LabelPrefixFile string `json:"labelPrefixFile,omitempty"`
// Labels is not implemented and may be removed in the future.
// Setting this has no effect.
Labels []string `json:"labels,omitempty"`
// LB is not implemented and may be removed in the future.
// Setting this has no effect.
LB string `json:"lb,omitempty"`
// LibDir is not implemented and may be removed in the future.
// Setting this has no effect.
LibDir string `json:"libDir,omitempty"`
// LogDrivers is not implemented and may be removed in the future.
// Setting this has no effect.
LogDrivers []string `json:"logDriver,omitempty"`
// LogOpt is not implemented and may be removed in the future.
// Setting this has no effect.
LogOpt map[string]string `json:"logOpt,omitempty"`
// Logstash is not implemented and may be removed in the future.
// Setting this has no effect.
Logstash bool `json:"logstash,omitempty"`
// LogstashAgent is not implemented and may be removed in the future.
// Setting this has no effect.
LogstashAgent string `json:"logstashAgent,omitempty"`
// LogstashProbeTimer is not implemented and may be removed in the future.
// Setting this has no effect.
LogstashProbeTimer uint32 `json:"logstashProbeTimer,omitempty"`
// DisableMasquerade disables masquerading traffic to external destinations behind the node IP.
DisableMasquerade bool `json:"disableMasquerade,omitempty"`
// Nat6Range is not implemented and may be removed in the future.
// Setting this has no effect.
Nat46Range string `json:"nat46Range,omitempty"`
// Pprof is not implemented and may be removed in the future.
// Setting this has no effect.
Pprof bool `json:"pprof,omitempty"`
// PrefilterDevice is not implemented and may be removed in the future.
// Setting this has no effect.
PrefilterDevice string `json:"prefilterDevice,omitempty"`
// PrometheusServeAddr is deprecated. Use EnablePrometheusMetrics and AgentPrometheusPort instead.
// Setting this has no effect.
PrometheusServeAddr string `json:"prometheusServeAddr,omitempty"`
// Restore is not implemented and may be removed in the future.
// Setting this has no effect.
Restore bool `json:"restore,omitempty"`
// SingleClusterRoute is not implemented and may be removed in the future.
// Setting this has no effect.
SingleClusterRoute bool `json:"singleClusterRoute,omitempty"`
// SocketPath is not implemented and may be removed in the future.
// Setting this has no effect.
SocketPath string `json:"socketPath,omitempty"`
// StateDir is not implemented and may be removed in the future.
// Setting this has no effect.
StateDir string `json:"stateDir,omitempty"`
// TracePayloadLen is not implemented and may be removed in the future.
// Setting this has no effect.
TracePayloadLen int `json:"tracePayloadlen,omitempty"`
// Tunnel specifies the Cilium tunelling mode. Possible values are "vxlan", "geneve", or "disabled".
// Default: vxlan
Tunnel string `json:"tunnel,omitempty"`
// EnableIpv6 enables cluster IPv6 traffic. If both EnableIpv6 and EnableIpv4 are set to false
// then IPv4 will be enabled.
// Default: false
EnableIpv6 bool `json:"enableipv6"`
// EnableIpv4 enables cluster IPv4 traffic. If both EnableIpv6 and EnableIpv4 are set to false
// then IPv4 will be enabled.
// Default: false
EnableIpv4 bool `json:"enableipv4"`
// MonitorAggregation sets the level of packet monitoring. Possible values are "low", "medium", or "maximum".
// Default: medium
MonitorAggregation string `json:"monitorAggregation"`
// BPFCTGlobalTCPMax is the maximum number of entries in the TCP CT table.
// Default: 524288
BPFCTGlobalTCPMax int `json:"bpfCTGlobalTCPMax"`
// BPFCTGlobalAnyMax is the maximum number of entries in the non-TCP CT table.
// Default: 262144
BPFCTGlobalAnyMax int `json:"bpfCTGlobalAnyMax"`
// PreallocateBPFMaps reduces the per-packet latency at the expense of up-front memory allocation.
// Default: true
PreallocateBPFMaps bool `json:"preallocateBPFMaps"`
// SidecarIstioProxyImage is the regular expression matching compatible Istio sidecar istio-proxy
// container image names.
// Default: cilium/istio_proxy
SidecarIstioProxyImage string `json:"sidecarIstioProxyImage"`
// ClusterName is the name of the cluster. It is only relevant when building a mesh of clusters.
ClusterName string `json:"clusterName"`
// ToFqdnsDNSRejectResponseCode sets the DNS response code for rejecting DNS requests.
// Possible values are "nameError" or "refused".
// Default: refused
ToFqdnsDNSRejectResponseCode string `json:"toFqdnsDnsRejectResponseCode,omitempty"`
// ToFqdnsEnablePoller replaces the DNS proxy-based implementation of FQDN policies
// with the less powerful legacy implementation.
// Default: false
ToFqdnsEnablePoller bool `json:"toFqdnsEnablePoller"`
// ContainerRuntimeLabels enables fetching of container-runtime labels from the specified container runtime and associating them with endpoints.
// Supported values are: "none", "containerd", "crio", "docker", "auto"
// As of Cilium 1.7.0, Cilium no longer fetches information from the
// container runtime and this field is ignored.
// Default: none
ContainerRuntimeLabels string `json:"containerRuntimeLabels,omitempty"`
// Ipam specifies the IP address allocation mode to use.
// Possible values are "crd" and "eni".
// "eni" will use AWS native networking for pods. Eni requires masquerade to be set to false.
// "crd" will use CRDs for controlling IP address management.
// Empty value will use host-scope address management.
Ipam string `json:"ipam,omitempty"`
// IPTablesRulesNoinstall disables installing the base IPTables rules used for masquerading and kube-proxy.
// Default: false
IPTablesRulesNoinstall bool `json:"IPTablesRulesNoinstall"`
// AutoDirectNodeRoutes adds automatic L2 routing between nodes.
// Default: false
AutoDirectNodeRoutes bool `json:"autoDirectNodeRoutes"`
// EnableNodePort replaces kube-proxy with Cilium's BPF implementation.
// Requires spec.kubeProxy.enabled be set to false.
// Default: false
EnableNodePort bool `json:"enableNodePort"`
// EtcdManagd installs an additional etcd cluster that is used for Cilium state change.
// The cluster is operated by cilium-etcd-operator.
// Default: false
EtcdManaged bool `json:"etcdManaged,omitempty"`
// EnableRemoteNodeIdentity enables the remote-node-identity added in Cilium 1.7.0.
// Default: false
EnableRemoteNodeIdentity bool `json:"enableRemoteNodeIdentity"`
// RemoveCbrBridge is not implemented and may be removed in the future.
// Setting this has no effect.
RemoveCbrBridge bool `json:"removeCbrBridge"`
// RestartPods is not implemented and may be removed in the future.
// Setting this has no effect.
RestartPods bool `json:"restartPods"`
// ReconfigureKubelet is not implemented and may be removed in the future.
// Setting this has no effect.
ReconfigureKubelet bool `json:"reconfigureKubelet"`
// NodeInitBootstrapFile is not implemented and may be removed in the future.
// Setting this has no effect.
NodeInitBootstrapFile string `json:"nodeInitBootstrapFile"`
// CniBinPath is not implemented and may be removed in the future.
// Setting this has no effect.
CniBinPath string `json:"cniBinPath"`
}
// LyftIpVlanNetworkingSpec declares that we want to use the cni-ipvlan-vpc-k8s CNI networking
type LyftVPCNetworkingSpec struct {
SubnetTags map[string]string `json:"subnetTags,omitempty"`
}
// GCENetworkingSpec is the specification of GCE's native networking mode, using IP aliases
type GCENetworkingSpec struct {
}

View File

@ -1,102 +0,0 @@
/*
Copyright 2019 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 v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
var (
SchemeBuilder runtime.SchemeBuilder
localSchemeBuilder = &SchemeBuilder
AddToScheme = localSchemeBuilder.AddToScheme
)
func init() {
// We only register manually written functions here. The registration of the
// generated functions takes place in the generated files. The separation
// makes the code compile even when the generated files are missing.
localSchemeBuilder.Register(addKnownTypes, addDefaultingFuncs, addConversionFuncs)
}
// GroupName is the group name use in this package
const GroupName = "kops.k8s.io"
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
//// Kind takes an unqualified kind and returns a Group qualified GroupKind
//func Kind(kind string) schema.GroupKind {
// return SchemeGroupVersion.WithKind(kind).GroupKind()
//}
//
//// Resource takes an unqualified resource and returns a Group qualified GroupResource
//func Resource(resource string) schema.GroupResource {
// return SchemeGroupVersion.WithResource(resource).GroupResource()
//}
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Cluster{},
&ClusterList{},
&InstanceGroup{},
&InstanceGroupList{},
&SSHCredential{},
&SSHCredentialList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
func (obj *Cluster) GetObjectKind() schema.ObjectKind {
return &obj.TypeMeta
}
func (obj *InstanceGroup) GetObjectKind() schema.ObjectKind {
return &obj.TypeMeta
}
func (obj *SSHCredential) GetObjectKind() schema.ObjectKind {
return &obj.TypeMeta
}
func addConversionFuncs(scheme *runtime.Scheme) error {
// Add non-generated conversion functions
err := scheme.AddConversionFuncs(
Convert_v1alpha1_BastionSpec_To_kops_BastionSpec,
Convert_kops_BastionSpec_To_v1alpha1_BastionSpec,
Convert_v1alpha1_ClusterSpec_To_kops_ClusterSpec,
Convert_kops_ClusterSpec_To_v1alpha1_ClusterSpec,
Convert_v1alpha1_EtcdMemberSpec_To_kops_EtcdMemberSpec,
Convert_kops_EtcdMemberSpec_To_v1alpha1_EtcdMemberSpec,
Convert_v1alpha1_InstanceGroupSpec_To_kops_InstanceGroupSpec,
Convert_kops_InstanceGroupSpec_To_v1alpha1_InstanceGroupSpec,
Convert_v1alpha1_TopologySpec_To_kops_TopologySpec,
Convert_kops_TopologySpec_To_v1alpha1_TopologySpec,
)
if err != nil {
return err
}
return nil
}

View File

@ -1,45 +0,0 @@
/*
Copyright 2019 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 v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// SSHCredential represent a set of kops secrets
type SSHCredential struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec SSHCredentialSpec `json:"spec,omitempty"`
}
type SSHCredentialSpec struct {
PublicKey string `json:"publicKey,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type SSHCredentialList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []SSHCredential `json:"items"`
}

View File

@ -1,52 +0,0 @@
/*
Copyright 2019 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 v1alpha1
const (
TopologyPublic = "public"
TopologyPrivate = "private"
)
// +k8s:conversion-gen=false
type TopologySpec struct {
// The environment to launch the Kubernetes masters in public|private
Masters string `json:"masters,omitempty"`
// The environment to launch the Kubernetes nodes in public|private
Nodes string `json:"nodes,omitempty"`
// Bastion provide an external facing point of entry into a network
// containing private network instances. This host can provide a single
// point of fortification or audit and can be started and stopped to enable
// or disable inbound SSH communication from the Internet, some call bastion
// as the "jump server".
Bastion *BastionSpec `json:"bastion,omitempty"`
// DNS configures options relating to DNS, in particular whether we use a public or a private hosted zone
DNS *DNSSpec `json:"dns,omitempty"`
}
type DNSSpec struct {
Type DNSType `json:"type,omitempty"`
}
type DNSType string
const (
DNSTypePublic DNSType = "Public"
DNSTypePrivate DNSType = "Private"
)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,45 +0,0 @@
// +build !ignore_autogenerated
/*
Copyright 2020 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.
*/
// Code generated by defaulter-gen. DO NOT EDIT.
package v1alpha1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
// RegisterDefaults adds defaulters functions to the given scheme.
// Public to allow building arbitrary schemes.
// All generated defaulters are covering - they call all nested defaulters.
func RegisterDefaults(scheme *runtime.Scheme) error {
scheme.AddTypeDefaultingFunc(&Cluster{}, func(obj interface{}) { SetObjectDefaults_Cluster(obj.(*Cluster)) })
scheme.AddTypeDefaultingFunc(&ClusterList{}, func(obj interface{}) { SetObjectDefaults_ClusterList(obj.(*ClusterList)) })
return nil
}
func SetObjectDefaults_Cluster(in *Cluster) {
SetDefaults_ClusterSpec(&in.Spec)
}
func SetObjectDefaults_ClusterList(in *ClusterList) {
for i := range in.Items {
a := &in.Items[i]
SetObjectDefaults_Cluster(a)
}
}

View File

@ -10,7 +10,6 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/client/clientset_generated/clientset/typed/kops/internalversion:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/kops/v1alpha1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/kops/v1alpha2:go_default_library",
"//vendor/k8s.io/client-go/discovery:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library",

View File

@ -25,14 +25,12 @@ import (
rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol"
kopsinternalversion "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/internalversion"
kopsv1alpha1 "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1"
kopsv1alpha2 "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2"
)
type Interface interface {
Discovery() discovery.DiscoveryInterface
Kops() kopsinternalversion.KopsInterface
KopsV1alpha1() kopsv1alpha1.KopsV1alpha1Interface
KopsV1alpha2() kopsv1alpha2.KopsV1alpha2Interface
}
@ -41,7 +39,6 @@ type Interface interface {
type Clientset struct {
*discovery.DiscoveryClient
kops *kopsinternalversion.KopsClient
kopsV1alpha1 *kopsv1alpha1.KopsV1alpha1Client
kopsV1alpha2 *kopsv1alpha2.KopsV1alpha2Client
}
@ -50,11 +47,6 @@ func (c *Clientset) Kops() kopsinternalversion.KopsInterface {
return c.kops
}
// KopsV1alpha1 retrieves the KopsV1alpha1Client
func (c *Clientset) KopsV1alpha1() kopsv1alpha1.KopsV1alpha1Interface {
return c.kopsV1alpha1
}
// KopsV1alpha2 retrieves the KopsV1alpha2Client
func (c *Clientset) KopsV1alpha2() kopsv1alpha2.KopsV1alpha2Interface {
return c.kopsV1alpha2
@ -85,10 +77,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if err != nil {
return nil, err
}
cs.kopsV1alpha1, err = kopsv1alpha1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.kopsV1alpha2, err = kopsv1alpha2.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
@ -106,7 +94,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
func NewForConfigOrDie(c *rest.Config) *Clientset {
var cs Clientset
cs.kops = kopsinternalversion.NewForConfigOrDie(c)
cs.kopsV1alpha1 = kopsv1alpha1.NewForConfigOrDie(c)
cs.kopsV1alpha2 = kopsv1alpha2.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
@ -117,7 +104,6 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
func New(c rest.Interface) *Clientset {
var cs Clientset
cs.kops = kopsinternalversion.New(c)
cs.kopsV1alpha1 = kopsv1alpha1.New(c)
cs.kopsV1alpha2 = kopsv1alpha2.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)

View File

@ -11,13 +11,10 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/kops:go_default_library",
"//pkg/apis/kops/v1alpha1:go_default_library",
"//pkg/apis/kops/v1alpha2:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/kops/internalversion:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/kops/v1alpha1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/kops/v1alpha2:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",

View File

@ -27,8 +27,6 @@ import (
clientset "k8s.io/kops/pkg/client/clientset_generated/clientset"
kopsinternalversion "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/internalversion"
fakekopsinternalversion "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake"
kopsv1alpha1 "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1"
fakekopsv1alpha1 "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake"
kopsv1alpha2 "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2"
fakekopsv1alpha2 "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake"
)
@ -85,11 +83,6 @@ func (c *Clientset) Kops() kopsinternalversion.KopsInterface {
return &fakekopsinternalversion.FakeKops{Fake: &c.Fake}
}
// KopsV1alpha1 retrieves the KopsV1alpha1Client
func (c *Clientset) KopsV1alpha1() kopsv1alpha1.KopsV1alpha1Interface {
return &fakekopsv1alpha1.FakeKopsV1alpha1{Fake: &c.Fake}
}
// KopsV1alpha2 retrieves the KopsV1alpha2Client
func (c *Clientset) KopsV1alpha2() kopsv1alpha2.KopsV1alpha2Interface {
return &fakekopsv1alpha2.FakeKopsV1alpha2{Fake: &c.Fake}

View File

@ -25,7 +25,6 @@ import (
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
kopsinternalversion "k8s.io/kops/pkg/apis/kops"
kopsv1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
kopsv1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2"
)
@ -34,7 +33,6 @@ var codecs = serializer.NewCodecFactory(scheme)
var parameterCodec = runtime.NewParameterCodec(scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
kopsinternalversion.AddToScheme,
kopsv1alpha1.AddToScheme,
kopsv1alpha2.AddToScheme,
}

View File

@ -1,23 +0,0 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"cluster.go",
"doc.go",
"generated_expansion.go",
"instancegroup.go",
"kops_client.go",
"sshcredential.go",
],
importpath = "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1",
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/kops/v1alpha1:go_default_library",
"//pkg/client/clientset_generated/clientset/scheme:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library",
],
)

View File

@ -1,174 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme"
)
// ClustersGetter has a method to return a ClusterInterface.
// A group's client should implement this interface.
type ClustersGetter interface {
Clusters(namespace string) ClusterInterface
}
// ClusterInterface has methods to work with Cluster resources.
type ClusterInterface interface {
Create(*v1alpha1.Cluster) (*v1alpha1.Cluster, error)
Update(*v1alpha1.Cluster) (*v1alpha1.Cluster, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.Cluster, error)
List(opts v1.ListOptions) (*v1alpha1.ClusterList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error)
ClusterExpansion
}
// clusters implements ClusterInterface
type clusters struct {
client rest.Interface
ns string
}
// newClusters returns a Clusters
func newClusters(c *KopsV1alpha1Client, namespace string) *clusters {
return &clusters{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
func (c *clusters) Get(name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Get().
Namespace(c.ns).
Resource("clusters").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
func (c *clusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ClusterList{}
err = c.client.Get().
Namespace(c.ns).
Resource("clusters").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusters.
func (c *clusters) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("clusters").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *clusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Post().
Namespace(c.ns).
Resource("clusters").
Body(cluster).
Do().
Into(result)
return
}
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *clusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Put().
Namespace(c.ns).
Resource("clusters").
Name(cluster.Name).
Body(cluster).
Do().
Into(result)
return
}
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
func (c *clusters) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("clusters").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *clusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("clusters").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched cluster.
func (c *clusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("clusters").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

View File

@ -1,20 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1

View File

@ -1,25 +0,0 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"fake_cluster.go",
"fake_instancegroup.go",
"fake_kops_client.go",
"fake_sshcredential.go",
],
importpath = "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake",
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/kops/v1alpha1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/kops/v1alpha1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library",
"//vendor/k8s.io/client-go/testing:go_default_library",
],
)

View File

@ -1,20 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake

View File

@ -1,128 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
)
// FakeClusters implements ClusterInterface
type FakeClusters struct {
Fake *FakeKopsV1alpha1
ns string
}
var clustersResource = schema.GroupVersionResource{Group: "kops.k8s.io", Version: "v1alpha1", Resource: "clusters"}
var clustersKind = schema.GroupVersionKind{Group: "kops.k8s.io", Version: "v1alpha1", Kind: "Cluster"}
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(clustersResource, c.ns, name), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
func (c *FakeClusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(clustersResource, clustersKind, c.ns, opts), &v1alpha1.ClusterList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ClusterList{ListMeta: obj.(*v1alpha1.ClusterList).ListMeta}
for _, item := range obj.(*v1alpha1.ClusterList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested clusters.
func (c *FakeClusters) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(clustersResource, c.ns, opts))
}
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *FakeClusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(clustersResource, c.ns, cluster), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *FakeClusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(clustersResource, c.ns, cluster), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
func (c *FakeClusters) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(clustersResource, c.ns, name), &v1alpha1.Cluster{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(clustersResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterList{})
return err
}
// Patch applies the patch and returns the patched cluster.
func (c *FakeClusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(clustersResource, c.ns, name, pt, data, subresources...), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}

View File

@ -1,128 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
)
// FakeInstanceGroups implements InstanceGroupInterface
type FakeInstanceGroups struct {
Fake *FakeKopsV1alpha1
ns string
}
var instancegroupsResource = schema.GroupVersionResource{Group: "kops.k8s.io", Version: "v1alpha1", Resource: "instancegroups"}
var instancegroupsKind = schema.GroupVersionKind{Group: "kops.k8s.io", Version: "v1alpha1", Kind: "InstanceGroup"}
// Get takes name of the instanceGroup, and returns the corresponding instanceGroup object, and an error if there is any.
func (c *FakeInstanceGroups) Get(name string, options v1.GetOptions) (result *v1alpha1.InstanceGroup, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(instancegroupsResource, c.ns, name), &v1alpha1.InstanceGroup{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.InstanceGroup), err
}
// List takes label and field selectors, and returns the list of InstanceGroups that match those selectors.
func (c *FakeInstanceGroups) List(opts v1.ListOptions) (result *v1alpha1.InstanceGroupList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(instancegroupsResource, instancegroupsKind, c.ns, opts), &v1alpha1.InstanceGroupList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.InstanceGroupList{ListMeta: obj.(*v1alpha1.InstanceGroupList).ListMeta}
for _, item := range obj.(*v1alpha1.InstanceGroupList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested instanceGroups.
func (c *FakeInstanceGroups) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(instancegroupsResource, c.ns, opts))
}
// Create takes the representation of a instanceGroup and creates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
func (c *FakeInstanceGroups) Create(instanceGroup *v1alpha1.InstanceGroup) (result *v1alpha1.InstanceGroup, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(instancegroupsResource, c.ns, instanceGroup), &v1alpha1.InstanceGroup{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.InstanceGroup), err
}
// Update takes the representation of a instanceGroup and updates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
func (c *FakeInstanceGroups) Update(instanceGroup *v1alpha1.InstanceGroup) (result *v1alpha1.InstanceGroup, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(instancegroupsResource, c.ns, instanceGroup), &v1alpha1.InstanceGroup{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.InstanceGroup), err
}
// Delete takes name of the instanceGroup and deletes it. Returns an error if one occurs.
func (c *FakeInstanceGroups) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(instancegroupsResource, c.ns, name), &v1alpha1.InstanceGroup{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeInstanceGroups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(instancegroupsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.InstanceGroupList{})
return err
}
// Patch applies the patch and returns the patched instanceGroup.
func (c *FakeInstanceGroups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.InstanceGroup, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(instancegroupsResource, c.ns, name, pt, data, subresources...), &v1alpha1.InstanceGroup{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.InstanceGroup), err
}

View File

@ -1,48 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1alpha1 "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1"
)
type FakeKopsV1alpha1 struct {
*testing.Fake
}
func (c *FakeKopsV1alpha1) Clusters(namespace string) v1alpha1.ClusterInterface {
return &FakeClusters{c, namespace}
}
func (c *FakeKopsV1alpha1) InstanceGroups(namespace string) v1alpha1.InstanceGroupInterface {
return &FakeInstanceGroups{c, namespace}
}
func (c *FakeKopsV1alpha1) SSHCredentials(namespace string) v1alpha1.SSHCredentialInterface {
return &FakeSSHCredentials{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeKopsV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View File

@ -1,128 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
)
// FakeSSHCredentials implements SSHCredentialInterface
type FakeSSHCredentials struct {
Fake *FakeKopsV1alpha1
ns string
}
var sshcredentialsResource = schema.GroupVersionResource{Group: "kops.k8s.io", Version: "v1alpha1", Resource: "sshcredentials"}
var sshcredentialsKind = schema.GroupVersionKind{Group: "kops.k8s.io", Version: "v1alpha1", Kind: "SSHCredential"}
// Get takes name of the sSHCredential, and returns the corresponding sSHCredential object, and an error if there is any.
func (c *FakeSSHCredentials) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHCredential, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(sshcredentialsResource, c.ns, name), &v1alpha1.SSHCredential{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.SSHCredential), err
}
// List takes label and field selectors, and returns the list of SSHCredentials that match those selectors.
func (c *FakeSSHCredentials) List(opts v1.ListOptions) (result *v1alpha1.SSHCredentialList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(sshcredentialsResource, sshcredentialsKind, c.ns, opts), &v1alpha1.SSHCredentialList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.SSHCredentialList{ListMeta: obj.(*v1alpha1.SSHCredentialList).ListMeta}
for _, item := range obj.(*v1alpha1.SSHCredentialList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested sSHCredentials.
func (c *FakeSSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(sshcredentialsResource, c.ns, opts))
}
// Create takes the representation of a sSHCredential and creates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
func (c *FakeSSHCredentials) Create(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha1.SSHCredential{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.SSHCredential), err
}
// Update takes the representation of a sSHCredential and updates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
func (c *FakeSSHCredentials) Update(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha1.SSHCredential{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.SSHCredential), err
}
// Delete takes name of the sSHCredential and deletes it. Returns an error if one occurs.
func (c *FakeSSHCredentials) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(sshcredentialsResource, c.ns, name), &v1alpha1.SSHCredential{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeSSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(sshcredentialsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.SSHCredentialList{})
return err
}
// Patch applies the patch and returns the patched sSHCredential.
func (c *FakeSSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHCredential, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(sshcredentialsResource, c.ns, name, pt, data, subresources...), &v1alpha1.SSHCredential{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.SSHCredential), err
}

View File

@ -1,25 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
type ClusterExpansion interface{}
type InstanceGroupExpansion interface{}
type SSHCredentialExpansion interface{}

View File

@ -1,174 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme"
)
// InstanceGroupsGetter has a method to return a InstanceGroupInterface.
// A group's client should implement this interface.
type InstanceGroupsGetter interface {
InstanceGroups(namespace string) InstanceGroupInterface
}
// InstanceGroupInterface has methods to work with InstanceGroup resources.
type InstanceGroupInterface interface {
Create(*v1alpha1.InstanceGroup) (*v1alpha1.InstanceGroup, error)
Update(*v1alpha1.InstanceGroup) (*v1alpha1.InstanceGroup, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.InstanceGroup, error)
List(opts v1.ListOptions) (*v1alpha1.InstanceGroupList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.InstanceGroup, err error)
InstanceGroupExpansion
}
// instanceGroups implements InstanceGroupInterface
type instanceGroups struct {
client rest.Interface
ns string
}
// newInstanceGroups returns a InstanceGroups
func newInstanceGroups(c *KopsV1alpha1Client, namespace string) *instanceGroups {
return &instanceGroups{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the instanceGroup, and returns the corresponding instanceGroup object, and an error if there is any.
func (c *instanceGroups) Get(name string, options v1.GetOptions) (result *v1alpha1.InstanceGroup, err error) {
result = &v1alpha1.InstanceGroup{}
err = c.client.Get().
Namespace(c.ns).
Resource("instancegroups").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of InstanceGroups that match those selectors.
func (c *instanceGroups) List(opts v1.ListOptions) (result *v1alpha1.InstanceGroupList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.InstanceGroupList{}
err = c.client.Get().
Namespace(c.ns).
Resource("instancegroups").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested instanceGroups.
func (c *instanceGroups) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("instancegroups").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a instanceGroup and creates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
func (c *instanceGroups) Create(instanceGroup *v1alpha1.InstanceGroup) (result *v1alpha1.InstanceGroup, err error) {
result = &v1alpha1.InstanceGroup{}
err = c.client.Post().
Namespace(c.ns).
Resource("instancegroups").
Body(instanceGroup).
Do().
Into(result)
return
}
// Update takes the representation of a instanceGroup and updates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
func (c *instanceGroups) Update(instanceGroup *v1alpha1.InstanceGroup) (result *v1alpha1.InstanceGroup, err error) {
result = &v1alpha1.InstanceGroup{}
err = c.client.Put().
Namespace(c.ns).
Resource("instancegroups").
Name(instanceGroup.Name).
Body(instanceGroup).
Do().
Into(result)
return
}
// Delete takes name of the instanceGroup and deletes it. Returns an error if one occurs.
func (c *instanceGroups) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("instancegroups").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *instanceGroups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("instancegroups").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched instanceGroup.
func (c *instanceGroups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.InstanceGroup, err error) {
result = &v1alpha1.InstanceGroup{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("instancegroups").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

View File

@ -1,99 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
rest "k8s.io/client-go/rest"
v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
"k8s.io/kops/pkg/client/clientset_generated/clientset/scheme"
)
type KopsV1alpha1Interface interface {
RESTClient() rest.Interface
ClustersGetter
InstanceGroupsGetter
SSHCredentialsGetter
}
// KopsV1alpha1Client is used to interact with features provided by the kops.k8s.io group.
type KopsV1alpha1Client struct {
restClient rest.Interface
}
func (c *KopsV1alpha1Client) Clusters(namespace string) ClusterInterface {
return newClusters(c, namespace)
}
func (c *KopsV1alpha1Client) InstanceGroups(namespace string) InstanceGroupInterface {
return newInstanceGroups(c, namespace)
}
func (c *KopsV1alpha1Client) SSHCredentials(namespace string) SSHCredentialInterface {
return newSSHCredentials(c, namespace)
}
// NewForConfig creates a new KopsV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*KopsV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &KopsV1alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new KopsV1alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *KopsV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new KopsV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *KopsV1alpha1Client {
return &KopsV1alpha1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *KopsV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View File

@ -1,174 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme"
)
// SSHCredentialsGetter has a method to return a SSHCredentialInterface.
// A group's client should implement this interface.
type SSHCredentialsGetter interface {
SSHCredentials(namespace string) SSHCredentialInterface
}
// SSHCredentialInterface has methods to work with SSHCredential resources.
type SSHCredentialInterface interface {
Create(*v1alpha1.SSHCredential) (*v1alpha1.SSHCredential, error)
Update(*v1alpha1.SSHCredential) (*v1alpha1.SSHCredential, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.SSHCredential, error)
List(opts v1.ListOptions) (*v1alpha1.SSHCredentialList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHCredential, err error)
SSHCredentialExpansion
}
// sSHCredentials implements SSHCredentialInterface
type sSHCredentials struct {
client rest.Interface
ns string
}
// newSSHCredentials returns a SSHCredentials
func newSSHCredentials(c *KopsV1alpha1Client, namespace string) *sSHCredentials {
return &sSHCredentials{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the sSHCredential, and returns the corresponding sSHCredential object, and an error if there is any.
func (c *sSHCredentials) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHCredential, err error) {
result = &v1alpha1.SSHCredential{}
err = c.client.Get().
Namespace(c.ns).
Resource("sshcredentials").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of SSHCredentials that match those selectors.
func (c *sSHCredentials) List(opts v1.ListOptions) (result *v1alpha1.SSHCredentialList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.SSHCredentialList{}
err = c.client.Get().
Namespace(c.ns).
Resource("sshcredentials").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested sSHCredentials.
func (c *sSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("sshcredentials").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a sSHCredential and creates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
func (c *sSHCredentials) Create(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) {
result = &v1alpha1.SSHCredential{}
err = c.client.Post().
Namespace(c.ns).
Resource("sshcredentials").
Body(sSHCredential).
Do().
Into(result)
return
}
// Update takes the representation of a sSHCredential and updates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
func (c *sSHCredentials) Update(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) {
result = &v1alpha1.SSHCredential{}
err = c.client.Put().
Namespace(c.ns).
Resource("sshcredentials").
Name(sSHCredential.Name).
Body(sSHCredential).
Do().
Into(result)
return
}
// Delete takes name of the sSHCredential and deletes it. Returns an error if one occurs.
func (c *sSHCredentials) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("sshcredentials").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *sSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("sshcredentials").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched sSHCredential.
func (c *sSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHCredential, err error) {
result = &v1alpha1.SSHCredential{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("sshcredentials").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

View File

@ -10,7 +10,6 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/client/clientset_generated/internalclientset/typed/kops/internalversion:go_default_library",
"//pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1:go_default_library",
"//pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2:go_default_library",
"//vendor/k8s.io/client-go/discovery:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library",

View File

@ -25,14 +25,12 @@ import (
rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol"
kopsinternalversion "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion"
kopsv1alpha1 "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1"
kopsv1alpha2 "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2"
)
type Interface interface {
Discovery() discovery.DiscoveryInterface
Kops() kopsinternalversion.KopsInterface
KopsV1alpha1() kopsv1alpha1.KopsV1alpha1Interface
KopsV1alpha2() kopsv1alpha2.KopsV1alpha2Interface
}
@ -41,7 +39,6 @@ type Interface interface {
type Clientset struct {
*discovery.DiscoveryClient
kops *kopsinternalversion.KopsClient
kopsV1alpha1 *kopsv1alpha1.KopsV1alpha1Client
kopsV1alpha2 *kopsv1alpha2.KopsV1alpha2Client
}
@ -50,11 +47,6 @@ func (c *Clientset) Kops() kopsinternalversion.KopsInterface {
return c.kops
}
// KopsV1alpha1 retrieves the KopsV1alpha1Client
func (c *Clientset) KopsV1alpha1() kopsv1alpha1.KopsV1alpha1Interface {
return c.kopsV1alpha1
}
// KopsV1alpha2 retrieves the KopsV1alpha2Client
func (c *Clientset) KopsV1alpha2() kopsv1alpha2.KopsV1alpha2Interface {
return c.kopsV1alpha2
@ -85,10 +77,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if err != nil {
return nil, err
}
cs.kopsV1alpha1, err = kopsv1alpha1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.kopsV1alpha2, err = kopsv1alpha2.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
@ -106,7 +94,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
func NewForConfigOrDie(c *rest.Config) *Clientset {
var cs Clientset
cs.kops = kopsinternalversion.NewForConfigOrDie(c)
cs.kopsV1alpha1 = kopsv1alpha1.NewForConfigOrDie(c)
cs.kopsV1alpha2 = kopsv1alpha2.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
@ -117,7 +104,6 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
func New(c rest.Interface) *Clientset {
var cs Clientset
cs.kops = kopsinternalversion.New(c)
cs.kopsV1alpha1 = kopsv1alpha1.New(c)
cs.kopsV1alpha2 = kopsv1alpha2.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)

View File

@ -11,13 +11,10 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/kops:go_default_library",
"//pkg/apis/kops/v1alpha1:go_default_library",
"//pkg/apis/kops/v1alpha2:go_default_library",
"//pkg/client/clientset_generated/internalclientset:go_default_library",
"//pkg/client/clientset_generated/internalclientset/typed/kops/internalversion:go_default_library",
"//pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake:go_default_library",
"//pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1:go_default_library",
"//pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake:go_default_library",
"//pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2:go_default_library",
"//pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",

View File

@ -27,8 +27,6 @@ import (
clientset "k8s.io/kops/pkg/client/clientset_generated/internalclientset"
kopsinternalversion "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion"
fakekopsinternalversion "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake"
kopsv1alpha1 "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1"
fakekopsv1alpha1 "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake"
kopsv1alpha2 "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2"
fakekopsv1alpha2 "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake"
)
@ -85,11 +83,6 @@ func (c *Clientset) Kops() kopsinternalversion.KopsInterface {
return &fakekopsinternalversion.FakeKops{Fake: &c.Fake}
}
// KopsV1alpha1 retrieves the KopsV1alpha1Client
func (c *Clientset) KopsV1alpha1() kopsv1alpha1.KopsV1alpha1Interface {
return &fakekopsv1alpha1.FakeKopsV1alpha1{Fake: &c.Fake}
}
// KopsV1alpha2 retrieves the KopsV1alpha2Client
func (c *Clientset) KopsV1alpha2() kopsv1alpha2.KopsV1alpha2Interface {
return &fakekopsv1alpha2.FakeKopsV1alpha2{Fake: &c.Fake}

View File

@ -25,7 +25,6 @@ import (
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
kopsinternalversion "k8s.io/kops/pkg/apis/kops"
kopsv1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
kopsv1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2"
)
@ -34,7 +33,6 @@ var codecs = serializer.NewCodecFactory(scheme)
var parameterCodec = runtime.NewParameterCodec(scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
kopsinternalversion.AddToScheme,
kopsv1alpha1.AddToScheme,
kopsv1alpha2.AddToScheme,
}

View File

@ -1,23 +0,0 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"cluster.go",
"doc.go",
"generated_expansion.go",
"instancegroup.go",
"kops_client.go",
"sshcredential.go",
],
importpath = "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1",
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/kops/v1alpha1:go_default_library",
"//pkg/client/clientset_generated/internalclientset/scheme:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library",
],
)

View File

@ -1,174 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme"
)
// ClustersGetter has a method to return a ClusterInterface.
// A group's client should implement this interface.
type ClustersGetter interface {
Clusters(namespace string) ClusterInterface
}
// ClusterInterface has methods to work with Cluster resources.
type ClusterInterface interface {
Create(*v1alpha1.Cluster) (*v1alpha1.Cluster, error)
Update(*v1alpha1.Cluster) (*v1alpha1.Cluster, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.Cluster, error)
List(opts v1.ListOptions) (*v1alpha1.ClusterList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error)
ClusterExpansion
}
// clusters implements ClusterInterface
type clusters struct {
client rest.Interface
ns string
}
// newClusters returns a Clusters
func newClusters(c *KopsV1alpha1Client, namespace string) *clusters {
return &clusters{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
func (c *clusters) Get(name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Get().
Namespace(c.ns).
Resource("clusters").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
func (c *clusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ClusterList{}
err = c.client.Get().
Namespace(c.ns).
Resource("clusters").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusters.
func (c *clusters) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("clusters").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *clusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Post().
Namespace(c.ns).
Resource("clusters").
Body(cluster).
Do().
Into(result)
return
}
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *clusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Put().
Namespace(c.ns).
Resource("clusters").
Name(cluster.Name).
Body(cluster).
Do().
Into(result)
return
}
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
func (c *clusters) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("clusters").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *clusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("clusters").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched cluster.
func (c *clusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("clusters").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

View File

@ -1,20 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1

View File

@ -1,25 +0,0 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"fake_cluster.go",
"fake_instancegroup.go",
"fake_kops_client.go",
"fake_sshcredential.go",
],
importpath = "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake",
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/kops/v1alpha1:go_default_library",
"//pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/watch:go_default_library",
"//vendor/k8s.io/client-go/rest:go_default_library",
"//vendor/k8s.io/client-go/testing:go_default_library",
],
)

View File

@ -1,20 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake

View File

@ -1,128 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
)
// FakeClusters implements ClusterInterface
type FakeClusters struct {
Fake *FakeKopsV1alpha1
ns string
}
var clustersResource = schema.GroupVersionResource{Group: "kops.k8s.io", Version: "v1alpha1", Resource: "clusters"}
var clustersKind = schema.GroupVersionKind{Group: "kops.k8s.io", Version: "v1alpha1", Kind: "Cluster"}
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(clustersResource, c.ns, name), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
func (c *FakeClusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(clustersResource, clustersKind, c.ns, opts), &v1alpha1.ClusterList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ClusterList{ListMeta: obj.(*v1alpha1.ClusterList).ListMeta}
for _, item := range obj.(*v1alpha1.ClusterList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested clusters.
func (c *FakeClusters) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(clustersResource, c.ns, opts))
}
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *FakeClusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(clustersResource, c.ns, cluster), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *FakeClusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(clustersResource, c.ns, cluster), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
func (c *FakeClusters) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(clustersResource, c.ns, name), &v1alpha1.Cluster{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(clustersResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterList{})
return err
}
// Patch applies the patch and returns the patched cluster.
func (c *FakeClusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(clustersResource, c.ns, name, pt, data, subresources...), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}

View File

@ -1,128 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
)
// FakeInstanceGroups implements InstanceGroupInterface
type FakeInstanceGroups struct {
Fake *FakeKopsV1alpha1
ns string
}
var instancegroupsResource = schema.GroupVersionResource{Group: "kops.k8s.io", Version: "v1alpha1", Resource: "instancegroups"}
var instancegroupsKind = schema.GroupVersionKind{Group: "kops.k8s.io", Version: "v1alpha1", Kind: "InstanceGroup"}
// Get takes name of the instanceGroup, and returns the corresponding instanceGroup object, and an error if there is any.
func (c *FakeInstanceGroups) Get(name string, options v1.GetOptions) (result *v1alpha1.InstanceGroup, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(instancegroupsResource, c.ns, name), &v1alpha1.InstanceGroup{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.InstanceGroup), err
}
// List takes label and field selectors, and returns the list of InstanceGroups that match those selectors.
func (c *FakeInstanceGroups) List(opts v1.ListOptions) (result *v1alpha1.InstanceGroupList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(instancegroupsResource, instancegroupsKind, c.ns, opts), &v1alpha1.InstanceGroupList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.InstanceGroupList{ListMeta: obj.(*v1alpha1.InstanceGroupList).ListMeta}
for _, item := range obj.(*v1alpha1.InstanceGroupList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested instanceGroups.
func (c *FakeInstanceGroups) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(instancegroupsResource, c.ns, opts))
}
// Create takes the representation of a instanceGroup and creates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
func (c *FakeInstanceGroups) Create(instanceGroup *v1alpha1.InstanceGroup) (result *v1alpha1.InstanceGroup, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(instancegroupsResource, c.ns, instanceGroup), &v1alpha1.InstanceGroup{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.InstanceGroup), err
}
// Update takes the representation of a instanceGroup and updates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
func (c *FakeInstanceGroups) Update(instanceGroup *v1alpha1.InstanceGroup) (result *v1alpha1.InstanceGroup, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(instancegroupsResource, c.ns, instanceGroup), &v1alpha1.InstanceGroup{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.InstanceGroup), err
}
// Delete takes name of the instanceGroup and deletes it. Returns an error if one occurs.
func (c *FakeInstanceGroups) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(instancegroupsResource, c.ns, name), &v1alpha1.InstanceGroup{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeInstanceGroups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(instancegroupsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.InstanceGroupList{})
return err
}
// Patch applies the patch and returns the patched instanceGroup.
func (c *FakeInstanceGroups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.InstanceGroup, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(instancegroupsResource, c.ns, name, pt, data, subresources...), &v1alpha1.InstanceGroup{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.InstanceGroup), err
}

View File

@ -1,48 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1alpha1 "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1"
)
type FakeKopsV1alpha1 struct {
*testing.Fake
}
func (c *FakeKopsV1alpha1) Clusters(namespace string) v1alpha1.ClusterInterface {
return &FakeClusters{c, namespace}
}
func (c *FakeKopsV1alpha1) InstanceGroups(namespace string) v1alpha1.InstanceGroupInterface {
return &FakeInstanceGroups{c, namespace}
}
func (c *FakeKopsV1alpha1) SSHCredentials(namespace string) v1alpha1.SSHCredentialInterface {
return &FakeSSHCredentials{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeKopsV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View File

@ -1,128 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
)
// FakeSSHCredentials implements SSHCredentialInterface
type FakeSSHCredentials struct {
Fake *FakeKopsV1alpha1
ns string
}
var sshcredentialsResource = schema.GroupVersionResource{Group: "kops.k8s.io", Version: "v1alpha1", Resource: "sshcredentials"}
var sshcredentialsKind = schema.GroupVersionKind{Group: "kops.k8s.io", Version: "v1alpha1", Kind: "SSHCredential"}
// Get takes name of the sSHCredential, and returns the corresponding sSHCredential object, and an error if there is any.
func (c *FakeSSHCredentials) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHCredential, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(sshcredentialsResource, c.ns, name), &v1alpha1.SSHCredential{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.SSHCredential), err
}
// List takes label and field selectors, and returns the list of SSHCredentials that match those selectors.
func (c *FakeSSHCredentials) List(opts v1.ListOptions) (result *v1alpha1.SSHCredentialList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(sshcredentialsResource, sshcredentialsKind, c.ns, opts), &v1alpha1.SSHCredentialList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.SSHCredentialList{ListMeta: obj.(*v1alpha1.SSHCredentialList).ListMeta}
for _, item := range obj.(*v1alpha1.SSHCredentialList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested sSHCredentials.
func (c *FakeSSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(sshcredentialsResource, c.ns, opts))
}
// Create takes the representation of a sSHCredential and creates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
func (c *FakeSSHCredentials) Create(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha1.SSHCredential{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.SSHCredential), err
}
// Update takes the representation of a sSHCredential and updates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
func (c *FakeSSHCredentials) Update(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha1.SSHCredential{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.SSHCredential), err
}
// Delete takes name of the sSHCredential and deletes it. Returns an error if one occurs.
func (c *FakeSSHCredentials) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(sshcredentialsResource, c.ns, name), &v1alpha1.SSHCredential{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeSSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(sshcredentialsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.SSHCredentialList{})
return err
}
// Patch applies the patch and returns the patched sSHCredential.
func (c *FakeSSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHCredential, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(sshcredentialsResource, c.ns, name, pt, data, subresources...), &v1alpha1.SSHCredential{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.SSHCredential), err
}

View File

@ -1,25 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
type ClusterExpansion interface{}
type InstanceGroupExpansion interface{}
type SSHCredentialExpansion interface{}

View File

@ -1,174 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme"
)
// InstanceGroupsGetter has a method to return a InstanceGroupInterface.
// A group's client should implement this interface.
type InstanceGroupsGetter interface {
InstanceGroups(namespace string) InstanceGroupInterface
}
// InstanceGroupInterface has methods to work with InstanceGroup resources.
type InstanceGroupInterface interface {
Create(*v1alpha1.InstanceGroup) (*v1alpha1.InstanceGroup, error)
Update(*v1alpha1.InstanceGroup) (*v1alpha1.InstanceGroup, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.InstanceGroup, error)
List(opts v1.ListOptions) (*v1alpha1.InstanceGroupList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.InstanceGroup, err error)
InstanceGroupExpansion
}
// instanceGroups implements InstanceGroupInterface
type instanceGroups struct {
client rest.Interface
ns string
}
// newInstanceGroups returns a InstanceGroups
func newInstanceGroups(c *KopsV1alpha1Client, namespace string) *instanceGroups {
return &instanceGroups{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the instanceGroup, and returns the corresponding instanceGroup object, and an error if there is any.
func (c *instanceGroups) Get(name string, options v1.GetOptions) (result *v1alpha1.InstanceGroup, err error) {
result = &v1alpha1.InstanceGroup{}
err = c.client.Get().
Namespace(c.ns).
Resource("instancegroups").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of InstanceGroups that match those selectors.
func (c *instanceGroups) List(opts v1.ListOptions) (result *v1alpha1.InstanceGroupList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.InstanceGroupList{}
err = c.client.Get().
Namespace(c.ns).
Resource("instancegroups").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested instanceGroups.
func (c *instanceGroups) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("instancegroups").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a instanceGroup and creates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
func (c *instanceGroups) Create(instanceGroup *v1alpha1.InstanceGroup) (result *v1alpha1.InstanceGroup, err error) {
result = &v1alpha1.InstanceGroup{}
err = c.client.Post().
Namespace(c.ns).
Resource("instancegroups").
Body(instanceGroup).
Do().
Into(result)
return
}
// Update takes the representation of a instanceGroup and updates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
func (c *instanceGroups) Update(instanceGroup *v1alpha1.InstanceGroup) (result *v1alpha1.InstanceGroup, err error) {
result = &v1alpha1.InstanceGroup{}
err = c.client.Put().
Namespace(c.ns).
Resource("instancegroups").
Name(instanceGroup.Name).
Body(instanceGroup).
Do().
Into(result)
return
}
// Delete takes name of the instanceGroup and deletes it. Returns an error if one occurs.
func (c *instanceGroups) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("instancegroups").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *instanceGroups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("instancegroups").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched instanceGroup.
func (c *instanceGroups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.InstanceGroup, err error) {
result = &v1alpha1.InstanceGroup{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("instancegroups").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

View File

@ -1,99 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
rest "k8s.io/client-go/rest"
v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
"k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme"
)
type KopsV1alpha1Interface interface {
RESTClient() rest.Interface
ClustersGetter
InstanceGroupsGetter
SSHCredentialsGetter
}
// KopsV1alpha1Client is used to interact with features provided by the kops.k8s.io group.
type KopsV1alpha1Client struct {
restClient rest.Interface
}
func (c *KopsV1alpha1Client) Clusters(namespace string) ClusterInterface {
return newClusters(c, namespace)
}
func (c *KopsV1alpha1Client) InstanceGroups(namespace string) InstanceGroupInterface {
return newInstanceGroups(c, namespace)
}
func (c *KopsV1alpha1Client) SSHCredentials(namespace string) SSHCredentialInterface {
return newSSHCredentials(c, namespace)
}
// NewForConfig creates a new KopsV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*KopsV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &KopsV1alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new KopsV1alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *KopsV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new KopsV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *KopsV1alpha1Client {
return &KopsV1alpha1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *KopsV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View File

@ -1,174 +0,0 @@
/*
Copyright 2020 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1"
scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme"
)
// SSHCredentialsGetter has a method to return a SSHCredentialInterface.
// A group's client should implement this interface.
type SSHCredentialsGetter interface {
SSHCredentials(namespace string) SSHCredentialInterface
}
// SSHCredentialInterface has methods to work with SSHCredential resources.
type SSHCredentialInterface interface {
Create(*v1alpha1.SSHCredential) (*v1alpha1.SSHCredential, error)
Update(*v1alpha1.SSHCredential) (*v1alpha1.SSHCredential, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.SSHCredential, error)
List(opts v1.ListOptions) (*v1alpha1.SSHCredentialList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHCredential, err error)
SSHCredentialExpansion
}
// sSHCredentials implements SSHCredentialInterface
type sSHCredentials struct {
client rest.Interface
ns string
}
// newSSHCredentials returns a SSHCredentials
func newSSHCredentials(c *KopsV1alpha1Client, namespace string) *sSHCredentials {
return &sSHCredentials{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the sSHCredential, and returns the corresponding sSHCredential object, and an error if there is any.
func (c *sSHCredentials) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHCredential, err error) {
result = &v1alpha1.SSHCredential{}
err = c.client.Get().
Namespace(c.ns).
Resource("sshcredentials").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of SSHCredentials that match those selectors.
func (c *sSHCredentials) List(opts v1.ListOptions) (result *v1alpha1.SSHCredentialList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.SSHCredentialList{}
err = c.client.Get().
Namespace(c.ns).
Resource("sshcredentials").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested sSHCredentials.
func (c *sSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("sshcredentials").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a sSHCredential and creates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
func (c *sSHCredentials) Create(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) {
result = &v1alpha1.SSHCredential{}
err = c.client.Post().
Namespace(c.ns).
Resource("sshcredentials").
Body(sSHCredential).
Do().
Into(result)
return
}
// Update takes the representation of a sSHCredential and updates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
func (c *sSHCredentials) Update(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) {
result = &v1alpha1.SSHCredential{}
err = c.client.Put().
Namespace(c.ns).
Resource("sshcredentials").
Name(sSHCredential.Name).
Body(sSHCredential).
Do().
Into(result)
return
}
// Delete takes name of the sSHCredential and deletes it. Returns an error if one occurs.
func (c *sSHCredentials) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("sshcredentials").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *sSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("sshcredentials").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched sSHCredential.
func (c *sSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHCredential, err error) {
result = &v1alpha1.SSHCredential{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("sshcredentials").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

View File

@ -15,7 +15,6 @@ go_library(
"//pkg/acls:go_default_library",
"//pkg/apis/kops:go_default_library",
"//pkg/apis/kops/registry:go_default_library",
"//pkg/apis/kops/v1alpha1:go_default_library",
"//pkg/apis/kops/v1alpha2:go_default_library",
"//pkg/apis/kops/validation:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/kops/internalversion:go_default_library",

View File

@ -32,7 +32,6 @@ import (
"k8s.io/klog"
api "k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/apis/kops/registry"
"k8s.io/kops/pkg/apis/kops/v1alpha1"
"k8s.io/kops/pkg/apis/kops/validation"
"k8s.io/kops/util/pkg/vfs"
)
@ -44,8 +43,6 @@ type ClusterVFS struct {
func newClusterVFS(basePath vfs.Path) *ClusterVFS {
c := &ClusterVFS{}
c.init("Cluster", basePath, StoreVersion)
defaultReadVersion := v1alpha1.SchemeGroupVersion.WithKind("Cluster")
c.defaultReadVersion = &defaultReadVersion
return c
}

View File

@ -27,7 +27,6 @@ import (
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/klog"
"k8s.io/kops/pkg/acls"
"k8s.io/kops/pkg/apis/kops"
@ -41,11 +40,10 @@ var StoreVersion = v1alpha2.SchemeGroupVersion
type ValidationFunction func(o runtime.Object) error
type commonVFS struct {
kind string
basePath vfs.Path
encoder runtime.Encoder
defaultReadVersion *schema.GroupVersionKind
validate ValidationFunction
kind string
basePath vfs.Path
encoder runtime.Encoder
validate ValidationFunction
}
func (c *commonVFS) init(kind string, basePath vfs.Path, storeVersion runtime.GroupVersioner) {
@ -123,7 +121,7 @@ func (c *commonVFS) readConfig(configPath vfs.Path) (runtime.Object, error) {
return nil, fmt.Errorf("error reading %s: %v", configPath, err)
}
object, _, err := kopscodecs.Decode(data, c.defaultReadVersion)
object, _, err := kopscodecs.Decode(data, nil)
if err != nil {
return nil, fmt.Errorf("error parsing %s: %v", configPath, err)
}

View File

@ -28,7 +28,6 @@ import (
"k8s.io/apimachinery/pkg/watch"
"k8s.io/klog"
kopsapi "k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/apis/kops/v1alpha1"
"k8s.io/kops/pkg/apis/kops/validation"
kopsinternalversion "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/internalversion"
"k8s.io/kops/util/pkg/vfs"
@ -60,8 +59,6 @@ func NewInstanceGroupMirror(cluster *kopsapi.Cluster, configBase vfs.Path) Insta
clusterName: clusterName,
}
r.init(kind, configBase.Join("instancegroup"), StoreVersion)
defaultReadVersion := v1alpha1.SchemeGroupVersion.WithKind(kind)
r.defaultReadVersion = &defaultReadVersion
r.validate = func(o runtime.Object) error {
return validation.ValidateInstanceGroup(o.(*kopsapi.InstanceGroup)).ToAggregate()
}
@ -81,8 +78,6 @@ func newInstanceGroupVFS(c *VFSClientset, cluster *kopsapi.Cluster) *InstanceGro
clusterName: clusterName,
}
r.init(kind, c.basePath.Join(clusterName, "instancegroup"), StoreVersion)
defaultReadVersion := v1alpha1.SchemeGroupVersion.WithKind(kind)
r.defaultReadVersion = &defaultReadVersion
r.validate = func(o runtime.Object) error {
return validation.ValidateInstanceGroup(o.(*kopsapi.InstanceGroup)).ToAggregate()
}

View File

@ -106,14 +106,6 @@ func rewriteAPIGroup(y []byte) []byte {
continue
}
{
re := regexp.MustCompile("kops/v1alpha1")
if re.Match(lines[i]) {
lines[i] = re.ReplaceAllLiteral(lines[i], []byte("kops.k8s.io/v1alpha1"))
changed = true
}
}
{
re := regexp.MustCompile("kops/v1alpha2")
lines[i] = re.ReplaceAllLiteral(lines[i], []byte("kops.k8s.io/v1alpha2"))

View File

@ -7,12 +7,10 @@ go_test(
"exported_testdata", # keep
],
deps = [
"//pkg/apis/kops/v1alpha1:go_default_library",
"//pkg/apis/kops/v1alpha2:go_default_library",
"//pkg/diff:go_default_library",
"//pkg/kopscodecs:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
],
)

View File

@ -24,8 +24,6 @@ import (
"testing"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/kops/pkg/apis/kops/v1alpha1"
"k8s.io/kops/pkg/apis/kops/v1alpha2"
"k8s.io/kops/pkg/diff"
"k8s.io/kops/pkg/kopscodecs"
@ -33,16 +31,6 @@ import (
// TestConversionMinimal runs the test on a minimum configuration, similar to kops create cluster minimal.example.com --zones us-west-1a
func TestConversionMinimal(t *testing.T) {
runTest(t, "minimal", "v1alpha1", "v1alpha2")
runTest(t, "minimal", "v1alpha2", "v1alpha1")
runTest(t, "minimal", "v1alpha0", "v1alpha1")
runTest(t, "minimal", "v1alpha0", "v1alpha2")
runTest(t, "minimal", "legacy-v1alpha1", "v1alpha1")
runTest(t, "minimal", "legacy-v1alpha1", "v1alpha2")
runTest(t, "minimal", "legacy-v1alpha2", "v1alpha1")
runTest(t, "minimal", "legacy-v1alpha2", "v1alpha2")
}
@ -59,11 +47,6 @@ func runTest(t *testing.T, srcDir string, fromVersion string, toVersion string)
t.Fatalf("unexpected error reading expectedPath %q: %v", expectedPath, err)
}
defaults := &schema.GroupVersionKind{
Group: v1alpha1.SchemeGroupVersion.Group,
Version: v1alpha1.SchemeGroupVersion.Version,
}
yaml, ok := runtime.SerializerInfoForMediaType(kopscodecs.Codecs.SupportedMediaTypes(), "application/yaml")
if !ok {
t.Fatalf("no YAML serializer registered")
@ -71,8 +54,6 @@ func runTest(t *testing.T, srcDir string, fromVersion string, toVersion string)
var encoder runtime.Encoder
switch toVersion {
case "v1alpha1":
encoder = kopscodecs.Codecs.EncoderForVersion(yaml.Serializer, v1alpha1.SchemeGroupVersion)
case "v1alpha2":
encoder = kopscodecs.Codecs.EncoderForVersion(yaml.Serializer, v1alpha2.SchemeGroupVersion)
@ -83,7 +64,7 @@ func runTest(t *testing.T, srcDir string, fromVersion string, toVersion string)
var actual []string
for _, s := range strings.Split(string(sourceBytes), "\n---\n") {
o, gvk, err := kopscodecs.Decode([]byte(s), defaults)
o, gvk, err := kopscodecs.Decode([]byte(s), nil)
if err != nil {
t.Fatalf("error parsing file %q: %v", sourcePath, err)
}

View File

@ -1,89 +0,0 @@
apiVersion: kops/v1alpha1
kind: Cluster
metadata:
creationTimestamp: "2016-12-10T22:42:27Z"
name: minimal.example.com
spec:
additionalSans:
- proxy.api.minimal.example.com
addons:
- manifest: s3://somebucket/example.yaml
adminAccess:
- 0.0.0.0/0
api:
dns: {}
authorization:
alwaysAllow: {}
channel: stable
cloudProvider: aws
configBase: memfs://clusters.example.com/minimal.example.com
etcdClusters:
- cpuRequest: 200m
etcdMembers:
- name: us-test-1a
zone: us-test-1a
memoryRequest: 100Mi
name: main
- cpuRequest: 200m
etcdMembers:
- name: us-test-1a
zone: us-test-1a
memoryRequest: 100Mi
name: events
iam:
legacy: true
kubernetesVersion: v1.14.0
masterInternalName: api.internal.minimal.example.com
masterPublicName: api.minimal.example.com
networkCIDR: 172.20.0.0/16
networking:
kubenet: {}
nonMasqueradeCIDR: 100.64.0.0/10
topology:
dns:
type: Public
masters: public
nodes: public
zones:
- cidr: 172.20.32.0/19
name: us-test-1a
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-10T22:42:28Z"
labels:
kops.k8s.io/cluster: minimal.example.com
name: nodes
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.medium
maxSize: 2
minSize: 2
role: Node
zones:
- us-test-1a
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-10T22:42:28Z"
labels:
kops.k8s.io/cluster: minimal.example.com
name: master-us-test-1a
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: m3.medium
maxSize: 1
minSize: 1
role: Master
zones:
- us-test-1a

View File

@ -1,81 +0,0 @@
kind: Cluster
metadata:
creationTimestamp: "2016-12-10T22:42:27Z"
name: minimal.example.com
spec:
additionalSans:
- proxy.api.minimal.example.com
addons:
- manifest: s3://somebucket/example.yaml
adminAccess:
- 0.0.0.0/0
channel: stable
cloudProvider: aws
configBase: memfs://clusters.example.com/minimal.example.com
etcdClusters:
- cpuRequest: 200m
etcdMembers:
- name: us-test-1a
zone: us-test-1a
memoryRequest: 100Mi
name: main
- cpuRequest: 200m
etcdMembers:
- name: us-test-1a
zone: us-test-1a
memoryRequest: 100Mi
name: events
kubernetesVersion: v1.14.0
masterInternalName: api.internal.minimal.example.com
masterPublicName: api.minimal.example.com
networkCIDR: 172.20.0.0/16
networking:
kubenet: {}
nonMasqueradeCIDR: 100.64.0.0/10
topology:
bastion:
idleTimeout: 120
machineType: t2.medium
dns:
type: Public
masters: public
nodes: public
zones:
- cidr: 172.20.32.0/19
name: us-test-1a
---
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-10T22:42:28Z"
name: nodes
labels:
kops.k8s.io/cluster: minimal.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.medium
maxSize: 2
minSize: 2
role: Node
zones:
- us-test-1a
---
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-10T22:42:28Z"
name: master-us-test-1a
labels:
kops.k8s.io/cluster: minimal.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: m3.medium
maxSize: 1
minSize: 1
role: Master
zones:
- us-test-1a

View File

@ -1,87 +0,0 @@
apiVersion: kops.k8s.io/v1alpha1
kind: Cluster
metadata:
creationTimestamp: "2016-12-10T22:42:27Z"
name: minimal.example.com
spec:
additionalSans:
- proxy.api.minimal.example.com
addons:
- manifest: s3://somebucket/example.yaml
adminAccess:
- 0.0.0.0/0
api:
dns: {}
authorization:
alwaysAllow: {}
channel: stable
cloudProvider: aws
configBase: memfs://clusters.example.com/minimal.example.com
etcdClusters:
- cpuRequest: 200m
etcdMembers:
- name: us-test-1a
zone: us-test-1a
memoryRequest: 100Mi
name: main
- cpuRequest: 200m
etcdMembers:
- name: us-test-1a
zone: us-test-1a
memoryRequest: 100Mi
name: events
iam:
legacy: true
kubernetesVersion: v1.14.0
masterInternalName: api.internal.minimal.example.com
masterPublicName: api.minimal.example.com
networkCIDR: 172.20.0.0/16
networking:
kubenet: {}
nonMasqueradeCIDR: 100.64.0.0/10
topology:
dns:
type: Public
masters: public
nodes: public
zones:
- cidr: 172.20.32.0/19
name: us-test-1a
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-10T22:42:28Z"
labels:
kops.k8s.io/cluster: minimal.example.com
name: nodes
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.medium
maxSize: 2
minSize: 2
role: Node
zones:
- us-test-1a
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-10T22:42:28Z"
labels:
kops.k8s.io/cluster: minimal.example.com
name: master-us-test-1a
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: m3.medium
maxSize: 1
minSize: 1
role: Master
zones:
- us-test-1a

View File

@ -1,122 +0,0 @@
apiVersion: kops.k8s.io/v1alpha1
kind: Cluster
metadata:
creationTimestamp: "2017-01-01T00:00:00Z"
name: ha.example.com
spec:
adminAccess:
- 0.0.0.0/0
api:
dns: {}
channel: stable
cloudProvider: aws
configBase: memfs://tests/ha.example.com
etcdClusters:
- etcdMembers:
- name: a
zone: us-test-1a
- name: b
zone: us-test-1b
- name: c
zone: us-test-1c
name: main
- etcdMembers:
- name: a
zone: us-test-1a
- name: b
zone: us-test-1b
- name: c
zone: us-test-1c
name: events
kubernetesVersion: v1.14.0
masterPublicName: api.ha.example.com
networkCIDR: 172.20.0.0/16
networking:
kubenet: {}
nonMasqueradeCIDR: 100.64.0.0/10
topology:
dns:
type: Public
masters: public
nodes: public
zones:
- cidr: 172.20.32.0/19
name: us-test-1a
- cidr: 172.20.64.0/19
name: us-test-1b
- cidr: 172.20.96.0/19
name: us-test-1c
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2017-01-01T00:00:00Z"
labels:
kops.k8s.io/cluster: ha.example.com
name: master-us-test-1a
spec:
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: m3.medium
maxSize: 1
minSize: 1
role: Master
zones:
- us-test-1a
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2017-01-01T00:00:00Z"
labels:
kops.k8s.io/cluster: ha.example.com
name: master-us-test-1b
spec:
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: m3.medium
maxSize: 1
minSize: 1
role: Master
zones:
- us-test-1b
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2017-01-01T00:00:00Z"
labels:
kops.k8s.io/cluster: ha.example.com
name: master-us-test-1c
spec:
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: m3.medium
maxSize: 1
minSize: 1
role: Master
zones:
- us-test-1c
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2017-01-01T00:00:00Z"
labels:
kops.k8s.io/cluster: ha.example.com
name: nodes
spec:
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.medium
maxSize: 2
minSize: 2
role: Node
zones:
- us-test-1a
- us-test-1b
- us-test-1c

View File

@ -1 +0,0 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==

View File

@ -1,64 +0,0 @@
kind: Cluster
metadata:
creationTimestamp: "2016-12-11T05:47:53Z"
name: minimal-141.example.com
spec:
adminAccess:
- 0.0.0.0/0
channel: stable
cloudProvider: aws
configBase: memfs://clusters.example.com/minimal-141.example.com
etcdClusters:
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
name: main
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
name: events
kubernetesVersion: v1.14.0
masterPublicName: api.minimal-141.example.com
networkCIDR: 172.20.0.0/16
networking:
kubenet: {}
nonMasqueradeCIDR: 100.64.0.0/10
zones:
- cidr: 172.20.32.0/19
name: us-test-1a
---
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-11T05:47:54Z"
name: nodes
labels:
kops.k8s.io/cluster: minimal-141.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.medium
maxSize: 2
minSize: 2
role: Node
zones:
- us-test-1a
---
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-11T05:47:54Z"
name: master-us-test-1a
labels:
kops.k8s.io/cluster: minimal-141.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: m3.medium
maxSize: 1
minSize: 1
role: Master
zones:
- us-test-1a

View File

@ -1,491 +0,0 @@
locals = {
cluster_name = "minimal-141.example.com"
master_autoscaling_group_ids = ["${aws_autoscaling_group.master-us-test-1a-masters-minimal-141-example-com.id}"]
master_security_group_ids = ["${aws_security_group.masters-minimal-141-example-com.id}"]
masters_role_arn = "${aws_iam_role.masters-minimal-141-example-com.arn}"
masters_role_name = "${aws_iam_role.masters-minimal-141-example-com.name}"
node_autoscaling_group_ids = ["${aws_autoscaling_group.nodes-minimal-141-example-com.id}"]
node_security_group_ids = ["${aws_security_group.nodes-minimal-141-example-com.id}"]
node_subnet_ids = ["${aws_subnet.us-test-1a-minimal-141-example-com.id}"]
nodes_role_arn = "${aws_iam_role.nodes-minimal-141-example-com.arn}"
nodes_role_name = "${aws_iam_role.nodes-minimal-141-example-com.name}"
region = "us-test-1"
route_table_public_id = "${aws_route_table.minimal-141-example-com.id}"
subnet_us-test-1a_id = "${aws_subnet.us-test-1a-minimal-141-example-com.id}"
vpc_cidr_block = "${aws_vpc.minimal-141-example-com.cidr_block}"
vpc_id = "${aws_vpc.minimal-141-example-com.id}"
}
output "cluster_name" {
value = "minimal-141.example.com"
}
output "master_autoscaling_group_ids" {
value = ["${aws_autoscaling_group.master-us-test-1a-masters-minimal-141-example-com.id}"]
}
output "master_security_group_ids" {
value = ["${aws_security_group.masters-minimal-141-example-com.id}"]
}
output "masters_role_arn" {
value = "${aws_iam_role.masters-minimal-141-example-com.arn}"
}
output "masters_role_name" {
value = "${aws_iam_role.masters-minimal-141-example-com.name}"
}
output "node_autoscaling_group_ids" {
value = ["${aws_autoscaling_group.nodes-minimal-141-example-com.id}"]
}
output "node_security_group_ids" {
value = ["${aws_security_group.nodes-minimal-141-example-com.id}"]
}
output "node_subnet_ids" {
value = ["${aws_subnet.us-test-1a-minimal-141-example-com.id}"]
}
output "nodes_role_arn" {
value = "${aws_iam_role.nodes-minimal-141-example-com.arn}"
}
output "nodes_role_name" {
value = "${aws_iam_role.nodes-minimal-141-example-com.name}"
}
output "region" {
value = "us-test-1"
}
output "route_table_public_id" {
value = "${aws_route_table.minimal-141-example-com.id}"
}
output "subnet_us-test-1a_id" {
value = "${aws_subnet.us-test-1a-minimal-141-example-com.id}"
}
output "vpc_cidr_block" {
value = "${aws_vpc.minimal-141-example-com.cidr_block}"
}
output "vpc_id" {
value = "${aws_vpc.minimal-141-example-com.id}"
}
provider "aws" {
region = "us-test-1"
}
resource "aws_autoscaling_group" "master-us-test-1a-masters-minimal-141-example-com" {
name = "master-us-test-1a.masters.minimal-141.example.com"
launch_configuration = "${aws_launch_configuration.master-us-test-1a-masters-minimal-141-example-com.id}"
max_size = 1
min_size = 1
vpc_zone_identifier = ["${aws_subnet.us-test-1a-minimal-141-example-com.id}"]
tag = {
key = "KubernetesCluster"
value = "minimal-141.example.com"
propagate_at_launch = true
}
tag = {
key = "Name"
value = "master-us-test-1a.masters.minimal-141.example.com"
propagate_at_launch = true
}
tag = {
key = "k8s.io/role/master"
value = "1"
propagate_at_launch = true
}
tag = {
key = "kops.k8s.io/instancegroup"
value = "master-us-test-1a"
propagate_at_launch = true
}
tag = {
key = "kubernetes.io/cluster/minimal-141.example.com"
value = "owned"
propagate_at_launch = true
}
metrics_granularity = "1Minute"
enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"]
}
resource "aws_autoscaling_group" "nodes-minimal-141-example-com" {
name = "nodes.minimal-141.example.com"
launch_configuration = "${aws_launch_configuration.nodes-minimal-141-example-com.id}"
max_size = 2
min_size = 2
vpc_zone_identifier = ["${aws_subnet.us-test-1a-minimal-141-example-com.id}"]
tag = {
key = "KubernetesCluster"
value = "minimal-141.example.com"
propagate_at_launch = true
}
tag = {
key = "Name"
value = "nodes.minimal-141.example.com"
propagate_at_launch = true
}
tag = {
key = "k8s.io/role/node"
value = "1"
propagate_at_launch = true
}
tag = {
key = "kops.k8s.io/instancegroup"
value = "nodes"
propagate_at_launch = true
}
tag = {
key = "kubernetes.io/cluster/minimal-141.example.com"
value = "owned"
propagate_at_launch = true
}
metrics_granularity = "1Minute"
enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"]
}
resource "aws_ebs_volume" "us-test-1a-etcd-events-minimal-141-example-com" {
availability_zone = "us-test-1a"
size = 20
type = "gp2"
encrypted = false
tags = {
KubernetesCluster = "minimal-141.example.com"
Name = "us-test-1a.etcd-events.minimal-141.example.com"
"k8s.io/etcd/events" = "us-test-1a/us-test-1a"
"k8s.io/role/master" = "1"
"kubernetes.io/cluster/minimal-141.example.com" = "owned"
}
}
resource "aws_ebs_volume" "us-test-1a-etcd-main-minimal-141-example-com" {
availability_zone = "us-test-1a"
size = 20
type = "gp2"
encrypted = false
tags = {
KubernetesCluster = "minimal-141.example.com"
Name = "us-test-1a.etcd-main.minimal-141.example.com"
"k8s.io/etcd/main" = "us-test-1a/us-test-1a"
"k8s.io/role/master" = "1"
"kubernetes.io/cluster/minimal-141.example.com" = "owned"
}
}
resource "aws_iam_instance_profile" "masters-minimal-141-example-com" {
name = "masters.minimal-141.example.com"
role = "${aws_iam_role.masters-minimal-141-example-com.name}"
}
resource "aws_iam_instance_profile" "nodes-minimal-141-example-com" {
name = "nodes.minimal-141.example.com"
role = "${aws_iam_role.nodes-minimal-141-example-com.name}"
}
resource "aws_iam_role" "masters-minimal-141-example-com" {
name = "masters.minimal-141.example.com"
assume_role_policy = "${file("${path.module}/data/aws_iam_role_masters.minimal-141.example.com_policy")}"
}
resource "aws_iam_role" "nodes-minimal-141-example-com" {
name = "nodes.minimal-141.example.com"
assume_role_policy = "${file("${path.module}/data/aws_iam_role_nodes.minimal-141.example.com_policy")}"
}
resource "aws_iam_role_policy" "masters-minimal-141-example-com" {
name = "masters.minimal-141.example.com"
role = "${aws_iam_role.masters-minimal-141-example-com.name}"
policy = "${file("${path.module}/data/aws_iam_role_policy_masters.minimal-141.example.com_policy")}"
}
resource "aws_iam_role_policy" "nodes-minimal-141-example-com" {
name = "nodes.minimal-141.example.com"
role = "${aws_iam_role.nodes-minimal-141-example-com.name}"
policy = "${file("${path.module}/data/aws_iam_role_policy_nodes.minimal-141.example.com_policy")}"
}
resource "aws_internet_gateway" "minimal-141-example-com" {
vpc_id = "${aws_vpc.minimal-141-example-com.id}"
tags = {
KubernetesCluster = "minimal-141.example.com"
Name = "minimal-141.example.com"
"kubernetes.io/cluster/minimal-141.example.com" = "owned"
}
}
resource "aws_key_pair" "kubernetes-minimal-141-example-com-c4a6ed9aa889b9e2c39cd663eb9c7157" {
key_name = "kubernetes.minimal-141.example.com-c4:a6:ed:9a:a8:89:b9:e2:c3:9c:d6:63:eb:9c:71:57"
public_key = "${file("${path.module}/data/aws_key_pair_kubernetes.minimal-141.example.com-c4a6ed9aa889b9e2c39cd663eb9c7157_public_key")}"
}
resource "aws_launch_configuration" "master-us-test-1a-masters-minimal-141-example-com" {
name_prefix = "master-us-test-1a.masters.minimal-141.example.com-"
image_id = "ami-12345678"
instance_type = "m3.medium"
key_name = "${aws_key_pair.kubernetes-minimal-141-example-com-c4a6ed9aa889b9e2c39cd663eb9c7157.id}"
iam_instance_profile = "${aws_iam_instance_profile.masters-minimal-141-example-com.id}"
security_groups = ["${aws_security_group.masters-minimal-141-example-com.id}"]
associate_public_ip_address = true
user_data = "${file("${path.module}/data/aws_launch_configuration_master-us-test-1a.masters.minimal-141.example.com_user_data")}"
root_block_device = {
volume_type = "gp2"
volume_size = 64
delete_on_termination = true
}
ephemeral_block_device = {
device_name = "/dev/sdc"
virtual_name = "ephemeral0"
}
lifecycle = {
create_before_destroy = true
}
enable_monitoring = false
}
resource "aws_launch_configuration" "nodes-minimal-141-example-com" {
name_prefix = "nodes.minimal-141.example.com-"
image_id = "ami-12345678"
instance_type = "t2.medium"
key_name = "${aws_key_pair.kubernetes-minimal-141-example-com-c4a6ed9aa889b9e2c39cd663eb9c7157.id}"
iam_instance_profile = "${aws_iam_instance_profile.nodes-minimal-141-example-com.id}"
security_groups = ["${aws_security_group.nodes-minimal-141-example-com.id}"]
associate_public_ip_address = true
user_data = "${file("${path.module}/data/aws_launch_configuration_nodes.minimal-141.example.com_user_data")}"
root_block_device = {
volume_type = "gp2"
volume_size = 128
delete_on_termination = true
}
lifecycle = {
create_before_destroy = true
}
enable_monitoring = false
}
resource "aws_route" "route-0-0-0-0--0" {
route_table_id = "${aws_route_table.minimal-141-example-com.id}"
destination_cidr_block = "0.0.0.0/0"
gateway_id = "${aws_internet_gateway.minimal-141-example-com.id}"
}
resource "aws_route_table" "minimal-141-example-com" {
vpc_id = "${aws_vpc.minimal-141-example-com.id}"
tags = {
KubernetesCluster = "minimal-141.example.com"
Name = "minimal-141.example.com"
"kubernetes.io/cluster/minimal-141.example.com" = "owned"
"kubernetes.io/kops/role" = "public"
}
}
resource "aws_route_table_association" "us-test-1a-minimal-141-example-com" {
subnet_id = "${aws_subnet.us-test-1a-minimal-141-example-com.id}"
route_table_id = "${aws_route_table.minimal-141-example-com.id}"
}
resource "aws_security_group" "masters-minimal-141-example-com" {
name = "masters.minimal-141.example.com"
vpc_id = "${aws_vpc.minimal-141-example-com.id}"
description = "Security group for masters"
tags = {
KubernetesCluster = "minimal-141.example.com"
Name = "masters.minimal-141.example.com"
"kubernetes.io/cluster/minimal-141.example.com" = "owned"
}
}
resource "aws_security_group" "nodes-minimal-141-example-com" {
name = "nodes.minimal-141.example.com"
vpc_id = "${aws_vpc.minimal-141-example-com.id}"
description = "Security group for nodes"
tags = {
KubernetesCluster = "minimal-141.example.com"
Name = "nodes.minimal-141.example.com"
"kubernetes.io/cluster/minimal-141.example.com" = "owned"
}
}
resource "aws_security_group_rule" "all-master-to-master" {
type = "ingress"
security_group_id = "${aws_security_group.masters-minimal-141-example-com.id}"
source_security_group_id = "${aws_security_group.masters-minimal-141-example-com.id}"
from_port = 0
to_port = 0
protocol = "-1"
}
resource "aws_security_group_rule" "all-master-to-node" {
type = "ingress"
security_group_id = "${aws_security_group.nodes-minimal-141-example-com.id}"
source_security_group_id = "${aws_security_group.masters-minimal-141-example-com.id}"
from_port = 0
to_port = 0
protocol = "-1"
}
resource "aws_security_group_rule" "all-node-to-node" {
type = "ingress"
security_group_id = "${aws_security_group.nodes-minimal-141-example-com.id}"
source_security_group_id = "${aws_security_group.nodes-minimal-141-example-com.id}"
from_port = 0
to_port = 0
protocol = "-1"
}
resource "aws_security_group_rule" "https-external-to-master-0-0-0-0--0" {
type = "ingress"
security_group_id = "${aws_security_group.masters-minimal-141-example-com.id}"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
resource "aws_security_group_rule" "master-egress" {
type = "egress"
security_group_id = "${aws_security_group.masters-minimal-141-example-com.id}"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
resource "aws_security_group_rule" "node-egress" {
type = "egress"
security_group_id = "${aws_security_group.nodes-minimal-141-example-com.id}"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
resource "aws_security_group_rule" "node-to-master-tcp-1-2379" {
type = "ingress"
security_group_id = "${aws_security_group.masters-minimal-141-example-com.id}"
source_security_group_id = "${aws_security_group.nodes-minimal-141-example-com.id}"
from_port = 1
to_port = 2379
protocol = "tcp"
}
resource "aws_security_group_rule" "node-to-master-tcp-2382-4000" {
type = "ingress"
security_group_id = "${aws_security_group.masters-minimal-141-example-com.id}"
source_security_group_id = "${aws_security_group.nodes-minimal-141-example-com.id}"
from_port = 2382
to_port = 4000
protocol = "tcp"
}
resource "aws_security_group_rule" "node-to-master-tcp-4003-65535" {
type = "ingress"
security_group_id = "${aws_security_group.masters-minimal-141-example-com.id}"
source_security_group_id = "${aws_security_group.nodes-minimal-141-example-com.id}"
from_port = 4003
to_port = 65535
protocol = "tcp"
}
resource "aws_security_group_rule" "node-to-master-udp-1-65535" {
type = "ingress"
security_group_id = "${aws_security_group.masters-minimal-141-example-com.id}"
source_security_group_id = "${aws_security_group.nodes-minimal-141-example-com.id}"
from_port = 1
to_port = 65535
protocol = "udp"
}
resource "aws_security_group_rule" "ssh-external-to-master-0-0-0-0--0" {
type = "ingress"
security_group_id = "${aws_security_group.masters-minimal-141-example-com.id}"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
resource "aws_security_group_rule" "ssh-external-to-node-0-0-0-0--0" {
type = "ingress"
security_group_id = "${aws_security_group.nodes-minimal-141-example-com.id}"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
resource "aws_subnet" "us-test-1a-minimal-141-example-com" {
vpc_id = "${aws_vpc.minimal-141-example-com.id}"
cidr_block = "172.20.32.0/19"
availability_zone = "us-test-1a"
tags = {
KubernetesCluster = "minimal-141.example.com"
Name = "us-test-1a.minimal-141.example.com"
SubnetType = "Public"
"kubernetes.io/cluster/minimal-141.example.com" = "owned"
"kubernetes.io/role/elb" = "1"
}
}
resource "aws_vpc" "minimal-141-example-com" {
cidr_block = "172.20.0.0/16"
enable_dns_hostnames = true
enable_dns_support = true
tags = {
KubernetesCluster = "minimal-141.example.com"
Name = "minimal-141.example.com"
"kubernetes.io/cluster/minimal-141.example.com" = "owned"
}
}
resource "aws_vpc_dhcp_options" "minimal-141-example-com" {
domain_name = "us-test-1.compute.internal"
domain_name_servers = ["AmazonProvidedDNS"]
tags = {
KubernetesCluster = "minimal-141.example.com"
Name = "minimal-141.example.com"
"kubernetes.io/cluster/minimal-141.example.com" = "owned"
}
}
resource "aws_vpc_dhcp_options_association" "minimal-141-example-com" {
vpc_id = "${aws_vpc.minimal-141-example-com.id}"
dhcp_options_id = "${aws_vpc_dhcp_options.minimal-141-example-com.id}"
}
terraform = {
required_version = ">= 0.9.3"
}

View File

@ -1,22 +1,22 @@
apiVersion: kops.k8s.io/v1alpha1
apiVersion: kops.k8s.io/v1alpha2
kind: Cluster
metadata:
creationTimestamp: "2016-12-10T22:42:27Z"
name: minimal-json.example.com
spec:
adminAccess:
kubernetesApiAccess:
- 0.0.0.0/0
channel: stable
cloudProvider: aws
configBase: memfs://clusters.example.com/minimal-json.example.com
etcdClusters:
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
- instanceGroup: master-us-test-1a
name: us-test-1a
name: main
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
- instanceGroup: master-us-test-1a
name: us-test-1a
name: events
kubernetesVersion: v1.14.0
masterInternalName: api.internal.minimal-json.example.com
@ -25,19 +25,20 @@ spec:
networking:
kubenet: {}
nonMasqueradeCIDR: 100.64.0.0/10
sshAccess:
- 0.0.0.0/0
topology:
bastion:
idleTimeout: 120
machineType: t2.medium
masters: public
nodes: public
zones:
subnets:
- cidr: 172.20.32.0/19
name: us-test-1a
type: Public
zone: us-test-1a
---
apiVersion: kops.k8s.io/v1alpha1
apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-10T22:42:28Z"
@ -51,12 +52,12 @@ spec:
maxSize: 2
minSize: 2
role: Node
zones:
subnets:
- us-test-1a
---
apiVersion: kops.k8s.io/v1alpha1
apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-10T22:42:28Z"
@ -70,7 +71,7 @@ spec:
maxSize: 1
minSize: 1
role: Master
zones:
subnets:
- us-test-1a

View File

@ -1,73 +0,0 @@
kind: Cluster
metadata:
creationTimestamp: "2016-12-10T22:42:27Z"
name: minimal.example.com
spec:
adminAccess:
- 0.0.0.0/0
channel: stable
cloudProvider: aws
configBase: memfs://clusters.example.com/minimal.example.com
etcdClusters:
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
name: main
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
name: events
kubernetesVersion: v1.14.0
masterInternalName: api.internal.minimal.example.com
masterPublicName: api.minimal.example.com
networkCIDR: 172.20.0.0/16
networking:
kubenet: {}
nonMasqueradeCIDR: 100.64.0.0/10
topology:
bastion:
idleTimeout: 120
machineType: t2.medium
masters: public
nodes: public
zones:
- cidr: 172.20.32.0/19
name: us-test-1a
---
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-10T22:42:28Z"
name: nodes
labels:
kops.k8s.io/cluster: minimal.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.medium
maxSize: 2
minSize: 2
role: Node
zones:
- us-test-1a
---
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-10T22:42:28Z"
name: master-us-test-1a
labels:
kops.k8s.io/cluster: minimal.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: m3.medium
maxSize: 1
minSize: 1
role: Master
zones:
- us-test-1a

View File

@ -1,76 +0,0 @@
apiVersion: kops.k8s.io/v1alpha1
kind: Cluster
metadata:
creationTimestamp: "2016-12-10T22:42:27Z"
name: minimal.example.com
spec:
adminAccess:
- 0.0.0.0/0
channel: stable
cloudProvider: aws
configBase: memfs://clusters.example.com/minimal.example.com
etcdClusters:
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
name: main
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
name: events
kubernetesVersion: v1.14.0
masterInternalName: api.internal.minimal.example.com
masterPublicName: api.minimal.example.com
networkCIDR: 172.20.0.0/16
networking:
kubenet: {}
nonMasqueradeCIDR: 100.64.0.0/10
topology:
bastion:
idleTimeout: 120
machineType: t2.medium
masters: public
nodes: public
zones:
- cidr: 172.20.32.0/19
name: us-test-1a
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-10T22:42:28Z"
name: nodes
labels:
kops.k8s.io/cluster: minimal.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.medium
maxSize: 2
minSize: 2
role: Node
zones:
- us-test-1a
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-10T22:42:28Z"
name: master-us-test-1a
labels:
kops.k8s.io/cluster: minimal.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: m3.medium
maxSize: 1
minSize: 1
role: Master
zones:
- us-test-1a

View File

@ -1,96 +0,0 @@
apiVersion: kops.k8s.io/v1alpha1
kind: Cluster
metadata:
creationTimestamp: "2016-12-12T04:13:14Z"
name: privatecalico.example.com
spec:
adminAccess:
- 0.0.0.0/0
channel: stable
cloudProvider: aws
configBase: memfs://clusters.example.com/privatecalico.example.com
etcdClusters:
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
name: main
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
name: events
kubernetesVersion: v1.14.0
masterInternalName: api.internal.privatecalico.example.com
masterPublicName: api.privatecalico.example.com
networkCIDR: 172.20.0.0/16
networking:
calico: {}
nonMasqueradeCIDR: 100.64.0.0/10
topology:
bastion:
enable: true
idleTimeout: 300
machineType: t2.medium
masters: private
nodes: private
zones:
- cidr: 172.20.4.0/22
name: us-test-1a
privateCIDR: 172.20.32.0/19
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-12T04:13:15Z"
name: master-us-test-1a
labels:
kops.k8s.io/cluster: privatecalico.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: m3.medium
maxSize: 1
minSize: 1
role: Master
zones:
- us-test-1a
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-12T04:13:15Z"
name: nodes
labels:
kops.k8s.io/cluster: privatecalico.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.medium
maxSize: 2
minSize: 2
role: Node
zones:
- us-test-1a
---
apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-14T15:32:41Z"
name: bastion
labels:
kops.k8s.io/cluster: privatecalico.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.micro
maxSize: 1
minSize: 1
role: Bastion
subnets:
- utility-us-test-1a

View File

@ -1,96 +0,0 @@
apiVersion: kops.k8s.io/v1alpha1
kind: Cluster
metadata:
creationTimestamp: "2016-12-12T04:13:14Z"
name: privatecanal.example.com
spec:
adminAccess:
- 0.0.0.0/0
channel: stable
cloudProvider: aws
configBase: memfs://clusters.example.com/privatecanal.example.com
etcdClusters:
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
name: main
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
name: events
kubernetesVersion: v1.14.0
masterInternalName: api.internal.privatecanal.example.com
masterPublicName: api.privatecanal.example.com
networkCIDR: 172.20.0.0/16
networking:
canal: {}
nonMasqueradeCIDR: 100.64.0.0/10
topology:
bastion:
enable: true
idleTimeout: 300
machineType: t2.medium
masters: private
nodes: private
zones:
- cidr: 172.20.4.0/22
name: us-test-1a
privateCIDR: 172.20.32.0/19
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-12T04:13:15Z"
name: master-us-test-1a
labels:
kops.k8s.io/cluster: privatecanal.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: m3.medium
maxSize: 1
minSize: 1
role: Master
zones:
- us-test-1a
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-12T04:13:15Z"
name: nodes
labels:
kops.k8s.io/cluster: privatecanal.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.medium
maxSize: 2
minSize: 2
role: Node
zones:
- us-test-1a
---
apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-14T15:32:41Z"
name: bastion
labels:
kops.k8s.io/cluster: privatecanal.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.micro
maxSize: 1
minSize: 1
role: Bastion
subnets:
- utility-us-test-1a

View File

@ -1,97 +0,0 @@
apiVersion: kops.k8s.io/v1alpha1
kind: Cluster
metadata:
creationTimestamp: "2016-12-12T04:13:14Z"
name: privateflannel.example.com
spec:
adminAccess:
- 0.0.0.0/0
channel: stable
cloudProvider: aws
configBase: memfs://clusters.example.com/privateflannel.example.com
etcdClusters:
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
name: main
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
name: events
kubernetesVersion: v1.14.0
masterInternalName: api.internal.privateflannel.example.com
masterPublicName: api.privateflannel.example.com
networkCIDR: 172.20.0.0/16
networking:
flannel:
backend: vxlan
nonMasqueradeCIDR: 100.64.0.0/10
topology:
bastion:
enable: true
idleTimeout: 300
machineType: t2.medium
masters: private
nodes: private
zones:
- cidr: 172.20.4.0/22
name: us-test-1a
privateCIDR: 172.20.32.0/19
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-12T04:13:15Z"
name: master-us-test-1a
labels:
kops.k8s.io/cluster: privateflannel.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: m3.medium
maxSize: 1
minSize: 1
role: Master
zones:
- us-test-1a
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-12T04:13:15Z"
name: nodes
labels:
kops.k8s.io/cluster: privateflannel.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.medium
maxSize: 2
minSize: 2
role: Node
zones:
- us-test-1a
---
apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-14T15:32:41Z"
name: bastion
labels:
kops.k8s.io/cluster: privateflannel.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.micro
maxSize: 1
minSize: 1
role: Bastion
subnets:
- utility-us-test-1a

View File

@ -1,96 +0,0 @@
apiVersion: kops.k8s.io/v1alpha1
kind: Cluster
metadata:
creationTimestamp: "2016-12-12T04:13:14Z"
name: privateweave.example.com
spec:
adminAccess:
- 0.0.0.0/0
channel: stable
cloudProvider: aws
configBase: memfs://clusters.example.com/privateweave.example.com
etcdClusters:
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
name: main
- etcdMembers:
- name: us-test-1a
zone: us-test-1a
name: events
kubernetesVersion: v1.14.0
masterInternalName: api.internal.privateweave.example.com
masterPublicName: api.privateweave.example.com
networkCIDR: 172.20.0.0/16
networking:
weave: {}
nonMasqueradeCIDR: 100.64.0.0/10
topology:
bastion:
enable: true
idleTimeout: 300
machineType: t2.medium
masters: private
nodes: private
zones:
- cidr: 172.20.4.0/22
name: us-test-1a
privateCIDR: 172.20.32.0/19
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-12T04:13:15Z"
name: master-us-test-1a
labels:
kops.k8s.io/cluster: privateweave.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: m3.medium
maxSize: 1
minSize: 1
role: Master
zones:
- us-test-1a
---
apiVersion: kops.k8s.io/v1alpha1
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-12T04:13:15Z"
name: nodes
labels:
kops.k8s.io/cluster: privateweave.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.medium
maxSize: 2
minSize: 2
role: Node
zones:
- us-test-1a
---
apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
metadata:
creationTimestamp: "2016-12-14T15:32:41Z"
name: bastion
labels:
kops.k8s.io/cluster: privateweave.example.com
spec:
associatePublicIp: true
image: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2016-10-21
machineType: t2.micro
maxSize: 1
minSize: 1
role: Bastion
subnets:
- utility-us-test-1a