From 7c6f17296cee0f2544dc596e7c412efd742d3d71 Mon Sep 17 00:00:00 2001 From: Maru Newby Date: Thu, 12 Oct 2017 09:59:18 -0700 Subject: [PATCH] Remove ./federation path --- federation/BUILD | 44 - federation/Makefile | 70 - federation/OWNERS | 17 - federation/README.md | 67 - federation/apis/core/BUILD | 38 - federation/apis/core/install/BUILD | 33 - federation/apis/core/install/install.go | 54 - federation/apis/core/register.go | 102 - federation/apis/core/v1/BUILD | 38 - federation/apis/core/v1/conversion.go | 70 - federation/apis/core/v1/defaults.go | 26 - federation/apis/core/v1/doc.go | 23 - federation/apis/core/v1/register.go | 68 - .../apis/core/v1/zz_generated.conversion.go | 35 - federation/apis/federation/BUILD | 44 - federation/apis/federation/annotations.go | 29 - federation/apis/federation/doc.go | 19 - federation/apis/federation/install/BUILD | 50 - federation/apis/federation/install/install.go | 51 - .../apis/federation/install/install_test.go | 119 - federation/apis/federation/register.go | 51 - federation/apis/federation/types.go | 178 - federation/apis/federation/v1beta1/BUILD | 51 - .../apis/federation/v1beta1/defaults.go | 25 - federation/apis/federation/v1beta1/doc.go | 21 - .../apis/federation/v1beta1/generated.pb.go | 1766 -- .../apis/federation/v1beta1/generated.proto | 150 - .../apis/federation/v1beta1/register.go | 53 - federation/apis/federation/v1beta1/types.go | 161 - .../v1beta1/types_swagger_doc_generated.go | 106 - .../v1beta1/zz_generated.conversion.go | 205 - .../v1beta1/zz_generated.deepcopy.go | 245 - .../v1beta1/zz_generated.defaults.go | 32 - federation/apis/federation/validation/BUILD | 44 - .../apis/federation/validation/validation.go | 64 - .../federation/validation/validation_test.go | 330 - .../apis/federation/zz_generated.deepcopy.go | 331 - federation/apis/openapi-spec/swagger.json | 15312 ---------------- federation/apis/swagger-spec/api.json | 87 - federation/apis/swagger-spec/apis.json | 138 - federation/apis/swagger-spec/extensions.json | 114 - .../apis/swagger-spec/extensions_v1beta1.json | 8283 --------- federation/apis/swagger-spec/federation.json | 114 - .../apis/swagger-spec/federation_v1beta1.json | 1361 -- federation/apis/swagger-spec/logs.json | 46 - .../apis/swagger-spec/resourceListing.json | 46 - federation/apis/swagger-spec/v1.json | 5841 ------ federation/apis/swagger-spec/version.json | 76 - federation/client/cache/BUILD | 29 - federation/client/cache/cluster_cache.go | 35 - .../federation_clientset/BUILD | 50 - .../federation_clientset/clientset.go | 186 - .../federation_clientset/doc.go | 18 - .../federation_clientset/fake/BUILD | 55 - .../fake/clientset_generated.go | 119 - .../federation_clientset/fake/doc.go | 18 - .../federation_clientset/fake/register.go | 61 - .../import_known_versions.go | 25 - .../federation_clientset/scheme/BUILD | 39 - .../federation_clientset/scheme/doc.go | 18 - .../federation_clientset/scheme/register.go | 61 - .../typed/autoscaling/v1/BUILD | 42 - .../autoscaling/v1/autoscaling_client.go | 88 - .../typed/autoscaling/v1/doc.go | 18 - .../typed/autoscaling/v1/fake/BUILD | 40 - .../typed/autoscaling/v1/fake/doc.go | 18 - .../v1/fake/fake_autoscaling_client.go | 38 - .../v1/fake/fake_horizontalpodautoscaler.go | 138 - .../autoscaling/v1/generated_expansion.go | 19 - .../autoscaling/v1/horizontalpodautoscaler.go | 172 - .../federation_clientset/typed/batch/v1/BUILD | 42 - .../typed/batch/v1/batch_client.go | 88 - .../typed/batch/v1/doc.go | 18 - .../typed/batch/v1/fake/BUILD | 40 - .../typed/batch/v1/fake/doc.go | 18 - .../typed/batch/v1/fake/fake_batch_client.go | 38 - .../typed/batch/v1/fake/fake_job.go | 138 - .../typed/batch/v1/generated_expansion.go | 19 - .../typed/batch/v1/job.go | 172 - .../federation_clientset/typed/core/v1/BUILD | 47 - .../typed/core/v1/configmap.go | 155 - .../typed/core/v1/core_client.go | 108 - .../federation_clientset/typed/core/v1/doc.go | 18 - .../typed/core/v1/event.go | 155 - .../typed/core/v1/fake/BUILD | 45 - .../typed/core/v1/fake/doc.go | 18 - .../typed/core/v1/fake/fake_configmap.go | 126 - .../typed/core/v1/fake/fake_core_client.go | 54 - .../typed/core/v1/fake/fake_event.go | 126 - .../typed/core/v1/fake/fake_namespace.go | 129 - .../core/v1/fake/fake_namespace_expansion.go | 37 - .../typed/core/v1/fake/fake_secret.go | 126 - .../typed/core/v1/fake/fake_service.go | 138 - .../typed/core/v1/generated_expansion.go | 25 - .../typed/core/v1/namespace.go | 161 - .../typed/core/v1/namespace_expansion.go | 31 - .../typed/core/v1/secret.go | 155 - .../typed/core/v1/service.go | 172 - .../typed/extensions/v1beta1/BUILD | 46 - .../typed/extensions/v1beta1/daemonset.go | 172 - .../typed/extensions/v1beta1/deployment.go | 203 - .../v1beta1/deployment_expansion.go | 29 - .../typed/extensions/v1beta1/doc.go | 18 - .../extensions/v1beta1/extensions_client.go | 103 - .../typed/extensions/v1beta1/fake/BUILD | 44 - .../typed/extensions/v1beta1/fake/doc.go | 18 - .../extensions/v1beta1/fake/fake_daemonset.go | 138 - .../v1beta1/fake/fake_deployment.go | 160 - .../v1beta1/fake/fake_deployment_expansion.go | 33 - .../v1beta1/fake/fake_extensions_client.go | 50 - .../extensions/v1beta1/fake/fake_ingress.go | 138 - .../v1beta1/fake/fake_replicaset.go | 160 - .../extensions/v1beta1/generated_expansion.go | 23 - .../typed/extensions/v1beta1/ingress.go | 172 - .../typed/extensions/v1beta1/replicaset.go | 203 - .../typed/federation/v1beta1/BUILD | 42 - .../typed/federation/v1beta1/cluster.go | 161 - .../typed/federation/v1beta1/doc.go | 18 - .../typed/federation/v1beta1/fake/BUILD | 40 - .../typed/federation/v1beta1/fake/doc.go | 18 - .../federation/v1beta1/fake/fake_cluster.go | 129 - .../v1beta1/fake/fake_federation_client.go | 38 - .../federation/v1beta1/federation_client.go | 88 - .../federation/v1beta1/generated_expansion.go | 19 - federation/cluster/BUILD | 14 - federation/cluster/common.sh | 118 - federation/cluster/federation-down.sh | 75 - federation/cluster/federation-up.sh | 138 - federation/cluster/log-dump.sh | 89 - federation/cluster/upgrade.sh | 43 - federation/cmd/federation-apiserver/BUILD | 44 - federation/cmd/federation-apiserver/OWNERS | 10 - .../cmd/federation-apiserver/apiserver.go | 53 - federation/cmd/federation-apiserver/app/BUILD | 105 - .../federation-apiserver/app/autoscaling.go | 62 - .../cmd/federation-apiserver/app/batch.go | 62 - .../cmd/federation-apiserver/app/core.go | 104 - .../federation-apiserver/app/extensions.go | 92 - .../federation-apiserver/app/federation.go | 64 - .../cmd/federation-apiserver/app/install.go | 55 - .../federation-apiserver/app/options/BUILD | 35 - .../app/options/options.go | 94 - .../app/options/validation.go | 58 - .../cmd/federation-apiserver/app/plugins.go | 40 - .../cmd/federation-apiserver/app/server.go | 484 - .../cmd/federation-controller-manager/BUILD | 46 - .../cmd/federation-controller-manager/OWNERS | 8 - .../federation-controller-manager/app/BUILD | 82 - .../app/controllermanager.go | 318 - .../app/controllermanager_test.go | 88 - .../app/options/BUILD | 33 - .../app/options/options.go | 152 - .../app/plugins.go | 27 - .../controller-manager.go | 52 - federation/cmd/genfeddocs/BUILD | 41 - federation/cmd/genfeddocs/gen_fed_docs.go | 71 - federation/cmd/kubefed/BUILD | 36 - federation/cmd/kubefed/app/BUILD | 33 - federation/cmd/kubefed/app/kubefed.go | 47 - federation/cmd/kubefed/kubefed.go | 30 - federation/deploy/config.json.sample | 83 - federation/deploy/deploy.sh | 145 - federation/develop/BUILD | 14 - federation/develop/develop.sh | 196 - federation/develop/kubefed.sh | 48 - federation/develop/push-federation-images.sh | 26 - federation/docs/api-reference/README.md | 12 - .../extensions/v1beta1/definitions.html | 7374 -------- .../extensions/v1beta1/operations.html | 9927 ---------- .../federation/v1beta1/definitions.html | 1601 -- .../federation/v1beta1/operations.html | 1916 -- .../docs/api-reference/v1/definitions.html | 2448 --- .../docs/api-reference/v1/operations.html | 9524 ---------- federation/pkg/dnsprovider/BUILD | 49 - federation/pkg/dnsprovider/dns.go | 114 - federation/pkg/dnsprovider/dns_test.go | 96 - federation/pkg/dnsprovider/doc.go | 21 - federation/pkg/dnsprovider/plugins.go | 109 - .../dnsprovider/providers/aws/route53/BUILD | 64 - .../providers/aws/route53/interface.go | 39 - .../providers/aws/route53/route53.go | 72 - .../providers/aws/route53/route53_test.go | 295 - .../providers/aws/route53/rrchangeset.go | 134 - .../providers/aws/route53/rrset.go | 63 - .../providers/aws/route53/rrsets.go | 106 - .../providers/aws/route53/stubs/BUILD | 29 - .../providers/aws/route53/stubs/route53api.go | 133 - .../dnsprovider/providers/aws/route53/zone.go | 56 - .../providers/aws/route53/zones.go | 80 - .../pkg/dnsprovider/providers/coredns/BUILD | 62 - .../dnsprovider/providers/coredns/coredns.go | 144 - .../providers/coredns/coredns_test.go | 270 - .../providers/coredns/interface.go | 41 - .../providers/coredns/rrchangeset.go | 148 - .../dnsprovider/providers/coredns/rrset.go | 49 - .../dnsprovider/providers/coredns/rrsets.go | 114 - .../dnsprovider/providers/coredns/stubs/BUILD | 29 - .../providers/coredns/stubs/corednsapi.go | 85 - .../pkg/dnsprovider/providers/coredns/zone.go | 42 - .../dnsprovider/providers/coredns/zones.go | 49 - .../providers/google/clouddns/BUILD | 65 - .../providers/google/clouddns/clouddns.go | 116 - .../google/clouddns/clouddns_test.go | 273 - .../providers/google/clouddns/interface.go | 43 - .../providers/google/clouddns/internal/BUILD | 53 - .../google/clouddns/internal/change.go | 43 - .../clouddns/internal/changes_create_call.go | 34 - .../clouddns/internal/changes_service.go | 43 - .../google/clouddns/internal/clouddns.go | 35 - .../google/clouddns/internal/interfaces/BUILD | 29 - .../internal/interfaces/interfaces.go | 212 - .../google/clouddns/internal/managed_zone.go | 39 - .../internal/managed_zone_create_call.go | 33 - .../internal/managed_zones_delete_call.go | 32 - .../internal/managed_zones_get_call.go | 33 - .../internal/managed_zones_list_call.go | 38 - .../internal/managed_zones_list_response.go | 35 - .../internal/managed_zones_service.go | 51 - .../google/clouddns/internal/rrset.go | 32 - .../clouddns/internal/rrsets_list_call.go | 53 - .../clouddns/internal/rrsets_list_response.go | 38 - .../clouddns/internal/rrsets_service.go | 43 - .../google/clouddns/internal/service.go | 49 - .../google/clouddns/internal/stubs/BUILD | 48 - .../google/clouddns/internal/stubs/change.go | 36 - .../internal/stubs/changes_create_call.go | 67 - .../internal/stubs/changes_service.go | 34 - .../clouddns/internal/stubs/clouddns.go | 33 - .../clouddns/internal/stubs/managed_zone.go | 41 - .../stubs/managed_zone_create_call.go | 52 - .../stubs/managed_zones_delete_call.go | 53 - .../internal/stubs/managed_zones_get_call.go | 42 - .../internal/stubs/managed_zones_list_call.go | 59 - .../stubs/managed_zones_list_response.go | 28 - .../internal/stubs/managed_zones_service.go | 46 - .../google/clouddns/internal/stubs/rrset.go | 34 - .../internal/stubs/rrsets_list_call.go | 52 - .../internal/stubs/rrsets_list_response.go | 30 - .../clouddns/internal/stubs/rrsets_service.go | 83 - .../google/clouddns/internal/stubs/service.go | 54 - .../providers/google/clouddns/rrchangeset.go | 124 - .../providers/google/clouddns/rrset.go | 53 - .../providers/google/clouddns/rrsets.go | 94 - .../providers/google/clouddns/zone.go | 48 - .../providers/google/clouddns/zones.go | 73 - federation/pkg/dnsprovider/rrstype/BUILD | 25 - federation/pkg/dnsprovider/rrstype/rrstype.go | 28 - federation/pkg/dnsprovider/tests/BUILD | 29 - .../pkg/dnsprovider/tests/commontests.go | 194 - federation/pkg/federatedtypes/BUILD | 88 - federation/pkg/federatedtypes/adapter.go | 79 - federation/pkg/federatedtypes/configmap.go | 150 - .../pkg/federatedtypes/crudtester/BUILD | 33 - .../federatedtypes/crudtester/crudtester.go | 247 - federation/pkg/federatedtypes/daemonset.go | 167 - federation/pkg/federatedtypes/deployment.go | 189 - federation/pkg/federatedtypes/hpa.go | 1015 - federation/pkg/federatedtypes/hpa_test.go | 264 - federation/pkg/federatedtypes/namespace.go | 215 - .../pkg/federatedtypes/qualifiedname.go | 41 - federation/pkg/federatedtypes/registry.go | 59 - federation/pkg/federatedtypes/replicaset.go | 189 - federation/pkg/federatedtypes/scheduling.go | 356 - .../pkg/federatedtypes/scheduling_test.go | 163 - federation/pkg/federatedtypes/secret.go | 152 - federation/pkg/federation-controller/BUILD | 33 - federation/pkg/federation-controller/OWNERS | 8 - .../pkg/federation-controller/cluster/BUILD | 67 - .../cluster/cluster_client.go | 170 - .../cluster/clustercontroller.go | 209 - .../cluster/clustercontroller_test.go | 173 - .../pkg/federation-controller/cluster/doc.go | 18 - federation/pkg/federation-controller/doc.go | 19 - .../pkg/federation-controller/ingress/BUILD | 77 - .../ingress/ingress_controller.go | 890 - .../ingress/ingress_controller_test.go | 397 - .../pkg/federation-controller/job/BUILD | 79 - .../job/jobcontroller.go | 562 - .../job/jobcontroller_test.go | 282 - .../pkg/federation-controller/service/BUILD | 87 - .../federation-controller/service/dns/BUILD | 62 - .../federation-controller/service/dns/dns.go | 549 - .../service/dns/dns_test.go | 251 - .../service/ingress/BUILD | 29 - .../service/ingress/ingress.go | 136 - .../service/servicecontroller.go | 727 - .../service/servicecontroller_test.go | 383 - .../pkg/federation-controller/sync/BUILD | 69 - .../federation-controller/sync/controller.go | 598 - .../sync/controller_test.go | 231 - .../pkg/federation-controller/util/BUILD | 100 - .../pkg/federation-controller/util/backoff.go | 36 - .../util/cluster_util.go | 148 - .../util/clusterselector/BUILD | 42 - .../util/clusterselector/clusterselector.go | 86 - .../clusterselector/clusterselector_test.go | 98 - .../federation-controller/util/configmap.go | 31 - .../util/delaying_deliverer.go | 183 - .../util/delaying_deliverer_test.go | 63 - .../util/deletionhelper/BUILD | 33 - .../util/deletionhelper/deletion_helper.go | 210 - .../federation-controller/util/deployment.go | 75 - .../util/deployment_test.go | 70 - .../util/eventsink/BUILD | 52 - .../util/eventsink/eventsink.go | 111 - .../util/eventsink/eventsink_test.go | 71 - .../util/federated_informer.go | 524 - .../util/federated_informer_test.go | 150 - .../util/federated_updater.go | 157 - .../util/federated_updater_test.go | 157 - .../util/finalizers/BUILD | 45 - .../util/finalizers/finalizers.go | 66 - .../util/finalizers/finalizers_test.go | 171 - .../federation-controller/util/handlers.go | 112 - .../util/handlers_test.go | 100 - .../pkg/federation-controller/util/hpa/BUILD | 39 - .../pkg/federation-controller/util/hpa/hpa.go | 75 - .../util/hpa/hpa_test.go | 115 - .../pkg/federation-controller/util/meta.go | 85 - .../federation-controller/util/meta_test.go | 117 - .../federation-controller/util/planner/BUILD | 38 - .../util/planner/planner.go | 238 - .../util/planner/planner_test.go | 348 - .../util/podanalyzer/BUILD | 40 - .../util/podanalyzer/pod_helper.go | 63 - .../util/podanalyzer/pod_helper_test.go | 98 - .../util/replicapreferences/BUILD | 45 - .../util/replicapreferences/preferences.go | 55 - .../replicapreferences/preferences_test.go | 92 - .../pkg/federation-controller/util/secret.go | 32 - .../pkg/federation-controller/util/test/BUILD | 39 - .../util/test/test_helper.go | 445 - federation/pkg/kubefed/BUILD | 101 - federation/pkg/kubefed/cluster.go | 178 - federation/pkg/kubefed/cluster_test.go | 239 - federation/pkg/kubefed/init/BUILD | 86 - federation/pkg/kubefed/init/init.go | 1229 -- federation/pkg/kubefed/init/init_test.go | 1634 -- federation/pkg/kubefed/join.go | 700 - federation/pkg/kubefed/join_test.go | 616 - federation/pkg/kubefed/kubefed.go | 91 - federation/pkg/kubefed/testing/BUILD | 36 - federation/pkg/kubefed/testing/testing.go | 188 - federation/pkg/kubefed/unjoin.go | 332 - federation/pkg/kubefed/unjoin_test.go | 307 - federation/pkg/kubefed/util/BUILD | 47 - federation/pkg/kubefed/util/util.go | 347 - .../pkg/admission/schedulingpolicy/BUILD | 69 - .../admission/schedulingpolicy/admission.go | 214 - .../schedulingpolicy/admission_test.go | 474 - .../pkg/admission/schedulingpolicy/merge.go | 45 - .../admission/schedulingpolicy/merge_test.go | 66 - .../pkg/admission/schedulingpolicy/query.go | 145 - federation/registry/cluster/BUILD | 67 - federation/registry/cluster/etcd/BUILD | 53 - federation/registry/cluster/etcd/etcd.go | 68 - federation/registry/cluster/etcd/etcd_test.go | 146 - federation/registry/cluster/registry.go | 82 - federation/registry/cluster/strategy.go | 121 - federation/registry/cluster/strategy_test.go | 168 - federation/test/e2e/BUILD | 70 - federation/test/e2e/OWNERS | 16 - federation/test/e2e/README.md | 1 - federation/test/e2e/apiserver.go | 122 - federation/test/e2e/authn.go | 207 - federation/test/e2e/crud.go | 55 - federation/test/e2e/event.go | 99 - federation/test/e2e/framework/BUILD | 51 - federation/test/e2e/framework/cluster.go | 240 - federation/test/e2e/framework/crudtester.go | 44 - federation/test/e2e/framework/framework.go | 256 - federation/test/e2e/framework/util.go | 150 - federation/test/e2e/ingress.go | 638 - federation/test/e2e/job.go | 290 - federation/test/e2e/namespace.go | 236 - federation/test/e2e/replicaset.go | 461 - federation/test/e2e/service.go | 371 - federation/test/e2e/upgrade.go | 139 - federation/test/e2e/upgrades/BUILD | 35 - federation/test/e2e/upgrades/simple.go | 72 - federation/test/e2e/upgrades/upgrade.go | 56 - federation/test/e2e/util.go | 512 - federation/test/integration/BUILD | 50 - federation/test/integration/OWNERS | 16 - federation/test/integration/api_test.go | 417 - federation/test/integration/crud_test.go | 114 - federation/test/integration/framework/BUILD | 49 - federation/test/integration/framework/api.go | 133 - .../test/integration/framework/controller.go | 43 - .../test/integration/framework/crudtester.go | 47 - .../test/integration/framework/federation.go | 141 - federation/test/integration/framework/util.go | 40 - federation/test/integration/main_test.go | 27 - 393 files changed, 111184 deletions(-) delete mode 100644 federation/BUILD delete mode 100644 federation/Makefile delete mode 100644 federation/OWNERS delete mode 100644 federation/README.md delete mode 100644 federation/apis/core/BUILD delete mode 100644 federation/apis/core/install/BUILD delete mode 100644 federation/apis/core/install/install.go delete mode 100644 federation/apis/core/register.go delete mode 100644 federation/apis/core/v1/BUILD delete mode 100644 federation/apis/core/v1/conversion.go delete mode 100644 federation/apis/core/v1/defaults.go delete mode 100644 federation/apis/core/v1/doc.go delete mode 100644 federation/apis/core/v1/register.go delete mode 100644 federation/apis/core/v1/zz_generated.conversion.go delete mode 100644 federation/apis/federation/BUILD delete mode 100644 federation/apis/federation/annotations.go delete mode 100644 federation/apis/federation/doc.go delete mode 100644 federation/apis/federation/install/BUILD delete mode 100644 federation/apis/federation/install/install.go delete mode 100644 federation/apis/federation/install/install_test.go delete mode 100644 federation/apis/federation/register.go delete mode 100644 federation/apis/federation/types.go delete mode 100644 federation/apis/federation/v1beta1/BUILD delete mode 100644 federation/apis/federation/v1beta1/defaults.go delete mode 100644 federation/apis/federation/v1beta1/doc.go delete mode 100644 federation/apis/federation/v1beta1/generated.pb.go delete mode 100644 federation/apis/federation/v1beta1/generated.proto delete mode 100644 federation/apis/federation/v1beta1/register.go delete mode 100644 federation/apis/federation/v1beta1/types.go delete mode 100644 federation/apis/federation/v1beta1/types_swagger_doc_generated.go delete mode 100644 federation/apis/federation/v1beta1/zz_generated.conversion.go delete mode 100644 federation/apis/federation/v1beta1/zz_generated.deepcopy.go delete mode 100644 federation/apis/federation/v1beta1/zz_generated.defaults.go delete mode 100644 federation/apis/federation/validation/BUILD delete mode 100644 federation/apis/federation/validation/validation.go delete mode 100644 federation/apis/federation/validation/validation_test.go delete mode 100644 federation/apis/federation/zz_generated.deepcopy.go delete mode 100644 federation/apis/openapi-spec/swagger.json delete mode 100644 federation/apis/swagger-spec/api.json delete mode 100644 federation/apis/swagger-spec/apis.json delete mode 100644 federation/apis/swagger-spec/extensions.json delete mode 100644 federation/apis/swagger-spec/extensions_v1beta1.json delete mode 100644 federation/apis/swagger-spec/federation.json delete mode 100644 federation/apis/swagger-spec/federation_v1beta1.json delete mode 100644 federation/apis/swagger-spec/logs.json delete mode 100644 federation/apis/swagger-spec/resourceListing.json delete mode 100644 federation/apis/swagger-spec/v1.json delete mode 100644 federation/apis/swagger-spec/version.json delete mode 100644 federation/client/cache/BUILD delete mode 100644 federation/client/cache/cluster_cache.go delete mode 100644 federation/client/clientset_generated/federation_clientset/BUILD delete mode 100644 federation/client/clientset_generated/federation_clientset/clientset.go delete mode 100644 federation/client/clientset_generated/federation_clientset/doc.go delete mode 100644 federation/client/clientset_generated/federation_clientset/fake/BUILD delete mode 100644 federation/client/clientset_generated/federation_clientset/fake/clientset_generated.go delete mode 100644 federation/client/clientset_generated/federation_clientset/fake/doc.go delete mode 100644 federation/client/clientset_generated/federation_clientset/fake/register.go delete mode 100644 federation/client/clientset_generated/federation_clientset/import_known_versions.go delete mode 100644 federation/client/clientset_generated/federation_clientset/scheme/BUILD delete mode 100644 federation/client/clientset_generated/federation_clientset/scheme/doc.go delete mode 100644 federation/client/clientset_generated/federation_clientset/scheme/register.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/BUILD delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/autoscaling_client.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/doc.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/BUILD delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/doc.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/fake_autoscaling_client.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/generated_expansion.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/horizontalpodautoscaler.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/batch/v1/BUILD delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/batch/v1/batch_client.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/batch/v1/doc.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/BUILD delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/doc.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/fake_batch_client.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/fake_job.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/batch/v1/generated_expansion.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/batch/v1/job.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/BUILD delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/configmap.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/core_client.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/doc.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/event.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/BUILD delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/doc.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_configmap.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_core_client.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_event.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_namespace.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_namespace_expansion.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_secret.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_service.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/generated_expansion.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/namespace.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/namespace_expansion.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/secret.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/core/v1/service.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/BUILD delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/daemonset.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/deployment.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/deployment_expansion.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/doc.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/extensions_client.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/BUILD delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/doc.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_daemonset.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_deployment.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_deployment_expansion.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_extensions_client.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_ingress.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_replicaset.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/generated_expansion.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/ingress.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/replicaset.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/BUILD delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/cluster.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/doc.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/BUILD delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/doc.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/fake_cluster.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/fake_federation_client.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/federation_client.go delete mode 100644 federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/generated_expansion.go delete mode 100644 federation/cluster/BUILD delete mode 100644 federation/cluster/common.sh delete mode 100755 federation/cluster/federation-down.sh delete mode 100755 federation/cluster/federation-up.sh delete mode 100755 federation/cluster/log-dump.sh delete mode 100755 federation/cluster/upgrade.sh delete mode 100644 federation/cmd/federation-apiserver/BUILD delete mode 100644 federation/cmd/federation-apiserver/OWNERS delete mode 100644 federation/cmd/federation-apiserver/apiserver.go delete mode 100644 federation/cmd/federation-apiserver/app/BUILD delete mode 100644 federation/cmd/federation-apiserver/app/autoscaling.go delete mode 100644 federation/cmd/federation-apiserver/app/batch.go delete mode 100644 federation/cmd/federation-apiserver/app/core.go delete mode 100644 federation/cmd/federation-apiserver/app/extensions.go delete mode 100644 federation/cmd/federation-apiserver/app/federation.go delete mode 100644 federation/cmd/federation-apiserver/app/install.go delete mode 100644 federation/cmd/federation-apiserver/app/options/BUILD delete mode 100644 federation/cmd/federation-apiserver/app/options/options.go delete mode 100644 federation/cmd/federation-apiserver/app/options/validation.go delete mode 100644 federation/cmd/federation-apiserver/app/plugins.go delete mode 100644 federation/cmd/federation-apiserver/app/server.go delete mode 100644 federation/cmd/federation-controller-manager/BUILD delete mode 100644 federation/cmd/federation-controller-manager/OWNERS delete mode 100644 federation/cmd/federation-controller-manager/app/BUILD delete mode 100644 federation/cmd/federation-controller-manager/app/controllermanager.go delete mode 100644 federation/cmd/federation-controller-manager/app/controllermanager_test.go delete mode 100644 federation/cmd/federation-controller-manager/app/options/BUILD delete mode 100644 federation/cmd/federation-controller-manager/app/options/options.go delete mode 100644 federation/cmd/federation-controller-manager/app/plugins.go delete mode 100644 federation/cmd/federation-controller-manager/controller-manager.go delete mode 100644 federation/cmd/genfeddocs/BUILD delete mode 100644 federation/cmd/genfeddocs/gen_fed_docs.go delete mode 100644 federation/cmd/kubefed/BUILD delete mode 100644 federation/cmd/kubefed/app/BUILD delete mode 100644 federation/cmd/kubefed/app/kubefed.go delete mode 100644 federation/cmd/kubefed/kubefed.go delete mode 100644 federation/deploy/config.json.sample delete mode 100755 federation/deploy/deploy.sh delete mode 100644 federation/develop/BUILD delete mode 100755 federation/develop/develop.sh delete mode 100755 federation/develop/kubefed.sh delete mode 100755 federation/develop/push-federation-images.sh delete mode 100644 federation/docs/api-reference/README.md delete mode 100755 federation/docs/api-reference/extensions/v1beta1/definitions.html delete mode 100755 federation/docs/api-reference/extensions/v1beta1/operations.html delete mode 100755 federation/docs/api-reference/federation/v1beta1/definitions.html delete mode 100755 federation/docs/api-reference/federation/v1beta1/operations.html delete mode 100755 federation/docs/api-reference/v1/definitions.html delete mode 100755 federation/docs/api-reference/v1/operations.html delete mode 100644 federation/pkg/dnsprovider/BUILD delete mode 100644 federation/pkg/dnsprovider/dns.go delete mode 100644 federation/pkg/dnsprovider/dns_test.go delete mode 100644 federation/pkg/dnsprovider/doc.go delete mode 100644 federation/pkg/dnsprovider/plugins.go delete mode 100644 federation/pkg/dnsprovider/providers/aws/route53/BUILD delete mode 100644 federation/pkg/dnsprovider/providers/aws/route53/interface.go delete mode 100644 federation/pkg/dnsprovider/providers/aws/route53/route53.go delete mode 100644 federation/pkg/dnsprovider/providers/aws/route53/route53_test.go delete mode 100644 federation/pkg/dnsprovider/providers/aws/route53/rrchangeset.go delete mode 100644 federation/pkg/dnsprovider/providers/aws/route53/rrset.go delete mode 100644 federation/pkg/dnsprovider/providers/aws/route53/rrsets.go delete mode 100644 federation/pkg/dnsprovider/providers/aws/route53/stubs/BUILD delete mode 100644 federation/pkg/dnsprovider/providers/aws/route53/stubs/route53api.go delete mode 100644 federation/pkg/dnsprovider/providers/aws/route53/zone.go delete mode 100644 federation/pkg/dnsprovider/providers/aws/route53/zones.go delete mode 100644 federation/pkg/dnsprovider/providers/coredns/BUILD delete mode 100644 federation/pkg/dnsprovider/providers/coredns/coredns.go delete mode 100644 federation/pkg/dnsprovider/providers/coredns/coredns_test.go delete mode 100644 federation/pkg/dnsprovider/providers/coredns/interface.go delete mode 100644 federation/pkg/dnsprovider/providers/coredns/rrchangeset.go delete mode 100644 federation/pkg/dnsprovider/providers/coredns/rrset.go delete mode 100644 federation/pkg/dnsprovider/providers/coredns/rrsets.go delete mode 100644 federation/pkg/dnsprovider/providers/coredns/stubs/BUILD delete mode 100644 federation/pkg/dnsprovider/providers/coredns/stubs/corednsapi.go delete mode 100644 federation/pkg/dnsprovider/providers/coredns/zone.go delete mode 100644 federation/pkg/dnsprovider/providers/coredns/zones.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/BUILD delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/clouddns.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/clouddns_test.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/interface.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/BUILD delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/change.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/changes_create_call.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/changes_service.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/clouddns.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces/BUILD delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces/interfaces.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zone.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zone_create_call.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_delete_call.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_get_call.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_list_call.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_list_response.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_service.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/rrset.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/rrsets_list_call.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/rrsets_list_response.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/rrsets_service.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/service.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/BUILD delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/change.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/changes_create_call.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/changes_service.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/clouddns.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zone.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zone_create_call.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_delete_call.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_get_call.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_list_call.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_list_response.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_service.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrset.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrsets_list_call.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrsets_list_response.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrsets_service.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/service.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/rrchangeset.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/rrset.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/rrsets.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/zone.go delete mode 100644 federation/pkg/dnsprovider/providers/google/clouddns/zones.go delete mode 100644 federation/pkg/dnsprovider/rrstype/BUILD delete mode 100644 federation/pkg/dnsprovider/rrstype/rrstype.go delete mode 100644 federation/pkg/dnsprovider/tests/BUILD delete mode 100644 federation/pkg/dnsprovider/tests/commontests.go delete mode 100644 federation/pkg/federatedtypes/BUILD delete mode 100644 federation/pkg/federatedtypes/adapter.go delete mode 100644 federation/pkg/federatedtypes/configmap.go delete mode 100644 federation/pkg/federatedtypes/crudtester/BUILD delete mode 100644 federation/pkg/federatedtypes/crudtester/crudtester.go delete mode 100644 federation/pkg/federatedtypes/daemonset.go delete mode 100644 federation/pkg/federatedtypes/deployment.go delete mode 100644 federation/pkg/federatedtypes/hpa.go delete mode 100644 federation/pkg/federatedtypes/hpa_test.go delete mode 100644 federation/pkg/federatedtypes/namespace.go delete mode 100644 federation/pkg/federatedtypes/qualifiedname.go delete mode 100644 federation/pkg/federatedtypes/registry.go delete mode 100644 federation/pkg/federatedtypes/replicaset.go delete mode 100644 federation/pkg/federatedtypes/scheduling.go delete mode 100644 federation/pkg/federatedtypes/scheduling_test.go delete mode 100644 federation/pkg/federatedtypes/secret.go delete mode 100644 federation/pkg/federation-controller/BUILD delete mode 100644 federation/pkg/federation-controller/OWNERS delete mode 100644 federation/pkg/federation-controller/cluster/BUILD delete mode 100644 federation/pkg/federation-controller/cluster/cluster_client.go delete mode 100644 federation/pkg/federation-controller/cluster/clustercontroller.go delete mode 100644 federation/pkg/federation-controller/cluster/clustercontroller_test.go delete mode 100644 federation/pkg/federation-controller/cluster/doc.go delete mode 100644 federation/pkg/federation-controller/doc.go delete mode 100644 federation/pkg/federation-controller/ingress/BUILD delete mode 100644 federation/pkg/federation-controller/ingress/ingress_controller.go delete mode 100644 federation/pkg/federation-controller/ingress/ingress_controller_test.go delete mode 100644 federation/pkg/federation-controller/job/BUILD delete mode 100644 federation/pkg/federation-controller/job/jobcontroller.go delete mode 100644 federation/pkg/federation-controller/job/jobcontroller_test.go delete mode 100644 federation/pkg/federation-controller/service/BUILD delete mode 100644 federation/pkg/federation-controller/service/dns/BUILD delete mode 100644 federation/pkg/federation-controller/service/dns/dns.go delete mode 100644 federation/pkg/federation-controller/service/dns/dns_test.go delete mode 100644 federation/pkg/federation-controller/service/ingress/BUILD delete mode 100644 federation/pkg/federation-controller/service/ingress/ingress.go delete mode 100644 federation/pkg/federation-controller/service/servicecontroller.go delete mode 100644 federation/pkg/federation-controller/service/servicecontroller_test.go delete mode 100644 federation/pkg/federation-controller/sync/BUILD delete mode 100644 federation/pkg/federation-controller/sync/controller.go delete mode 100644 federation/pkg/federation-controller/sync/controller_test.go delete mode 100644 federation/pkg/federation-controller/util/BUILD delete mode 100644 federation/pkg/federation-controller/util/backoff.go delete mode 100644 federation/pkg/federation-controller/util/cluster_util.go delete mode 100644 federation/pkg/federation-controller/util/clusterselector/BUILD delete mode 100644 federation/pkg/federation-controller/util/clusterselector/clusterselector.go delete mode 100644 federation/pkg/federation-controller/util/clusterselector/clusterselector_test.go delete mode 100644 federation/pkg/federation-controller/util/configmap.go delete mode 100644 federation/pkg/federation-controller/util/delaying_deliverer.go delete mode 100644 federation/pkg/federation-controller/util/delaying_deliverer_test.go delete mode 100644 federation/pkg/federation-controller/util/deletionhelper/BUILD delete mode 100644 federation/pkg/federation-controller/util/deletionhelper/deletion_helper.go delete mode 100644 federation/pkg/federation-controller/util/deployment.go delete mode 100644 federation/pkg/federation-controller/util/deployment_test.go delete mode 100644 federation/pkg/federation-controller/util/eventsink/BUILD delete mode 100644 federation/pkg/federation-controller/util/eventsink/eventsink.go delete mode 100644 federation/pkg/federation-controller/util/eventsink/eventsink_test.go delete mode 100644 federation/pkg/federation-controller/util/federated_informer.go delete mode 100644 federation/pkg/federation-controller/util/federated_informer_test.go delete mode 100644 federation/pkg/federation-controller/util/federated_updater.go delete mode 100644 federation/pkg/federation-controller/util/federated_updater_test.go delete mode 100644 federation/pkg/federation-controller/util/finalizers/BUILD delete mode 100644 federation/pkg/federation-controller/util/finalizers/finalizers.go delete mode 100644 federation/pkg/federation-controller/util/finalizers/finalizers_test.go delete mode 100644 federation/pkg/federation-controller/util/handlers.go delete mode 100644 federation/pkg/federation-controller/util/handlers_test.go delete mode 100644 federation/pkg/federation-controller/util/hpa/BUILD delete mode 100644 federation/pkg/federation-controller/util/hpa/hpa.go delete mode 100644 federation/pkg/federation-controller/util/hpa/hpa_test.go delete mode 100644 federation/pkg/federation-controller/util/meta.go delete mode 100644 federation/pkg/federation-controller/util/meta_test.go delete mode 100644 federation/pkg/federation-controller/util/planner/BUILD delete mode 100644 federation/pkg/federation-controller/util/planner/planner.go delete mode 100644 federation/pkg/federation-controller/util/planner/planner_test.go delete mode 100644 federation/pkg/federation-controller/util/podanalyzer/BUILD delete mode 100644 federation/pkg/federation-controller/util/podanalyzer/pod_helper.go delete mode 100644 federation/pkg/federation-controller/util/podanalyzer/pod_helper_test.go delete mode 100644 federation/pkg/federation-controller/util/replicapreferences/BUILD delete mode 100644 federation/pkg/federation-controller/util/replicapreferences/preferences.go delete mode 100644 federation/pkg/federation-controller/util/replicapreferences/preferences_test.go delete mode 100644 federation/pkg/federation-controller/util/secret.go delete mode 100644 federation/pkg/federation-controller/util/test/BUILD delete mode 100644 federation/pkg/federation-controller/util/test/test_helper.go delete mode 100644 federation/pkg/kubefed/BUILD delete mode 100644 federation/pkg/kubefed/cluster.go delete mode 100644 federation/pkg/kubefed/cluster_test.go delete mode 100644 federation/pkg/kubefed/init/BUILD delete mode 100644 federation/pkg/kubefed/init/init.go delete mode 100644 federation/pkg/kubefed/init/init_test.go delete mode 100644 federation/pkg/kubefed/join.go delete mode 100644 federation/pkg/kubefed/join_test.go delete mode 100644 federation/pkg/kubefed/kubefed.go delete mode 100644 federation/pkg/kubefed/testing/BUILD delete mode 100644 federation/pkg/kubefed/testing/testing.go delete mode 100644 federation/pkg/kubefed/unjoin.go delete mode 100644 federation/pkg/kubefed/unjoin_test.go delete mode 100644 federation/pkg/kubefed/util/BUILD delete mode 100644 federation/pkg/kubefed/util/util.go delete mode 100644 federation/plugin/pkg/admission/schedulingpolicy/BUILD delete mode 100644 federation/plugin/pkg/admission/schedulingpolicy/admission.go delete mode 100644 federation/plugin/pkg/admission/schedulingpolicy/admission_test.go delete mode 100644 federation/plugin/pkg/admission/schedulingpolicy/merge.go delete mode 100644 federation/plugin/pkg/admission/schedulingpolicy/merge_test.go delete mode 100644 federation/plugin/pkg/admission/schedulingpolicy/query.go delete mode 100644 federation/registry/cluster/BUILD delete mode 100644 federation/registry/cluster/etcd/BUILD delete mode 100644 federation/registry/cluster/etcd/etcd.go delete mode 100644 federation/registry/cluster/etcd/etcd_test.go delete mode 100644 federation/registry/cluster/registry.go delete mode 100644 federation/registry/cluster/strategy.go delete mode 100644 federation/registry/cluster/strategy_test.go delete mode 100644 federation/test/e2e/BUILD delete mode 100644 federation/test/e2e/OWNERS delete mode 100644 federation/test/e2e/README.md delete mode 100644 federation/test/e2e/apiserver.go delete mode 100644 federation/test/e2e/authn.go delete mode 100644 federation/test/e2e/crud.go delete mode 100644 federation/test/e2e/event.go delete mode 100644 federation/test/e2e/framework/BUILD delete mode 100644 federation/test/e2e/framework/cluster.go delete mode 100644 federation/test/e2e/framework/crudtester.go delete mode 100644 federation/test/e2e/framework/framework.go delete mode 100644 federation/test/e2e/framework/util.go delete mode 100644 federation/test/e2e/ingress.go delete mode 100644 federation/test/e2e/job.go delete mode 100644 federation/test/e2e/namespace.go delete mode 100644 federation/test/e2e/replicaset.go delete mode 100644 federation/test/e2e/service.go delete mode 100644 federation/test/e2e/upgrade.go delete mode 100644 federation/test/e2e/upgrades/BUILD delete mode 100644 federation/test/e2e/upgrades/simple.go delete mode 100644 federation/test/e2e/upgrades/upgrade.go delete mode 100644 federation/test/e2e/util.go delete mode 100644 federation/test/integration/BUILD delete mode 100644 federation/test/integration/OWNERS delete mode 100644 federation/test/integration/api_test.go delete mode 100644 federation/test/integration/crud_test.go delete mode 100644 federation/test/integration/framework/BUILD delete mode 100644 federation/test/integration/framework/api.go delete mode 100644 federation/test/integration/framework/controller.go delete mode 100644 federation/test/integration/framework/crudtester.go delete mode 100644 federation/test/integration/framework/federation.go delete mode 100644 federation/test/integration/framework/util.go delete mode 100644 federation/test/integration/main_test.go diff --git a/federation/BUILD b/federation/BUILD deleted file mode 100644 index 5473e90177..0000000000 --- a/federation/BUILD +++ /dev/null @@ -1,44 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load("@io_bazel//tools/build_defs/pkg:pkg.bzl", "pkg_tar") - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/apis/core:all-srcs", - "//federation/apis/federation:all-srcs", - "//federation/client/cache:all-srcs", - "//federation/client/clientset_generated/federation_clientset:all-srcs", - "//federation/cluster:all-srcs", - "//federation/cmd/federation-apiserver:all-srcs", - "//federation/cmd/federation-controller-manager:all-srcs", - "//federation/cmd/genfeddocs:all-srcs", - "//federation/cmd/kubefed:all-srcs", - "//federation/develop:all-srcs", - "//federation/pkg/dnsprovider:all-srcs", - "//federation/pkg/federatedtypes:all-srcs", - "//federation/pkg/federation-controller:all-srcs", - "//federation/pkg/kubefed:all-srcs", - "//federation/plugin/pkg/admission/schedulingpolicy:all-srcs", - "//federation/registry/cluster:all-srcs", - "//federation/test/e2e:all-srcs", - "//federation/test/integration:all-srcs", - ], - tags = ["automanaged"], -) - -pkg_tar( - name = "release", - files = glob([ - "deploy/**", - ]) + ["//federation/cluster:all-srcs"], - package_dir = "federation", -) diff --git a/federation/Makefile b/federation/Makefile deleted file mode 100644 index 091f802120..0000000000 --- a/federation/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright 2016 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. - -DBG_MAKEFILE ?= -ifeq ($(DBG_MAKEFILE),1) - $(warning ***** starting makefile for goal(s) "$(MAKECMDGOALS)") - $(warning ***** $(shell date)) -else - # If we're not debugging the Makefile, don't echo recipes. - MAKEFLAGS += -s -endif - -.PHONY: all -all: init build push deploy - -.PHONY: init -init: - ./develop/develop.sh init - -.PHONY: build -build: build_binaries build_image - -.PHONY: push -push: - ./develop/develop.sh push - -.PHONY: deploy -deploy: deploy_clusters deploy_federation - -.PHONY: destroy -destroy: destroy_federation destroy_clusters - -.PHONY: build_binaries -build_binaries: - ./develop/develop.sh build_binaries - -.PHONY: build_image -build_image: - ./develop/develop.sh build_image - -.PHONY: deploy_clusters -deploy_clusters: - ./develop/develop.sh deploy_clusters - -.PHONY: deploy_federation -deploy_federation: - ./develop/develop.sh deploy_federation - -.PHONY: destroy_federation -destroy_federation: - ./develop/develop.sh destroy_federation - -.PHONY: destroy_clusters -destroy_clusters: - ./develop/develop.sh destroy_clusters - -.PHONY: redeploy_federation -redeploy_federation: - ./develop/develop.sh redeploy_federation diff --git a/federation/OWNERS b/federation/OWNERS deleted file mode 100644 index 84b3679855..0000000000 --- a/federation/OWNERS +++ /dev/null @@ -1,17 +0,0 @@ -reviewers: - - colhom - - csbell - - irfanurrehman - - madhusudancs - - marun - - mwielgus - - nikhiljindal - - quinton-hoole - - shashidharatd -approvers: - - csbell - - irfanurrehman - - madhusudancs - - mwielgus - - nikhiljindal - - quinton-hoole diff --git a/federation/README.md b/federation/README.md deleted file mode 100644 index 8003e9fd18..0000000000 --- a/federation/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# Cluster Federation - -Kubernetes Cluster Federation enables users to federate multiple -Kubernetes clusters. Please see the [user guide](https://kubernetes.io/docs/concepts/cluster-administration/federation-service-discovery/) -and the [admin guide](https://kubernetes.io/docs/tutorials/federation/set-up-cluster-federation-kubefed/) -for more details about setting up and using the Cluster Federation. - -# Building Kubernetes Cluster Federation - -Please see the [Kubernetes Development Guide](https://github.com/kubernetes/community/blob/master/contributors/devel/development.md) -for initial setup. Once you have the development environment setup -as explained in that guide, you also need to install [`jq`](https://stedolan.github.io/jq/download/) - - -Building cluster federation artifacts should be as simple as running: - -```shell -make build -``` - -You can specify the docker registry to tag the image using the -KUBE_REGISTRY environment variable. Please make sure that you use -the same value in all the subsequent commands. - -To push the built docker images to the registry, run: - -```shell -make push -``` - -To initialize the deployment run: - -(This pulls the installer images) - -```shell -make init -``` - -To deploy the clusters and install the federation components, edit the -`${KUBE_ROOT}/_output/federation/config.json` file to describe your -clusters and run: - -```shell -make deploy -``` - -To turn down the federation components and tear down the clusters run: - -```shell -make destroy -``` - -# Ideas for improvement - -1. Continue with `destroy` phase even in the face of errors. - - The bash script sets `set -e errexit` which causes the script to exit - at the very first error. This should be the default mode for deploying - components but not for destroying/cleanup. - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/federation/README.md?pixel)]() diff --git a/federation/apis/core/BUILD b/federation/apis/core/BUILD deleted file mode 100644 index b5d58afb5c..0000000000 --- a/federation/apis/core/BUILD +++ /dev/null @@ -1,38 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["register.go"], - importpath = "k8s.io/kubernetes/federation/apis/core", - deps = [ - "//pkg/api:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apimachinery/announced:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apimachinery/registered: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/runtime/serializer:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/apis/core/install:all-srcs", - "//federation/apis/core/v1:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/apis/core/install/BUILD b/federation/apis/core/install/BUILD deleted file mode 100644 index 2c1a036a69..0000000000 --- a/federation/apis/core/install/BUILD +++ /dev/null @@ -1,33 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["install.go"], - importpath = "k8s.io/kubernetes/federation/apis/core/install", - deps = [ - "//federation/apis/core:go_default_library", - "//federation/apis/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apimachinery/announced:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apimachinery/registered:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/apis/core/install/install.go b/federation/apis/core/install/install.go deleted file mode 100644 index ca250a4f43..0000000000 --- a/federation/apis/core/install/install.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2016 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 install - -import ( - "k8s.io/apimachinery/pkg/apimachinery/announced" - "k8s.io/apimachinery/pkg/apimachinery/registered" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/kubernetes/federation/apis/core" - corev1 "k8s.io/kubernetes/federation/apis/core/v1" -) - -func init() { - Install(core.GroupFactoryRegistry, core.Registry, core.Scheme) -} - -// Install registers the API group and adds types to a scheme -func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) { - if err := announced.NewGroupMetaFactory( - &announced.GroupMetaFactoryArgs{ - GroupName: core.GroupName, - VersionPreferenceOrder: []string{corev1.SchemeGroupVersion.Version}, - AddInternalObjectsToScheme: core.AddToScheme, - RootScopedKinds: sets.NewString( - "Namespace", - ), - IgnoredKinds: sets.NewString( - "ListOptions", - "DeleteOptions", - "Status", - ), - }, - announced.VersionToSchemeFunc{ - corev1.SchemeGroupVersion.Version: corev1.AddToScheme, - }, - ).Announce(groupFactoryRegistry).RegisterAndEnable(registry, scheme); err != nil { - panic(err) - } -} diff --git a/federation/apis/core/register.go b/federation/apis/core/register.go deleted file mode 100644 index efb4dd5845..0000000000 --- a/federation/apis/core/register.go +++ /dev/null @@ -1,102 +0,0 @@ -/* -Copyright 2016 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 core - -import ( - "os" - - "k8s.io/apimachinery/pkg/apimachinery/announced" - "k8s.io/apimachinery/pkg/apimachinery/registered" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/kubernetes/pkg/api" -) - -// NOTE: the registry, scheme and codecs are created here to allow to install a federation core group -// that is completely independent from the Kubernetes core group. It's only used for the core group itself. -// The other apigroups in the federation apiserver use the Kubernetes registry, scheme and codecs. - -// GroupFactoryRegistry is the APIGroupFactoryRegistry (overlaps a bit with Registry, see comments in package for details) -var GroupFactoryRegistry = make(announced.APIGroupFactoryRegistry) - -// Registry is an instance of an API registry. This is an interim step to start removing the idea of a global -// API registry. -var Registry = registered.NewOrDie(os.Getenv("KUBE_API_VERSIONS")) - -// Scheme is the default instance of runtime.Scheme to which types in the Kubernetes API are already registered. -var Scheme = runtime.NewScheme() - -// Codecs provides access to encoding and decoding for the scheme -var Codecs = serializer.NewCodecFactory(Scheme) - -// GroupName is the group name use in this package -const GroupName = "" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} - -// Unversioned is group version for unversioned API objects -// TODO: this should be v1 probably -var Unversioned = schema.GroupVersion{Group: "", Version: "v1"} - -// ParameterCodec handles versioning of objects that are converted to query parameters. -var ParameterCodec = runtime.NewParameterCodec(Scheme) - -// 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() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -func addKnownTypes(scheme *runtime.Scheme) error { - if err := scheme.AddIgnoredConversionType(&metav1.TypeMeta{}, &metav1.TypeMeta{}); err != nil { - return err - } - scheme.AddKnownTypes(SchemeGroupVersion, - &api.ServiceList{}, - &api.Service{}, - &api.Namespace{}, - &api.NamespaceList{}, - &api.Secret{}, - &api.SecretList{}, - &api.Event{}, - &api.EventList{}, - &api.ConfigMap{}, - &api.ConfigMapList{}, - ) - - // Register Unversioned types under their own special group - scheme.AddUnversionedTypes(Unversioned, - &metav1.Status{}, - &metav1.APIVersions{}, - &metav1.APIGroupList{}, - &metav1.APIGroup{}, - &metav1.APIResourceList{}, - ) - return nil -} diff --git a/federation/apis/core/v1/BUILD b/federation/apis/core/v1/BUILD deleted file mode 100644 index 1077ddd954..0000000000 --- a/federation/apis/core/v1/BUILD +++ /dev/null @@ -1,38 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "conversion.go", - "defaults.go", - "doc.go", - "register.go", - "zz_generated.conversion.go", - ], - importpath = "k8s.io/kubernetes/federation/apis/core/v1", - deps = [ - "//pkg/api/v1:go_default_library", - "//vendor/k8s.io/api/core/v1: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", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/apis/core/v1/conversion.go b/federation/apis/core/v1/conversion.go deleted file mode 100644 index 2e9ed1e741..0000000000 --- a/federation/apis/core/v1/conversion.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2016 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 v1 - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/kubernetes/pkg/api/v1" -) - -func addConversionFuncs(scheme *runtime.Scheme) error { - // Add non-generated conversion functions - err := scheme.AddConversionFuncs( - v1.Convert_v1_DeleteOptions_To_api_DeleteOptions, - v1.Convert_api_DeleteOptions_To_v1_DeleteOptions, - v1.Convert_v1_List_To_api_List, - v1.Convert_api_List_To_v1_List, - v1.Convert_v1_ListOptions_To_api_ListOptions, - v1.Convert_api_ListOptions_To_v1_ListOptions, - v1.Convert_v1_ObjectFieldSelector_To_api_ObjectFieldSelector, - v1.Convert_api_ObjectFieldSelector_To_v1_ObjectFieldSelector, - v1.Convert_v1_ObjectMeta_To_api_ObjectMeta, - v1.Convert_api_ObjectMeta_To_v1_ObjectMeta, - v1.Convert_v1_ObjectReference_To_api_ObjectReference, - v1.Convert_api_ObjectReference_To_v1_ObjectReference, - v1.Convert_v1_Secret_To_api_Secret, - v1.Convert_api_Secret_To_v1_Secret, - v1.Convert_v1_SecretList_To_api_SecretList, - v1.Convert_api_SecretList_To_v1_SecretList, - v1.Convert_v1_Service_To_api_Service, - v1.Convert_api_Service_To_v1_Service, - v1.Convert_v1_ServiceList_To_api_ServiceList, - v1.Convert_api_ServiceList_To_v1_ServiceList, - v1.Convert_v1_ServicePort_To_api_ServicePort, - v1.Convert_api_ServicePort_To_v1_ServicePort, - v1.Convert_v1_ServiceProxyOptions_To_api_ServiceProxyOptions, - v1.Convert_api_ServiceProxyOptions_To_v1_ServiceProxyOptions, - v1.Convert_v1_ServiceSpec_To_api_ServiceSpec, - v1.Convert_api_ServiceSpec_To_v1_ServiceSpec, - v1.Convert_v1_ServiceStatus_To_api_ServiceStatus, - v1.Convert_api_ServiceStatus_To_v1_ServiceStatus, - ) - if err != nil { - return err - } - - if err := v1.AddFieldLabelConversionsForEvent(scheme); err != nil { - return nil - } - if err := v1.AddFieldLabelConversionsForNamespace(scheme); err != nil { - return nil - } - if err := v1.AddFieldLabelConversionsForSecret(scheme); err != nil { - return nil - } - return nil -} diff --git a/federation/apis/core/v1/defaults.go b/federation/apis/core/v1/defaults.go deleted file mode 100644 index 48a5b2581a..0000000000 --- a/federation/apis/core/v1/defaults.go +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2016 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 v1 - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/kubernetes/pkg/api/v1" -) - -func addDefaultingFuncs(scheme *runtime.Scheme) error { - return v1.RegisterDefaults(scheme) -} diff --git a/federation/apis/core/v1/doc.go b/federation/apis/core/v1/doc.go deleted file mode 100644 index 50a5741fc4..0000000000 --- a/federation/apis/core/v1/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2016 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. -*/ - -// This is probably not required for now because we are reusing the types -// in k8s.io/kubernetes/pkg/api. But adding it now as a guard to ensure -// that others don't stumble on this in the future when they add new -// types here since adding it now doesn't hurt. -// +k8s:conversion-gen=k8s.io/kubernetes/federation/apis/core - -package v1 diff --git a/federation/apis/core/v1/register.go b/federation/apis/core/v1/register.go deleted file mode 100644 index dc3e643019..0000000000 --- a/federation/apis/core/v1/register.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2014 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 v1 - -import ( - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the group name use in this package -const GroupName = "" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} - -var ( - // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. - // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. - 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, addConversionFuncs, addDefaultingFuncs) -} - -// Adds the list of known types to api.Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &v1.Service{}, - &v1.Namespace{}, - &v1.NamespaceList{}, - &v1.ServiceList{}, - &v1.Secret{}, - &v1.SecretList{}, - &v1.Event{}, - &v1.EventList{}, - &v1.ConfigMap{}, - &v1.ConfigMapList{}, - ) - - // Add common types - scheme.AddKnownTypes(SchemeGroupVersion, &metav1.Status{}) - - // Add the watch version that applies - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/federation/apis/core/v1/zz_generated.conversion.go b/federation/apis/core/v1/zz_generated.conversion.go deleted file mode 100644 index 0221d60e0a..0000000000 --- a/federation/apis/core/v1/zz_generated.conversion.go +++ /dev/null @@ -1,35 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was autogenerated by conversion-gen. Do not edit it manually! - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(scheme *runtime.Scheme) error { - return scheme.AddGeneratedConversionFuncs() -} diff --git a/federation/apis/federation/BUILD b/federation/apis/federation/BUILD deleted file mode 100644 index 8118508131..0000000000 --- a/federation/apis/federation/BUILD +++ /dev/null @@ -1,44 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "annotations.go", - "doc.go", - "register.go", - "types.go", - "zz_generated.deepcopy.go", - ], - importpath = "k8s.io/kubernetes/federation/apis/federation", - deps = [ - "//pkg/api:go_default_library", - "//vendor/k8s.io/api/core/v1: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", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/apis/federation/install:all-srcs", - "//federation/apis/federation/v1beta1:all-srcs", - "//federation/apis/federation/validation:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/apis/federation/annotations.go b/federation/apis/federation/annotations.go deleted file mode 100644 index 9a9e519f36..0000000000 --- a/federation/apis/federation/annotations.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federation - -// FederationNameAnnotation is the annotation which holds the name of -// the federation that a federation control plane component is associated -// with. It must be applied to all the API types that represent that federations -// control plane's components in the host cluster and in joining clusters. -const FederationNameAnnotation = "federation.alpha.kubernetes.io/federation-name" - -// ClusterNameAnnotation is the annotation which holds the name of -// the cluster that an object is associated with. If the object is -// not associated with any cluster, then this annotation is not -// required. -const ClusterNameAnnotation = "federation.alpha.kubernetes.io/cluster-name" diff --git a/federation/apis/federation/doc.go b/federation/apis/federation/doc.go deleted file mode 100644 index 4c51dfeebe..0000000000 --- a/federation/apis/federation/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2016 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:deepcopy-gen=package,register - -package federation // import "k8s.io/kubernetes/federation/apis/federation" diff --git a/federation/apis/federation/install/BUILD b/federation/apis/federation/install/BUILD deleted file mode 100644 index b003e09b15..0000000000 --- a/federation/apis/federation/install/BUILD +++ /dev/null @@ -1,50 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = ["install.go"], - importpath = "k8s.io/kubernetes/federation/apis/federation/install", - deps = [ - "//federation/apis/federation:go_default_library", - "//federation/apis/federation/v1beta1:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apimachinery/announced:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apimachinery/registered:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["install_test.go"], - importpath = "k8s.io/kubernetes/federation/apis/federation/install", - library = ":go_default_library", - deps = [ - "//federation/apis/federation:go_default_library", - "//federation/apis/federation/v1beta1:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/apis/federation/install/install.go b/federation/apis/federation/install/install.go deleted file mode 100644 index 6c609f0b94..0000000000 --- a/federation/apis/federation/install/install.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2016 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 install - -import ( - "k8s.io/apimachinery/pkg/apimachinery/announced" - "k8s.io/apimachinery/pkg/apimachinery/registered" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/kubernetes/pkg/api/legacyscheme" - - "k8s.io/kubernetes/federation/apis/federation" - "k8s.io/kubernetes/federation/apis/federation/v1beta1" -) - -func init() { - Install(legacyscheme.GroupFactoryRegistry, legacyscheme.Registry, legacyscheme.Scheme) -} - -// Install registers the API group and adds types to a scheme -func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) { - if err := announced.NewGroupMetaFactory( - &announced.GroupMetaFactoryArgs{ - GroupName: federation.GroupName, - VersionPreferenceOrder: []string{v1beta1.SchemeGroupVersion.Version}, - AddInternalObjectsToScheme: federation.AddToScheme, - RootScopedKinds: sets.NewString( - "Cluster", - ), - }, - announced.VersionToSchemeFunc{ - v1beta1.SchemeGroupVersion.Version: v1beta1.AddToScheme, - }, - ).Announce(groupFactoryRegistry).RegisterAndEnable(registry, scheme); err != nil { - panic(err) - } -} diff --git a/federation/apis/federation/install/install_test.go b/federation/apis/federation/install/install_test.go deleted file mode 100644 index cfc40d5168..0000000000 --- a/federation/apis/federation/install/install_test.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -Copyright 2016 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 install - -import ( - "encoding/json" - "testing" - - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/kubernetes/federation/apis/federation" - "k8s.io/kubernetes/federation/apis/federation/v1beta1" - "k8s.io/kubernetes/pkg/api/legacyscheme" -) - -func TestResourceVersioner(t *testing.T) { - accessor := meta.NewAccessor() - cluster := federation.Cluster{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "10"}} - version, err := accessor.ResourceVersion(&cluster) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - if version != "10" { - t.Errorf("version = %v, want 10", version) - } - - clusterList := federation.ClusterList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}} - version, err = accessor.ResourceVersion(&clusterList) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - if version != "10" { - t.Errorf("version = %v, want 10", version) - } -} - -func TestCodec(t *testing.T) { - cluster := federation.Cluster{} - // We do want to use package registered rather than testapi here, because we - // want to test if the package install and package registered work as expected. - data, err := runtime.Encode(legacyscheme.Codecs.LegacyCodec(legacyscheme.Registry.GroupOrDie(federation.GroupName).GroupVersion), &cluster) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - other := federation.Cluster{} - if err := json.Unmarshal(data, &other); err != nil { - t.Fatalf("unexpected error: %v", err) - } - if other.APIVersion != legacyscheme.Registry.GroupOrDie(federation.GroupName).GroupVersion.String() || other.Kind != "Cluster" { - t.Errorf("unexpected unmarshalled object %#v", other) - } -} - -func TestInterfacesFor(t *testing.T) { - if _, err := legacyscheme.Registry.GroupOrDie(federation.GroupName).InterfacesFor(federation.SchemeGroupVersion); err == nil { - t.Fatalf("unexpected non-error: %v", err) - } - for i, version := range legacyscheme.Registry.GroupOrDie(federation.GroupName).GroupVersions { - if vi, err := legacyscheme.Registry.GroupOrDie(federation.GroupName).InterfacesFor(version); err != nil || vi == nil { - t.Fatalf("%d: unexpected result: %v", i, err) - } - } -} - -func TestRESTMapper(t *testing.T) { - gv := v1beta1.SchemeGroupVersion - clusterGVK := gv.WithKind("Cluster") - - if gvk, err := legacyscheme.Registry.GroupOrDie(federation.GroupName).RESTMapper.KindFor(gv.WithResource("clusters")); err != nil || gvk != clusterGVK { - t.Errorf("unexpected version mapping: %v %v", gvk, err) - } - - if m, err := legacyscheme.Registry.GroupOrDie(federation.GroupName).RESTMapper.RESTMapping(clusterGVK.GroupKind(), ""); err != nil || m.GroupVersionKind != clusterGVK || m.Resource != "clusters" { - t.Errorf("unexpected version mapping: %#v %v", m, err) - } - - for _, version := range legacyscheme.Registry.GroupOrDie(federation.GroupName).GroupVersions { - mapping, err := legacyscheme.Registry.GroupOrDie(federation.GroupName).RESTMapper.RESTMapping(clusterGVK.GroupKind(), version.Version) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - - if mapping.Resource != "clusters" { - t.Errorf("incorrect resource name: %#v", mapping) - } - if mapping.GroupVersionKind.GroupVersion() != version { - t.Errorf("incorrect groupVersion: %v", mapping) - } - - interfaces, _ := legacyscheme.Registry.GroupOrDie(federation.GroupName).InterfacesFor(version) - if mapping.ObjectConvertor != interfaces.ObjectConvertor { - t.Errorf("mapping: %#v, interfaces: %#v", mapping, interfaces) - } - - rc := &federation.Cluster{ObjectMeta: metav1.ObjectMeta{Name: "foo"}} - name, err := mapping.MetadataAccessor.Name(rc) - if err != nil { - t.Errorf("unexpected error: %v", err) - } - if name != "foo" { - t.Errorf("unable to retrieve object meta with: %v", mapping.MetadataAccessor) - } - } -} diff --git a/federation/apis/federation/register.go b/federation/apis/federation/register.go deleted file mode 100644 index 9fe9bfc865..0000000000 --- a/federation/apis/federation/register.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2016 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 federation - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the group name use in this package -const GroupName = "federation" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} - -// 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() -} - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &Cluster{}, - &ClusterList{}, - ) - return nil -} diff --git a/federation/apis/federation/types.go b/federation/apis/federation/types.go deleted file mode 100644 index 0e0aeb38f7..0000000000 --- a/federation/apis/federation/types.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright 2016 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 federation - -import ( - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/kubernetes/pkg/api" -) - -// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match. -type ServerAddressByClientCIDR struct { - // The CIDR with which clients can match their IP to figure out the server address that they should use. - ClientCIDR string - // Address of this server, suitable for a client that matches the above CIDR. - // This can be a hostname, hostname:port, IP or IP:port. - ServerAddress string -} - -// ClusterSpec describes the attributes of a kubernetes cluster. -type ClusterSpec struct { - // A map of client CIDR to server address. - // This is to help clients reach servers in the most network-efficient way possible. - // Clients can use the appropriate server address as per the CIDR that they match. - // In case of multiple matches, clients should use the longest matching CIDR. - ServerAddressByClientCIDRs []ServerAddressByClientCIDR - // Name of the secret containing kubeconfig to access this cluster. - // The secret is read from the kubernetes cluster that is hosting federation control plane. - // Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key "kubeconfig". - // This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets. - // This can be left empty if the cluster allows insecure access. - // +optional - SecretRef *api.LocalObjectReference -} - -type ClusterConditionType string - -// These are valid conditions of a cluster. -const ( - // ClusterReady means the cluster is ready to accept workloads. - ClusterReady ClusterConditionType = "Ready" - // ClusterOffline means the cluster is temporarily down or not reachable - ClusterOffline ClusterConditionType = "Offline" -) - -// ClusterCondition describes current state of a cluster. -type ClusterCondition struct { - // Type of cluster condition, Complete or Failed. - Type ClusterConditionType - // Status of the condition, one of True, False, Unknown. - Status api.ConditionStatus - // Last time the condition was checked. - // +optional - LastProbeTime metav1.Time - // Last time the condition transit from one status to another. - // +optional - LastTransitionTime metav1.Time - // (brief) reason for the condition's last transition. - // +optional - Reason string - // Human readable message indicating details about last transition. - // +optional - Message string -} - -// ClusterStatus is information about the current status of a cluster updated by cluster controller periodically. -type ClusterStatus struct { - // Conditions is an array of current cluster conditions. - // +optional - Conditions []ClusterCondition - // Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. - // These will always be in the same region. - // +optional - Zones []string - // Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'. - // +optional - Region string -} - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation. -type Cluster struct { - metav1.TypeMeta - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta - - // Spec defines the behavior of the Cluster. - // +optional - Spec ClusterSpec - // Status describes the current status of a Cluster - // +optional - Status ClusterStatus -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// A list of all the kubernetes clusters registered to the federation -type ClusterList struct { - metav1.TypeMeta - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds - // +optional - metav1.ListMeta - - // List of Cluster objects. - Items []Cluster -} - -// Temporary/alpha structures to support custom replica assignments within Federated workloads. - -// A set of preferences that can be added to federated version of workloads (deployments, replicasets, ..) -// as a json-serialized annotation. The preferences allow the users to express in which clusters they -// want to put their replicas within the mentioned workload objects. -type ReplicaAllocationPreferences struct { - // If set to true then already scheduled and running replicas may be moved to other clusters - // in order to match current state to the specified preferences. Otherwise, if set to false, - // up and running replicas will not be moved. - // +optional - Rebalance bool - - // A mapping between cluster names and preferences regarding a local workload object (dep, rs, .. ) in - // these clusters. - // "*" (if provided) applies to all clusters if an explicit mapping is not provided. - // If omitted, clusters without explicit preferences should not have any replicas scheduled. - // +optional - Clusters map[string]ClusterPreferences -} - -// Preferences regarding number of replicas assigned to a cluster workload object (dep, rs, ..) within -// a federated workload object. -type ClusterPreferences struct { - // Minimum number of replicas that should be assigned to this cluster workload object. 0 by default. - // +optional - MinReplicas int64 - - // Maximum number of replicas that should be assigned to this cluster workload object. - // Unbounded if no value provided (default). - // +optional - MaxReplicas *int64 - - // A number expressing the preference to put an additional replica to this cluster workload object. - // 0 by default. - Weight int64 -} - -// Annotation for a federated service to keep record of service loadbalancer ingresses in federated cluster -type FederatedServiceIngress struct { - // List of loadbalancer ingress of a service in all federated clusters - // +optional - Items []ClusterServiceIngress `json:"items,omitempty"` -} - -// Loadbalancer ingresses of a service within a federated cluster -type ClusterServiceIngress struct { - // Cluster is the name of the federated cluster - Cluster string `json:"cluster"` - // List of loadbalancer ingresses of a federated service within a federated cluster - Items []v1.LoadBalancerIngress `json:"items"` -} diff --git a/federation/apis/federation/v1beta1/BUILD b/federation/apis/federation/v1beta1/BUILD deleted file mode 100644 index 2533e534ff..0000000000 --- a/federation/apis/federation/v1beta1/BUILD +++ /dev/null @@ -1,51 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "defaults.go", - "doc.go", - "generated.pb.go", - "register.go", - "types.go", - "types_swagger_doc_generated.go", - "zz_generated.conversion.go", - "zz_generated.deepcopy.go", - "zz_generated.defaults.go", - ], - importpath = "k8s.io/kubernetes/federation/apis/federation/v1beta1", - deps = [ - "//federation/apis/federation:go_default_library", - "//pkg/api:go_default_library", - "//vendor/github.com/gogo/protobuf/proto:go_default_library", - "//vendor/k8s.io/api/core/v1: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", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) - -filegroup( - name = "go_default_library_protos", - srcs = ["generated.proto"], - visibility = ["//visibility:public"], -) diff --git a/federation/apis/federation/v1beta1/defaults.go b/federation/apis/federation/v1beta1/defaults.go deleted file mode 100644 index 37abb53bd2..0000000000 --- a/federation/apis/federation/v1beta1/defaults.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2016 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 v1beta1 - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -func addDefaultingFuncs(scheme *runtime.Scheme) error { - return RegisterDefaults(scheme) -} diff --git a/federation/apis/federation/v1beta1/doc.go b/federation/apis/federation/v1beta1/doc.go deleted file mode 100644 index 7382fb5b8e..0000000000 --- a/federation/apis/federation/v1beta1/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2016 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:deepcopy-gen=package,register -// +k8s:conversion-gen=k8s.io/kubernetes/federation/apis/federation -// +k8s:openapi-gen=true -// +k8s:defaulter-gen=TypeMeta -package v1beta1 // import "k8s.io/kubernetes/federation/apis/federation/v1beta1" diff --git a/federation/apis/federation/v1beta1/generated.pb.go b/federation/apis/federation/v1beta1/generated.pb.go deleted file mode 100644 index a93e24c322..0000000000 --- a/federation/apis/federation/v1beta1/generated.pb.go +++ /dev/null @@ -1,1766 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by protoc-gen-gogo. -// source: k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.proto -// DO NOT EDIT! - -/* - Package v1beta1 is a generated protocol buffer package. - - It is generated from these files: - k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.proto - - It has these top-level messages: - Cluster - ClusterCondition - ClusterList - ClusterSelectorRequirement - ClusterSpec - ClusterStatus - ServerAddressByClientCIDR -*/ -package v1beta1 - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -import k8s_io_api_core_v1 "k8s.io/api/core/v1" - -import strings "strings" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package - -func (m *Cluster) Reset() { *m = Cluster{} } -func (*Cluster) ProtoMessage() {} -func (*Cluster) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} } - -func (m *ClusterCondition) Reset() { *m = ClusterCondition{} } -func (*ClusterCondition) ProtoMessage() {} -func (*ClusterCondition) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } - -func (m *ClusterList) Reset() { *m = ClusterList{} } -func (*ClusterList) ProtoMessage() {} -func (*ClusterList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } - -func (m *ClusterSelectorRequirement) Reset() { *m = ClusterSelectorRequirement{} } -func (*ClusterSelectorRequirement) ProtoMessage() {} -func (*ClusterSelectorRequirement) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{3} -} - -func (m *ClusterSpec) Reset() { *m = ClusterSpec{} } -func (*ClusterSpec) ProtoMessage() {} -func (*ClusterSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} } - -func (m *ClusterStatus) Reset() { *m = ClusterStatus{} } -func (*ClusterStatus) ProtoMessage() {} -func (*ClusterStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{5} } - -func (m *ServerAddressByClientCIDR) Reset() { *m = ServerAddressByClientCIDR{} } -func (*ServerAddressByClientCIDR) ProtoMessage() {} -func (*ServerAddressByClientCIDR) Descriptor() ([]byte, []int) { - return fileDescriptorGenerated, []int{6} -} - -func init() { - proto.RegisterType((*Cluster)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.Cluster") - proto.RegisterType((*ClusterCondition)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ClusterCondition") - proto.RegisterType((*ClusterList)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ClusterList") - proto.RegisterType((*ClusterSelectorRequirement)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ClusterSelectorRequirement") - proto.RegisterType((*ClusterSpec)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ClusterSpec") - proto.RegisterType((*ClusterStatus)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ClusterStatus") - proto.RegisterType((*ServerAddressByClientCIDR)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ServerAddressByClientCIDR") -} -func (m *Cluster) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Cluster) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) - n1, err := m.ObjectMeta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) - n2, err := m.Spec.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - dAtA[i] = 0x1a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) - n3, err := m.Status.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 - return i, nil -} - -func (m *ClusterCondition) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ClusterCondition) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) - i += copy(dAtA[i:], m.Type) - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) - i += copy(dAtA[i:], m.Status) - dAtA[i] = 0x1a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.LastProbeTime.Size())) - n4, err := m.LastProbeTime.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 - dAtA[i] = 0x22 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.LastTransitionTime.Size())) - n5, err := m.LastTransitionTime.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 - dAtA[i] = 0x2a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) - i += copy(dAtA[i:], m.Reason) - dAtA[i] = 0x32 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) - i += copy(dAtA[i:], m.Message) - return i, nil -} - -func (m *ClusterList) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ClusterList) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) - n6, err := m.ListMeta.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - if len(m.Items) > 0 { - for _, msg := range m.Items { - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *ClusterSelectorRequirement) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ClusterSelectorRequirement) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Operator))) - i += copy(dAtA[i:], m.Operator) - if len(m.Values) > 0 { - for _, s := range m.Values { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func (m *ClusterSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ClusterSpec) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.ServerAddressByClientCIDRs) > 0 { - for _, msg := range m.ServerAddressByClientCIDRs { - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.SecretRef != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.SecretRef.Size())) - n7, err := m.SecretRef.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 - } - return i, nil -} - -func (m *ClusterStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ClusterStatus) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Conditions) > 0 { - for _, msg := range m.Conditions { - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Zones) > 0 { - for _, s := range m.Zones { - dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - dAtA[i] = 0x32 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Region))) - i += copy(dAtA[i:], m.Region) - return i, nil -} - -func (m *ServerAddressByClientCIDR) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ServerAddressByClientCIDR) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.ClientCIDR))) - i += copy(dAtA[i:], m.ClientCIDR) - dAtA[i] = 0x12 - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.ServerAddress))) - i += copy(dAtA[i:], m.ServerAddress) - return i, nil -} - -func encodeFixed64Generated(dAtA []byte, offset int, v uint64) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - dAtA[offset+4] = uint8(v >> 32) - dAtA[offset+5] = uint8(v >> 40) - dAtA[offset+6] = uint8(v >> 48) - dAtA[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Generated(dAtA []byte, offset int, v uint32) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *Cluster) Size() (n int) { - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ClusterCondition) Size() (n int) { - var l int - _ = l - l = len(m.Type) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Status) - n += 1 + l + sovGenerated(uint64(l)) - l = m.LastProbeTime.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.LastTransitionTime.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Reason) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Message) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ClusterList) Size() (n int) { - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *ClusterSelectorRequirement) Size() (n int) { - var l int - _ = l - l = len(m.Key) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Operator) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Values) > 0 { - for _, s := range m.Values { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *ClusterSpec) Size() (n int) { - var l int - _ = l - if len(m.ServerAddressByClientCIDRs) > 0 { - for _, e := range m.ServerAddressByClientCIDRs { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - if m.SecretRef != nil { - l = m.SecretRef.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *ClusterStatus) Size() (n int) { - var l int - _ = l - if len(m.Conditions) > 0 { - for _, e := range m.Conditions { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.Zones) > 0 { - for _, s := range m.Zones { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - l = len(m.Region) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *ServerAddressByClientCIDR) Size() (n int) { - var l int - _ = l - l = len(m.ClientCIDR) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.ServerAddress) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func sovGenerated(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozGenerated(x uint64) (n int) { - return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Cluster) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Cluster{`, - `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ClusterSpec", "ClusterSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "ClusterStatus", "ClusterStatus", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *ClusterCondition) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ClusterCondition{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `LastProbeTime:` + strings.Replace(strings.Replace(this.LastProbeTime.String(), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1), `&`, ``, 1) + `,`, - `LastTransitionTime:` + strings.Replace(strings.Replace(this.LastTransitionTime.String(), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1), `&`, ``, 1) + `,`, - `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, - `Message:` + fmt.Sprintf("%v", this.Message) + `,`, - `}`, - }, "") - return s -} -func (this *ClusterList) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ClusterList{`, - `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "Cluster", "Cluster", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *ClusterSelectorRequirement) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ClusterSelectorRequirement{`, - `Key:` + fmt.Sprintf("%v", this.Key) + `,`, - `Operator:` + fmt.Sprintf("%v", this.Operator) + `,`, - `Values:` + fmt.Sprintf("%v", this.Values) + `,`, - `}`, - }, "") - return s -} -func (this *ClusterSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ClusterSpec{`, - `ServerAddressByClientCIDRs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ServerAddressByClientCIDRs), "ServerAddressByClientCIDR", "ServerAddressByClientCIDR", 1), `&`, ``, 1) + `,`, - `SecretRef:` + strings.Replace(fmt.Sprintf("%v", this.SecretRef), "LocalObjectReference", "k8s_io_api_core_v1.LocalObjectReference", 1) + `,`, - `}`, - }, "") - return s -} -func (this *ClusterStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ClusterStatus{`, - `Conditions:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Conditions), "ClusterCondition", "ClusterCondition", 1), `&`, ``, 1) + `,`, - `Zones:` + fmt.Sprintf("%v", this.Zones) + `,`, - `Region:` + fmt.Sprintf("%v", this.Region) + `,`, - `}`, - }, "") - return s -} -func (this *ServerAddressByClientCIDR) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ServerAddressByClientCIDR{`, - `ClientCIDR:` + fmt.Sprintf("%v", this.ClientCIDR) + `,`, - `ServerAddress:` + fmt.Sprintf("%v", this.ServerAddress) + `,`, - `}`, - }, "") - return s -} -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Cluster) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Cluster: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Cluster: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ClusterCondition) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ClusterCondition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterCondition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = ClusterConditionType(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Status = k8s_io_api_core_v1.ConditionStatus(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastProbeTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LastProbeTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Reason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ClusterList) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ClusterList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, Cluster{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ClusterSelectorRequirement) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ClusterSelectorRequirement: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterSelectorRequirement: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Operator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ClusterSpec) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ClusterSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServerAddressByClientCIDRs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServerAddressByClientCIDRs = append(m.ServerAddressByClientCIDRs, ServerAddressByClientCIDR{}) - if err := m.ServerAddressByClientCIDRs[len(m.ServerAddressByClientCIDRs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SecretRef", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SecretRef == nil { - m.SecretRef = &k8s_io_api_core_v1.LocalObjectReference{} - } - if err := m.SecretRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ClusterStatus) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ClusterStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ClusterStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Conditions = append(m.Conditions, ClusterCondition{}) - if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Zones", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Zones = append(m.Zones, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Region = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ServerAddressByClientCIDR) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ServerAddressByClientCIDR: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServerAddressByClientCIDR: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientCIDR", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientCIDR = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServerAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenerated(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthGenerated - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipGenerated(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") -) - -func init() { - proto.RegisterFile("k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.proto", fileDescriptorGenerated) -} - -var fileDescriptorGenerated = []byte{ - // 871 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0x9b, 0x26, 0x6d, 0xa6, 0x04, 0x56, 0x23, 0x90, 0x42, 0x24, 0x1c, 0x64, 0x21, 0x54, - 0x10, 0x6b, 0xd3, 0x52, 0xa1, 0x95, 0x10, 0x87, 0x75, 0x56, 0x48, 0x2b, 0xba, 0x2a, 0x9a, 0x16, - 0x0e, 0x2b, 0x0e, 0x4c, 0x9c, 0x57, 0x77, 0x48, 0xec, 0x31, 0x33, 0xe3, 0x48, 0xd9, 0x13, 0x7f, - 0x00, 0x48, 0x9c, 0xf9, 0x37, 0x38, 0x73, 0xef, 0x09, 0xf6, 0xc0, 0x61, 0x4f, 0x11, 0x0d, 0xff, - 0xc5, 0x9e, 0xd0, 0x8c, 0x27, 0x4e, 0xbc, 0x69, 0x60, 0xb7, 0xbd, 0x79, 0x3e, 0xbf, 0xef, 0xfb, - 0xde, 0xbc, 0x1f, 0x83, 0x1e, 0x8c, 0xee, 0x49, 0x9f, 0xf1, 0x60, 0x94, 0x0f, 0x40, 0xa4, 0xa0, - 0x40, 0x06, 0xe7, 0x30, 0x04, 0x41, 0x15, 0xe3, 0x69, 0x40, 0x33, 0x56, 0x39, 0x4f, 0x0e, 0x06, - 0xa0, 0xe8, 0x41, 0x10, 0x43, 0xaa, 0x21, 0x18, 0xfa, 0x99, 0xe0, 0x8a, 0xe3, 0xa3, 0x42, 0xc5, - 0x5f, 0xaa, 0xf8, 0x4b, 0x96, 0xaf, 0x55, 0x56, 0xcf, 0x56, 0xa5, 0x7b, 0x37, 0x66, 0xea, 0x22, - 0x1f, 0xf8, 0x11, 0x4f, 0x82, 0x98, 0xc7, 0x3c, 0x30, 0x62, 0x83, 0xfc, 0xdc, 0x9c, 0xcc, 0xc1, - 0x7c, 0x15, 0x26, 0x5d, 0xcf, 0xa6, 0x4a, 0x33, 0x16, 0x44, 0x5c, 0x40, 0x30, 0x59, 0x4b, 0xa4, - 0x7b, 0xb4, 0x8c, 0x49, 0x68, 0x74, 0xc1, 0x52, 0x10, 0xd3, 0x20, 0x1b, 0xc5, 0xc5, 0x4d, 0x12, - 0x50, 0xf4, 0x3a, 0x56, 0xb0, 0x89, 0x25, 0xf2, 0x54, 0xb1, 0x04, 0xd6, 0x08, 0x9f, 0xfe, 0x1f, - 0x41, 0x46, 0x17, 0x90, 0xd0, 0x35, 0xde, 0x27, 0x9b, 0x78, 0xb9, 0x62, 0xe3, 0x80, 0xa5, 0x4a, - 0x2a, 0xf1, 0x22, 0xc9, 0xfb, 0x7d, 0x0b, 0xed, 0xf4, 0xc7, 0xb9, 0x54, 0x20, 0xf0, 0x77, 0x68, - 0x57, 0x5f, 0x62, 0x48, 0x15, 0xed, 0x38, 0xef, 0x3a, 0xfb, 0x7b, 0x87, 0x1f, 0xfb, 0xb6, 0xf6, - 0xab, 0x9a, 0x7e, 0x36, 0x8a, 0x8b, 0xb2, 0xeb, 0x68, 0x7f, 0x72, 0xe0, 0x9f, 0x0c, 0xbe, 0x87, - 0x48, 0x3d, 0x02, 0x45, 0x43, 0x7c, 0x39, 0xeb, 0xd5, 0xe6, 0xb3, 0x1e, 0x5a, 0x62, 0xa4, 0x54, - 0xc5, 0x11, 0xda, 0x96, 0x19, 0x44, 0x9d, 0x2d, 0xa3, 0x7e, 0xdf, 0xbf, 0x49, 0x67, 0x7d, 0x9b, - 0xee, 0x69, 0x06, 0x51, 0xf8, 0x9a, 0xb5, 0xdb, 0xd6, 0x27, 0x62, 0xc4, 0xf1, 0x08, 0x35, 0xa5, - 0xa2, 0x2a, 0x97, 0x9d, 0xba, 0xb1, 0xe9, 0xdf, 0xce, 0xc6, 0x48, 0x85, 0xaf, 0x5b, 0xa3, 0x66, - 0x71, 0x26, 0xd6, 0xc2, 0xfb, 0xa3, 0x8e, 0xee, 0xd8, 0xc8, 0x3e, 0x4f, 0x87, 0x4c, 0x4b, 0xe0, - 0x7b, 0x68, 0x5b, 0x4d, 0x33, 0x30, 0x45, 0x6c, 0x85, 0xef, 0x2d, 0x72, 0x3c, 0x9b, 0x66, 0xf0, - 0x7c, 0xd6, 0x7b, 0xf3, 0xc5, 0x78, 0x8d, 0x13, 0xc3, 0xc0, 0xc7, 0x65, 0xee, 0x5b, 0x86, 0x7b, - 0x54, 0xb5, 0x7d, 0x3e, 0xeb, 0x5d, 0x33, 0xa8, 0x7e, 0xa9, 0x54, 0x4d, 0x0e, 0xc7, 0xa8, 0x3d, - 0xa6, 0x52, 0x7d, 0x25, 0xf8, 0x00, 0xce, 0x58, 0x02, 0xb6, 0x20, 0x1f, 0xbe, 0x5c, 0x57, 0x35, - 0x23, 0x7c, 0xcb, 0x26, 0xd0, 0x3e, 0x5e, 0x15, 0x22, 0x55, 0x5d, 0x3c, 0x41, 0x58, 0x03, 0x67, - 0x82, 0xa6, 0xb2, 0xb8, 0x92, 0x76, 0xdb, 0x7e, 0x65, 0xb7, 0xae, 0x75, 0xc3, 0xc7, 0x6b, 0x6a, - 0xe4, 0x1a, 0x07, 0xfc, 0x3e, 0x6a, 0x0a, 0xa0, 0x92, 0xa7, 0x9d, 0x86, 0x29, 0x57, 0xd9, 0x25, - 0x62, 0x50, 0x62, 0xff, 0xe2, 0x0f, 0xd0, 0x4e, 0x02, 0x52, 0xd2, 0x18, 0x3a, 0x4d, 0x13, 0xf8, - 0x86, 0x0d, 0xdc, 0x79, 0x54, 0xc0, 0x64, 0xf1, 0xdf, 0xfb, 0xd3, 0x41, 0x7b, 0xb6, 0x41, 0xc7, - 0x4c, 0x2a, 0xfc, 0xed, 0xda, 0x52, 0xf8, 0x2f, 0x77, 0x21, 0xcd, 0x36, 0x2b, 0x71, 0xc7, 0x7a, - 0xed, 0x2e, 0x90, 0x95, 0x85, 0x18, 0xa0, 0x06, 0x53, 0x90, 0xe8, 0x76, 0xd7, 0xf7, 0xf7, 0x0e, - 0x3f, 0xbf, 0xd5, 0xa8, 0x86, 0x6d, 0xeb, 0xd4, 0x78, 0xa8, 0x35, 0x49, 0x21, 0xed, 0xfd, 0xec, - 0xa0, 0xee, 0x62, 0x98, 0x61, 0x0c, 0x91, 0xe2, 0x82, 0xc0, 0x0f, 0x39, 0x13, 0x90, 0x40, 0xaa, - 0xf0, 0x3b, 0xa8, 0x3e, 0x82, 0xa9, 0x9d, 0xd5, 0x3d, 0xab, 0x50, 0xff, 0x12, 0xa6, 0x44, 0xe3, - 0xf8, 0x23, 0xb4, 0xcb, 0x33, 0x6d, 0xc8, 0x85, 0x9d, 0xc9, 0xf2, 0x3e, 0x27, 0x16, 0x27, 0x65, - 0x04, 0xf6, 0x50, 0x73, 0x42, 0xc7, 0x39, 0xe8, 0xdd, 0xab, 0xef, 0xb7, 0x42, 0xa4, 0x9b, 0xf1, - 0x8d, 0x41, 0x88, 0xfd, 0xe3, 0xfd, 0xba, 0x55, 0x56, 0x58, 0x6f, 0x2d, 0xfe, 0xcd, 0x41, 0x5d, - 0x09, 0x62, 0x02, 0xe2, 0xfe, 0x70, 0x28, 0x40, 0xca, 0x70, 0xda, 0x1f, 0x33, 0x48, 0x55, 0xff, - 0xe1, 0x03, 0x22, 0x3b, 0x8e, 0xa9, 0xcc, 0xc9, 0xcd, 0x2a, 0x73, 0xba, 0x49, 0x37, 0xf4, 0xec, - 0x2d, 0xba, 0x1b, 0x43, 0x24, 0xf9, 0x8f, 0xb4, 0xf0, 0xd7, 0xa8, 0x25, 0x21, 0x12, 0xa0, 0x08, - 0x9c, 0xdb, 0xf7, 0x6c, 0x7f, 0x65, 0x30, 0x7c, 0xbd, 0x9b, 0x66, 0x0c, 0x78, 0x44, 0xc7, 0xc5, - 0x63, 0x48, 0xe0, 0x1c, 0x04, 0xa4, 0x11, 0x84, 0xed, 0xf9, 0xac, 0xd7, 0x3a, 0x5d, 0xd0, 0xc9, - 0x52, 0xc9, 0xfb, 0xcb, 0x41, 0xed, 0xca, 0xcb, 0x83, 0x9f, 0x20, 0x14, 0x2d, 0xf6, 0x7b, 0x51, - 0x8d, 0x2f, 0x6e, 0x35, 0x27, 0xe5, 0x73, 0xb1, 0x7c, 0xad, 0x4b, 0x48, 0x92, 0x15, 0x37, 0xdc, - 0x43, 0x8d, 0x27, 0x3c, 0x05, 0xd9, 0x69, 0x98, 0x6e, 0xb6, 0xf4, 0x6c, 0x3d, 0xd6, 0x00, 0x29, - 0xf0, 0x62, 0x01, 0x63, 0xc6, 0x53, 0xbb, 0x57, 0x2b, 0x0b, 0xa8, 0x51, 0x62, 0xff, 0x7a, 0x3f, - 0x39, 0xe8, 0xed, 0x8d, 0x85, 0xc6, 0x87, 0x08, 0x45, 0xe5, 0xc9, 0x4e, 0xe2, 0x32, 0xb5, 0xf2, - 0x0f, 0x59, 0x89, 0xc2, 0x9f, 0xa1, 0x76, 0xa5, 0x3b, 0x76, 0x38, 0xcb, 0xf7, 0xaa, 0xe2, 0x46, - 0xaa, 0xb1, 0xe1, 0xdd, 0xcb, 0x2b, 0xb7, 0xf6, 0xf4, 0xca, 0xad, 0x3d, 0xbb, 0x72, 0x6b, 0x3f, - 0xce, 0x5d, 0xe7, 0x72, 0xee, 0x3a, 0x4f, 0xe7, 0xae, 0xf3, 0x6c, 0xee, 0x3a, 0x7f, 0xcf, 0x5d, - 0xe7, 0x97, 0x7f, 0xdc, 0xda, 0xe3, 0x1d, 0x5b, 0xb7, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xed, - 0x72, 0x6d, 0x62, 0xc8, 0x08, 0x00, 0x00, -} diff --git a/federation/apis/federation/v1beta1/generated.proto b/federation/apis/federation/v1beta1/generated.proto deleted file mode 100644 index 5e1f665287..0000000000 --- a/federation/apis/federation/v1beta1/generated.proto +++ /dev/null @@ -1,150 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = 'proto2'; - -package k8s.io.kubernetes.federation.apis.federation.v1beta1; - -import "k8s.io/api/core/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; -import "k8s.io/apimachinery/pkg/util/intstr/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "v1beta1"; - -// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation. -message Cluster { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Spec defines the behavior of the Cluster. - // +optional - optional ClusterSpec spec = 2; - - // Status describes the current status of a Cluster - // +optional - optional ClusterStatus status = 3; -} - -// ClusterCondition describes current state of a cluster. -message ClusterCondition { - // Type of cluster condition, Complete or Failed. - optional string type = 1; - - // Status of the condition, one of True, False, Unknown. - optional string status = 2; - - // Last time the condition was checked. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastProbeTime = 3; - - // Last time the condition transit from one status to another. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 4; - - // (brief) reason for the condition's last transition. - // +optional - optional string reason = 5; - - // Human readable message indicating details about last transition. - // +optional - optional string message = 6; -} - -// A list of all the kubernetes clusters registered to the federation -message ClusterList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // List of Cluster objects. - repeated Cluster items = 2; -} - -// ClusterSelectorRequirement contains values, a key, and an operator that relates the key and values. -// The zero value of ClusterSelectorRequirement is invalid. -// ClusterSelectorRequirement implements both set based match and exact match -message ClusterSelectorRequirement { - // +patchMergeKey=key - // +patchStrategy=merge - optional string key = 1; - - // The Operator defines how the Key is matched to the Values. One of "in", "notin", - // "exists", "!", "=", "!=", "gt" or "lt". - optional string operator = 2; - - // An array of string values. If the operator is "in" or "notin", - // the values array must be non-empty. If the operator is "exists" or "!", - // the values array must be empty. If the operator is "gt" or "lt", the values - // array must have a single element, which will be interpreted as an integer. - // This array is replaced during a strategic merge patch. - // +optional - repeated string values = 3; -} - -// ClusterSpec describes the attributes of a kubernetes cluster. -message ClusterSpec { - // A map of client CIDR to server address. - // This is to help clients reach servers in the most network-efficient way possible. - // Clients can use the appropriate server address as per the CIDR that they match. - // In case of multiple matches, clients should use the longest matching CIDR. - // +patchMergeKey=clientCIDR - // +patchStrategy=merge - repeated ServerAddressByClientCIDR serverAddressByClientCIDRs = 1; - - // Name of the secret containing kubeconfig to access this cluster. - // The secret is read from the kubernetes cluster that is hosting federation control plane. - // Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key "kubeconfig". - // This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets. - // This can be left empty if the cluster allows insecure access. - // +optional - optional k8s.io.api.core.v1.LocalObjectReference secretRef = 2; -} - -// ClusterStatus is information about the current status of a cluster updated by cluster controller periodically. -message ClusterStatus { - // Conditions is an array of current cluster conditions. - // +optional - repeated ClusterCondition conditions = 1; - - // Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. - // These will always be in the same region. - // +optional - repeated string zones = 5; - - // Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'. - // +optional - optional string region = 6; -} - -// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match. -message ServerAddressByClientCIDR { - // The CIDR with which clients can match their IP to figure out the server address that they should use. - optional string clientCIDR = 1; - - // Address of this server, suitable for a client that matches the above CIDR. - // This can be a hostname, hostname:port, IP or IP:port. - optional string serverAddress = 2; -} - diff --git a/federation/apis/federation/v1beta1/register.go b/federation/apis/federation/v1beta1/register.go deleted file mode 100644 index b14f5b1b06..0000000000 --- a/federation/apis/federation/v1beta1/register.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2016 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 v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the group name use in this package -const GroupName = "federation" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} - -var ( - // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. - // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. - 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) -} - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &Cluster{}, - &ClusterList{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/federation/apis/federation/v1beta1/types.go b/federation/apis/federation/v1beta1/types.go deleted file mode 100644 index b8c9cca3fd..0000000000 --- a/federation/apis/federation/v1beta1/types.go +++ /dev/null @@ -1,161 +0,0 @@ -/* -Copyright 2016 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 v1beta1 - -import ( - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match. -type ServerAddressByClientCIDR struct { - // The CIDR with which clients can match their IP to figure out the server address that they should use. - ClientCIDR string `json:"clientCIDR" protobuf:"bytes,1,opt,name=clientCIDR"` - // Address of this server, suitable for a client that matches the above CIDR. - // This can be a hostname, hostname:port, IP or IP:port. - ServerAddress string `json:"serverAddress" protobuf:"bytes,2,opt,name=serverAddress"` -} - -// ClusterSpec describes the attributes of a kubernetes cluster. -type ClusterSpec struct { - // A map of client CIDR to server address. - // This is to help clients reach servers in the most network-efficient way possible. - // Clients can use the appropriate server address as per the CIDR that they match. - // In case of multiple matches, clients should use the longest matching CIDR. - // +patchMergeKey=clientCIDR - // +patchStrategy=merge - ServerAddressByClientCIDRs []ServerAddressByClientCIDR `json:"serverAddressByClientCIDRs" patchStrategy:"merge" patchMergeKey:"clientCIDR" protobuf:"bytes,1,rep,name=serverAddressByClientCIDRs"` - // Name of the secret containing kubeconfig to access this cluster. - // The secret is read from the kubernetes cluster that is hosting federation control plane. - // Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key "kubeconfig". - // This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets. - // This can be left empty if the cluster allows insecure access. - // +optional - SecretRef *v1.LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,2,opt,name=secretRef"` -} - -type ClusterConditionType string - -// These are valid conditions of a cluster. -const ( - // ClusterReady means the cluster is ready to accept workloads. - ClusterReady ClusterConditionType = "Ready" - // ClusterOffline means the cluster is temporarily down or not reachable - ClusterOffline ClusterConditionType = "Offline" -) - -// ClusterCondition describes current state of a cluster. -type ClusterCondition struct { - // Type of cluster condition, Complete or Failed. - Type ClusterConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ClusterConditionType"` - // Status of the condition, one of True, False, Unknown. - Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"` - // Last time the condition was checked. - // +optional - LastProbeTime metav1.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"` - // Last time the condition transit from one status to another. - // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"` - // (brief) reason for the condition's last transition. - // +optional - Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"` - // Human readable message indicating details about last transition. - // +optional - Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` -} - -// ClusterStatus is information about the current status of a cluster updated by cluster controller periodically. -type ClusterStatus struct { - // Conditions is an array of current cluster conditions. - // +optional - Conditions []ClusterCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"` - // Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. - // These will always be in the same region. - // +optional - Zones []string `json:"zones,omitempty" protobuf:"bytes,5,rep,name=zones"` - // Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'. - // +optional - Region string `json:"region,omitempty" protobuf:"bytes,6,opt,name=region"` -} - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +genclient:nonNamespaced - -// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation. -type Cluster struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Spec defines the behavior of the Cluster. - // +optional - Spec ClusterSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` - // Status describes the current status of a Cluster - // +optional - Status ClusterStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// A list of all the kubernetes clusters registered to the federation -type ClusterList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // List of Cluster objects. - Items []Cluster `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// Expressed as value of annotation for selecting the clusters on which a resource is created. -type ClusterSelector []ClusterSelectorRequirement - -// ClusterSelectorRequirement contains values, a key, and an operator that relates the key and values. -// The zero value of ClusterSelectorRequirement is invalid. -// ClusterSelectorRequirement implements both set based match and exact match -type ClusterSelectorRequirement struct { - // +patchMergeKey=key - // +patchStrategy=merge - Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key" protobuf:"bytes,1,opt,name=key"` - // The Operator defines how the Key is matched to the Values. One of "in", "notin", - // "exists", "!", "=", "!=", "gt" or "lt". - Operator string `json:"operator" protobuf:"bytes,2,opt,name=operator"` - // An array of string values. If the operator is "in" or "notin", - // the values array must be non-empty. If the operator is "exists" or "!", - // the values array must be empty. If the operator is "gt" or "lt", the values - // array must have a single element, which will be interpreted as an integer. - // This array is replaced during a strategic merge patch. - // +optional - Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"` -} - -const ( - // FederationNamespaceSystem is the system namespace where we place federation control plane components. - FederationNamespaceSystem string = "federation-system" - - // FederationClusterSelectorAnnotation is used to determine placement of objects on federated clusters - FederationClusterSelectorAnnotation string = "federation.alpha.kubernetes.io/cluster-selector" - - // FederationOnlyClusterSelector is the cluster selector to indicate any object in - // federation having this annotation should not be synced to federated clusters. - FederationOnlyClusterSelector string = "federation.kubernetes.io/federation-control-plane=true" -) diff --git a/federation/apis/federation/v1beta1/types_swagger_doc_generated.go b/federation/apis/federation/v1beta1/types_swagger_doc_generated.go deleted file mode 100644 index dda8cf524b..0000000000 --- a/federation/apis/federation/v1beta1/types_swagger_doc_generated.go +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2016 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 v1beta1 - -// This file contains a collection of methods that can be used from go-restful to -// generate Swagger API documentation for its models. Please read this PR for more -// information on the implementation: https://github.com/emicklei/go-restful/pull/215 -// -// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if -// they are on one line! For multiple line or blocks that you want to ignore use ---. -// Any context after a --- is ignored. -// -// Those methods can be generated by using hack/update-generated-swagger-docs.sh - -// AUTO-GENERATED FUNCTIONS START HERE -var map_Cluster = map[string]string{ - "": "Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.", - "metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "spec": "Spec defines the behavior of the Cluster.", - "status": "Status describes the current status of a Cluster", -} - -func (Cluster) SwaggerDoc() map[string]string { - return map_Cluster -} - -var map_ClusterCondition = map[string]string{ - "": "ClusterCondition describes current state of a cluster.", - "type": "Type of cluster condition, Complete or Failed.", - "status": "Status of the condition, one of True, False, Unknown.", - "lastProbeTime": "Last time the condition was checked.", - "lastTransitionTime": "Last time the condition transit from one status to another.", - "reason": "(brief) reason for the condition's last transition.", - "message": "Human readable message indicating details about last transition.", -} - -func (ClusterCondition) SwaggerDoc() map[string]string { - return map_ClusterCondition -} - -var map_ClusterList = map[string]string{ - "": "A list of all the kubernetes clusters registered to the federation", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "items": "List of Cluster objects.", -} - -func (ClusterList) SwaggerDoc() map[string]string { - return map_ClusterList -} - -var map_ClusterSelectorRequirement = map[string]string{ - "": "ClusterSelectorRequirement contains values, a key, and an operator that relates the key and values. The zero value of ClusterSelectorRequirement is invalid. ClusterSelectorRequirement implements both set based match and exact match", - "operator": "The Operator defines how the Key is matched to the Values. One of \"in\", \"notin\", \"exists\", \"!\", \"=\", \"!=\", \"gt\" or \"lt\".", - "values": "An array of string values. If the operator is \"in\" or \"notin\", the values array must be non-empty. If the operator is \"exists\" or \"!\", the values array must be empty. If the operator is \"gt\" or \"lt\", the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.", -} - -func (ClusterSelectorRequirement) SwaggerDoc() map[string]string { - return map_ClusterSelectorRequirement -} - -var map_ClusterSpec = map[string]string{ - "": "ClusterSpec describes the attributes of a kubernetes cluster.", - "serverAddressByClientCIDRs": "A map of client CIDR to server address. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR.", - "secretRef": "Name of the secret containing kubeconfig to access this cluster. The secret is read from the kubernetes cluster that is hosting federation control plane. Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key \"kubeconfig\". This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets. This can be left empty if the cluster allows insecure access.", -} - -func (ClusterSpec) SwaggerDoc() map[string]string { - return map_ClusterSpec -} - -var map_ClusterStatus = map[string]string{ - "": "ClusterStatus is information about the current status of a cluster updated by cluster controller periodically.", - "conditions": "Conditions is an array of current cluster conditions.", - "zones": "Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. These will always be in the same region.", - "region": "Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.", -} - -func (ClusterStatus) SwaggerDoc() map[string]string { - return map_ClusterStatus -} - -var map_ServerAddressByClientCIDR = map[string]string{ - "": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.", - "clientCIDR": "The CIDR with which clients can match their IP to figure out the server address that they should use.", - "serverAddress": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.", -} - -func (ServerAddressByClientCIDR) SwaggerDoc() map[string]string { - return map_ServerAddressByClientCIDR -} - -// AUTO-GENERATED FUNCTIONS END HERE diff --git a/federation/apis/federation/v1beta1/zz_generated.conversion.go b/federation/apis/federation/v1beta1/zz_generated.conversion.go deleted file mode 100644 index 1f9e733ddc..0000000000 --- a/federation/apis/federation/v1beta1/zz_generated.conversion.go +++ /dev/null @@ -1,205 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was autogenerated by conversion-gen. Do not edit it manually! - -package v1beta1 - -import ( - v1 "k8s.io/api/core/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - federation "k8s.io/kubernetes/federation/apis/federation" - api "k8s.io/kubernetes/pkg/api" - unsafe "unsafe" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(scheme *runtime.Scheme) error { - return scheme.AddGeneratedConversionFuncs( - Convert_v1beta1_Cluster_To_federation_Cluster, - Convert_federation_Cluster_To_v1beta1_Cluster, - Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition, - Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition, - Convert_v1beta1_ClusterList_To_federation_ClusterList, - Convert_federation_ClusterList_To_v1beta1_ClusterList, - Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec, - Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec, - Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus, - Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus, - Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR, - Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR, - ) -} - -func autoConvert_v1beta1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_Cluster_To_federation_Cluster is an autogenerated conversion function. -func Convert_v1beta1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error { - return autoConvert_v1beta1_Cluster_To_federation_Cluster(in, out, s) -} - -func autoConvert_federation_Cluster_To_v1beta1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_federation_Cluster_To_v1beta1_Cluster is an autogenerated conversion function. -func Convert_federation_Cluster_To_v1beta1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error { - return autoConvert_federation_Cluster_To_v1beta1_Cluster(in, out, s) -} - -func autoConvert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error { - out.Type = federation.ClusterConditionType(in.Type) - out.Status = api.ConditionStatus(in.Status) - out.LastProbeTime = in.LastProbeTime - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition is an autogenerated conversion function. -func Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in, out, s) -} - -func autoConvert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error { - out.Type = ClusterConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.LastProbeTime = in.LastProbeTime - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition is an autogenerated conversion function. -func Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error { - return autoConvert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in, out, s) -} - -func autoConvert_v1beta1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]federation.Cluster)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_ClusterList_To_federation_ClusterList is an autogenerated conversion function. -func Convert_v1beta1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterList_To_federation_ClusterList(in, out, s) -} - -func autoConvert_federation_ClusterList_To_v1beta1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]Cluster)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_federation_ClusterList_To_v1beta1_ClusterList is an autogenerated conversion function. -func Convert_federation_ClusterList_To_v1beta1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error { - return autoConvert_federation_ClusterList_To_v1beta1_ClusterList(in, out, s) -} - -func autoConvert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error { - out.ServerAddressByClientCIDRs = *(*[]federation.ServerAddressByClientCIDR)(unsafe.Pointer(&in.ServerAddressByClientCIDRs)) - out.SecretRef = (*api.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - return nil -} - -// Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec is an autogenerated conversion function. -func Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in, out, s) -} - -func autoConvert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { - out.ServerAddressByClientCIDRs = *(*[]ServerAddressByClientCIDR)(unsafe.Pointer(&in.ServerAddressByClientCIDRs)) - out.SecretRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - return nil -} - -// Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec is an autogenerated conversion function. -func Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { - return autoConvert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in, out, s) -} - -func autoConvert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error { - out.Conditions = *(*[]federation.ClusterCondition)(unsafe.Pointer(&in.Conditions)) - out.Zones = *(*[]string)(unsafe.Pointer(&in.Zones)) - out.Region = in.Region - return nil -} - -// Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus is an autogenerated conversion function. -func Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in, out, s) -} - -func autoConvert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - out.Conditions = *(*[]ClusterCondition)(unsafe.Pointer(&in.Conditions)) - out.Zones = *(*[]string)(unsafe.Pointer(&in.Zones)) - out.Region = in.Region - return nil -} - -// Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus is an autogenerated conversion function. -func Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - return autoConvert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in, out, s) -} - -func autoConvert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error { - out.ClientCIDR = in.ClientCIDR - out.ServerAddress = in.ServerAddress - return nil -} - -// Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR is an autogenerated conversion function. -func Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error { - return autoConvert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in, out, s) -} - -func autoConvert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error { - out.ClientCIDR = in.ClientCIDR - out.ServerAddress = in.ServerAddress - return nil -} - -// Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR is an autogenerated conversion function. -func Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error { - return autoConvert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in, out, s) -} diff --git a/federation/apis/federation/v1beta1/zz_generated.deepcopy.go b/federation/apis/federation/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index 716b3af29f..0000000000 --- a/federation/apis/federation/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,245 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was autogenerated by deepcopy-gen. Do not edit it manually! - -package v1beta1 - -import ( - v1 "k8s.io/api/core/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - reflect "reflect" -) - -func init() { - SchemeBuilder.Register(RegisterDeepCopies) -} - -// RegisterDeepCopies adds deep-copy functions to the given scheme. Public -// to allow building arbitrary schemes. -// -// Deprecated: deepcopy registration will go away when static deepcopy is fully implemented. -func RegisterDeepCopies(scheme *runtime.Scheme) error { - return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*Cluster).DeepCopyInto(out.(*Cluster)) - return nil - }, InType: reflect.TypeOf(&Cluster{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ClusterCondition).DeepCopyInto(out.(*ClusterCondition)) - return nil - }, InType: reflect.TypeOf(&ClusterCondition{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ClusterList).DeepCopyInto(out.(*ClusterList)) - return nil - }, InType: reflect.TypeOf(&ClusterList{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ClusterSelectorRequirement).DeepCopyInto(out.(*ClusterSelectorRequirement)) - return nil - }, InType: reflect.TypeOf(&ClusterSelectorRequirement{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ClusterSpec).DeepCopyInto(out.(*ClusterSpec)) - return nil - }, InType: reflect.TypeOf(&ClusterSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ClusterStatus).DeepCopyInto(out.(*ClusterStatus)) - return nil - }, InType: reflect.TypeOf(&ClusterStatus{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ServerAddressByClientCIDR).DeepCopyInto(out.(*ServerAddressByClientCIDR)) - return nil - }, InType: reflect.TypeOf(&ServerAddressByClientCIDR{})}, - ) -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Cluster) DeepCopyInto(out *Cluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. -func (in *Cluster) DeepCopy() *Cluster { - if in == nil { - return nil - } - out := new(Cluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Cluster) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { - return nil - } -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition) { - *out = *in - in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCondition. -func (in *ClusterCondition) DeepCopy() *ClusterCondition { - if in == nil { - return nil - } - out := new(ClusterCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterList) DeepCopyInto(out *ClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. -func (in *ClusterList) DeepCopy() *ClusterList { - if in == nil { - return nil - } - out := new(ClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { - return nil - } -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSelectorRequirement) DeepCopyInto(out *ClusterSelectorRequirement) { - *out = *in - if in.Values != nil { - in, out := &in.Values, &out.Values - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSelectorRequirement. -func (in *ClusterSelectorRequirement) DeepCopy() *ClusterSelectorRequirement { - if in == nil { - return nil - } - out := new(ClusterSelectorRequirement) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { - *out = *in - if in.ServerAddressByClientCIDRs != nil { - in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs - *out = make([]ServerAddressByClientCIDR, len(*in)) - copy(*out, *in) - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - if *in == nil { - *out = nil - } else { - *out = new(v1.LocalObjectReference) - **out = **in - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. -func (in *ClusterSpec) DeepCopy() *ClusterSpec { - if in == nil { - return nil - } - out := new(ClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ClusterCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Zones != nil { - in, out := &in.Zones, &out.Zones - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. -func (in *ClusterStatus) DeepCopy() *ClusterStatus { - if in == nil { - return nil - } - out := new(ClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServerAddressByClientCIDR) DeepCopyInto(out *ServerAddressByClientCIDR) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerAddressByClientCIDR. -func (in *ServerAddressByClientCIDR) DeepCopy() *ServerAddressByClientCIDR { - if in == nil { - return nil - } - out := new(ServerAddressByClientCIDR) - in.DeepCopyInto(out) - return out -} diff --git a/federation/apis/federation/v1beta1/zz_generated.defaults.go b/federation/apis/federation/v1beta1/zz_generated.defaults.go deleted file mode 100644 index e24e70be38..0000000000 --- a/federation/apis/federation/v1beta1/zz_generated.defaults.go +++ /dev/null @@ -1,32 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was autogenerated by defaulter-gen. Do not edit it manually! - -package v1beta1 - -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 { - return nil -} diff --git a/federation/apis/federation/validation/BUILD b/federation/apis/federation/validation/BUILD deleted file mode 100644 index 9c7c0caac8..0000000000 --- a/federation/apis/federation/validation/BUILD +++ /dev/null @@ -1,44 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = ["validation.go"], - importpath = "k8s.io/kubernetes/federation/apis/federation/validation", - deps = [ - "//federation/apis/federation:go_default_library", - "//pkg/api/validation:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["validation_test.go"], - importpath = "k8s.io/kubernetes/federation/apis/federation/validation", - library = ":go_default_library", - deps = [ - "//federation/apis/federation:go_default_library", - "//pkg/api:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/apis/federation/validation/validation.go b/federation/apis/federation/validation/validation.go deleted file mode 100644 index 8db2ff4858..0000000000 --- a/federation/apis/federation/validation/validation.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2016 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 validation - -import ( - "fmt" - "net" - - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/kubernetes/federation/apis/federation" - "k8s.io/kubernetes/pkg/api/validation" -) - -func ValidateClusterSpec(spec *federation.ClusterSpec, fieldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - // address is required. - if len(spec.ServerAddressByClientCIDRs) == 0 { - allErrs = append(allErrs, field.Required(fieldPath.Child("serverAddressByClientCIDRs"), "")) - } else { - for i, address := range spec.ServerAddressByClientCIDRs { - idxPath := fieldPath.Child("serverAddressByClientCIDRs").Index(i) - if len(address.ClientCIDR) > 0 { - if _, _, err := net.ParseCIDR(address.ClientCIDR); err != nil { - allErrs = append(allErrs, field.Invalid(idxPath.Child("clientCIDR"), address.ClientCIDR, fmt.Sprintf("must be a valid CIDR: %v", err))) - } - } - } - } - return allErrs -} - -func ValidateCluster(cluster *federation.Cluster) field.ErrorList { - allErrs := validation.ValidateObjectMeta(&cluster.ObjectMeta, false, validation.ValidateClusterName, field.NewPath("metadata")) - allErrs = append(allErrs, ValidateClusterSpec(&cluster.Spec, field.NewPath("spec"))...) - return allErrs -} - -func ValidateClusterUpdate(cluster, oldCluster *federation.Cluster) field.ErrorList { - allErrs := validation.ValidateObjectMetaUpdate(&cluster.ObjectMeta, &oldCluster.ObjectMeta, field.NewPath("metadata")) - if cluster.Name != oldCluster.Name { - allErrs = append(allErrs, field.Invalid(field.NewPath("meta", "name"), - cluster.Name+" != "+oldCluster.Name, "cannot change cluster name")) - } - return allErrs -} - -func ValidateClusterStatusUpdate(cluster, oldCluster *federation.Cluster) field.ErrorList { - allErrs := validation.ValidateObjectMetaUpdate(&cluster.ObjectMeta, &oldCluster.ObjectMeta, field.NewPath("metadata")) - return allErrs -} diff --git a/federation/apis/federation/validation/validation_test.go b/federation/apis/federation/validation/validation_test.go deleted file mode 100644 index 10054bf294..0000000000 --- a/federation/apis/federation/validation/validation_test.go +++ /dev/null @@ -1,330 +0,0 @@ -/* -Copyright 2016 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 validation - -import ( - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/kubernetes/federation/apis/federation" - "k8s.io/kubernetes/pkg/api" -) - -func TestValidateClusterSpec(t *testing.T) { - type validateClusterSpecTest struct { - testName string - spec *federation.ClusterSpec - path *field.Path - } - - successCases := []validateClusterSpecTest{ - { - testName: "normal CIDR", - spec: &federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: "localhost:8888", - }, - }, - }, - path: field.NewPath("spec"), - }, - { - testName: "missing CIDR", - spec: &federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "", - ServerAddress: "localhost:8888", - }, - }, - }, - path: field.NewPath("spec"), - }, - { - testName: "no host in CIDR", - spec: &federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/32", - ServerAddress: "localhost:8888", - }, - }, - }, - path: field.NewPath("spec"), - }, - } - for _, successCase := range successCases { - errs := ValidateClusterSpec(successCase.spec, successCase.path) - if len(errs) != 0 { - t.Errorf("expect success for testname: %q but got: %v", successCase.testName, errs) - } - } - - errorCases := []validateClusterSpecTest{ - { - testName: "invalid CIDR : network missing", - spec: &federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0", - ServerAddress: "localhost:8888", - }, - }, - }, - path: field.NewPath("spec"), - }, - { - testName: "invalid CIDR : invalid address value", - spec: &federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "256.0.0.0/16", - ServerAddress: "localhost:8888", - }, - }, - }, - path: field.NewPath("spec"), - }, - { - testName: "invalid CIDR : invalid address formation", - spec: &federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0/16", - ServerAddress: "localhost:8888", - }, - }, - }, - path: field.NewPath("spec"), - }, - { - testName: "invalid CIDR : invalid network num", - spec: &federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/33", - ServerAddress: "localhost:8888", - }, - }, - }, - path: field.NewPath("spec"), - }, - } - - for _, errorCase := range errorCases { - errs := ValidateClusterSpec(errorCase.spec, errorCase.path) - if len(errs) == 0 { - t.Errorf("expect failure for testname : %q", errorCase.testName) - } - } - -} - -func TestValidateCluster(t *testing.T) { - successCases := []federation.Cluster{ - { - ObjectMeta: metav1.ObjectMeta{Name: "cluster-s"}, - Spec: federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: "localhost:8888", - }, - }, - }, - }, - } - for _, successCase := range successCases { - errs := ValidateCluster(&successCase) - if len(errs) != 0 { - t.Errorf("expect success: %v", errs) - } - } - - errorCases := map[string]federation.Cluster{ - "missing cluster addresses": { - ObjectMeta: metav1.ObjectMeta{Name: "cluster-f"}, - }, - "empty cluster addresses": { - ObjectMeta: metav1.ObjectMeta{Name: "cluster-f"}, - Spec: federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{}, - }}, - "invalid_label": { - ObjectMeta: metav1.ObjectMeta{ - Name: "cluster-f", - Labels: map[string]string{ - "NoUppercaseOrSpecialCharsLike=Equals": "bar", - }, - }, - }, - "invalid cluster name (is a subdomain)": { - ObjectMeta: metav1.ObjectMeta{Name: "mycluster.mycompany"}, - Spec: federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: "localhost:8888", - }, - }, - }, - }, - } - for testName, errorCase := range errorCases { - errs := ValidateCluster(&errorCase) - if len(errs) == 0 { - t.Errorf("expected failure for %s", testName) - } - } -} - -func TestValidateClusterUpdate(t *testing.T) { - type clusterUpdateTest struct { - old federation.Cluster - update federation.Cluster - } - successCases := []clusterUpdateTest{ - { - old: federation.Cluster{ - ObjectMeta: metav1.ObjectMeta{Name: "cluster-s"}, - Spec: federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: "localhost:8888", - }, - }, - }, - }, - update: federation.Cluster{ - ObjectMeta: metav1.ObjectMeta{Name: "cluster-s"}, - Spec: federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: "localhost:8888", - }, - }, - }, - }, - }, - } - for _, successCase := range successCases { - successCase.old.ObjectMeta.ResourceVersion = "1" - successCase.update.ObjectMeta.ResourceVersion = "1" - errs := ValidateClusterUpdate(&successCase.update, &successCase.old) - if len(errs) != 0 { - t.Errorf("expect success: %v", errs) - } - } - - errorCases := map[string]clusterUpdateTest{ - "cluster name changed": { - old: federation.Cluster{ - ObjectMeta: metav1.ObjectMeta{Name: "cluster-s"}, - Spec: federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: "localhost:8888", - }, - }, - }, - }, - update: federation.Cluster{ - ObjectMeta: metav1.ObjectMeta{Name: "cluster-newname"}, - Spec: federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: "localhost:8888", - }, - }, - }, - }, - }, - } - for testName, errorCase := range errorCases { - errs := ValidateClusterUpdate(&errorCase.update, &errorCase.old) - if len(errs) == 0 { - t.Errorf("expected failure: %s", testName) - } - } -} - -func TestValidateClusterStatusUpdate(t *testing.T) { - type clusterUpdateTest struct { - old federation.Cluster - update federation.Cluster - } - successCases := []clusterUpdateTest{ - { - old: federation.Cluster{ - ObjectMeta: metav1.ObjectMeta{Name: "cluster-s"}, - Spec: federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: "localhost:8888", - }, - }, - }, - Status: federation.ClusterStatus{ - Conditions: []federation.ClusterCondition{ - {Type: federation.ClusterReady, Status: api.ConditionTrue}, - }, - }, - }, - update: federation.Cluster{ - ObjectMeta: metav1.ObjectMeta{Name: "cluster-s"}, - Spec: federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: "localhost:8888", - }, - }, - }, - Status: federation.ClusterStatus{ - Conditions: []federation.ClusterCondition{ - {Type: federation.ClusterReady, Status: api.ConditionTrue}, - {Type: federation.ClusterOffline, Status: api.ConditionTrue}, - }, - }, - }, - }, - } - for _, successCase := range successCases { - successCase.old.ObjectMeta.ResourceVersion = "1" - successCase.update.ObjectMeta.ResourceVersion = "1" - errs := ValidateClusterUpdate(&successCase.update, &successCase.old) - if len(errs) != 0 { - t.Errorf("expect success: %v", errs) - } - } - - errorCases := map[string]clusterUpdateTest{} - for testName, errorCase := range errorCases { - errs := ValidateClusterStatusUpdate(&errorCase.update, &errorCase.old) - if len(errs) == 0 { - t.Errorf("expected failure: %s", testName) - } - } -} diff --git a/federation/apis/federation/zz_generated.deepcopy.go b/federation/apis/federation/zz_generated.deepcopy.go deleted file mode 100644 index a944361d96..0000000000 --- a/federation/apis/federation/zz_generated.deepcopy.go +++ /dev/null @@ -1,331 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was autogenerated by deepcopy-gen. Do not edit it manually! - -package federation - -import ( - v1 "k8s.io/api/core/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - api "k8s.io/kubernetes/pkg/api" - reflect "reflect" -) - -func init() { - SchemeBuilder.Register(RegisterDeepCopies) -} - -// RegisterDeepCopies adds deep-copy functions to the given scheme. Public -// to allow building arbitrary schemes. -// -// Deprecated: deepcopy registration will go away when static deepcopy is fully implemented. -func RegisterDeepCopies(scheme *runtime.Scheme) error { - return scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*Cluster).DeepCopyInto(out.(*Cluster)) - return nil - }, InType: reflect.TypeOf(&Cluster{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ClusterCondition).DeepCopyInto(out.(*ClusterCondition)) - return nil - }, InType: reflect.TypeOf(&ClusterCondition{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ClusterList).DeepCopyInto(out.(*ClusterList)) - return nil - }, InType: reflect.TypeOf(&ClusterList{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ClusterPreferences).DeepCopyInto(out.(*ClusterPreferences)) - return nil - }, InType: reflect.TypeOf(&ClusterPreferences{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ClusterServiceIngress).DeepCopyInto(out.(*ClusterServiceIngress)) - return nil - }, InType: reflect.TypeOf(&ClusterServiceIngress{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ClusterSpec).DeepCopyInto(out.(*ClusterSpec)) - return nil - }, InType: reflect.TypeOf(&ClusterSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ClusterStatus).DeepCopyInto(out.(*ClusterStatus)) - return nil - }, InType: reflect.TypeOf(&ClusterStatus{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*FederatedServiceIngress).DeepCopyInto(out.(*FederatedServiceIngress)) - return nil - }, InType: reflect.TypeOf(&FederatedServiceIngress{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ReplicaAllocationPreferences).DeepCopyInto(out.(*ReplicaAllocationPreferences)) - return nil - }, InType: reflect.TypeOf(&ReplicaAllocationPreferences{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*ServerAddressByClientCIDR).DeepCopyInto(out.(*ServerAddressByClientCIDR)) - return nil - }, InType: reflect.TypeOf(&ServerAddressByClientCIDR{})}, - ) -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Cluster) DeepCopyInto(out *Cluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. -func (in *Cluster) DeepCopy() *Cluster { - if in == nil { - return nil - } - out := new(Cluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Cluster) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { - return nil - } -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition) { - *out = *in - in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterCondition. -func (in *ClusterCondition) DeepCopy() *ClusterCondition { - if in == nil { - return nil - } - out := new(ClusterCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterList) DeepCopyInto(out *ClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. -func (in *ClusterList) DeepCopy() *ClusterList { - if in == nil { - return nil - } - out := new(ClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } else { - return nil - } -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterPreferences) DeepCopyInto(out *ClusterPreferences) { - *out = *in - if in.MaxReplicas != nil { - in, out := &in.MaxReplicas, &out.MaxReplicas - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPreferences. -func (in *ClusterPreferences) DeepCopy() *ClusterPreferences { - if in == nil { - return nil - } - out := new(ClusterPreferences) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterServiceIngress) DeepCopyInto(out *ClusterServiceIngress) { - *out = *in - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1.LoadBalancerIngress, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterServiceIngress. -func (in *ClusterServiceIngress) DeepCopy() *ClusterServiceIngress { - if in == nil { - return nil - } - out := new(ClusterServiceIngress) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { - *out = *in - if in.ServerAddressByClientCIDRs != nil { - in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs - *out = make([]ServerAddressByClientCIDR, len(*in)) - copy(*out, *in) - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - if *in == nil { - *out = nil - } else { - *out = new(api.LocalObjectReference) - **out = **in - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. -func (in *ClusterSpec) DeepCopy() *ClusterSpec { - if in == nil { - return nil - } - out := new(ClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ClusterCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Zones != nil { - in, out := &in.Zones, &out.Zones - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. -func (in *ClusterStatus) DeepCopy() *ClusterStatus { - if in == nil { - return nil - } - out := new(ClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FederatedServiceIngress) DeepCopyInto(out *FederatedServiceIngress) { - *out = *in - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterServiceIngress, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederatedServiceIngress. -func (in *FederatedServiceIngress) DeepCopy() *FederatedServiceIngress { - if in == nil { - return nil - } - out := new(FederatedServiceIngress) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReplicaAllocationPreferences) DeepCopyInto(out *ReplicaAllocationPreferences) { - *out = *in - if in.Clusters != nil { - in, out := &in.Clusters, &out.Clusters - *out = make(map[string]ClusterPreferences, len(*in)) - for key, val := range *in { - newVal := new(ClusterPreferences) - val.DeepCopyInto(newVal) - (*out)[key] = *newVal - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaAllocationPreferences. -func (in *ReplicaAllocationPreferences) DeepCopy() *ReplicaAllocationPreferences { - if in == nil { - return nil - } - out := new(ReplicaAllocationPreferences) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServerAddressByClientCIDR) DeepCopyInto(out *ServerAddressByClientCIDR) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerAddressByClientCIDR. -func (in *ServerAddressByClientCIDR) DeepCopy() *ServerAddressByClientCIDR { - if in == nil { - return nil - } - out := new(ServerAddressByClientCIDR) - in.DeepCopyInto(out) - return out -} diff --git a/federation/apis/openapi-spec/swagger.json b/federation/apis/openapi-spec/swagger.json deleted file mode 100644 index 63643b8246..0000000000 --- a/federation/apis/openapi-spec/swagger.json +++ /dev/null @@ -1,15312 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Generic API Server", - "version": "v1.9.0" - }, - "paths": { - "/api/": { - "get": { - "description": "get available API versions", - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core" - ], - "operationId": "getCoreAPIVersions", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIVersions" - } - }, - "401": { - "description": "Unauthorized" - } - } - } - }, - "/api/v1/": { - "get": { - "description": "get available resources", - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "getCoreV1APIResources", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" - } - }, - "401": { - "description": "Unauthorized" - } - } - } - }, - "/api/v1/configmaps": { - "get": { - "description": "list or watch objects of kind ConfigMap", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "listCoreV1ConfigMapForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMapList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "ConfigMap" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/events": { - "get": { - "description": "list or watch objects of kind Event", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "listCoreV1EventForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.EventList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Event" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/namespaces": { - "get": { - "description": "list or watch objects of kind Namespace", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "listCoreV1Namespace", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.NamespaceList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Namespace" - } - }, - "post": { - "description": "create a Namespace", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "createCoreV1Namespace", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Namespace" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/api/v1/namespaces/{namespace}/configmaps": { - "get": { - "description": "list or watch objects of kind ConfigMap", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "listCoreV1NamespacedConfigMap", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMapList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "ConfigMap" - } - }, - "post": { - "description": "create a ConfigMap", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "createCoreV1NamespacedConfigMap", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMap" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMap" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMap" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMap" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "ConfigMap" - } - }, - "delete": { - "description": "delete collection of ConfigMap", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "deleteCoreV1CollectionNamespacedConfigMap", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "ConfigMap" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/api/v1/namespaces/{namespace}/configmaps/{name}": { - "get": { - "description": "read the specified ConfigMap", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "readCoreV1NamespacedConfigMap", - "parameters": [ - { - "uniqueItems": true, - "type": "boolean", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "name": "exact", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "name": "export", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMap" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "ConfigMap" - } - }, - "put": { - "description": "replace the specified ConfigMap", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "replaceCoreV1NamespacedConfigMap", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMap" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMap" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMap" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "ConfigMap" - } - }, - "delete": { - "description": "delete a ConfigMap", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "deleteCoreV1NamespacedConfigMap", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - }, - { - "uniqueItems": true, - "type": "integer", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "name": "gracePeriodSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "name": "orphanDependents", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "name": "propagationPolicy", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "ConfigMap" - } - }, - "patch": { - "description": "partially update the specified ConfigMap", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "patchCoreV1NamespacedConfigMap", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMap" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "ConfigMap" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the ConfigMap", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/api/v1/namespaces/{namespace}/events": { - "get": { - "description": "list or watch objects of kind Event", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "listCoreV1NamespacedEvent", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.EventList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Event" - } - }, - "post": { - "description": "create an Event", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "createCoreV1NamespacedEvent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Event" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Event" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Event" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Event" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Event" - } - }, - "delete": { - "description": "delete collection of Event", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "deleteCoreV1CollectionNamespacedEvent", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Event" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/api/v1/namespaces/{namespace}/events/{name}": { - "get": { - "description": "read the specified Event", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "readCoreV1NamespacedEvent", - "parameters": [ - { - "uniqueItems": true, - "type": "boolean", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "name": "exact", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "name": "export", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Event" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Event" - } - }, - "put": { - "description": "replace the specified Event", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "replaceCoreV1NamespacedEvent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Event" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Event" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Event" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Event" - } - }, - "delete": { - "description": "delete an Event", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "deleteCoreV1NamespacedEvent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - }, - { - "uniqueItems": true, - "type": "integer", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "name": "gracePeriodSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "name": "orphanDependents", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "name": "propagationPolicy", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Event" - } - }, - "patch": { - "description": "partially update the specified Event", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "patchCoreV1NamespacedEvent", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Event" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Event" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Event", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/api/v1/namespaces/{namespace}/secrets": { - "get": { - "description": "list or watch objects of kind Secret", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "listCoreV1NamespacedSecret", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.SecretList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Secret" - } - }, - "post": { - "description": "create a Secret", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "createCoreV1NamespacedSecret", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Secret" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Secret" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Secret" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Secret" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Secret" - } - }, - "delete": { - "description": "delete collection of Secret", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "deleteCoreV1CollectionNamespacedSecret", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Secret" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/api/v1/namespaces/{namespace}/secrets/{name}": { - "get": { - "description": "read the specified Secret", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "readCoreV1NamespacedSecret", - "parameters": [ - { - "uniqueItems": true, - "type": "boolean", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "name": "exact", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "name": "export", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Secret" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Secret" - } - }, - "put": { - "description": "replace the specified Secret", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "replaceCoreV1NamespacedSecret", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Secret" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Secret" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Secret" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Secret" - } - }, - "delete": { - "description": "delete a Secret", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "deleteCoreV1NamespacedSecret", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - }, - { - "uniqueItems": true, - "type": "integer", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "name": "gracePeriodSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "name": "orphanDependents", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "name": "propagationPolicy", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Secret" - } - }, - "patch": { - "description": "partially update the specified Secret", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "patchCoreV1NamespacedSecret", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Secret" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Secret" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Secret", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/api/v1/namespaces/{namespace}/services": { - "get": { - "description": "list or watch objects of kind Service", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "listCoreV1NamespacedService", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.ServiceList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Service" - } - }, - "post": { - "description": "create a Service", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "createCoreV1NamespacedService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Service" - } - }, - "delete": { - "description": "delete collection of Service", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "deleteCoreV1CollectionNamespacedService", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Service" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/api/v1/namespaces/{namespace}/services/{name}": { - "get": { - "description": "read the specified Service", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "readCoreV1NamespacedService", - "parameters": [ - { - "uniqueItems": true, - "type": "boolean", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "name": "exact", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "name": "export", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Service" - } - }, - "put": { - "description": "replace the specified Service", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "replaceCoreV1NamespacedService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Service" - } - }, - "delete": { - "description": "delete a Service", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "deleteCoreV1NamespacedService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - }, - { - "uniqueItems": true, - "type": "integer", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "name": "gracePeriodSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "name": "orphanDependents", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "name": "propagationPolicy", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Service" - } - }, - "patch": { - "description": "partially update the specified Service", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "patchCoreV1NamespacedService", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Service" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Service", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/api/v1/namespaces/{namespace}/services/{name}/status": { - "get": { - "description": "read status of the specified Service", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "readCoreV1NamespacedServiceStatus", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Service" - } - }, - "put": { - "description": "replace status of the specified Service", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "replaceCoreV1NamespacedServiceStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Service" - } - }, - "patch": { - "description": "partially update status of the specified Service", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "patchCoreV1NamespacedServiceStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Service" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Service", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/api/v1/namespaces/{name}": { - "get": { - "description": "read the specified Namespace", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "readCoreV1Namespace", - "parameters": [ - { - "uniqueItems": true, - "type": "boolean", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "name": "exact", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "name": "export", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Namespace" - } - }, - "put": { - "description": "replace the specified Namespace", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "replaceCoreV1Namespace", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Namespace" - } - }, - "delete": { - "description": "delete a Namespace", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "deleteCoreV1Namespace", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - }, - { - "uniqueItems": true, - "type": "integer", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "name": "gracePeriodSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "name": "orphanDependents", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "name": "propagationPolicy", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Namespace" - } - }, - "patch": { - "description": "partially update the specified Namespace", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "patchCoreV1Namespace", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Namespace" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Namespace", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/api/v1/namespaces/{name}/finalize": { - "put": { - "description": "replace finalize of the specified Namespace", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "replaceCoreV1NamespaceFinalize", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Namespace" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Namespace", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/api/v1/namespaces/{name}/status": { - "get": { - "description": "read status of the specified Namespace", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "readCoreV1NamespaceStatus", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Namespace" - } - }, - "put": { - "description": "replace status of the specified Namespace", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "replaceCoreV1NamespaceStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Namespace" - } - }, - "patch": { - "description": "partially update status of the specified Namespace", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "patchCoreV1NamespaceStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Namespace" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Namespace", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/api/v1/secrets": { - "get": { - "description": "list or watch objects of kind Secret", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "listCoreV1SecretForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.SecretList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Secret" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/services": { - "get": { - "description": "list or watch objects of kind Service", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "listCoreV1ServiceForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.core.v1.ServiceList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Service" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/watch/configmaps": { - "get": { - "description": "watch individual changes to a list of ConfigMap", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "watchCoreV1ConfigMapListForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "ConfigMap" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/watch/events": { - "get": { - "description": "watch individual changes to a list of Event", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "watchCoreV1EventListForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Event" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/watch/namespaces": { - "get": { - "description": "watch individual changes to a list of Namespace", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "watchCoreV1NamespaceList", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Namespace" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/watch/namespaces/{namespace}/configmaps": { - "get": { - "description": "watch individual changes to a list of ConfigMap", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "watchCoreV1NamespacedConfigMapList", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "ConfigMap" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/watch/namespaces/{namespace}/configmaps/{name}": { - "get": { - "description": "watch changes to an object of kind ConfigMap", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "watchCoreV1NamespacedConfigMap", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watch", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "ConfigMap" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "name of the ConfigMap", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/watch/namespaces/{namespace}/events": { - "get": { - "description": "watch individual changes to a list of Event", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "watchCoreV1NamespacedEventList", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Event" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/watch/namespaces/{namespace}/events/{name}": { - "get": { - "description": "watch changes to an object of kind Event", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "watchCoreV1NamespacedEvent", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watch", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Event" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "name of the Event", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/watch/namespaces/{namespace}/secrets": { - "get": { - "description": "watch individual changes to a list of Secret", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "watchCoreV1NamespacedSecretList", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Secret" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/watch/namespaces/{namespace}/secrets/{name}": { - "get": { - "description": "watch changes to an object of kind Secret", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "watchCoreV1NamespacedSecret", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watch", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Secret" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "name of the Secret", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/watch/namespaces/{namespace}/services": { - "get": { - "description": "watch individual changes to a list of Service", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "watchCoreV1NamespacedServiceList", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Service" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/watch/namespaces/{namespace}/services/{name}": { - "get": { - "description": "watch changes to an object of kind Service", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "watchCoreV1NamespacedService", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watch", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Service" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "name of the Service", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/watch/namespaces/{name}": { - "get": { - "description": "watch changes to an object of kind Namespace", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "watchCoreV1Namespace", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watch", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Namespace" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "name of the Namespace", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/watch/secrets": { - "get": { - "description": "watch individual changes to a list of Secret", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "watchCoreV1SecretListForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Secret" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/api/v1/watch/services": { - "get": { - "description": "watch individual changes to a list of Service", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "core_v1" - ], - "operationId": "watchCoreV1ServiceListForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "", - "version": "v1", - "kind": "Service" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/": { - "get": { - "description": "get available API versions", - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "apis" - ], - "operationId": "getAPIVersions", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIGroupList" - } - }, - "401": { - "description": "Unauthorized" - } - } - } - }, - "/apis/extensions/": { - "get": { - "description": "get information of a group", - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions" - ], - "operationId": "getExtensionsAPIGroup", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup" - } - }, - "401": { - "description": "Unauthorized" - } - } - } - }, - "/apis/extensions/v1beta1/": { - "get": { - "description": "get available resources", - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "getExtensionsV1beta1APIResources", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" - } - }, - "401": { - "description": "Unauthorized" - } - } - } - }, - "/apis/extensions/v1beta1/daemonsets": { - "get": { - "description": "list or watch objects of kind DaemonSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "listExtensionsV1beta1DaemonSetForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSetList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/deployments": { - "get": { - "description": "list or watch objects of kind Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "listExtensionsV1beta1DeploymentForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DeploymentList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/ingresses": { - "get": { - "description": "list or watch objects of kind Ingress", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "listExtensionsV1beta1IngressForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.IngressList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets": { - "get": { - "description": "list or watch objects of kind DaemonSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "listExtensionsV1beta1NamespacedDaemonSet", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSetList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - }, - "post": { - "description": "create a DaemonSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "createExtensionsV1beta1NamespacedDaemonSet", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - }, - "delete": { - "description": "delete collection of DaemonSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "deleteExtensionsV1beta1CollectionNamespacedDaemonSet", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}": { - "get": { - "description": "read the specified DaemonSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "readExtensionsV1beta1NamespacedDaemonSet", - "parameters": [ - { - "uniqueItems": true, - "type": "boolean", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "name": "exact", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "name": "export", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - }, - "put": { - "description": "replace the specified DaemonSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "replaceExtensionsV1beta1NamespacedDaemonSet", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - }, - "delete": { - "description": "delete a DaemonSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "deleteExtensionsV1beta1NamespacedDaemonSet", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - }, - { - "uniqueItems": true, - "type": "integer", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "name": "gracePeriodSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "name": "orphanDependents", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "name": "propagationPolicy", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - }, - "patch": { - "description": "partially update the specified DaemonSet", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "patchExtensionsV1beta1NamespacedDaemonSet", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the DaemonSet", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status": { - "get": { - "description": "read status of the specified DaemonSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "readExtensionsV1beta1NamespacedDaemonSetStatus", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - }, - "put": { - "description": "replace status of the specified DaemonSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "replaceExtensionsV1beta1NamespacedDaemonSetStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - }, - "patch": { - "description": "partially update status of the specified DaemonSet", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "patchExtensionsV1beta1NamespacedDaemonSetStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the DaemonSet", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments": { - "get": { - "description": "list or watch objects of kind Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "listExtensionsV1beta1NamespacedDeployment", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DeploymentList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - }, - "post": { - "description": "create a Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "createExtensionsV1beta1NamespacedDeployment", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - }, - "delete": { - "description": "delete collection of Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "deleteExtensionsV1beta1CollectionNamespacedDeployment", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}": { - "get": { - "description": "read the specified Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "readExtensionsV1beta1NamespacedDeployment", - "parameters": [ - { - "uniqueItems": true, - "type": "boolean", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "name": "exact", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "name": "export", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - }, - "put": { - "description": "replace the specified Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "replaceExtensionsV1beta1NamespacedDeployment", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - }, - "delete": { - "description": "delete a Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "deleteExtensionsV1beta1NamespacedDeployment", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - }, - { - "uniqueItems": true, - "type": "integer", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "name": "gracePeriodSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "name": "orphanDependents", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "name": "propagationPolicy", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - }, - "patch": { - "description": "partially update the specified Deployment", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "patchExtensionsV1beta1NamespacedDeployment", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Deployment", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback": { - "post": { - "description": "create rollback of a Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "createExtensionsV1beta1NamespacedDeploymentRollback", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DeploymentRollback" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DeploymentRollback" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DeploymentRollback" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DeploymentRollback" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DeploymentRollback" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the DeploymentRollback", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale": { - "get": { - "description": "read scale of the specified Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "readExtensionsV1beta1NamespacedDeploymentScale", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Scale" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Scale" - } - }, - "put": { - "description": "replace scale of the specified Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "replaceExtensionsV1beta1NamespacedDeploymentScale", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Scale" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Scale" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Scale" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Scale" - } - }, - "patch": { - "description": "partially update scale of the specified Deployment", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "patchExtensionsV1beta1NamespacedDeploymentScale", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Scale" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Scale" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Scale", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status": { - "get": { - "description": "read status of the specified Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "readExtensionsV1beta1NamespacedDeploymentStatus", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - }, - "put": { - "description": "replace status of the specified Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "replaceExtensionsV1beta1NamespacedDeploymentStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - }, - "patch": { - "description": "partially update status of the specified Deployment", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "patchExtensionsV1beta1NamespacedDeploymentStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Deployment", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses": { - "get": { - "description": "list or watch objects of kind Ingress", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "listExtensionsV1beta1NamespacedIngress", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.IngressList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - }, - "post": { - "description": "create an Ingress", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "createExtensionsV1beta1NamespacedIngress", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - }, - "delete": { - "description": "delete collection of Ingress", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "deleteExtensionsV1beta1CollectionNamespacedIngress", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}": { - "get": { - "description": "read the specified Ingress", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "readExtensionsV1beta1NamespacedIngress", - "parameters": [ - { - "uniqueItems": true, - "type": "boolean", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "name": "exact", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "name": "export", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - }, - "put": { - "description": "replace the specified Ingress", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "replaceExtensionsV1beta1NamespacedIngress", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - }, - "delete": { - "description": "delete an Ingress", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "deleteExtensionsV1beta1NamespacedIngress", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - }, - { - "uniqueItems": true, - "type": "integer", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "name": "gracePeriodSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "name": "orphanDependents", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "name": "propagationPolicy", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - }, - "patch": { - "description": "partially update the specified Ingress", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "patchExtensionsV1beta1NamespacedIngress", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Ingress", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status": { - "get": { - "description": "read status of the specified Ingress", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "readExtensionsV1beta1NamespacedIngressStatus", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - }, - "put": { - "description": "replace status of the specified Ingress", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "replaceExtensionsV1beta1NamespacedIngressStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - }, - "patch": { - "description": "partially update status of the specified Ingress", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "patchExtensionsV1beta1NamespacedIngressStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Ingress", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets": { - "get": { - "description": "list or watch objects of kind ReplicaSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "listExtensionsV1beta1NamespacedReplicaSet", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSetList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - }, - "post": { - "description": "create a ReplicaSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "createExtensionsV1beta1NamespacedReplicaSet", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - }, - "delete": { - "description": "delete collection of ReplicaSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "deleteExtensionsV1beta1CollectionNamespacedReplicaSet", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}": { - "get": { - "description": "read the specified ReplicaSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "readExtensionsV1beta1NamespacedReplicaSet", - "parameters": [ - { - "uniqueItems": true, - "type": "boolean", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "name": "exact", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "name": "export", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - }, - "put": { - "description": "replace the specified ReplicaSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "replaceExtensionsV1beta1NamespacedReplicaSet", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - }, - "delete": { - "description": "delete a ReplicaSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "deleteExtensionsV1beta1NamespacedReplicaSet", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - }, - { - "uniqueItems": true, - "type": "integer", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "name": "gracePeriodSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "name": "orphanDependents", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "name": "propagationPolicy", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - }, - "patch": { - "description": "partially update the specified ReplicaSet", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "patchExtensionsV1beta1NamespacedReplicaSet", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the ReplicaSet", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale": { - "get": { - "description": "read scale of the specified ReplicaSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "readExtensionsV1beta1NamespacedReplicaSetScale", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Scale" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Scale" - } - }, - "put": { - "description": "replace scale of the specified ReplicaSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "replaceExtensionsV1beta1NamespacedReplicaSetScale", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Scale" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Scale" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Scale" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Scale" - } - }, - "patch": { - "description": "partially update scale of the specified ReplicaSet", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "patchExtensionsV1beta1NamespacedReplicaSetScale", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Scale" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Scale" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Scale", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status": { - "get": { - "description": "read status of the specified ReplicaSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "readExtensionsV1beta1NamespacedReplicaSetStatus", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - }, - "put": { - "description": "replace status of the specified ReplicaSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "replaceExtensionsV1beta1NamespacedReplicaSetStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - }, - "patch": { - "description": "partially update status of the specified ReplicaSet", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "patchExtensionsV1beta1NamespacedReplicaSetStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the ReplicaSet", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/replicasets": { - "get": { - "description": "list or watch objects of kind ReplicaSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "listExtensionsV1beta1ReplicaSetForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSetList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/watch/daemonsets": { - "get": { - "description": "watch individual changes to a list of DaemonSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "watchExtensionsV1beta1DaemonSetListForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/watch/deployments": { - "get": { - "description": "watch individual changes to a list of Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "watchExtensionsV1beta1DeploymentListForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/watch/ingresses": { - "get": { - "description": "watch individual changes to a list of Ingress", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "watchExtensionsV1beta1IngressListForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets": { - "get": { - "description": "watch individual changes to a list of DaemonSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "watchExtensionsV1beta1NamespacedDaemonSetList", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}": { - "get": { - "description": "watch changes to an object of kind DaemonSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "watchExtensionsV1beta1NamespacedDaemonSet", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watch", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "name of the DaemonSet", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments": { - "get": { - "description": "watch individual changes to a list of Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "watchExtensionsV1beta1NamespacedDeploymentList", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}": { - "get": { - "description": "watch changes to an object of kind Deployment", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "watchExtensionsV1beta1NamespacedDeployment", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watch", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "name of the Deployment", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses": { - "get": { - "description": "watch individual changes to a list of Ingress", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "watchExtensionsV1beta1NamespacedIngressList", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}": { - "get": { - "description": "watch changes to an object of kind Ingress", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "watchExtensionsV1beta1NamespacedIngress", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watch", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "name of the Ingress", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets": { - "get": { - "description": "watch individual changes to a list of ReplicaSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "watchExtensionsV1beta1NamespacedReplicaSetList", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}": { - "get": { - "description": "watch changes to an object of kind ReplicaSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "watchExtensionsV1beta1NamespacedReplicaSet", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watch", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "name of the ReplicaSet", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "object name and auth scope, such as for teams and projects", - "name": "namespace", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/extensions/v1beta1/watch/replicasets": { - "get": { - "description": "watch individual changes to a list of ReplicaSet", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "extensions_v1beta1" - ], - "operationId": "watchExtensionsV1beta1ReplicaSetListForAllNamespaces", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/federation/": { - "get": { - "description": "get information of a group", - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "federation" - ], - "operationId": "getFederationAPIGroup", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup" - } - }, - "401": { - "description": "Unauthorized" - } - } - } - }, - "/apis/federation/v1beta1/": { - "get": { - "description": "get available resources", - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "federation_v1beta1" - ], - "operationId": "getFederationV1beta1APIResources", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" - } - }, - "401": { - "description": "Unauthorized" - } - } - } - }, - "/apis/federation/v1beta1/clusters": { - "get": { - "description": "list or watch objects of kind Cluster", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "federation_v1beta1" - ], - "operationId": "listFederationV1beta1Cluster", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterList" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "list", - "x-kubernetes-group-version-kind": { - "group": "federation", - "version": "v1beta1", - "kind": "Cluster" - } - }, - "post": { - "description": "create a Cluster", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "federation_v1beta1" - ], - "operationId": "createFederationV1beta1Cluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster" - } - }, - "202": { - "description": "Accepted", - "schema": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "post", - "x-kubernetes-group-version-kind": { - "group": "federation", - "version": "v1beta1", - "kind": "Cluster" - } - }, - "delete": { - "description": "delete collection of Cluster", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "federation_v1beta1" - ], - "operationId": "deleteFederationV1beta1CollectionCluster", - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "deletecollection", - "x-kubernetes-group-version-kind": { - "group": "federation", - "version": "v1beta1", - "kind": "Cluster" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/federation/v1beta1/clusters/{name}": { - "get": { - "description": "read the specified Cluster", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "federation_v1beta1" - ], - "operationId": "readFederationV1beta1Cluster", - "parameters": [ - { - "uniqueItems": true, - "type": "boolean", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "name": "exact", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "name": "export", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "get", - "x-kubernetes-group-version-kind": { - "group": "federation", - "version": "v1beta1", - "kind": "Cluster" - } - }, - "put": { - "description": "replace the specified Cluster", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "federation_v1beta1" - ], - "operationId": "replaceFederationV1beta1Cluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "federation", - "version": "v1beta1", - "kind": "Cluster" - } - }, - "delete": { - "description": "delete a Cluster", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "federation_v1beta1" - ], - "operationId": "deleteFederationV1beta1Cluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - } - }, - { - "uniqueItems": true, - "type": "integer", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "name": "gracePeriodSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "name": "orphanDependents", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "name": "propagationPolicy", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "delete", - "x-kubernetes-group-version-kind": { - "group": "federation", - "version": "v1beta1", - "kind": "Cluster" - } - }, - "patch": { - "description": "partially update the specified Cluster", - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "federation_v1beta1" - ], - "operationId": "patchFederationV1beta1Cluster", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "patch", - "x-kubernetes-group-version-kind": { - "group": "federation", - "version": "v1beta1", - "kind": "Cluster" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Cluster", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/federation/v1beta1/clusters/{name}/status": { - "put": { - "description": "replace status of the specified Cluster", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "schemes": [ - "https" - ], - "tags": [ - "federation_v1beta1" - ], - "operationId": "replaceFederationV1beta1ClusterStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster" - } - }, - "201": { - "description": "Created", - "schema": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "put", - "x-kubernetes-group-version-kind": { - "group": "federation", - "version": "v1beta1", - "kind": "Cluster" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "name of the Cluster", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - } - ] - }, - "/apis/federation/v1beta1/watch/clusters": { - "get": { - "description": "watch individual changes to a list of Cluster", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "federation_v1beta1" - ], - "operationId": "watchFederationV1beta1ClusterList", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watchlist", - "x-kubernetes-group-version-kind": { - "group": "federation", - "version": "v1beta1", - "kind": "Cluster" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/apis/federation/v1beta1/watch/clusters/{name}": { - "get": { - "description": "watch changes to an object of kind Cluster", - "consumes": [ - "*/*" - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "schemes": [ - "https" - ], - "tags": [ - "federation_v1beta1" - ], - "operationId": "watchFederationV1beta1Cluster", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - } - }, - "401": { - "description": "Unauthorized" - } - }, - "x-kubernetes-action": "watch", - "x-kubernetes-group-version-kind": { - "group": "federation", - "version": "v1beta1", - "kind": "Cluster" - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "name": "continue", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "name": "fieldSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "If true, partially initialized resources are included in the response.", - "name": "includeUninitialized", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "name": "labelSelector", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "name": "limit", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "name of the Cluster", - "name": "name", - "in": "path", - "required": true - }, - { - "uniqueItems": true, - "type": "string", - "description": "If 'true', then the output is pretty printed.", - "name": "pretty", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "name": "resourceVersion", - "in": "query" - }, - { - "uniqueItems": true, - "type": "integer", - "description": "Timeout for the list/watch call.", - "name": "timeoutSeconds", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "name": "watch", - "in": "query" - } - ] - }, - "/logs/": { - "get": { - "schemes": [ - "https" - ], - "tags": [ - "logs" - ], - "operationId": "logFileListHandler", - "responses": { - "401": { - "description": "Unauthorized" - } - } - } - }, - "/logs/{logpath}": { - "get": { - "schemes": [ - "https" - ], - "tags": [ - "logs" - ], - "operationId": "logFileHandler", - "responses": { - "401": { - "description": "Unauthorized" - } - } - }, - "parameters": [ - { - "uniqueItems": true, - "type": "string", - "description": "path to the log", - "name": "logpath", - "in": "path", - "required": true - } - ] - }, - "/version/": { - "get": { - "description": "get the code version", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "tags": [ - "version" - ], - "operationId": "getCodeVersion", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.version.Info" - } - }, - "401": { - "description": "Unauthorized" - } - } - } - } - }, - "definitions": { - "intstr.IntOrString": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.util.intstr.IntOrString instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString" - }, - "io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource": { - "description": "Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.", - "required": [ - "volumeID" - ], - "properties": { - "fsType": { - "description": "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - "type": "string" - }, - "partition": { - "description": "The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).", - "type": "integer", - "format": "int32" - }, - "readOnly": { - "description": "Specify \"true\" to force and set the ReadOnly property in VolumeMounts to \"true\". If omitted, the default is \"false\". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - "type": "boolean" - }, - "volumeID": { - "description": "Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.Affinity": { - "description": "Affinity is a group of affinity scheduling rules.", - "properties": { - "nodeAffinity": { - "description": "Describes node affinity scheduling rules for the pod.", - "$ref": "#/definitions/io.k8s.api.core.v1.NodeAffinity" - }, - "podAffinity": { - "description": "Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).", - "$ref": "#/definitions/io.k8s.api.core.v1.PodAffinity" - }, - "podAntiAffinity": { - "description": "Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).", - "$ref": "#/definitions/io.k8s.api.core.v1.PodAntiAffinity" - } - } - }, - "io.k8s.api.core.v1.AzureDiskVolumeSource": { - "description": "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", - "required": [ - "diskName", - "diskURI" - ], - "properties": { - "cachingMode": { - "description": "Host Caching mode: None, Read Only, Read Write.", - "type": "string" - }, - "diskName": { - "description": "The Name of the data disk in the blob storage", - "type": "string" - }, - "diskURI": { - "description": "The URI the data disk in the blob storage", - "type": "string" - }, - "fsType": { - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - "type": "string" - }, - "kind": { - "description": "Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared", - "type": "string" - }, - "readOnly": { - "description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - "type": "boolean" - } - } - }, - "io.k8s.api.core.v1.AzureFileVolumeSource": { - "description": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - "required": [ - "secretName", - "shareName" - ], - "properties": { - "readOnly": { - "description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - "type": "boolean" - }, - "secretName": { - "description": "the name of secret that contains Azure Storage Account Name and Key", - "type": "string" - }, - "shareName": { - "description": "Share Name", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.Capabilities": { - "description": "Adds and removes POSIX capabilities from running containers.", - "properties": { - "add": { - "description": "Added capabilities", - "type": "array", - "items": { - "type": "string" - } - }, - "drop": { - "description": "Removed capabilities", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "io.k8s.api.core.v1.CephFSVolumeSource": { - "description": "Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.", - "required": [ - "monitors" - ], - "properties": { - "monitors": { - "description": "Required: Monitors is a collection of Ceph monitors More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - "type": "array", - "items": { - "type": "string" - } - }, - "path": { - "description": "Optional: Used as the mounted root, rather than the full Ceph tree, default is /", - "type": "string" - }, - "readOnly": { - "description": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - "type": "boolean" - }, - "secretFile": { - "description": "Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - "type": "string" - }, - "secretRef": { - "description": "Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - "$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference" - }, - "user": { - "description": "Optional: User is the rados user name, default is admin More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.CinderVolumeSource": { - "description": "Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.", - "required": [ - "volumeID" - ], - "properties": { - "fsType": { - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - "type": "string" - }, - "readOnly": { - "description": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - "type": "boolean" - }, - "volumeID": { - "description": "volume id used to identify the volume in cinder More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.ClientIPConfig": { - "description": "ClientIPConfig represents the configurations of Client IP based session affinity.", - "properties": { - "timeoutSeconds": { - "description": "timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be \u003e0 \u0026\u0026 \u003c=86400(for 1 day) if ServiceAffinity == \"ClientIP\". Default value is 10800(for 3 hours).", - "type": "integer", - "format": "int32" - } - } - }, - "io.k8s.api.core.v1.ConfigMap": { - "description": "ConfigMap holds configuration data for pods to consume.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "data": { - "description": "Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "ConfigMap" - } - ] - }, - "io.k8s.api.core.v1.ConfigMapEnvSource": { - "description": "ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.", - "properties": { - "name": { - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - "type": "string" - }, - "optional": { - "description": "Specify whether the ConfigMap must be defined", - "type": "boolean" - } - } - }, - "io.k8s.api.core.v1.ConfigMapKeySelector": { - "description": "Selects a key from a ConfigMap.", - "required": [ - "key" - ], - "properties": { - "key": { - "description": "The key to select.", - "type": "string" - }, - "name": { - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - "type": "string" - }, - "optional": { - "description": "Specify whether the ConfigMap or it's key must be defined", - "type": "boolean" - } - } - }, - "io.k8s.api.core.v1.ConfigMapList": { - "description": "ConfigMapList is a resource containing a list of ConfigMap objects.", - "required": [ - "items" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "Items is the list of ConfigMaps.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMap" - } - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "ConfigMapList" - } - ] - }, - "io.k8s.api.core.v1.ConfigMapProjection": { - "description": "Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.", - "properties": { - "items": { - "description": "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.KeyToPath" - } - }, - "name": { - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - "type": "string" - }, - "optional": { - "description": "Specify whether the ConfigMap or it's keys must be defined", - "type": "boolean" - } - } - }, - "io.k8s.api.core.v1.ConfigMapVolumeSource": { - "description": "Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.", - "properties": { - "defaultMode": { - "description": "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - "type": "integer", - "format": "int32" - }, - "items": { - "description": "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.KeyToPath" - } - }, - "name": { - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - "type": "string" - }, - "optional": { - "description": "Specify whether the ConfigMap or it's keys must be defined", - "type": "boolean" - } - } - }, - "io.k8s.api.core.v1.Container": { - "description": "A single application container that you want to run within a pod.", - "required": [ - "name" - ], - "properties": { - "args": { - "description": "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. 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. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - "type": "array", - "items": { - "type": "string" - } - }, - "command": { - "description": "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. 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. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - "type": "array", - "items": { - "type": "string" - } - }, - "env": { - "description": "List of environment variables to set in the container. Cannot be updated.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.EnvVar" - }, - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge" - }, - "envFrom": { - "description": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.EnvFromSource" - } - }, - "image": { - "description": "Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.", - "type": "string" - }, - "imagePullPolicy": { - "description": "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", - "type": "string" - }, - "lifecycle": { - "description": "Actions that the management system should take in response to container lifecycle events. Cannot be updated.", - "$ref": "#/definitions/io.k8s.api.core.v1.Lifecycle" - }, - "livenessProbe": { - "description": "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - "$ref": "#/definitions/io.k8s.api.core.v1.Probe" - }, - "name": { - "description": "Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.", - "type": "string" - }, - "ports": { - "description": "List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.ContainerPort" - }, - "x-kubernetes-patch-merge-key": "containerPort", - "x-kubernetes-patch-strategy": "merge" - }, - "readinessProbe": { - "description": "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - "$ref": "#/definitions/io.k8s.api.core.v1.Probe" - }, - "resources": { - "description": "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources", - "$ref": "#/definitions/io.k8s.api.core.v1.ResourceRequirements" - }, - "securityContext": { - "description": "Security options the pod should run with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/", - "$ref": "#/definitions/io.k8s.api.core.v1.SecurityContext" - }, - "stdin": { - "description": "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.", - "type": "boolean" - }, - "stdinOnce": { - "description": "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", - "type": "boolean" - }, - "terminationMessagePath": { - "description": "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", - "type": "string" - }, - "terminationMessagePolicy": { - "description": "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.", - "type": "string" - }, - "tty": { - "description": "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.", - "type": "boolean" - }, - "volumeMounts": { - "description": "Pod volumes to mount into the container's filesystem. Cannot be updated.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.VolumeMount" - }, - "x-kubernetes-patch-merge-key": "mountPath", - "x-kubernetes-patch-strategy": "merge" - }, - "workingDir": { - "description": "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.ContainerPort": { - "description": "ContainerPort represents a network port in a single container.", - "required": [ - "containerPort" - ], - "properties": { - "containerPort": { - "description": "Number of port to expose on the pod's IP address. This must be a valid port number, 0 \u003c x \u003c 65536.", - "type": "integer", - "format": "int32" - }, - "hostIP": { - "description": "What host IP to bind the external port to.", - "type": "string" - }, - "hostPort": { - "description": "Number of port to expose on the host. If specified, this must be a valid port number, 0 \u003c x \u003c 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.", - "type": "integer", - "format": "int32" - }, - "name": { - "description": "If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.", - "type": "string" - }, - "protocol": { - "description": "Protocol for port. Must be UDP or TCP. Defaults to \"TCP\".", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.DownwardAPIProjection": { - "description": "Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.", - "properties": { - "items": { - "description": "Items is a list of DownwardAPIVolume file", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.DownwardAPIVolumeFile" - } - } - } - }, - "io.k8s.api.core.v1.DownwardAPIVolumeFile": { - "description": "DownwardAPIVolumeFile represents information to create the file containing the pod field", - "required": [ - "path" - ], - "properties": { - "fieldRef": { - "description": "Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.", - "$ref": "#/definitions/io.k8s.api.core.v1.ObjectFieldSelector" - }, - "mode": { - "description": "Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - "type": "integer", - "format": "int32" - }, - "path": { - "description": "Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'", - "type": "string" - }, - "resourceFieldRef": { - "description": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.", - "$ref": "#/definitions/io.k8s.api.core.v1.ResourceFieldSelector" - } - } - }, - "io.k8s.api.core.v1.DownwardAPIVolumeSource": { - "description": "DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.", - "properties": { - "defaultMode": { - "description": "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - "type": "integer", - "format": "int32" - }, - "items": { - "description": "Items is a list of downward API volume file", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.DownwardAPIVolumeFile" - } - } - } - }, - "io.k8s.api.core.v1.EmptyDirVolumeSource": { - "description": "Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.", - "properties": { - "medium": { - "description": "What type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", - "type": "string" - }, - "sizeLimit": { - "description": "Total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity" - } - } - }, - "io.k8s.api.core.v1.EnvFromSource": { - "description": "EnvFromSource represents the source of a set of ConfigMaps", - "properties": { - "configMapRef": { - "description": "The ConfigMap to select from", - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMapEnvSource" - }, - "prefix": { - "description": "An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.", - "type": "string" - }, - "secretRef": { - "description": "The Secret to select from", - "$ref": "#/definitions/io.k8s.api.core.v1.SecretEnvSource" - } - } - }, - "io.k8s.api.core.v1.EnvVar": { - "description": "EnvVar represents an environment variable present in a Container.", - "required": [ - "name" - ], - "properties": { - "name": { - "description": "Name of the environment variable. Must be a C_IDENTIFIER.", - "type": "string" - }, - "value": { - "description": "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 \"\".", - "type": "string" - }, - "valueFrom": { - "description": "Source for the environment variable's value. Cannot be used if value is not empty.", - "$ref": "#/definitions/io.k8s.api.core.v1.EnvVarSource" - } - } - }, - "io.k8s.api.core.v1.EnvVarSource": { - "description": "EnvVarSource represents a source for the value of an EnvVar.", - "properties": { - "configMapKeyRef": { - "description": "Selects a key of a ConfigMap.", - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMapKeySelector" - }, - "fieldRef": { - "description": "Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP.", - "$ref": "#/definitions/io.k8s.api.core.v1.ObjectFieldSelector" - }, - "resourceFieldRef": { - "description": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.", - "$ref": "#/definitions/io.k8s.api.core.v1.ResourceFieldSelector" - }, - "secretKeyRef": { - "description": "Selects a key of a secret in the pod's namespace", - "$ref": "#/definitions/io.k8s.api.core.v1.SecretKeySelector" - } - } - }, - "io.k8s.api.core.v1.Event": { - "description": "Event is a report of an event somewhere in the cluster.", - "required": [ - "metadata", - "involvedObject" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "count": { - "description": "The number of times this event has occurred.", - "type": "integer", - "format": "int32" - }, - "firstTimestamp": { - "description": "The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" - }, - "involvedObject": { - "description": "The object that this event is about.", - "$ref": "#/definitions/io.k8s.api.core.v1.ObjectReference" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "lastTimestamp": { - "description": "The time at which the most recent occurrence of this event was recorded.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" - }, - "message": { - "description": "A human-readable description of the status of this operation.", - "type": "string" - }, - "metadata": { - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - }, - "reason": { - "description": "This should be a short, machine understandable string that gives the reason for the transition into the object's current status.", - "type": "string" - }, - "source": { - "description": "The component reporting this event. Should be a short machine understandable string.", - "$ref": "#/definitions/io.k8s.api.core.v1.EventSource" - }, - "type": { - "description": "Type of this event (Normal, Warning), new types could be added in the future", - "type": "string" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "Event" - } - ] - }, - "io.k8s.api.core.v1.EventList": { - "description": "EventList is a list of events.", - "required": [ - "items" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "List of events", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.Event" - } - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "EventList" - } - ] - }, - "io.k8s.api.core.v1.EventSource": { - "description": "EventSource contains information for an event.", - "properties": { - "component": { - "description": "Component from which the event is generated.", - "type": "string" - }, - "host": { - "description": "Node name on which the event is generated.", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.ExecAction": { - "description": "ExecAction describes a \"run in container\" action.", - "properties": { - "command": { - "description": "Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "io.k8s.api.core.v1.FCVolumeSource": { - "description": "Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.", - "properties": { - "fsType": { - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - "type": "string" - }, - "lun": { - "description": "Optional: FC target lun number", - "type": "integer", - "format": "int32" - }, - "readOnly": { - "description": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - "type": "boolean" - }, - "targetWWNs": { - "description": "Optional: FC target worldwide names (WWNs)", - "type": "array", - "items": { - "type": "string" - } - }, - "wwids": { - "description": "Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "io.k8s.api.core.v1.FlexVolumeSource": { - "description": "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future.", - "required": [ - "driver" - ], - "properties": { - "driver": { - "description": "Driver is the name of the driver to use for this volume.", - "type": "string" - }, - "fsType": { - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.", - "type": "string" - }, - "options": { - "description": "Optional: Extra command options if any.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "readOnly": { - "description": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - "type": "boolean" - }, - "secretRef": { - "description": "Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.", - "$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference" - } - } - }, - "io.k8s.api.core.v1.FlockerVolumeSource": { - "description": "Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.", - "properties": { - "datasetName": { - "description": "Name of the dataset stored as metadata -\u003e name on the dataset for Flocker should be considered as deprecated", - "type": "string" - }, - "datasetUUID": { - "description": "UUID of the dataset. This is unique identifier of a Flocker dataset", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.GCEPersistentDiskVolumeSource": { - "description": "Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.", - "required": [ - "pdName" - ], - "properties": { - "fsType": { - "description": "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - "type": "string" - }, - "partition": { - "description": "The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - "type": "integer", - "format": "int32" - }, - "pdName": { - "description": "Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - "type": "string" - }, - "readOnly": { - "description": "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - "type": "boolean" - } - } - }, - "io.k8s.api.core.v1.GitRepoVolumeSource": { - "description": "Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.", - "required": [ - "repository" - ], - "properties": { - "directory": { - "description": "Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.", - "type": "string" - }, - "repository": { - "description": "Repository URL", - "type": "string" - }, - "revision": { - "description": "Commit hash for the specified revision.", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.GlusterfsVolumeSource": { - "description": "Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.", - "required": [ - "endpoints", - "path" - ], - "properties": { - "endpoints": { - "description": "EndpointsName is the endpoint name that details Glusterfs topology. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", - "type": "string" - }, - "path": { - "description": "Path is the Glusterfs volume path. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", - "type": "string" - }, - "readOnly": { - "description": "ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod", - "type": "boolean" - } - } - }, - "io.k8s.api.core.v1.HTTPGetAction": { - "description": "HTTPGetAction describes an action based on HTTP Get requests.", - "required": [ - "port" - ], - "properties": { - "host": { - "description": "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.", - "type": "string" - }, - "httpHeaders": { - "description": "Custom headers to set in the request. HTTP allows repeated headers.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.HTTPHeader" - } - }, - "path": { - "description": "Path to access on the HTTP server.", - "type": "string" - }, - "port": { - "description": "Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString" - }, - "scheme": { - "description": "Scheme to use for connecting to the host. Defaults to HTTP.", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.HTTPHeader": { - "description": "HTTPHeader describes a custom header to be used in HTTP probes", - "required": [ - "name", - "value" - ], - "properties": { - "name": { - "description": "The header field name", - "type": "string" - }, - "value": { - "description": "The header field value", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.Handler": { - "description": "Handler defines a specific action that should be taken", - "properties": { - "exec": { - "description": "One and only one of the following should be specified. Exec specifies the action to take.", - "$ref": "#/definitions/io.k8s.api.core.v1.ExecAction" - }, - "httpGet": { - "description": "HTTPGet specifies the http request to perform.", - "$ref": "#/definitions/io.k8s.api.core.v1.HTTPGetAction" - }, - "tcpSocket": { - "description": "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported", - "$ref": "#/definitions/io.k8s.api.core.v1.TCPSocketAction" - } - } - }, - "io.k8s.api.core.v1.HostAlias": { - "description": "HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.", - "properties": { - "hostnames": { - "description": "Hostnames for the above IP address.", - "type": "array", - "items": { - "type": "string" - } - }, - "ip": { - "description": "IP address of the host file entry.", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.HostPathVolumeSource": { - "description": "Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.", - "required": [ - "path" - ], - "properties": { - "path": { - "description": "Path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - "type": "string" - }, - "type": { - "description": "Type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.ISCSIVolumeSource": { - "description": "Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.", - "required": [ - "targetPortal", - "iqn", - "lun" - ], - "properties": { - "chapAuthDiscovery": { - "description": "whether support iSCSI Discovery CHAP authentication", - "type": "boolean" - }, - "chapAuthSession": { - "description": "whether support iSCSI Session CHAP authentication", - "type": "boolean" - }, - "fsType": { - "description": "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi", - "type": "string" - }, - "initiatorName": { - "description": "Custom iSCSI initiator name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface \u003ctarget portal\u003e:\u003cvolume name\u003e will be created for the connection.", - "type": "string" - }, - "iqn": { - "description": "Target iSCSI Qualified Name.", - "type": "string" - }, - "iscsiInterface": { - "description": "Optional: Defaults to 'default' (tcp). iSCSI interface name that uses an iSCSI transport.", - "type": "string" - }, - "lun": { - "description": "iSCSI target lun number.", - "type": "integer", - "format": "int32" - }, - "portals": { - "description": "iSCSI target portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", - "type": "array", - "items": { - "type": "string" - } - }, - "readOnly": { - "description": "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.", - "type": "boolean" - }, - "secretRef": { - "description": "CHAP secret for iSCSI target and initiator authentication", - "$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference" - }, - "targetPortal": { - "description": "iSCSI target portal. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.KeyToPath": { - "description": "Maps a string key to a path within a volume.", - "required": [ - "key", - "path" - ], - "properties": { - "key": { - "description": "The key to project.", - "type": "string" - }, - "mode": { - "description": "Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - "type": "integer", - "format": "int32" - }, - "path": { - "description": "The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.Lifecycle": { - "description": "Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.", - "properties": { - "postStart": { - "description": "PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks", - "$ref": "#/definitions/io.k8s.api.core.v1.Handler" - }, - "preStop": { - "description": "PreStop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks", - "$ref": "#/definitions/io.k8s.api.core.v1.Handler" - } - } - }, - "io.k8s.api.core.v1.LoadBalancerIngress": { - "description": "LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.", - "properties": { - "hostname": { - "description": "Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers)", - "type": "string" - }, - "ip": { - "description": "IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.LoadBalancerStatus": { - "description": "LoadBalancerStatus represents the status of a load-balancer.", - "properties": { - "ingress": { - "description": "Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.LoadBalancerIngress" - } - } - } - }, - "io.k8s.api.core.v1.LocalObjectReference": { - "description": "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.", - "properties": { - "name": { - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.NFSVolumeSource": { - "description": "Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.", - "required": [ - "server", - "path" - ], - "properties": { - "path": { - "description": "Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - "type": "string" - }, - "readOnly": { - "description": "ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - "type": "boolean" - }, - "server": { - "description": "Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.Namespace": { - "description": "Namespace provides a scope for Names. Use of multiple namespaces is optional.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - }, - "spec": { - "description": "Spec defines the behavior of the Namespace. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - "$ref": "#/definitions/io.k8s.api.core.v1.NamespaceSpec" - }, - "status": { - "description": "Status describes the current status of a Namespace. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - "$ref": "#/definitions/io.k8s.api.core.v1.NamespaceStatus" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "Namespace" - } - ] - }, - "io.k8s.api.core.v1.NamespaceList": { - "description": "NamespaceList is a list of Namespaces.", - "required": [ - "items" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "Items is the list of Namespace objects in the list. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.Namespace" - } - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "NamespaceList" - } - ] - }, - "io.k8s.api.core.v1.NamespaceSpec": { - "description": "NamespaceSpec describes the attributes on a Namespace.", - "properties": { - "finalizers": { - "description": "Finalizers is an opaque list of values that must be empty to permanently remove object from storage. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "io.k8s.api.core.v1.NamespaceStatus": { - "description": "NamespaceStatus is information about the current status of a Namespace.", - "properties": { - "phase": { - "description": "Phase is the current lifecycle phase of the namespace. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.NodeAffinity": { - "description": "Node affinity is a group of node affinity scheduling rules.", - "properties": { - "preferredDuringSchedulingIgnoredDuringExecution": { - "description": "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.PreferredSchedulingTerm" - } - }, - "requiredDuringSchedulingIgnoredDuringExecution": { - "description": "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.", - "$ref": "#/definitions/io.k8s.api.core.v1.NodeSelector" - } - } - }, - "io.k8s.api.core.v1.NodeSelector": { - "description": "A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.", - "required": [ - "nodeSelectorTerms" - ], - "properties": { - "nodeSelectorTerms": { - "description": "Required. A list of node selector terms. The terms are ORed.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.NodeSelectorTerm" - } - } - } - }, - "io.k8s.api.core.v1.NodeSelectorRequirement": { - "description": "A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", - "required": [ - "key", - "operator" - ], - "properties": { - "key": { - "description": "The label key that the selector applies to.", - "type": "string" - }, - "operator": { - "description": "Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.", - "type": "string" - }, - "values": { - "description": "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "io.k8s.api.core.v1.NodeSelectorTerm": { - "description": "A null or empty node selector term matches no objects.", - "required": [ - "matchExpressions" - ], - "properties": { - "matchExpressions": { - "description": "Required. A list of node selector requirements. The requirements are ANDed.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.NodeSelectorRequirement" - } - } - } - }, - "io.k8s.api.core.v1.ObjectFieldSelector": { - "description": "ObjectFieldSelector selects an APIVersioned field of an object.", - "required": [ - "fieldPath" - ], - "properties": { - "apiVersion": { - "description": "Version of the schema the FieldPath is written in terms of, defaults to \"v1\".", - "type": "string" - }, - "fieldPath": { - "description": "Path of the field to select in the specified API version.", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.ObjectReference": { - "description": "ObjectReference contains enough information to let you inspect or modify the referred object.", - "properties": { - "apiVersion": { - "description": "API version of the referent.", - "type": "string" - }, - "fieldPath": { - "description": "If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered the event) or if no container name is specified \"spec.containers[2]\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.", - "type": "string" - }, - "kind": { - "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "name": { - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - "type": "string" - }, - "namespace": { - "description": "Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/", - "type": "string" - }, - "resourceVersion": { - "description": "Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency", - "type": "string" - }, - "uid": { - "description": "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource": { - "description": "PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).", - "required": [ - "claimName" - ], - "properties": { - "claimName": { - "description": "ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - "type": "string" - }, - "readOnly": { - "description": "Will force the ReadOnly setting in VolumeMounts. Default false.", - "type": "boolean" - } - } - }, - "io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource": { - "description": "Represents a Photon Controller persistent disk resource.", - "required": [ - "pdID" - ], - "properties": { - "fsType": { - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - "type": "string" - }, - "pdID": { - "description": "ID that identifies Photon Controller persistent disk", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.PodAffinity": { - "description": "Pod affinity is a group of inter pod affinity scheduling rules.", - "properties": { - "preferredDuringSchedulingIgnoredDuringExecution": { - "description": "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.WeightedPodAffinityTerm" - } - }, - "requiredDuringSchedulingIgnoredDuringExecution": { - "description": "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.PodAffinityTerm" - } - } - } - }, - "io.k8s.api.core.v1.PodAffinityTerm": { - "description": "Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key \u003ctopologyKey\u003e matches that of any node on which a pod of the set of pods is running", - "properties": { - "labelSelector": { - "description": "A label query over a set of resources, in this case pods.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" - }, - "namespaces": { - "description": "namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means \"this pod's namespace\"", - "type": "array", - "items": { - "type": "string" - } - }, - "topologyKey": { - "description": "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. For PreferredDuringScheduling pod anti-affinity, empty topologyKey is interpreted as \"all topologies\" (\"all topologies\" here means all the topologyKeys indicated by scheduler command-line argument --failure-domains); for affinity and for RequiredDuringScheduling pod anti-affinity, empty topologyKey is not allowed.", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.PodAntiAffinity": { - "description": "Pod anti affinity is a group of inter pod anti affinity scheduling rules.", - "properties": { - "preferredDuringSchedulingIgnoredDuringExecution": { - "description": "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.WeightedPodAffinityTerm" - } - }, - "requiredDuringSchedulingIgnoredDuringExecution": { - "description": "If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.PodAffinityTerm" - } - } - } - }, - "io.k8s.api.core.v1.PodSecurityContext": { - "description": "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.", - "properties": { - "fsGroup": { - "description": "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume.", - "type": "integer", - "format": "int64" - }, - "runAsNonRoot": { - "description": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - "type": "boolean" - }, - "runAsUser": { - "description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.", - "type": "integer", - "format": "int64" - }, - "seLinuxOptions": { - "description": "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.", - "$ref": "#/definitions/io.k8s.api.core.v1.SELinuxOptions" - }, - "supplementalGroups": { - "description": "A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container.", - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - } - } - }, - "io.k8s.api.core.v1.PodSpec": { - "description": "PodSpec is a description of a pod.", - "required": [ - "containers" - ], - "properties": { - "activeDeadlineSeconds": { - "description": "Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.", - "type": "integer", - "format": "int64" - }, - "affinity": { - "description": "If specified, the pod's scheduling constraints", - "$ref": "#/definitions/io.k8s.api.core.v1.Affinity" - }, - "automountServiceAccountToken": { - "description": "AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.", - "type": "boolean" - }, - "containers": { - "description": "List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.Container" - }, - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge" - }, - "dnsPolicy": { - "description": "Set DNS policy for containers within the pod. One of 'ClusterFirstWithHostNet', 'ClusterFirst' or 'Default'. Defaults to \"ClusterFirst\". To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.", - "type": "string" - }, - "hostAliases": { - "description": "HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.HostAlias" - }, - "x-kubernetes-patch-merge-key": "ip", - "x-kubernetes-patch-strategy": "merge" - }, - "hostIPC": { - "description": "Use the host's ipc namespace. Optional: Default to false.", - "type": "boolean" - }, - "hostNetwork": { - "description": "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.", - "type": "boolean" - }, - "hostPID": { - "description": "Use the host's pid namespace. Optional: Default to false.", - "type": "boolean" - }, - "hostname": { - "description": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.", - "type": "string" - }, - "imagePullSecrets": { - "description": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference" - }, - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge" - }, - "initContainers": { - "description": "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, or Liveness probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.Container" - }, - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge" - }, - "nodeName": { - "description": "NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.", - "type": "string" - }, - "nodeSelector": { - "description": "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "priority": { - "description": "The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.", - "type": "integer", - "format": "int32" - }, - "priorityClassName": { - "description": "If specified, indicates the pod's priority. \"SYSTEM\" is a special keyword which indicates the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", - "type": "string" - }, - "restartPolicy": { - "description": "Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy", - "type": "string" - }, - "schedulerName": { - "description": "If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.", - "type": "string" - }, - "securityContext": { - "description": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.", - "$ref": "#/definitions/io.k8s.api.core.v1.PodSecurityContext" - }, - "serviceAccount": { - "description": "DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", - "type": "string" - }, - "serviceAccountName": { - "description": "ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", - "type": "string" - }, - "subdomain": { - "description": "If specified, the fully qualified Pod hostname will be \"\u003chostname\u003e.\u003csubdomain\u003e.\u003cpod namespace\u003e.svc.\u003ccluster domain\u003e\". If not specified, the pod will not have a domainname at all.", - "type": "string" - }, - "terminationGracePeriodSeconds": { - "description": "Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.", - "type": "integer", - "format": "int64" - }, - "tolerations": { - "description": "If specified, the pod's tolerations.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.Toleration" - } - }, - "volumes": { - "description": "List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.Volume" - }, - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge,retainKeys" - } - } - }, - "io.k8s.api.core.v1.PodTemplateSpec": { - "description": "PodTemplateSpec describes the data a pod should have when created from a template", - "properties": { - "metadata": { - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - }, - "spec": { - "description": "Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - "$ref": "#/definitions/io.k8s.api.core.v1.PodSpec" - } - } - }, - "io.k8s.api.core.v1.PortworxVolumeSource": { - "description": "PortworxVolumeSource represents a Portworx volume resource.", - "required": [ - "volumeID" - ], - "properties": { - "fsType": { - "description": "FSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.", - "type": "string" - }, - "readOnly": { - "description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - "type": "boolean" - }, - "volumeID": { - "description": "VolumeID uniquely identifies a Portworx volume", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.PreferredSchedulingTerm": { - "description": "An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).", - "required": [ - "weight", - "preference" - ], - "properties": { - "preference": { - "description": "A node selector term, associated with the corresponding weight.", - "$ref": "#/definitions/io.k8s.api.core.v1.NodeSelectorTerm" - }, - "weight": { - "description": "Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.", - "type": "integer", - "format": "int32" - } - } - }, - "io.k8s.api.core.v1.Probe": { - "description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.", - "properties": { - "exec": { - "description": "One and only one of the following should be specified. Exec specifies the action to take.", - "$ref": "#/definitions/io.k8s.api.core.v1.ExecAction" - }, - "failureThreshold": { - "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.", - "type": "integer", - "format": "int32" - }, - "httpGet": { - "description": "HTTPGet specifies the http request to perform.", - "$ref": "#/definitions/io.k8s.api.core.v1.HTTPGetAction" - }, - "initialDelaySeconds": { - "description": "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - "type": "integer", - "format": "int32" - }, - "periodSeconds": { - "description": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.", - "type": "integer", - "format": "int32" - }, - "successThreshold": { - "description": "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness. Minimum value is 1.", - "type": "integer", - "format": "int32" - }, - "tcpSocket": { - "description": "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported", - "$ref": "#/definitions/io.k8s.api.core.v1.TCPSocketAction" - }, - "timeoutSeconds": { - "description": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - "type": "integer", - "format": "int32" - } - } - }, - "io.k8s.api.core.v1.ProjectedVolumeSource": { - "description": "Represents a projected volume source", - "required": [ - "sources" - ], - "properties": { - "defaultMode": { - "description": "Mode bits to use on created files by default. Must be a value between 0 and 0777. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - "type": "integer", - "format": "int32" - }, - "sources": { - "description": "list of volume projections", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.VolumeProjection" - } - } - } - }, - "io.k8s.api.core.v1.QuobyteVolumeSource": { - "description": "Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.", - "required": [ - "registry", - "volume" - ], - "properties": { - "group": { - "description": "Group to map volume access to Default is no group", - "type": "string" - }, - "readOnly": { - "description": "ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.", - "type": "boolean" - }, - "registry": { - "description": "Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes", - "type": "string" - }, - "user": { - "description": "User to map volume access to Defaults to serivceaccount user", - "type": "string" - }, - "volume": { - "description": "Volume is a string that references an already created Quobyte volume by name.", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.RBDVolumeSource": { - "description": "Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.", - "required": [ - "monitors", - "image" - ], - "properties": { - "fsType": { - "description": "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd", - "type": "string" - }, - "image": { - "description": "The rados image name. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - "type": "string" - }, - "keyring": { - "description": "Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - "type": "string" - }, - "monitors": { - "description": "A collection of Ceph monitors. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - "type": "array", - "items": { - "type": "string" - } - }, - "pool": { - "description": "The rados pool name. Default is rbd. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - "type": "string" - }, - "readOnly": { - "description": "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - "type": "boolean" - }, - "secretRef": { - "description": "SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - "$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference" - }, - "user": { - "description": "The rados user name. Default is admin. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.ResourceFieldSelector": { - "description": "ResourceFieldSelector represents container resources (cpu, memory) and their output format", - "required": [ - "resource" - ], - "properties": { - "containerName": { - "description": "Container name: required for volumes, optional for env vars", - "type": "string" - }, - "divisor": { - "description": "Specifies the output format of the exposed resources, defaults to \"1\"", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity" - }, - "resource": { - "description": "Required: resource to select", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.ResourceRequirements": { - "description": "ResourceRequirements describes the compute resource requirements.", - "properties": { - "limits": { - "description": "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity" - } - }, - "requests": { - "description": "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity" - } - } - } - }, - "io.k8s.api.core.v1.SELinuxOptions": { - "description": "SELinuxOptions are the labels to be applied to the container", - "properties": { - "level": { - "description": "Level is SELinux level label that applies to the container.", - "type": "string" - }, - "role": { - "description": "Role is a SELinux role label that applies to the container.", - "type": "string" - }, - "type": { - "description": "Type is a SELinux type label that applies to the container.", - "type": "string" - }, - "user": { - "description": "User is a SELinux user label that applies to the container.", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.ScaleIOVolumeSource": { - "description": "ScaleIOVolumeSource represents a persistent ScaleIO volume", - "required": [ - "gateway", - "system", - "secretRef" - ], - "properties": { - "fsType": { - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - "type": "string" - }, - "gateway": { - "description": "The host address of the ScaleIO API Gateway.", - "type": "string" - }, - "protectionDomain": { - "description": "The name of the ScaleIO Protection Domain for the configured storage.", - "type": "string" - }, - "readOnly": { - "description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - "type": "boolean" - }, - "secretRef": { - "description": "SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.", - "$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference" - }, - "sslEnabled": { - "description": "Flag to enable/disable SSL communication with Gateway, default false", - "type": "boolean" - }, - "storageMode": { - "description": "Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.", - "type": "string" - }, - "storagePool": { - "description": "The ScaleIO Storage Pool associated with the protection domain.", - "type": "string" - }, - "system": { - "description": "The name of the storage system as configured in ScaleIO.", - "type": "string" - }, - "volumeName": { - "description": "The name of a volume already created in the ScaleIO system that is associated with this volume source.", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.Secret": { - "description": "Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "data": { - "description": "Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4", - "type": "object", - "additionalProperties": { - "type": "string", - "format": "byte" - } - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - }, - "stringData": { - "description": "stringData allows specifying non-binary secret data in string form. It is provided as a write-only convenience method. All keys and values are merged into the data field on write, overwriting any existing values. It is never output when reading from the API.", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "type": { - "description": "Used to facilitate programmatic handling of secret data.", - "type": "string" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "Secret" - } - ] - }, - "io.k8s.api.core.v1.SecretEnvSource": { - "description": "SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.", - "properties": { - "name": { - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - "type": "string" - }, - "optional": { - "description": "Specify whether the Secret must be defined", - "type": "boolean" - } - } - }, - "io.k8s.api.core.v1.SecretKeySelector": { - "description": "SecretKeySelector selects a key of a Secret.", - "required": [ - "key" - ], - "properties": { - "key": { - "description": "The key of the secret to select from. Must be a valid secret key.", - "type": "string" - }, - "name": { - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - "type": "string" - }, - "optional": { - "description": "Specify whether the Secret or it's key must be defined", - "type": "boolean" - } - } - }, - "io.k8s.api.core.v1.SecretList": { - "description": "SecretList is a list of Secret.", - "required": [ - "items" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "Items is a list of secret objects. More info: https://kubernetes.io/docs/concepts/configuration/secret", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.Secret" - } - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "SecretList" - } - ] - }, - "io.k8s.api.core.v1.SecretProjection": { - "description": "Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.", - "properties": { - "items": { - "description": "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.KeyToPath" - } - }, - "name": { - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - "type": "string" - }, - "optional": { - "description": "Specify whether the Secret or its key must be defined", - "type": "boolean" - } - } - }, - "io.k8s.api.core.v1.SecretVolumeSource": { - "description": "Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.", - "properties": { - "defaultMode": { - "description": "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - "type": "integer", - "format": "int32" - }, - "items": { - "description": "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.KeyToPath" - } - }, - "optional": { - "description": "Specify whether the Secret or it's keys must be defined", - "type": "boolean" - }, - "secretName": { - "description": "Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.SecurityContext": { - "description": "SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.", - "properties": { - "allowPrivilegeEscalation": { - "description": "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN", - "type": "boolean" - }, - "capabilities": { - "description": "The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime.", - "$ref": "#/definitions/io.k8s.api.core.v1.Capabilities" - }, - "privileged": { - "description": "Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false.", - "type": "boolean" - }, - "readOnlyRootFilesystem": { - "description": "Whether this container has a read-only root filesystem. Default is false.", - "type": "boolean" - }, - "runAsNonRoot": { - "description": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - "type": "boolean" - }, - "runAsUser": { - "description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - "type": "integer", - "format": "int64" - }, - "seLinuxOptions": { - "description": "The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - "$ref": "#/definitions/io.k8s.api.core.v1.SELinuxOptions" - } - } - }, - "io.k8s.api.core.v1.Service": { - "description": "Service is a named abstraction of software service (for example, mysql) consisting of local port (for example 3306) that the proxy listens on, and the selector that determines which pods will answer requests sent through the proxy.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - }, - "spec": { - "description": "Spec defines the behavior of a service. https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - "$ref": "#/definitions/io.k8s.api.core.v1.ServiceSpec" - }, - "status": { - "description": "Most recently observed status of the service. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - "$ref": "#/definitions/io.k8s.api.core.v1.ServiceStatus" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "Service" - } - ] - }, - "io.k8s.api.core.v1.ServiceList": { - "description": "ServiceList holds a list of services.", - "required": [ - "items" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "List of services", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.Service" - } - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "ServiceList" - } - ] - }, - "io.k8s.api.core.v1.ServicePort": { - "description": "ServicePort contains information on service's port.", - "required": [ - "port" - ], - "properties": { - "name": { - "description": "The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the 'Name' field in EndpointPort objects. Optional if only one ServicePort is defined on this service.", - "type": "string" - }, - "nodePort": { - "description": "The port on each node on which this service is exposed when type=NodePort or LoadBalancer. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one. More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport", - "type": "integer", - "format": "int32" - }, - "port": { - "description": "The port that will be exposed by this service.", - "type": "integer", - "format": "int32" - }, - "protocol": { - "description": "The IP protocol for this port. Supports \"TCP\" and \"UDP\". Default is TCP.", - "type": "string" - }, - "targetPort": { - "description": "Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod's container ports. If this is not specified, the value of the 'port' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the 'port' field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString" - } - } - }, - "io.k8s.api.core.v1.ServiceSpec": { - "description": "ServiceSpec describes the attributes that a user creates on a service.", - "properties": { - "clusterIP": { - "description": "clusterIP is the IP address of the service and is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. This field can not be changed through updates. Valid values are \"None\", empty string (\"\"), or a valid IP address. \"None\" can be specified for headless services when proxying is not required. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", - "type": "string" - }, - "externalIPs": { - "description": "externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system.", - "type": "array", - "items": { - "type": "string" - } - }, - "externalName": { - "description": "externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid DNS name and requires Type to be ExternalName.", - "type": "string" - }, - "externalTrafficPolicy": { - "description": "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.", - "type": "string" - }, - "healthCheckNodePort": { - "description": "healthCheckNodePort specifies the healthcheck nodePort for the service. If not specified, HealthCheckNodePort is created by the service api backend with the allocated nodePort. Will use user-specified nodePort value if specified by the client. Only effects when Type is set to LoadBalancer and ExternalTrafficPolicy is set to Local.", - "type": "integer", - "format": "int32" - }, - "loadBalancerIP": { - "description": "Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature.", - "type": "string" - }, - "loadBalancerSourceRanges": { - "description": "If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature.\" More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/", - "type": "array", - "items": { - "type": "string" - } - }, - "ports": { - "description": "The list of ports that are exposed by this service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.core.v1.ServicePort" - }, - "x-kubernetes-patch-merge-key": "port", - "x-kubernetes-patch-strategy": "merge" - }, - "publishNotReadyAddresses": { - "description": "publishNotReadyAddresses, when set to true, indicates that DNS implementations must publish the notReadyAddresses of subsets for the Endpoints associated with the Service. The default value is false. The primary use case for setting this field is to use a StatefulSet's Headless Service to propagate SRV records for its Pods without respect to their readiness for purpose of peer discovery. This field will replace the service.alpha.kubernetes.io/tolerate-unready-endpoints when that annotation is deprecated and all clients have been converted to use this field.", - "type": "boolean" - }, - "selector": { - "description": "Route service traffic to pods with label keys and values matching this selector. If empty or not present, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "sessionAffinity": { - "description": "Supports \"ClientIP\" and \"None\". Used to maintain session affinity. Enable client IP based session affinity. Must be ClientIP or None. Defaults to None. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", - "type": "string" - }, - "sessionAffinityConfig": { - "description": "sessionAffinityConfig contains the configurations of session affinity.", - "$ref": "#/definitions/io.k8s.api.core.v1.SessionAffinityConfig" - }, - "type": { - "description": "type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer. \"ExternalName\" maps to the specified externalName. \"ClusterIP\" allocates a cluster-internal IP address for load-balancing to endpoints. Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object. If clusterIP is \"None\", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a stable IP. \"NodePort\" builds on ClusterIP and allocates a port on every node which routes to the clusterIP. \"LoadBalancer\" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the clusterIP. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services---service-types", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.ServiceStatus": { - "description": "ServiceStatus represents the current status of a service.", - "properties": { - "loadBalancer": { - "description": "LoadBalancer contains the current status of the load-balancer, if one is present.", - "$ref": "#/definitions/io.k8s.api.core.v1.LoadBalancerStatus" - } - } - }, - "io.k8s.api.core.v1.SessionAffinityConfig": { - "description": "SessionAffinityConfig represents the configurations of session affinity.", - "properties": { - "clientIP": { - "description": "clientIP contains the configurations of Client IP based session affinity.", - "$ref": "#/definitions/io.k8s.api.core.v1.ClientIPConfig" - } - } - }, - "io.k8s.api.core.v1.StorageOSVolumeSource": { - "description": "Represents a StorageOS persistent volume resource.", - "properties": { - "fsType": { - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - "type": "string" - }, - "readOnly": { - "description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - "type": "boolean" - }, - "secretRef": { - "description": "SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.", - "$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference" - }, - "volumeName": { - "description": "VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.", - "type": "string" - }, - "volumeNamespace": { - "description": "VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.TCPSocketAction": { - "description": "TCPSocketAction describes an action based on opening a socket", - "required": [ - "port" - ], - "properties": { - "host": { - "description": "Optional: Host name to connect to, defaults to the pod IP.", - "type": "string" - }, - "port": { - "description": "Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString" - } - } - }, - "io.k8s.api.core.v1.Toleration": { - "description": "The pod this Toleration is attached to tolerates any taint that matches the triple \u003ckey,value,effect\u003e using the matching operator \u003coperator\u003e.", - "properties": { - "effect": { - "description": "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.", - "type": "string" - }, - "key": { - "description": "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.", - "type": "string" - }, - "operator": { - "description": "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.", - "type": "string" - }, - "tolerationSeconds": { - "description": "TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.", - "type": "integer", - "format": "int64" - }, - "value": { - "description": "Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.Volume": { - "description": "Volume represents a named volume in a pod that may be accessed by any container in the pod.", - "required": [ - "name" - ], - "properties": { - "awsElasticBlockStore": { - "description": "AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - "$ref": "#/definitions/io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource" - }, - "azureDisk": { - "description": "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", - "$ref": "#/definitions/io.k8s.api.core.v1.AzureDiskVolumeSource" - }, - "azureFile": { - "description": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - "$ref": "#/definitions/io.k8s.api.core.v1.AzureFileVolumeSource" - }, - "cephfs": { - "description": "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime", - "$ref": "#/definitions/io.k8s.api.core.v1.CephFSVolumeSource" - }, - "cinder": { - "description": "Cinder represents a cinder volume attached and mounted on kubelets host machine More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md", - "$ref": "#/definitions/io.k8s.api.core.v1.CinderVolumeSource" - }, - "configMap": { - "description": "ConfigMap represents a configMap that should populate this volume", - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMapVolumeSource" - }, - "downwardAPI": { - "description": "DownwardAPI represents downward API about the pod that should populate this volume", - "$ref": "#/definitions/io.k8s.api.core.v1.DownwardAPIVolumeSource" - }, - "emptyDir": { - "description": "EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", - "$ref": "#/definitions/io.k8s.api.core.v1.EmptyDirVolumeSource" - }, - "fc": { - "description": "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.", - "$ref": "#/definitions/io.k8s.api.core.v1.FCVolumeSource" - }, - "flexVolume": { - "description": "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future.", - "$ref": "#/definitions/io.k8s.api.core.v1.FlexVolumeSource" - }, - "flocker": { - "description": "Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running", - "$ref": "#/definitions/io.k8s.api.core.v1.FlockerVolumeSource" - }, - "gcePersistentDisk": { - "description": "GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - "$ref": "#/definitions/io.k8s.api.core.v1.GCEPersistentDiskVolumeSource" - }, - "gitRepo": { - "description": "GitRepo represents a git repository at a particular revision.", - "$ref": "#/definitions/io.k8s.api.core.v1.GitRepoVolumeSource" - }, - "glusterfs": { - "description": "Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md", - "$ref": "#/definitions/io.k8s.api.core.v1.GlusterfsVolumeSource" - }, - "hostPath": { - "description": "HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - "$ref": "#/definitions/io.k8s.api.core.v1.HostPathVolumeSource" - }, - "iscsi": { - "description": "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://releases.k8s.io/HEAD/examples/volumes/iscsi/README.md", - "$ref": "#/definitions/io.k8s.api.core.v1.ISCSIVolumeSource" - }, - "name": { - "description": "Volume's name. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - "type": "string" - }, - "nfs": { - "description": "NFS represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - "$ref": "#/definitions/io.k8s.api.core.v1.NFSVolumeSource" - }, - "persistentVolumeClaim": { - "description": "PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - "$ref": "#/definitions/io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource" - }, - "photonPersistentDisk": { - "description": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine", - "$ref": "#/definitions/io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource" - }, - "portworxVolume": { - "description": "PortworxVolume represents a portworx volume attached and mounted on kubelets host machine", - "$ref": "#/definitions/io.k8s.api.core.v1.PortworxVolumeSource" - }, - "projected": { - "description": "Items for all in one resources secrets, configmaps, and downward API", - "$ref": "#/definitions/io.k8s.api.core.v1.ProjectedVolumeSource" - }, - "quobyte": { - "description": "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime", - "$ref": "#/definitions/io.k8s.api.core.v1.QuobyteVolumeSource" - }, - "rbd": { - "description": "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md", - "$ref": "#/definitions/io.k8s.api.core.v1.RBDVolumeSource" - }, - "scaleIO": { - "description": "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.", - "$ref": "#/definitions/io.k8s.api.core.v1.ScaleIOVolumeSource" - }, - "secret": { - "description": "Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret", - "$ref": "#/definitions/io.k8s.api.core.v1.SecretVolumeSource" - }, - "storageos": { - "description": "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.", - "$ref": "#/definitions/io.k8s.api.core.v1.StorageOSVolumeSource" - }, - "vsphereVolume": { - "description": "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine", - "$ref": "#/definitions/io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource" - } - } - }, - "io.k8s.api.core.v1.VolumeMount": { - "description": "VolumeMount describes a mounting of a Volume within a container.", - "required": [ - "name", - "mountPath" - ], - "properties": { - "mountPath": { - "description": "Path within the container at which the volume should be mounted. Must not contain ':'.", - "type": "string" - }, - "mountPropagation": { - "description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release.", - "type": "string" - }, - "name": { - "description": "This must match the Name of a Volume.", - "type": "string" - }, - "readOnly": { - "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.", - "type": "boolean" - }, - "subPath": { - "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.VolumeProjection": { - "description": "Projection that may be projected along with other supported volume types", - "properties": { - "configMap": { - "description": "information about the configMap data to project", - "$ref": "#/definitions/io.k8s.api.core.v1.ConfigMapProjection" - }, - "downwardAPI": { - "description": "information about the downwardAPI data to project", - "$ref": "#/definitions/io.k8s.api.core.v1.DownwardAPIProjection" - }, - "secret": { - "description": "information about the secret data to project", - "$ref": "#/definitions/io.k8s.api.core.v1.SecretProjection" - } - } - }, - "io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource": { - "description": "Represents a vSphere volume resource.", - "required": [ - "volumePath" - ], - "properties": { - "fsType": { - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - "type": "string" - }, - "storagePolicyID": { - "description": "Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.", - "type": "string" - }, - "storagePolicyName": { - "description": "Storage Policy Based Management (SPBM) profile name.", - "type": "string" - }, - "volumePath": { - "description": "Path that identifies vSphere volume vmdk", - "type": "string" - } - } - }, - "io.k8s.api.core.v1.WeightedPodAffinityTerm": { - "description": "The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)", - "required": [ - "weight", - "podAffinityTerm" - ], - "properties": { - "podAffinityTerm": { - "description": "Required. A pod affinity term, associated with the corresponding weight.", - "$ref": "#/definitions/io.k8s.api.core.v1.PodAffinityTerm" - }, - "weight": { - "description": "weight associated with matching the corresponding podAffinityTerm, in the range 1-100.", - "type": "integer", - "format": "int32" - } - } - }, - "io.k8s.api.extensions.v1beta1.DaemonSet": { - "description": "DEPRECATED - This group version of DaemonSet is deprecated by apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - }, - "spec": { - "description": "The desired behavior of this daemon set. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSetSpec" - }, - "status": { - "description": "The current status of this daemon set. This data may be out of date by some window of time. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSetStatus" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSet" - } - ] - }, - "io.k8s.api.extensions.v1beta1.DaemonSetList": { - "description": "DaemonSetList is a collection of daemon sets.", - "required": [ - "items" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "A list of daemon sets.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSet" - } - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "extensions", - "version": "v1beta1", - "kind": "DaemonSetList" - } - ] - }, - "io.k8s.api.extensions.v1beta1.DaemonSetSpec": { - "description": "DaemonSetSpec is the specification of a daemon set.", - "required": [ - "template" - ], - "properties": { - "minReadySeconds": { - "description": "The minimum number of seconds for which a newly created DaemonSet pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready).", - "type": "integer", - "format": "int32" - }, - "revisionHistoryLimit": { - "description": "The number of old history to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10.", - "type": "integer", - "format": "int32" - }, - "selector": { - "description": "A label query over pods that are managed by the daemon set. Must match in order to be controlled. If empty, defaulted to labels on Pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" - }, - "template": { - "description": "An object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template's node selector (or on every node if no node selector is specified). More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template", - "$ref": "#/definitions/io.k8s.api.core.v1.PodTemplateSpec" - }, - "templateGeneration": { - "description": "DEPRECATED. A sequence number representing a specific generation of the template. Populated by the system. It can be set only during the creation.", - "type": "integer", - "format": "int64" - }, - "updateStrategy": { - "description": "An update strategy to replace existing DaemonSet pods with new pods.", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DaemonSetUpdateStrategy" - } - } - }, - "io.k8s.api.extensions.v1beta1.DaemonSetStatus": { - "description": "DaemonSetStatus represents the current status of a daemon set.", - "required": [ - "currentNumberScheduled", - "numberMisscheduled", - "desiredNumberScheduled", - "numberReady" - ], - "properties": { - "collisionCount": { - "description": "Count of hash collisions for the DaemonSet. The DaemonSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision.", - "type": "integer", - "format": "int32" - }, - "currentNumberScheduled": { - "description": "The number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", - "type": "integer", - "format": "int32" - }, - "desiredNumberScheduled": { - "description": "The total number of nodes that should be running the daemon pod (including nodes correctly running the daemon pod). More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", - "type": "integer", - "format": "int32" - }, - "numberAvailable": { - "description": "The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and available (ready for at least spec.minReadySeconds)", - "type": "integer", - "format": "int32" - }, - "numberMisscheduled": { - "description": "The number of nodes that are running the daemon pod, but are not supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/", - "type": "integer", - "format": "int32" - }, - "numberReady": { - "description": "The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and ready.", - "type": "integer", - "format": "int32" - }, - "numberUnavailable": { - "description": "The number of nodes that should be running the daemon pod and have none of the daemon pod running and available (ready for at least spec.minReadySeconds)", - "type": "integer", - "format": "int32" - }, - "observedGeneration": { - "description": "The most recent generation observed by the daemon set controller.", - "type": "integer", - "format": "int64" - }, - "updatedNumberScheduled": { - "description": "The total number of nodes that are running updated daemon pod", - "type": "integer", - "format": "int32" - } - } - }, - "io.k8s.api.extensions.v1beta1.DaemonSetUpdateStrategy": { - "properties": { - "rollingUpdate": { - "description": "Rolling update config params. Present only if type = \"RollingUpdate\".", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.RollingUpdateDaemonSet" - }, - "type": { - "description": "Type of daemon set update. Can be \"RollingUpdate\" or \"OnDelete\". Default is OnDelete.", - "type": "string" - } - } - }, - "io.k8s.api.extensions.v1beta1.Deployment": { - "description": "DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard object metadata.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - }, - "spec": { - "description": "Specification of the desired behavior of the Deployment.", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DeploymentSpec" - }, - "status": { - "description": "Most recently observed status of the Deployment.", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DeploymentStatus" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "extensions", - "version": "v1beta1", - "kind": "Deployment" - } - ] - }, - "io.k8s.api.extensions.v1beta1.DeploymentCondition": { - "description": "DeploymentCondition describes the state of a deployment at a certain point.", - "required": [ - "type", - "status" - ], - "properties": { - "lastTransitionTime": { - "description": "Last time the condition transitioned from one status to another.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" - }, - "lastUpdateTime": { - "description": "The last time this condition was updated.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" - }, - "message": { - "description": "A human readable message indicating details about the transition.", - "type": "string" - }, - "reason": { - "description": "The reason for the condition's last transition.", - "type": "string" - }, - "status": { - "description": "Status of the condition, one of True, False, Unknown.", - "type": "string" - }, - "type": { - "description": "Type of deployment condition.", - "type": "string" - } - } - }, - "io.k8s.api.extensions.v1beta1.DeploymentList": { - "description": "DeploymentList is a list of Deployments.", - "required": [ - "items" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "Items is the list of Deployments.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Deployment" - } - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard list metadata.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "extensions", - "version": "v1beta1", - "kind": "DeploymentList" - } - ] - }, - "io.k8s.api.extensions.v1beta1.DeploymentRollback": { - "description": "DEPRECATED. DeploymentRollback stores the information required to rollback a deployment.", - "required": [ - "name", - "rollbackTo" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "name": { - "description": "Required: This must match the Name of a deployment.", - "type": "string" - }, - "rollbackTo": { - "description": "The config of this deployment rollback.", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.RollbackConfig" - }, - "updatedAnnotations": { - "description": "The annotations to be updated to a deployment", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "extensions", - "version": "v1beta1", - "kind": "DeploymentRollback" - } - ] - }, - "io.k8s.api.extensions.v1beta1.DeploymentSpec": { - "description": "DeploymentSpec is the specification of the desired behavior of the Deployment.", - "required": [ - "template" - ], - "properties": { - "minReadySeconds": { - "description": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)", - "type": "integer", - "format": "int32" - }, - "paused": { - "description": "Indicates that the deployment is paused and will not be processed by the deployment controller.", - "type": "boolean" - }, - "progressDeadlineSeconds": { - "description": "The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. This is not set by default.", - "type": "integer", - "format": "int32" - }, - "replicas": { - "description": "Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.", - "type": "integer", - "format": "int32" - }, - "revisionHistoryLimit": { - "description": "The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified.", - "type": "integer", - "format": "int32" - }, - "rollbackTo": { - "description": "DEPRECATED. The config this deployment is rolling back to. Will be cleared after rollback is done.", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.RollbackConfig" - }, - "selector": { - "description": "Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" - }, - "strategy": { - "description": "The deployment strategy to use to replace existing pods with new ones.", - "x-kubernetes-patch-strategy": "retainKeys", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DeploymentStrategy" - }, - "template": { - "description": "Template describes the pods that will be created.", - "$ref": "#/definitions/io.k8s.api.core.v1.PodTemplateSpec" - } - } - }, - "io.k8s.api.extensions.v1beta1.DeploymentStatus": { - "description": "DeploymentStatus is the most recently observed status of the Deployment.", - "properties": { - "availableReplicas": { - "description": "Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.", - "type": "integer", - "format": "int32" - }, - "collisionCount": { - "description": "Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.", - "type": "integer", - "format": "int32" - }, - "conditions": { - "description": "Represents the latest available observations of a deployment's current state.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.DeploymentCondition" - }, - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge" - }, - "observedGeneration": { - "description": "The generation observed by the deployment controller.", - "type": "integer", - "format": "int64" - }, - "readyReplicas": { - "description": "Total number of ready pods targeted by this deployment.", - "type": "integer", - "format": "int32" - }, - "replicas": { - "description": "Total number of non-terminated pods targeted by this deployment (their labels match the selector).", - "type": "integer", - "format": "int32" - }, - "unavailableReplicas": { - "description": "Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.", - "type": "integer", - "format": "int32" - }, - "updatedReplicas": { - "description": "Total number of non-terminated pods targeted by this deployment that have the desired template spec.", - "type": "integer", - "format": "int32" - } - } - }, - "io.k8s.api.extensions.v1beta1.DeploymentStrategy": { - "description": "DeploymentStrategy describes how to replace existing pods with new ones.", - "properties": { - "rollingUpdate": { - "description": "Rolling update config params. Present only if DeploymentStrategyType = RollingUpdate.", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.RollingUpdateDeployment" - }, - "type": { - "description": "Type of deployment. Can be \"Recreate\" or \"RollingUpdate\". Default is RollingUpdate.", - "type": "string" - } - } - }, - "io.k8s.api.extensions.v1beta1.HTTPIngressPath": { - "description": "HTTPIngressPath associates a path regex with a backend. Incoming urls matching the path are forwarded to the backend.", - "required": [ - "backend" - ], - "properties": { - "backend": { - "description": "Backend defines the referenced service endpoint to which the traffic will be forwarded to.", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.IngressBackend" - }, - "path": { - "description": "Path is an extended POSIX regex as defined by IEEE Std 1003.1, (i.e this follows the egrep/unix syntax, not the perl syntax) matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional \"path\" part of a URL as defined by RFC 3986. Paths must begin with a '/'. If unspecified, the path defaults to a catch all sending traffic to the backend.", - "type": "string" - } - } - }, - "io.k8s.api.extensions.v1beta1.HTTPIngressRuleValue": { - "description": "HTTPIngressRuleValue is a list of http selectors pointing to backends. In the example: http://\u003chost\u003e/\u003cpath\u003e?\u003csearchpart\u003e -\u003e backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last '/' and before the first '?' or '#'.", - "required": [ - "paths" - ], - "properties": { - "paths": { - "description": "A collection of paths that map requests to backends.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.HTTPIngressPath" - } - } - } - }, - "io.k8s.api.extensions.v1beta1.Ingress": { - "description": "Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - }, - "spec": { - "description": "Spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.IngressSpec" - }, - "status": { - "description": "Status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.IngressStatus" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "extensions", - "version": "v1beta1", - "kind": "Ingress" - } - ] - }, - "io.k8s.api.extensions.v1beta1.IngressBackend": { - "description": "IngressBackend describes all endpoints for a given service and port.", - "required": [ - "serviceName", - "servicePort" - ], - "properties": { - "serviceName": { - "description": "Specifies the name of the referenced service.", - "type": "string" - }, - "servicePort": { - "description": "Specifies the port of the referenced service.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString" - } - } - }, - "io.k8s.api.extensions.v1beta1.IngressList": { - "description": "IngressList is a collection of Ingress.", - "required": [ - "items" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "Items is the list of Ingress.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.Ingress" - } - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "extensions", - "version": "v1beta1", - "kind": "IngressList" - } - ] - }, - "io.k8s.api.extensions.v1beta1.IngressRule": { - "description": "IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue.", - "properties": { - "host": { - "description": "Host is the fully qualified domain name of a network host, as defined by RFC 3986. Note the following deviations from the \"host\" part of the URI as defined in the RFC: 1. IPs are not allowed. Currently an IngressRuleValue can only apply to the\n\t IP in the Spec of the parent Ingress.\n2. The `:` delimiter is not respected because ports are not allowed.\n\t Currently the port of an Ingress is implicitly :80 for http and\n\t :443 for https.\nBoth these may change in the future. Incoming requests are matched against the host before the IngressRuleValue. If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue.", - "type": "string" - }, - "http": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.HTTPIngressRuleValue" - } - } - }, - "io.k8s.api.extensions.v1beta1.IngressSpec": { - "description": "IngressSpec describes the Ingress the user wishes to exist.", - "properties": { - "backend": { - "description": "A default backend capable of servicing requests that don't match any rule. At least one of 'backend' or 'rules' must be specified. This field is optional to allow the loadbalancer controller or defaulting logic to specify a global default.", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.IngressBackend" - }, - "rules": { - "description": "A list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.IngressRule" - } - }, - "tls": { - "description": "TLS configuration. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.IngressTLS" - } - } - } - }, - "io.k8s.api.extensions.v1beta1.IngressStatus": { - "description": "IngressStatus describe the current state of the Ingress.", - "properties": { - "loadBalancer": { - "description": "LoadBalancer contains the current status of the load-balancer.", - "$ref": "#/definitions/io.k8s.api.core.v1.LoadBalancerStatus" - } - } - }, - "io.k8s.api.extensions.v1beta1.IngressTLS": { - "description": "IngressTLS describes the transport layer security associated with an Ingress.", - "properties": { - "hosts": { - "description": "Hosts are a list of hosts included in the TLS certificate. The values in this list must match the name/s used in the tlsSecret. Defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress, if left unspecified.", - "type": "array", - "items": { - "type": "string" - } - }, - "secretName": { - "description": "SecretName is the name of the secret used to terminate SSL traffic on 443. Field is left optional to allow SSL routing based on SNI hostname alone. If the SNI host in a listener conflicts with the \"Host\" header field used by an IngressRule, the SNI host is used for termination and value of the Host header is used for routing.", - "type": "string" - } - } - }, - "io.k8s.api.extensions.v1beta1.ReplicaSet": { - "description": "DEPRECATED - This group version of ReplicaSet is deprecated by apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "If the Labels of a ReplicaSet are empty, they are defaulted to be the same as the Pod(s) that the ReplicaSet manages. Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - }, - "spec": { - "description": "Spec defines the specification of the desired behavior of the ReplicaSet. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSetSpec" - }, - "status": { - "description": "Status is the most recently observed status of the ReplicaSet. This data may be out of date by some window of time. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSetStatus" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSet" - } - ] - }, - "io.k8s.api.extensions.v1beta1.ReplicaSetCondition": { - "description": "ReplicaSetCondition describes the state of a replica set at a certain point.", - "required": [ - "type", - "status" - ], - "properties": { - "lastTransitionTime": { - "description": "The last time the condition transitioned from one status to another.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" - }, - "message": { - "description": "A human readable message indicating details about the transition.", - "type": "string" - }, - "reason": { - "description": "The reason for the condition's last transition.", - "type": "string" - }, - "status": { - "description": "Status of the condition, one of True, False, Unknown.", - "type": "string" - }, - "type": { - "description": "Type of replica set condition.", - "type": "string" - } - } - }, - "io.k8s.api.extensions.v1beta1.ReplicaSetList": { - "description": "ReplicaSetList is a collection of ReplicaSets.", - "required": [ - "items" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSet" - } - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "extensions", - "version": "v1beta1", - "kind": "ReplicaSetList" - } - ] - }, - "io.k8s.api.extensions.v1beta1.ReplicaSetSpec": { - "description": "ReplicaSetSpec is the specification of a ReplicaSet.", - "properties": { - "minReadySeconds": { - "description": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)", - "type": "integer", - "format": "int32" - }, - "replicas": { - "description": "Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller", - "type": "integer", - "format": "int32" - }, - "selector": { - "description": "Selector is a label query over pods that should match the replica count. If the selector is empty, it is defaulted to the labels present on the pod template. Label keys and values that must match in order to be controlled by this replica set. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" - }, - "template": { - "description": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template", - "$ref": "#/definitions/io.k8s.api.core.v1.PodTemplateSpec" - } - } - }, - "io.k8s.api.extensions.v1beta1.ReplicaSetStatus": { - "description": "ReplicaSetStatus represents the current status of a ReplicaSet.", - "required": [ - "replicas" - ], - "properties": { - "availableReplicas": { - "description": "The number of available replicas (ready for at least minReadySeconds) for this replica set.", - "type": "integer", - "format": "int32" - }, - "conditions": { - "description": "Represents the latest available observations of a replica set's current state.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ReplicaSetCondition" - }, - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge" - }, - "fullyLabeledReplicas": { - "description": "The number of pods that have labels matching the labels of the pod template of the replicaset.", - "type": "integer", - "format": "int32" - }, - "observedGeneration": { - "description": "ObservedGeneration reflects the generation of the most recently observed ReplicaSet.", - "type": "integer", - "format": "int64" - }, - "readyReplicas": { - "description": "The number of ready replicas for this replica set.", - "type": "integer", - "format": "int32" - }, - "replicas": { - "description": "Replicas is the most recently oberved number of replicas. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller", - "type": "integer", - "format": "int32" - } - } - }, - "io.k8s.api.extensions.v1beta1.RollbackConfig": { - "description": "DEPRECATED.", - "properties": { - "revision": { - "description": "The revision to rollback to. If set to 0, rollback to the last revision.", - "type": "integer", - "format": "int64" - } - } - }, - "io.k8s.api.extensions.v1beta1.RollingUpdateDaemonSet": { - "description": "Spec to control the desired behavior of daemon set rolling update.", - "properties": { - "maxUnavailable": { - "description": "The maximum number of DaemonSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of DaemonSet pods at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding up. This cannot be 0. Default value is 1. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their pods stopped for an update at any given time. The update starts by stopping at most 30% of those DaemonSet pods and then brings up new DaemonSet pods in their place. Once the new pods are available, it then proceeds onto other DaemonSet pods, thus ensuring that at least 70% of original number of DaemonSet pods are available at all times during the update.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString" - } - } - }, - "io.k8s.api.extensions.v1beta1.RollingUpdateDeployment": { - "description": "Spec to control the desired behavior of rolling update.", - "properties": { - "maxSurge": { - "description": "The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. By default, a value of 1 is used. Example: when this is set to 30%, the new RC can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new RC can be scaled up further, ensuring that total number of pods running at any time during the update is atmost 130% of desired pods.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString" - }, - "maxUnavailable": { - "description": "The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. By default, a fixed value of 1 is used. Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old RC can be scaled down further, followed by scaling up the new RC, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString" - } - } - }, - "io.k8s.api.extensions.v1beta1.Scale": { - "description": "represents a scaling request for a resource.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - }, - "spec": { - "description": "defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ScaleSpec" - }, - "status": { - "description": "current status of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status. Read-only.", - "$ref": "#/definitions/io.k8s.api.extensions.v1beta1.ScaleStatus" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "extensions", - "version": "v1beta1", - "kind": "Scale" - } - ] - }, - "io.k8s.api.extensions.v1beta1.ScaleSpec": { - "description": "describes the attributes of a scale subresource", - "properties": { - "replicas": { - "description": "desired number of instances for the scaled object.", - "type": "integer", - "format": "int32" - } - } - }, - "io.k8s.api.extensions.v1beta1.ScaleStatus": { - "description": "represents the current status of a scale subresource.", - "required": [ - "replicas" - ], - "properties": { - "replicas": { - "description": "actual number of observed instances of the scaled object.", - "type": "integer", - "format": "int32" - }, - "selector": { - "description": "label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "targetSelector": { - "description": "label selector for pods that should match the replicas count. This is a serializated version of both map-based and more expressive set-based selectors. This is done to avoid introspection in the clients. The string will be in the same format as the query-param syntax. If the target type only supports map-based selectors, both this field and map-based selector field are populated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", - "type": "string" - } - } - }, - "io.k8s.apimachinery.pkg.api.resource.Quantity": { - "type": "string" - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup": { - "description": "APIGroup contains the name, the supported versions, and the preferred version of a group.", - "required": [ - "name", - "versions", - "serverAddressByClientCIDRs" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "name": { - "description": "name is the name of the group.", - "type": "string" - }, - "preferredVersion": { - "description": "preferredVersion is the version preferred by the API server, which probably is the storage version.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionForDiscovery" - }, - "serverAddressByClientCIDRs": { - "description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ServerAddressByClientCIDR" - } - }, - "versions": { - "description": "versions are the versions supported in this group.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionForDiscovery" - } - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "APIGroup" - } - ] - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.APIGroupList": { - "description": "APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis.", - "required": [ - "groups" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "groups": { - "description": "groups is a list of APIGroup.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup" - } - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "APIGroupList" - } - ] - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.APIResource": { - "description": "APIResource specifies the name of a resource and whether it is namespaced.", - "required": [ - "name", - "singularName", - "namespaced", - "kind", - "verbs" - ], - "properties": { - "categories": { - "description": "categories is a list of the grouped resources this resource belongs to (e.g. 'all')", - "type": "array", - "items": { - "type": "string" - } - }, - "group": { - "description": "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".", - "type": "string" - }, - "kind": { - "description": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')", - "type": "string" - }, - "name": { - "description": "name is the plural name of the resource.", - "type": "string" - }, - "namespaced": { - "description": "namespaced indicates if a resource is namespaced or not.", - "type": "boolean" - }, - "shortNames": { - "description": "shortNames is a list of suggested short names of the resource.", - "type": "array", - "items": { - "type": "string" - } - }, - "singularName": { - "description": "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.", - "type": "string" - }, - "verbs": { - "description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)", - "type": "array", - "items": { - "type": "string" - } - }, - "version": { - "description": "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".", - "type": "string" - } - } - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList": { - "description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", - "required": [ - "groupVersion", - "resources" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "groupVersion": { - "description": "groupVersion is the group and version this APIResourceList is for.", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "resources": { - "description": "resources contains the name of the resources and if they are namespaced.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIResource" - } - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "APIResourceList" - } - ] - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.APIVersions": { - "description": "APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API.", - "required": [ - "versions", - "serverAddressByClientCIDRs" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "serverAddressByClientCIDRs": { - "description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ServerAddressByClientCIDR" - } - }, - "versions": { - "description": "versions are the api versions that are available.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "APIVersions" - } - ] - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions": { - "description": "DeleteOptions may be provided when deleting an API object.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "gracePeriodSeconds": { - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "type": "integer", - "format": "int64" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "orphanDependents": { - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "type": "boolean" - }, - "preconditions": { - "description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions" - }, - "propagationPolicy": { - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "type": "string" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "DeleteOptions" - }, - { - "group": "admission.k8s.io", - "version": "v1alpha1", - "kind": "DeleteOptions" - }, - { - "group": "admissionregistration.k8s.io", - "version": "v1alpha1", - "kind": "DeleteOptions" - }, - { - "group": "apps", - "version": "v1", - "kind": "DeleteOptions" - }, - { - "group": "apps", - "version": "v1beta1", - "kind": "DeleteOptions" - }, - { - "group": "apps", - "version": "v1beta2", - "kind": "DeleteOptions" - }, - { - "group": "authentication.k8s.io", - "version": "v1", - "kind": "DeleteOptions" - }, - { - "group": "authentication.k8s.io", - "version": "v1beta1", - "kind": "DeleteOptions" - }, - { - "group": "authorization.k8s.io", - "version": "v1", - "kind": "DeleteOptions" - }, - { - "group": "authorization.k8s.io", - "version": "v1beta1", - "kind": "DeleteOptions" - }, - { - "group": "autoscaling", - "version": "v1", - "kind": "DeleteOptions" - }, - { - "group": "autoscaling", - "version": "v2beta1", - "kind": "DeleteOptions" - }, - { - "group": "batch", - "version": "v1", - "kind": "DeleteOptions" - }, - { - "group": "batch", - "version": "v1beta1", - "kind": "DeleteOptions" - }, - { - "group": "batch", - "version": "v2alpha1", - "kind": "DeleteOptions" - }, - { - "group": "certificates.k8s.io", - "version": "v1beta1", - "kind": "DeleteOptions" - }, - { - "group": "extensions", - "version": "v1beta1", - "kind": "DeleteOptions" - }, - { - "group": "federation", - "version": "v1beta1", - "kind": "DeleteOptions" - }, - { - "group": "imagepolicy.k8s.io", - "version": "v1alpha1", - "kind": "DeleteOptions" - }, - { - "group": "networking.k8s.io", - "version": "v1", - "kind": "DeleteOptions" - }, - { - "group": "policy", - "version": "v1beta1", - "kind": "DeleteOptions" - }, - { - "group": "rbac.authorization.k8s.io", - "version": "v1", - "kind": "DeleteOptions" - }, - { - "group": "rbac.authorization.k8s.io", - "version": "v1alpha1", - "kind": "DeleteOptions" - }, - { - "group": "rbac.authorization.k8s.io", - "version": "v1beta1", - "kind": "DeleteOptions" - }, - { - "group": "scheduling.k8s.io", - "version": "v1alpha1", - "kind": "DeleteOptions" - }, - { - "group": "settings.k8s.io", - "version": "v1alpha1", - "kind": "DeleteOptions" - }, - { - "group": "storage.k8s.io", - "version": "v1", - "kind": "DeleteOptions" - }, - { - "group": "storage.k8s.io", - "version": "v1beta1", - "kind": "DeleteOptions" - } - ] - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionForDiscovery": { - "description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.", - "required": [ - "groupVersion", - "version" - ], - "properties": { - "groupVersion": { - "description": "groupVersion specifies the API group and version in the form \"group/version\"", - "type": "string" - }, - "version": { - "description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.", - "type": "string" - } - } - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.Initializer": { - "description": "Initializer is information about an initializer that has not yet completed.", - "required": [ - "name" - ], - "properties": { - "name": { - "description": "name of the process that is responsible for initializing this object.", - "type": "string" - } - } - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.Initializers": { - "description": "Initializers tracks the progress of initialization.", - "required": [ - "pending" - ], - "properties": { - "pending": { - "description": "Pending is a list of initializers that must execute in order before this object is visible. When the last pending initializer is removed, and no failing result is set, the initializers struct will be set to nil and the object is considered as initialized and visible to all clients.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Initializer" - }, - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge" - }, - "result": { - "description": "If result is set with the Failure field, the object will be persisted to storage and then deleted, ensuring that other clients can observe the deletion.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - } - } - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector": { - "description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", - "properties": { - "matchExpressions": { - "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement" - } - }, - "matchLabels": { - "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement": { - "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", - "required": [ - "key", - "operator" - ], - "properties": { - "key": { - "description": "key is the label key that the selector applies to.", - "type": "string", - "x-kubernetes-patch-merge-key": "key", - "x-kubernetes-patch-strategy": "merge" - }, - "operator": { - "description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.", - "type": "string" - }, - "values": { - "description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta": { - "description": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", - "properties": { - "continue": { - "description": "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response.", - "type": "string" - }, - "resourceVersion": { - "description": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency", - "type": "string" - }, - "selfLink": { - "description": "selfLink is a URL representing this object. Populated by the system. Read-only.", - "type": "string" - } - } - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta": { - "description": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", - "properties": { - "annotations": { - "description": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "clusterName": { - "description": "The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.", - "type": "string" - }, - "creationTimestamp": { - "description": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" - }, - "deletionGracePeriodSeconds": { - "description": "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.", - "type": "integer", - "format": "int64" - }, - "deletionTimestamp": { - "description": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field. Once set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" - }, - "finalizers": { - "description": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed.", - "type": "array", - "items": { - "type": "string" - }, - "x-kubernetes-patch-strategy": "merge" - }, - "generateName": { - "description": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency", - "type": "string" - }, - "generation": { - "description": "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.", - "type": "integer", - "format": "int64" - }, - "initializers": { - "description": "An initializer is a controller which enforces some system invariant at object creation time. This field is a list of initializers that have not yet acted on this object. If nil or empty, this object has been completely initialized. Otherwise, the object is considered uninitialized and is hidden (in list/watch and get calls) from clients that haven't explicitly asked to observe uninitialized objects.\n\nWhen an object is created, the system will populate this list with the current set of initializers. Only privileged users may set or modify this list. Once it is empty, it may not be modified further by any user.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Initializers" - }, - "labels": { - "description": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names", - "type": "string" - }, - "namespace": { - "description": "Namespace defines the space within each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces", - "type": "string" - }, - "ownerReferences": { - "description": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference" - }, - "x-kubernetes-patch-merge-key": "uid", - "x-kubernetes-patch-strategy": "merge" - }, - "resourceVersion": { - "description": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency", - "type": "string" - }, - "selfLink": { - "description": "SelfLink is a URL representing this object. Populated by the system. Read-only.", - "type": "string" - }, - "uid": { - "description": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids", - "type": "string" - } - } - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference": { - "description": "OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field.", - "required": [ - "apiVersion", - "kind", - "name", - "uid" - ], - "properties": { - "apiVersion": { - "description": "API version of the referent.", - "type": "string" - }, - "blockOwnerDeletion": { - "description": "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.", - "type": "boolean" - }, - "controller": { - "description": "If true, this reference points to the managing controller.", - "type": "boolean" - }, - "kind": { - "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "name": { - "description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names", - "type": "string" - }, - "uid": { - "description": "UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids", - "type": "string" - } - } - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.Patch": { - "description": "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body." - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions": { - "description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.", - "properties": { - "uid": { - "description": "Specifies the target UID.", - "type": "string" - } - } - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.ServerAddressByClientCIDR": { - "description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.", - "required": [ - "clientCIDR", - "serverAddress" - ], - "properties": { - "clientCIDR": { - "description": "The CIDR with which clients can match their IP to figure out the server address that they should use.", - "type": "string" - }, - "serverAddress": { - "description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.", - "type": "string" - } - } - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.Status": { - "description": "Status is a return value for calls that don't return other objects.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "code": { - "description": "Suggested HTTP return code for this status, 0 if not set.", - "type": "integer", - "format": "int32" - }, - "details": { - "description": "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "message": { - "description": "A human-readable description of the status of this operation.", - "type": "string" - }, - "metadata": { - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - }, - "reason": { - "description": "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.", - "type": "string" - }, - "status": { - "description": "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status", - "type": "string" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "Status" - } - ] - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause": { - "description": "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.", - "properties": { - "field": { - "description": "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"", - "type": "string" - }, - "message": { - "description": "A human-readable description of the cause of the error. This field may be presented as-is to a reader.", - "type": "string" - }, - "reason": { - "description": "A machine-readable description of the cause of the error. If this value is empty there is no information available.", - "type": "string" - } - } - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails": { - "description": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.", - "properties": { - "causes": { - "description": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause" - } - }, - "group": { - "description": "The group attribute of the resource associated with the status StatusReason.", - "type": "string" - }, - "kind": { - "description": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "name": { - "description": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).", - "type": "string" - }, - "retryAfterSeconds": { - "description": "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.", - "type": "integer", - "format": "int32" - }, - "uid": { - "description": "UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids", - "type": "string" - } - } - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.Time": { - "type": "string", - "format": "date-time" - }, - "io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent": { - "description": "Event represents a single event to a watched resource.", - "required": [ - "type", - "object" - ], - "properties": { - "object": { - "description": "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.runtime.RawExtension" - }, - "type": { - "type": "string" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "", - "version": "v1", - "kind": "WatchEvent" - }, - { - "group": "admission.k8s.io", - "version": "v1alpha1", - "kind": "WatchEvent" - }, - { - "group": "admissionregistration.k8s.io", - "version": "v1alpha1", - "kind": "WatchEvent" - }, - { - "group": "apps", - "version": "v1", - "kind": "WatchEvent" - }, - { - "group": "apps", - "version": "v1beta1", - "kind": "WatchEvent" - }, - { - "group": "apps", - "version": "v1beta2", - "kind": "WatchEvent" - }, - { - "group": "authentication.k8s.io", - "version": "v1", - "kind": "WatchEvent" - }, - { - "group": "authentication.k8s.io", - "version": "v1beta1", - "kind": "WatchEvent" - }, - { - "group": "authorization.k8s.io", - "version": "v1", - "kind": "WatchEvent" - }, - { - "group": "authorization.k8s.io", - "version": "v1beta1", - "kind": "WatchEvent" - }, - { - "group": "autoscaling", - "version": "v1", - "kind": "WatchEvent" - }, - { - "group": "autoscaling", - "version": "v2beta1", - "kind": "WatchEvent" - }, - { - "group": "batch", - "version": "v1", - "kind": "WatchEvent" - }, - { - "group": "batch", - "version": "v1beta1", - "kind": "WatchEvent" - }, - { - "group": "batch", - "version": "v2alpha1", - "kind": "WatchEvent" - }, - { - "group": "certificates.k8s.io", - "version": "v1beta1", - "kind": "WatchEvent" - }, - { - "group": "extensions", - "version": "v1beta1", - "kind": "WatchEvent" - }, - { - "group": "federation", - "version": "v1beta1", - "kind": "WatchEvent" - }, - { - "group": "imagepolicy.k8s.io", - "version": "v1alpha1", - "kind": "WatchEvent" - }, - { - "group": "networking.k8s.io", - "version": "v1", - "kind": "WatchEvent" - }, - { - "group": "policy", - "version": "v1beta1", - "kind": "WatchEvent" - }, - { - "group": "rbac.authorization.k8s.io", - "version": "v1", - "kind": "WatchEvent" - }, - { - "group": "rbac.authorization.k8s.io", - "version": "v1alpha1", - "kind": "WatchEvent" - }, - { - "group": "rbac.authorization.k8s.io", - "version": "v1beta1", - "kind": "WatchEvent" - }, - { - "group": "scheduling.k8s.io", - "version": "v1alpha1", - "kind": "WatchEvent" - }, - { - "group": "settings.k8s.io", - "version": "v1alpha1", - "kind": "WatchEvent" - }, - { - "group": "storage.k8s.io", - "version": "v1", - "kind": "WatchEvent" - }, - { - "group": "storage.k8s.io", - "version": "v1beta1", - "kind": "WatchEvent" - } - ] - }, - "io.k8s.apimachinery.pkg.runtime.RawExtension": { - "description": "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.Object `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// External package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// On the wire, the JSON will look something like this: {\n\t\"kind\":\"MyAPIObject\",\n\t\"apiVersion\":\"v1\",\n\t\"myPlugin\": {\n\t\t\"kind\":\"PluginA\",\n\t\t\"aOption\":\"foo\",\n\t},\n}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", - "required": [ - "Raw" - ], - "properties": { - "Raw": { - "description": "Raw is the underlying serialization of this object.", - "type": "string", - "format": "byte" - } - } - }, - "io.k8s.apimachinery.pkg.util.intstr.IntOrString": { - "type": "string", - "format": "int-or-string" - }, - "io.k8s.apimachinery.pkg.version.Info": { - "description": "Info contains versioning information. how we'll want to distribute that information.", - "required": [ - "major", - "minor", - "gitVersion", - "gitCommit", - "gitTreeState", - "buildDate", - "goVersion", - "compiler", - "platform" - ], - "properties": { - "buildDate": { - "type": "string" - }, - "compiler": { - "type": "string" - }, - "gitCommit": { - "type": "string" - }, - "gitTreeState": { - "type": "string" - }, - "gitVersion": { - "type": "string" - }, - "goVersion": { - "type": "string" - }, - "major": { - "type": "string" - }, - "minor": { - "type": "string" - }, - "platform": { - "type": "string" - } - } - }, - "io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster": { - "description": "Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.", - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - }, - "spec": { - "description": "Spec defines the behavior of the Cluster.", - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterSpec" - }, - "status": { - "description": "Status describes the current status of a Cluster", - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterStatus" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "federation", - "version": "v1beta1", - "kind": "Cluster" - } - ] - }, - "io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterCondition": { - "description": "ClusterCondition describes current state of a cluster.", - "required": [ - "type", - "status" - ], - "properties": { - "lastProbeTime": { - "description": "Last time the condition was checked.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" - }, - "lastTransitionTime": { - "description": "Last time the condition transit from one status to another.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" - }, - "message": { - "description": "Human readable message indicating details about last transition.", - "type": "string" - }, - "reason": { - "description": "(brief) reason for the condition's last transition.", - "type": "string" - }, - "status": { - "description": "Status of the condition, one of True, False, Unknown.", - "type": "string" - }, - "type": { - "description": "Type of cluster condition, Complete or Failed.", - "type": "string" - } - } - }, - "io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterList": { - "description": "A list of all the kubernetes clusters registered to the federation", - "required": [ - "items" - ], - "properties": { - "apiVersion": { - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - "type": "string" - }, - "items": { - "description": "List of Cluster objects.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster" - } - }, - "kind": { - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "type": "string" - }, - "metadata": { - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - } - }, - "x-kubernetes-group-version-kind": [ - { - "group": "federation", - "version": "v1beta1", - "kind": "ClusterList" - } - ] - }, - "io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterSpec": { - "description": "ClusterSpec describes the attributes of a kubernetes cluster.", - "required": [ - "serverAddressByClientCIDRs" - ], - "properties": { - "secretRef": { - "description": "Name of the secret containing kubeconfig to access this cluster. The secret is read from the kubernetes cluster that is hosting federation control plane. Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key \"kubeconfig\". This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets. This can be left empty if the cluster allows insecure access.", - "$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference" - }, - "serverAddressByClientCIDRs": { - "description": "A map of client CIDR to server address. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.ServerAddressByClientCIDR" - }, - "x-kubernetes-patch-merge-key": "clientCIDR", - "x-kubernetes-patch-strategy": "merge" - } - } - }, - "io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterStatus": { - "description": "ClusterStatus is information about the current status of a cluster updated by cluster controller periodically.", - "properties": { - "conditions": { - "description": "Conditions is an array of current cluster conditions.", - "type": "array", - "items": { - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterCondition" - } - }, - "region": { - "description": "Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.", - "type": "string" - }, - "zones": { - "description": "Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. These will always be in the same region.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "io.k8s.kubernetes.federation.apis.federation.v1beta1.ServerAddressByClientCIDR": { - "description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.", - "required": [ - "clientCIDR", - "serverAddress" - ], - "properties": { - "clientCIDR": { - "description": "The CIDR with which clients can match their IP to figure out the server address that they should use.", - "type": "string" - }, - "serverAddress": { - "description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.", - "type": "string" - } - } - }, - "resource.Quantity": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.api.resource.Quantity instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity" - }, - "runtime.RawExtension": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.runtime.RawExtension instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.runtime.RawExtension" - }, - "v1.APIGroup": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup" - }, - "v1.APIGroupList": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.APIGroupList instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIGroupList" - }, - "v1.APIResource": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.APIResource instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIResource" - }, - "v1.APIResourceList": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" - }, - "v1.APIVersions": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.APIVersions instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.APIVersions" - }, - "v1.DeleteOptions": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" - }, - "v1.GroupVersionForDiscovery": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionForDiscovery instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionForDiscovery" - }, - "v1.LabelSelector": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" - }, - "v1.LabelSelectorRequirement": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement" - }, - "v1.ListMeta": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" - }, - "v1.ObjectMeta": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" - }, - "v1.OwnerReference": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference" - }, - "v1.Patch": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.Patch instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - }, - "v1.Preconditions": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions" - }, - "v1.ServerAddressByClientCIDR": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.ServerAddressByClientCIDR instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ServerAddressByClientCIDR" - }, - "v1.Status": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.Status instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" - }, - "v1.StatusCause": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause" - }, - "v1.StatusDetails": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails" - }, - "v1.Time": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.Time instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time" - }, - "v1.WatchEvent": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" - }, - "v1beta1.Cluster": { - "description": "Deprecated. Please use io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster instead.", - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster" - }, - "v1beta1.ClusterCondition": { - "description": "Deprecated. Please use io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterCondition instead.", - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterCondition" - }, - "v1beta1.ClusterList": { - "description": "Deprecated. Please use io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterList instead.", - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterList" - }, - "v1beta1.ClusterSpec": { - "description": "Deprecated. Please use io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterSpec instead.", - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterSpec" - }, - "v1beta1.ClusterStatus": { - "description": "Deprecated. Please use io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterStatus instead.", - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterStatus" - }, - "v1beta1.ServerAddressByClientCIDR": { - "description": "Deprecated. Please use io.k8s.kubernetes.federation.apis.federation.v1beta1.ServerAddressByClientCIDR instead.", - "$ref": "#/definitions/io.k8s.kubernetes.federation.apis.federation.v1beta1.ServerAddressByClientCIDR" - }, - "version.Info": { - "description": "Deprecated. Please use io.k8s.apimachinery.pkg.version.Info instead.", - "$ref": "#/definitions/io.k8s.apimachinery.pkg.version.Info" - } - }, - "securityDefinitions": { - "BearerToken": { - "description": "Bearer Token authentication", - "type": "apiKey", - "name": "authorization", - "in": "header" - } - }, - "security": [ - { - "BearerToken": [] - } - ] - } diff --git a/federation/apis/swagger-spec/api.json b/federation/apis/swagger-spec/api.json deleted file mode 100644 index 3897ab506c..0000000000 --- a/federation/apis/swagger-spec/api.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "swaggerVersion": "1.2", - "apiVersion": "", - "basePath": "https://10.10.10.10:6443", - "resourcePath": "/api", - "info": { - "title": "", - "description": "" - }, - "apis": [ - { - "path": "/api", - "description": "get available API versions", - "operations": [ - { - "type": "v1.APIVersions", - "method": "GET", - "summary": "get available API versions", - "nickname": "getAPIVersions", - "parameters": [], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ] - } - ] - } - ], - "models": { - "v1.APIVersions": { - "id": "v1.APIVersions", - "description": "APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API.", - "required": [ - "versions", - "serverAddressByClientCIDRs" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "versions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "versions are the api versions that are available." - }, - "serverAddressByClientCIDRs": { - "type": "array", - "items": { - "$ref": "v1.ServerAddressByClientCIDR" - }, - "description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP." - } - } - }, - "v1.ServerAddressByClientCIDR": { - "id": "v1.ServerAddressByClientCIDR", - "description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.", - "required": [ - "clientCIDR", - "serverAddress" - ], - "properties": { - "clientCIDR": { - "type": "string", - "description": "The CIDR with which clients can match their IP to figure out the server address that they should use." - }, - "serverAddress": { - "type": "string", - "description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port." - } - } - } - } - } diff --git a/federation/apis/swagger-spec/apis.json b/federation/apis/swagger-spec/apis.json deleted file mode 100644 index 18d960ca59..0000000000 --- a/federation/apis/swagger-spec/apis.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "swaggerVersion": "1.2", - "apiVersion": "", - "basePath": "https://10.10.10.10:6443", - "resourcePath": "/apis", - "info": { - "title": "", - "description": "" - }, - "apis": [ - { - "path": "/apis", - "description": "get available API versions", - "operations": [ - { - "type": "v1.APIGroupList", - "method": "GET", - "summary": "get available API versions", - "nickname": "getAPIVersions", - "parameters": [], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ] - } - ] - } - ], - "models": { - "v1.APIGroupList": { - "id": "v1.APIGroupList", - "description": "APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis.", - "required": [ - "groups" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "groups": { - "type": "array", - "items": { - "$ref": "v1.APIGroup" - }, - "description": "groups is a list of APIGroup." - } - } - }, - "v1.APIGroup": { - "id": "v1.APIGroup", - "description": "APIGroup contains the name, the supported versions, and the preferred version of a group.", - "required": [ - "name", - "versions", - "serverAddressByClientCIDRs" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "name": { - "type": "string", - "description": "name is the name of the group." - }, - "versions": { - "type": "array", - "items": { - "$ref": "v1.GroupVersionForDiscovery" - }, - "description": "versions are the versions supported in this group." - }, - "preferredVersion": { - "$ref": "v1.GroupVersionForDiscovery", - "description": "preferredVersion is the version preferred by the API server, which probably is the storage version." - }, - "serverAddressByClientCIDRs": { - "type": "array", - "items": { - "$ref": "v1.ServerAddressByClientCIDR" - }, - "description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP." - } - } - }, - "v1.GroupVersionForDiscovery": { - "id": "v1.GroupVersionForDiscovery", - "description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.", - "required": [ - "groupVersion", - "version" - ], - "properties": { - "groupVersion": { - "type": "string", - "description": "groupVersion specifies the API group and version in the form \"group/version\"" - }, - "version": { - "type": "string", - "description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion." - } - } - }, - "v1.ServerAddressByClientCIDR": { - "id": "v1.ServerAddressByClientCIDR", - "description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.", - "required": [ - "clientCIDR", - "serverAddress" - ], - "properties": { - "clientCIDR": { - "type": "string", - "description": "The CIDR with which clients can match their IP to figure out the server address that they should use." - }, - "serverAddress": { - "type": "string", - "description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port." - } - } - } - } - } diff --git a/federation/apis/swagger-spec/extensions.json b/federation/apis/swagger-spec/extensions.json deleted file mode 100644 index 2e2fc1afd9..0000000000 --- a/federation/apis/swagger-spec/extensions.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "swaggerVersion": "1.2", - "apiVersion": "", - "basePath": "https://10.10.10.10:6443", - "resourcePath": "/apis/extensions", - "info": { - "title": "", - "description": "" - }, - "apis": [ - { - "path": "/apis/extensions", - "description": "get information of a group", - "operations": [ - { - "type": "v1.APIGroup", - "method": "GET", - "summary": "get information of a group", - "nickname": "getAPIGroup", - "parameters": [], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ] - } - ] - } - ], - "models": { - "v1.APIGroup": { - "id": "v1.APIGroup", - "description": "APIGroup contains the name, the supported versions, and the preferred version of a group.", - "required": [ - "name", - "versions", - "serverAddressByClientCIDRs" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "name": { - "type": "string", - "description": "name is the name of the group." - }, - "versions": { - "type": "array", - "items": { - "$ref": "v1.GroupVersionForDiscovery" - }, - "description": "versions are the versions supported in this group." - }, - "preferredVersion": { - "$ref": "v1.GroupVersionForDiscovery", - "description": "preferredVersion is the version preferred by the API server, which probably is the storage version." - }, - "serverAddressByClientCIDRs": { - "type": "array", - "items": { - "$ref": "v1.ServerAddressByClientCIDR" - }, - "description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP." - } - } - }, - "v1.GroupVersionForDiscovery": { - "id": "v1.GroupVersionForDiscovery", - "description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.", - "required": [ - "groupVersion", - "version" - ], - "properties": { - "groupVersion": { - "type": "string", - "description": "groupVersion specifies the API group and version in the form \"group/version\"" - }, - "version": { - "type": "string", - "description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion." - } - } - }, - "v1.ServerAddressByClientCIDR": { - "id": "v1.ServerAddressByClientCIDR", - "description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.", - "required": [ - "clientCIDR", - "serverAddress" - ], - "properties": { - "clientCIDR": { - "type": "string", - "description": "The CIDR with which clients can match their IP to figure out the server address that they should use." - }, - "serverAddress": { - "type": "string", - "description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port." - } - } - } - } - } diff --git a/federation/apis/swagger-spec/extensions_v1beta1.json b/federation/apis/swagger-spec/extensions_v1beta1.json deleted file mode 100644 index b5ee252289..0000000000 --- a/federation/apis/swagger-spec/extensions_v1beta1.json +++ /dev/null @@ -1,8283 +0,0 @@ -{ - "swaggerVersion": "1.2", - "apiVersion": "extensions/v1beta1", - "basePath": "https://10.10.10.10:6443", - "resourcePath": "/apis/extensions/v1beta1", - "info": { - "title": "", - "description": "" - }, - "apis": [ - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.DaemonSetList", - "method": "GET", - "summary": "list or watch objects of kind DaemonSet", - "nickname": "listNamespacedDaemonSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.DaemonSetList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.DaemonSet", - "method": "POST", - "summary": "create a DaemonSet", - "nickname": "createNamespacedDaemonSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.DaemonSet", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.DaemonSet" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.DaemonSet" - }, - { - "code": 202, - "message": "Accepted", - "responseModel": "v1beta1.DaemonSet" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete collection of DaemonSet", - "nickname": "deletecollectionNamespacedDaemonSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of DaemonSet", - "nickname": "watchNamespacedDaemonSetList", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.DaemonSet", - "method": "GET", - "summary": "read the specified DaemonSet", - "nickname": "readNamespacedDaemonSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "export", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "exact", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the DaemonSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.DaemonSet" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.DaemonSet", - "method": "PUT", - "summary": "replace the specified DaemonSet", - "nickname": "replaceNamespacedDaemonSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.DaemonSet", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the DaemonSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.DaemonSet" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.DaemonSet" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.DaemonSet", - "method": "PATCH", - "summary": "partially update the specified DaemonSet", - "nickname": "patchNamespacedDaemonSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the DaemonSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.DaemonSet" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete a DaemonSet", - "nickname": "deleteNamespacedDaemonSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.DeleteOptions", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "gracePeriodSeconds", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "orphanDependents", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "propagationPolicy", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the DaemonSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch changes to an object of kind DaemonSet", - "nickname": "watchNamespacedDaemonSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the DaemonSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/daemonsets", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.DaemonSetList", - "method": "GET", - "summary": "list or watch objects of kind DaemonSet", - "nickname": "listDaemonSetForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.DaemonSetList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/watch/daemonsets", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of DaemonSet", - "nickname": "watchDaemonSetListForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.DaemonSet", - "method": "GET", - "summary": "read status of the specified DaemonSet", - "nickname": "readNamespacedDaemonSetStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the DaemonSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.DaemonSet" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.DaemonSet", - "method": "PUT", - "summary": "replace status of the specified DaemonSet", - "nickname": "replaceNamespacedDaemonSetStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.DaemonSet", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the DaemonSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.DaemonSet" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.DaemonSet" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.DaemonSet", - "method": "PATCH", - "summary": "partially update status of the specified DaemonSet", - "nickname": "patchNamespacedDaemonSetStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the DaemonSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.DaemonSet" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/deployments", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.DeploymentList", - "method": "GET", - "summary": "list or watch objects of kind Deployment", - "nickname": "listNamespacedDeployment", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.DeploymentList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Deployment", - "method": "POST", - "summary": "create a Deployment", - "nickname": "createNamespacedDeployment", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.Deployment", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Deployment" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.Deployment" - }, - { - "code": 202, - "message": "Accepted", - "responseModel": "v1beta1.Deployment" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete collection of Deployment", - "nickname": "deletecollectionNamespacedDeployment", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of Deployment", - "nickname": "watchNamespacedDeploymentList", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.Deployment", - "method": "GET", - "summary": "read the specified Deployment", - "nickname": "readNamespacedDeployment", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "export", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "exact", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Deployment", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Deployment" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Deployment", - "method": "PUT", - "summary": "replace the specified Deployment", - "nickname": "replaceNamespacedDeployment", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.Deployment", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Deployment", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Deployment" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.Deployment" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Deployment", - "method": "PATCH", - "summary": "partially update the specified Deployment", - "nickname": "patchNamespacedDeployment", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Deployment", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Deployment" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete a Deployment", - "nickname": "deleteNamespacedDeployment", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.DeleteOptions", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "gracePeriodSeconds", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "orphanDependents", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "propagationPolicy", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Deployment", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch changes to an object of kind Deployment", - "nickname": "watchNamespacedDeployment", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Deployment", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/deployments", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.DeploymentList", - "method": "GET", - "summary": "list or watch objects of kind Deployment", - "nickname": "listDeploymentForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.DeploymentList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/watch/deployments", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of Deployment", - "nickname": "watchDeploymentListForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.DeploymentRollback", - "method": "POST", - "summary": "create rollback of a Deployment", - "nickname": "createNamespacedDeploymentRollback", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.DeploymentRollback", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the DeploymentRollback", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.DeploymentRollback" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.DeploymentRollback" - }, - { - "code": 202, - "message": "Accepted", - "responseModel": "v1beta1.DeploymentRollback" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.Scale", - "method": "GET", - "summary": "read scale of the specified Deployment", - "nickname": "readNamespacedDeploymentScale", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Scale", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Scale" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Scale", - "method": "PUT", - "summary": "replace scale of the specified Deployment", - "nickname": "replaceNamespacedDeploymentScale", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.Scale", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Scale", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Scale" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.Scale" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Scale", - "method": "PATCH", - "summary": "partially update scale of the specified Deployment", - "nickname": "patchNamespacedDeploymentScale", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Scale", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Scale" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.Deployment", - "method": "GET", - "summary": "read status of the specified Deployment", - "nickname": "readNamespacedDeploymentStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Deployment", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Deployment" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Deployment", - "method": "PUT", - "summary": "replace status of the specified Deployment", - "nickname": "replaceNamespacedDeploymentStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.Deployment", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Deployment", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Deployment" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.Deployment" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Deployment", - "method": "PATCH", - "summary": "partially update status of the specified Deployment", - "nickname": "patchNamespacedDeploymentStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Deployment", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Deployment" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.IngressList", - "method": "GET", - "summary": "list or watch objects of kind Ingress", - "nickname": "listNamespacedIngress", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.IngressList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Ingress", - "method": "POST", - "summary": "create an Ingress", - "nickname": "createNamespacedIngress", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.Ingress", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Ingress" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.Ingress" - }, - { - "code": 202, - "message": "Accepted", - "responseModel": "v1beta1.Ingress" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete collection of Ingress", - "nickname": "deletecollectionNamespacedIngress", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of Ingress", - "nickname": "watchNamespacedIngressList", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.Ingress", - "method": "GET", - "summary": "read the specified Ingress", - "nickname": "readNamespacedIngress", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "export", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "exact", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Ingress", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Ingress" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Ingress", - "method": "PUT", - "summary": "replace the specified Ingress", - "nickname": "replaceNamespacedIngress", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.Ingress", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Ingress", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Ingress" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.Ingress" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Ingress", - "method": "PATCH", - "summary": "partially update the specified Ingress", - "nickname": "patchNamespacedIngress", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Ingress", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Ingress" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete an Ingress", - "nickname": "deleteNamespacedIngress", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.DeleteOptions", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "gracePeriodSeconds", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "orphanDependents", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "propagationPolicy", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Ingress", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch changes to an object of kind Ingress", - "nickname": "watchNamespacedIngress", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Ingress", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/ingresses", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.IngressList", - "method": "GET", - "summary": "list or watch objects of kind Ingress", - "nickname": "listIngressForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.IngressList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/watch/ingresses", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of Ingress", - "nickname": "watchIngressListForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.Ingress", - "method": "GET", - "summary": "read status of the specified Ingress", - "nickname": "readNamespacedIngressStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Ingress", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Ingress" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Ingress", - "method": "PUT", - "summary": "replace status of the specified Ingress", - "nickname": "replaceNamespacedIngressStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.Ingress", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Ingress", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Ingress" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.Ingress" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Ingress", - "method": "PATCH", - "summary": "partially update status of the specified Ingress", - "nickname": "patchNamespacedIngressStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Ingress", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Ingress" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.ReplicaSetList", - "method": "GET", - "summary": "list or watch objects of kind ReplicaSet", - "nickname": "listNamespacedReplicaSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.ReplicaSetList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.ReplicaSet", - "method": "POST", - "summary": "create a ReplicaSet", - "nickname": "createNamespacedReplicaSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.ReplicaSet", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.ReplicaSet" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.ReplicaSet" - }, - { - "code": 202, - "message": "Accepted", - "responseModel": "v1beta1.ReplicaSet" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete collection of ReplicaSet", - "nickname": "deletecollectionNamespacedReplicaSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of ReplicaSet", - "nickname": "watchNamespacedReplicaSetList", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.ReplicaSet", - "method": "GET", - "summary": "read the specified ReplicaSet", - "nickname": "readNamespacedReplicaSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "export", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "exact", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the ReplicaSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.ReplicaSet" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.ReplicaSet", - "method": "PUT", - "summary": "replace the specified ReplicaSet", - "nickname": "replaceNamespacedReplicaSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.ReplicaSet", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the ReplicaSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.ReplicaSet" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.ReplicaSet" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.ReplicaSet", - "method": "PATCH", - "summary": "partially update the specified ReplicaSet", - "nickname": "patchNamespacedReplicaSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the ReplicaSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.ReplicaSet" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete a ReplicaSet", - "nickname": "deleteNamespacedReplicaSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.DeleteOptions", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "gracePeriodSeconds", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "orphanDependents", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "propagationPolicy", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the ReplicaSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch changes to an object of kind ReplicaSet", - "nickname": "watchNamespacedReplicaSet", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the ReplicaSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/replicasets", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.ReplicaSetList", - "method": "GET", - "summary": "list or watch objects of kind ReplicaSet", - "nickname": "listReplicaSetForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.ReplicaSetList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/watch/replicasets", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of ReplicaSet", - "nickname": "watchReplicaSetListForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.Scale", - "method": "GET", - "summary": "read scale of the specified ReplicaSet", - "nickname": "readNamespacedReplicaSetScale", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Scale", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Scale" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Scale", - "method": "PUT", - "summary": "replace scale of the specified ReplicaSet", - "nickname": "replaceNamespacedReplicaSetScale", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.Scale", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Scale", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Scale" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.Scale" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Scale", - "method": "PATCH", - "summary": "partially update scale of the specified ReplicaSet", - "nickname": "patchNamespacedReplicaSetScale", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Scale", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Scale" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1beta1.ReplicaSet", - "method": "GET", - "summary": "read status of the specified ReplicaSet", - "nickname": "readNamespacedReplicaSetStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the ReplicaSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.ReplicaSet" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.ReplicaSet", - "method": "PUT", - "summary": "replace status of the specified ReplicaSet", - "nickname": "replaceNamespacedReplicaSetStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.ReplicaSet", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the ReplicaSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.ReplicaSet" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.ReplicaSet" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.ReplicaSet", - "method": "PATCH", - "summary": "partially update status of the specified ReplicaSet", - "nickname": "patchNamespacedReplicaSetStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the ReplicaSet", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.ReplicaSet" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - } - ] - }, - { - "path": "/apis/extensions/v1beta1", - "description": "API at /apis/extensions/v1beta1", - "operations": [ - { - "type": "v1.APIResourceList", - "method": "GET", - "summary": "get available resources", - "nickname": "getAPIResources", - "parameters": [], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ] - } - ] - } - ], - "models": { - "v1beta1.DaemonSetList": { - "id": "v1beta1.DaemonSetList", - "description": "DaemonSetList is a collection of daemon sets.", - "required": [ - "items" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ListMeta", - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "items": { - "type": "array", - "items": { - "$ref": "v1beta1.DaemonSet" - }, - "description": "A list of daemon sets." - } - } - }, - "v1.ListMeta": { - "id": "v1.ListMeta", - "description": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", - "properties": { - "selfLink": { - "type": "string", - "description": "selfLink is a URL representing this object. Populated by the system. Read-only." - }, - "resourceVersion": { - "type": "string", - "description": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" - }, - "continue": { - "type": "string", - "description": "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response." - } - } - }, - "v1beta1.DaemonSet": { - "id": "v1beta1.DaemonSet", - "description": "DEPRECATED - This group version of DaemonSet is deprecated by apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ObjectMeta", - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "spec": { - "$ref": "v1beta1.DaemonSetSpec", - "description": "The desired behavior of this daemon set. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status" - }, - "status": { - "$ref": "v1beta1.DaemonSetStatus", - "description": "The current status of this daemon set. This data may be out of date by some window of time. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status" - } - } - }, - "v1.ObjectMeta": { - "id": "v1.ObjectMeta", - "description": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", - "properties": { - "name": { - "type": "string", - "description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names" - }, - "generateName": { - "type": "string", - "description": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - }, - "namespace": { - "type": "string", - "description": "Namespace defines the space within each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" - }, - "selfLink": { - "type": "string", - "description": "SelfLink is a URL representing this object. Populated by the system. Read-only." - }, - "uid": { - "type": "string", - "description": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - }, - "resourceVersion": { - "type": "string", - "description": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" - }, - "generation": { - "type": "integer", - "format": "int64", - "description": "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only." - }, - "creationTimestamp": { - "type": "string", - "description": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "deletionTimestamp": { - "type": "string", - "description": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field. Once set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "deletionGracePeriodSeconds": { - "type": "integer", - "format": "int64", - "description": "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only." - }, - "labels": { - "type": "object", - "description": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels" - }, - "annotations": { - "type": "object", - "description": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations" - }, - "ownerReferences": { - "type": "array", - "items": { - "$ref": "v1.OwnerReference" - }, - "description": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller." - }, - "initializers": { - "$ref": "v1.Initializers", - "description": "An initializer is a controller which enforces some system invariant at object creation time. This field is a list of initializers that have not yet acted on this object. If nil or empty, this object has been completely initialized. Otherwise, the object is considered uninitialized and is hidden (in list/watch and get calls) from clients that haven't explicitly asked to observe uninitialized objects.\n\nWhen an object is created, the system will populate this list with the current set of initializers. Only privileged users may set or modify this list. Once it is empty, it may not be modified further by any user." - }, - "finalizers": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed." - }, - "clusterName": { - "type": "string", - "description": "The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request." - } - } - }, - "v1.OwnerReference": { - "id": "v1.OwnerReference", - "description": "OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field.", - "required": [ - "apiVersion", - "kind", - "name", - "uid" - ], - "properties": { - "apiVersion": { - "type": "string", - "description": "API version of the referent." - }, - "kind": { - "type": "string", - "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "name": { - "type": "string", - "description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names" - }, - "uid": { - "type": "string", - "description": "UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - }, - "controller": { - "type": "boolean", - "description": "If true, this reference points to the managing controller." - }, - "blockOwnerDeletion": { - "type": "boolean", - "description": "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned." - } - } - }, - "v1.Initializers": { - "id": "v1.Initializers", - "description": "Initializers tracks the progress of initialization.", - "required": [ - "pending" - ], - "properties": { - "pending": { - "type": "array", - "items": { - "$ref": "v1.Initializer" - }, - "description": "Pending is a list of initializers that must execute in order before this object is visible. When the last pending initializer is removed, and no failing result is set, the initializers struct will be set to nil and the object is considered as initialized and visible to all clients." - }, - "result": { - "$ref": "v1.Status", - "description": "If result is set with the Failure field, the object will be persisted to storage and then deleted, ensuring that other clients can observe the deletion." - } - } - }, - "v1.Initializer": { - "id": "v1.Initializer", - "description": "Initializer is information about an initializer that has not yet completed.", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "description": "name of the process that is responsible for initializing this object." - } - } - }, - "v1.Status": { - "id": "v1.Status", - "description": "Status is a return value for calls that don't return other objects.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ListMeta", - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "status": { - "type": "string", - "description": "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status" - }, - "message": { - "type": "string", - "description": "A human-readable description of the status of this operation." - }, - "reason": { - "type": "string", - "description": "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it." - }, - "details": { - "$ref": "v1.StatusDetails", - "description": "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type." - }, - "code": { - "type": "integer", - "format": "int32", - "description": "Suggested HTTP return code for this status, 0 if not set." - } - } - }, - "v1.StatusDetails": { - "id": "v1.StatusDetails", - "description": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.", - "properties": { - "name": { - "type": "string", - "description": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described)." - }, - "group": { - "type": "string", - "description": "The group attribute of the resource associated with the status StatusReason." - }, - "kind": { - "type": "string", - "description": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "uid": { - "type": "string", - "description": "UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - }, - "causes": { - "type": "array", - "items": { - "$ref": "v1.StatusCause" - }, - "description": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes." - }, - "retryAfterSeconds": { - "type": "integer", - "format": "int32", - "description": "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action." - } - } - }, - "v1.StatusCause": { - "id": "v1.StatusCause", - "description": "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.", - "properties": { - "reason": { - "type": "string", - "description": "A machine-readable description of the cause of the error. If this value is empty there is no information available." - }, - "message": { - "type": "string", - "description": "A human-readable description of the cause of the error. This field may be presented as-is to a reader." - }, - "field": { - "type": "string", - "description": "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"" - } - } - }, - "v1beta1.DaemonSetSpec": { - "id": "v1beta1.DaemonSetSpec", - "description": "DaemonSetSpec is the specification of a daemon set.", - "required": [ - "template" - ], - "properties": { - "selector": { - "$ref": "v1.LabelSelector", - "description": "A label query over pods that are managed by the daemon set. Must match in order to be controlled. If empty, defaulted to labels on Pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors" - }, - "template": { - "$ref": "v1.PodTemplateSpec", - "description": "An object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template's node selector (or on every node if no node selector is specified). More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template" - }, - "updateStrategy": { - "$ref": "v1beta1.DaemonSetUpdateStrategy", - "description": "An update strategy to replace existing DaemonSet pods with new pods." - }, - "minReadySeconds": { - "type": "integer", - "format": "int32", - "description": "The minimum number of seconds for which a newly created DaemonSet pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)." - }, - "templateGeneration": { - "type": "integer", - "format": "int64", - "description": "DEPRECATED. A sequence number representing a specific generation of the template. Populated by the system. It can be set only during the creation." - }, - "revisionHistoryLimit": { - "type": "integer", - "format": "int32", - "description": "The number of old history to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10." - } - } - }, - "v1.LabelSelector": { - "id": "v1.LabelSelector", - "description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", - "properties": { - "matchLabels": { - "type": "object", - "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed." - }, - "matchExpressions": { - "type": "array", - "items": { - "$ref": "v1.LabelSelectorRequirement" - }, - "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed." - } - } - }, - "v1.LabelSelectorRequirement": { - "id": "v1.LabelSelectorRequirement", - "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", - "required": [ - "key", - "operator" - ], - "properties": { - "key": { - "type": "string", - "description": "key is the label key that the selector applies to." - }, - "operator": { - "type": "string", - "description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist." - }, - "values": { - "type": "array", - "items": { - "type": "string" - }, - "description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch." - } - } - }, - "v1.PodTemplateSpec": { - "id": "v1.PodTemplateSpec", - "description": "PodTemplateSpec describes the data a pod should have when created from a template", - "properties": { - "metadata": { - "$ref": "v1.ObjectMeta", - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "spec": { - "$ref": "v1.PodSpec", - "description": "Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status" - } - } - }, - "v1.PodSpec": { - "id": "v1.PodSpec", - "description": "PodSpec is a description of a pod.", - "required": [ - "containers" - ], - "properties": { - "volumes": { - "type": "array", - "items": { - "$ref": "v1.Volume" - }, - "description": "List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes" - }, - "initContainers": { - "type": "array", - "items": { - "$ref": "v1.Container" - }, - "description": "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, or Liveness probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" - }, - "containers": { - "type": "array", - "items": { - "$ref": "v1.Container" - }, - "description": "List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated." - }, - "restartPolicy": { - "type": "string", - "description": "Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy" - }, - "terminationGracePeriodSeconds": { - "type": "integer", - "format": "int64", - "description": "Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds." - }, - "activeDeadlineSeconds": { - "type": "integer", - "format": "int64", - "description": "Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer." - }, - "dnsPolicy": { - "type": "string", - "description": "Set DNS policy for containers within the pod. One of 'ClusterFirstWithHostNet', 'ClusterFirst' or 'Default'. Defaults to \"ClusterFirst\". To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'." - }, - "nodeSelector": { - "type": "object", - "description": "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/" - }, - "serviceAccountName": { - "type": "string", - "description": "ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/" - }, - "serviceAccount": { - "type": "string", - "description": "DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead." - }, - "automountServiceAccountToken": { - "type": "boolean", - "description": "AutomountServiceAccountToken indicates whether a service account token should be automatically mounted." - }, - "nodeName": { - "type": "string", - "description": "NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements." - }, - "hostNetwork": { - "type": "boolean", - "description": "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false." - }, - "hostPID": { - "type": "boolean", - "description": "Use the host's pid namespace. Optional: Default to false." - }, - "hostIPC": { - "type": "boolean", - "description": "Use the host's ipc namespace. Optional: Default to false." - }, - "securityContext": { - "$ref": "v1.PodSecurityContext", - "description": "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field." - }, - "imagePullSecrets": { - "type": "array", - "items": { - "$ref": "v1.LocalObjectReference" - }, - "description": "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod" - }, - "hostname": { - "type": "string", - "description": "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value." - }, - "subdomain": { - "type": "string", - "description": "If specified, the fully qualified Pod hostname will be \"\u003chostname\u003e.\u003csubdomain\u003e.\u003cpod namespace\u003e.svc.\u003ccluster domain\u003e\". If not specified, the pod will not have a domainname at all." - }, - "affinity": { - "$ref": "v1.Affinity", - "description": "If specified, the pod's scheduling constraints" - }, - "schedulerName": { - "type": "string", - "description": "If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler." - }, - "tolerations": { - "type": "array", - "items": { - "$ref": "v1.Toleration" - }, - "description": "If specified, the pod's tolerations." - }, - "hostAliases": { - "type": "array", - "items": { - "$ref": "v1.HostAlias" - }, - "description": "HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods." - }, - "priorityClassName": { - "type": "string", - "description": "If specified, indicates the pod's priority. \"SYSTEM\" is a special keyword which indicates the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default." - }, - "priority": { - "type": "integer", - "format": "int32", - "description": "The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority." - } - } - }, - "v1.Volume": { - "id": "v1.Volume", - "description": "Volume represents a named volume in a pod that may be accessed by any container in the pod.", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "description": "Volume's name. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - }, - "hostPath": { - "$ref": "v1.HostPathVolumeSource", - "description": "HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath" - }, - "emptyDir": { - "$ref": "v1.EmptyDirVolumeSource", - "description": "EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir" - }, - "gcePersistentDisk": { - "$ref": "v1.GCEPersistentDiskVolumeSource", - "description": "GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - }, - "awsElasticBlockStore": { - "$ref": "v1.AWSElasticBlockStoreVolumeSource", - "description": "AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" - }, - "gitRepo": { - "$ref": "v1.GitRepoVolumeSource", - "description": "GitRepo represents a git repository at a particular revision." - }, - "secret": { - "$ref": "v1.SecretVolumeSource", - "description": "Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret" - }, - "nfs": { - "$ref": "v1.NFSVolumeSource", - "description": "NFS represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs" - }, - "iscsi": { - "$ref": "v1.ISCSIVolumeSource", - "description": "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://releases.k8s.io/HEAD/examples/volumes/iscsi/README.md" - }, - "glusterfs": { - "$ref": "v1.GlusterfsVolumeSource", - "description": "Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md" - }, - "persistentVolumeClaim": { - "$ref": "v1.PersistentVolumeClaimVolumeSource", - "description": "PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" - }, - "rbd": { - "$ref": "v1.RBDVolumeSource", - "description": "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md" - }, - "flexVolume": { - "$ref": "v1.FlexVolumeSource", - "description": "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future." - }, - "cinder": { - "$ref": "v1.CinderVolumeSource", - "description": "Cinder represents a cinder volume attached and mounted on kubelets host machine More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md" - }, - "cephfs": { - "$ref": "v1.CephFSVolumeSource", - "description": "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime" - }, - "flocker": { - "$ref": "v1.FlockerVolumeSource", - "description": "Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running" - }, - "downwardAPI": { - "$ref": "v1.DownwardAPIVolumeSource", - "description": "DownwardAPI represents downward API about the pod that should populate this volume" - }, - "fc": { - "$ref": "v1.FCVolumeSource", - "description": "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod." - }, - "azureFile": { - "$ref": "v1.AzureFileVolumeSource", - "description": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod." - }, - "configMap": { - "$ref": "v1.ConfigMapVolumeSource", - "description": "ConfigMap represents a configMap that should populate this volume" - }, - "vsphereVolume": { - "$ref": "v1.VsphereVirtualDiskVolumeSource", - "description": "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine" - }, - "quobyte": { - "$ref": "v1.QuobyteVolumeSource", - "description": "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime" - }, - "azureDisk": { - "$ref": "v1.AzureDiskVolumeSource", - "description": "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod." - }, - "photonPersistentDisk": { - "$ref": "v1.PhotonPersistentDiskVolumeSource", - "description": "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine" - }, - "projected": { - "$ref": "v1.ProjectedVolumeSource", - "description": "Items for all in one resources secrets, configmaps, and downward API" - }, - "portworxVolume": { - "$ref": "v1.PortworxVolumeSource", - "description": "PortworxVolume represents a portworx volume attached and mounted on kubelets host machine" - }, - "scaleIO": { - "$ref": "v1.ScaleIOVolumeSource", - "description": "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes." - }, - "storageos": { - "$ref": "v1.StorageOSVolumeSource", - "description": "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes." - } - } - }, - "v1.HostPathVolumeSource": { - "id": "v1.HostPathVolumeSource", - "description": "Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.", - "required": [ - "path" - ], - "properties": { - "path": { - "type": "string", - "description": "Path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath" - }, - "type": { - "$ref": "v1.HostPathType", - "description": "Type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath" - } - } - }, - "v1.HostPathType": { - "id": "v1.HostPathType", - "properties": {} - }, - "v1.EmptyDirVolumeSource": { - "id": "v1.EmptyDirVolumeSource", - "description": "Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.", - "properties": { - "medium": { - "type": "string", - "description": "What type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir" - }, - "sizeLimit": { - "type": "string", - "description": "Total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir" - } - } - }, - "v1.GCEPersistentDiskVolumeSource": { - "id": "v1.GCEPersistentDiskVolumeSource", - "description": "Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.", - "required": [ - "pdName" - ], - "properties": { - "pdName": { - "type": "string", - "description": "Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - }, - "fsType": { - "type": "string", - "description": "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - }, - "partition": { - "type": "integer", - "format": "int32", - "description": "The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - }, - "readOnly": { - "type": "boolean", - "description": "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - } - } - }, - "v1.AWSElasticBlockStoreVolumeSource": { - "id": "v1.AWSElasticBlockStoreVolumeSource", - "description": "Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.", - "required": [ - "volumeID" - ], - "properties": { - "volumeID": { - "type": "string", - "description": "Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" - }, - "fsType": { - "type": "string", - "description": "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" - }, - "partition": { - "type": "integer", - "format": "int32", - "description": "The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty)." - }, - "readOnly": { - "type": "boolean", - "description": "Specify \"true\" to force and set the ReadOnly property in VolumeMounts to \"true\". If omitted, the default is \"false\". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" - } - } - }, - "v1.GitRepoVolumeSource": { - "id": "v1.GitRepoVolumeSource", - "description": "Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.", - "required": [ - "repository" - ], - "properties": { - "repository": { - "type": "string", - "description": "Repository URL" - }, - "revision": { - "type": "string", - "description": "Commit hash for the specified revision." - }, - "directory": { - "type": "string", - "description": "Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name." - } - } - }, - "v1.SecretVolumeSource": { - "id": "v1.SecretVolumeSource", - "description": "Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.", - "properties": { - "secretName": { - "type": "string", - "description": "Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret" - }, - "items": { - "type": "array", - "items": { - "$ref": "v1.KeyToPath" - }, - "description": "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'." - }, - "defaultMode": { - "type": "integer", - "format": "int32", - "description": "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set." - }, - "optional": { - "type": "boolean", - "description": "Specify whether the Secret or it's keys must be defined" - } - } - }, - "v1.KeyToPath": { - "id": "v1.KeyToPath", - "description": "Maps a string key to a path within a volume.", - "required": [ - "key", - "path" - ], - "properties": { - "key": { - "type": "string", - "description": "The key to project." - }, - "path": { - "type": "string", - "description": "The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'." - }, - "mode": { - "type": "integer", - "format": "int32", - "description": "Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set." - } - } - }, - "v1.NFSVolumeSource": { - "id": "v1.NFSVolumeSource", - "description": "Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.", - "required": [ - "server", - "path" - ], - "properties": { - "server": { - "type": "string", - "description": "Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs" - }, - "path": { - "type": "string", - "description": "Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs" - }, - "readOnly": { - "type": "boolean", - "description": "ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs" - } - } - }, - "v1.ISCSIVolumeSource": { - "id": "v1.ISCSIVolumeSource", - "description": "Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.", - "required": [ - "targetPortal", - "iqn", - "lun" - ], - "properties": { - "targetPortal": { - "type": "string", - "description": "iSCSI target portal. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260)." - }, - "iqn": { - "type": "string", - "description": "Target iSCSI Qualified Name." - }, - "lun": { - "type": "integer", - "format": "int32", - "description": "iSCSI target lun number." - }, - "iscsiInterface": { - "type": "string", - "description": "Optional: Defaults to 'default' (tcp). iSCSI interface name that uses an iSCSI transport." - }, - "fsType": { - "type": "string", - "description": "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi" - }, - "readOnly": { - "type": "boolean", - "description": "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false." - }, - "portals": { - "type": "array", - "items": { - "type": "string" - }, - "description": "iSCSI target portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260)." - }, - "chapAuthDiscovery": { - "type": "boolean", - "description": "whether support iSCSI Discovery CHAP authentication" - }, - "chapAuthSession": { - "type": "boolean", - "description": "whether support iSCSI Session CHAP authentication" - }, - "secretRef": { - "$ref": "v1.LocalObjectReference", - "description": "CHAP secret for iSCSI target and initiator authentication" - }, - "initiatorName": { - "type": "string", - "description": "Custom iSCSI initiator name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface \u003ctarget portal\u003e:\u003cvolume name\u003e will be created for the connection." - } - } - }, - "v1.LocalObjectReference": { - "id": "v1.LocalObjectReference", - "description": "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.", - "properties": { - "name": { - "type": "string", - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - } - } - }, - "v1.GlusterfsVolumeSource": { - "id": "v1.GlusterfsVolumeSource", - "description": "Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.", - "required": [ - "endpoints", - "path" - ], - "properties": { - "endpoints": { - "type": "string", - "description": "EndpointsName is the endpoint name that details Glusterfs topology. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod" - }, - "path": { - "type": "string", - "description": "Path is the Glusterfs volume path. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod" - }, - "readOnly": { - "type": "boolean", - "description": "ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod" - } - } - }, - "v1.PersistentVolumeClaimVolumeSource": { - "id": "v1.PersistentVolumeClaimVolumeSource", - "description": "PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).", - "required": [ - "claimName" - ], - "properties": { - "claimName": { - "type": "string", - "description": "ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" - }, - "readOnly": { - "type": "boolean", - "description": "Will force the ReadOnly setting in VolumeMounts. Default false." - } - } - }, - "v1.RBDVolumeSource": { - "id": "v1.RBDVolumeSource", - "description": "Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.", - "required": [ - "monitors", - "image" - ], - "properties": { - "monitors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A collection of Ceph monitors. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it" - }, - "image": { - "type": "string", - "description": "The rados image name. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it" - }, - "fsType": { - "type": "string", - "description": "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd" - }, - "pool": { - "type": "string", - "description": "The rados pool name. Default is rbd. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it" - }, - "user": { - "type": "string", - "description": "The rados user name. Default is admin. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it" - }, - "keyring": { - "type": "string", - "description": "Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it" - }, - "secretRef": { - "$ref": "v1.LocalObjectReference", - "description": "SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it" - }, - "readOnly": { - "type": "boolean", - "description": "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it" - } - } - }, - "v1.FlexVolumeSource": { - "id": "v1.FlexVolumeSource", - "description": "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future.", - "required": [ - "driver" - ], - "properties": { - "driver": { - "type": "string", - "description": "Driver is the name of the driver to use for this volume." - }, - "fsType": { - "type": "string", - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script." - }, - "secretRef": { - "$ref": "v1.LocalObjectReference", - "description": "Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts." - }, - "readOnly": { - "type": "boolean", - "description": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts." - }, - "options": { - "type": "object", - "description": "Optional: Extra command options if any." - } - } - }, - "v1.CinderVolumeSource": { - "id": "v1.CinderVolumeSource", - "description": "Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.", - "required": [ - "volumeID" - ], - "properties": { - "volumeID": { - "type": "string", - "description": "volume id used to identify the volume in cinder More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md" - }, - "fsType": { - "type": "string", - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md" - }, - "readOnly": { - "type": "boolean", - "description": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md" - } - } - }, - "v1.CephFSVolumeSource": { - "id": "v1.CephFSVolumeSource", - "description": "Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.", - "required": [ - "monitors" - ], - "properties": { - "monitors": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Required: Monitors is a collection of Ceph monitors More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it" - }, - "path": { - "type": "string", - "description": "Optional: Used as the mounted root, rather than the full Ceph tree, default is /" - }, - "user": { - "type": "string", - "description": "Optional: User is the rados user name, default is admin More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it" - }, - "secretFile": { - "type": "string", - "description": "Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it" - }, - "secretRef": { - "$ref": "v1.LocalObjectReference", - "description": "Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it" - }, - "readOnly": { - "type": "boolean", - "description": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it" - } - } - }, - "v1.FlockerVolumeSource": { - "id": "v1.FlockerVolumeSource", - "description": "Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.", - "properties": { - "datasetName": { - "type": "string", - "description": "Name of the dataset stored as metadata -\u003e name on the dataset for Flocker should be considered as deprecated" - }, - "datasetUUID": { - "type": "string", - "description": "UUID of the dataset. This is unique identifier of a Flocker dataset" - } - } - }, - "v1.DownwardAPIVolumeSource": { - "id": "v1.DownwardAPIVolumeSource", - "description": "DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "v1.DownwardAPIVolumeFile" - }, - "description": "Items is a list of downward API volume file" - }, - "defaultMode": { - "type": "integer", - "format": "int32", - "description": "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set." - } - } - }, - "v1.DownwardAPIVolumeFile": { - "id": "v1.DownwardAPIVolumeFile", - "description": "DownwardAPIVolumeFile represents information to create the file containing the pod field", - "required": [ - "path" - ], - "properties": { - "path": { - "type": "string", - "description": "Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'" - }, - "fieldRef": { - "$ref": "v1.ObjectFieldSelector", - "description": "Required: Selects a field of the pod: only annotations, labels, name and namespace are supported." - }, - "resourceFieldRef": { - "$ref": "v1.ResourceFieldSelector", - "description": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported." - }, - "mode": { - "type": "integer", - "format": "int32", - "description": "Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set." - } - } - }, - "v1.ObjectFieldSelector": { - "id": "v1.ObjectFieldSelector", - "description": "ObjectFieldSelector selects an APIVersioned field of an object.", - "required": [ - "fieldPath" - ], - "properties": { - "apiVersion": { - "type": "string", - "description": "Version of the schema the FieldPath is written in terms of, defaults to \"v1\"." - }, - "fieldPath": { - "type": "string", - "description": "Path of the field to select in the specified API version." - } - } - }, - "v1.ResourceFieldSelector": { - "id": "v1.ResourceFieldSelector", - "description": "ResourceFieldSelector represents container resources (cpu, memory) and their output format", - "required": [ - "resource" - ], - "properties": { - "containerName": { - "type": "string", - "description": "Container name: required for volumes, optional for env vars" - }, - "resource": { - "type": "string", - "description": "Required: resource to select" - }, - "divisor": { - "type": "string", - "description": "Specifies the output format of the exposed resources, defaults to \"1\"" - } - } - }, - "v1.FCVolumeSource": { - "id": "v1.FCVolumeSource", - "description": "Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.", - "properties": { - "targetWWNs": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Optional: FC target worldwide names (WWNs)" - }, - "lun": { - "type": "integer", - "format": "int32", - "description": "Optional: FC target lun number" - }, - "fsType": { - "type": "string", - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified." - }, - "readOnly": { - "type": "boolean", - "description": "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts." - }, - "wwids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously." - } - } - }, - "v1.AzureFileVolumeSource": { - "id": "v1.AzureFileVolumeSource", - "description": "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - "required": [ - "secretName", - "shareName" - ], - "properties": { - "secretName": { - "type": "string", - "description": "the name of secret that contains Azure Storage Account Name and Key" - }, - "shareName": { - "type": "string", - "description": "Share Name" - }, - "readOnly": { - "type": "boolean", - "description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts." - } - } - }, - "v1.ConfigMapVolumeSource": { - "id": "v1.ConfigMapVolumeSource", - "description": "Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.", - "properties": { - "name": { - "type": "string", - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - }, - "items": { - "type": "array", - "items": { - "$ref": "v1.KeyToPath" - }, - "description": "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'." - }, - "defaultMode": { - "type": "integer", - "format": "int32", - "description": "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set." - }, - "optional": { - "type": "boolean", - "description": "Specify whether the ConfigMap or it's keys must be defined" - } - } - }, - "v1.VsphereVirtualDiskVolumeSource": { - "id": "v1.VsphereVirtualDiskVolumeSource", - "description": "Represents a vSphere volume resource.", - "required": [ - "volumePath" - ], - "properties": { - "volumePath": { - "type": "string", - "description": "Path that identifies vSphere volume vmdk" - }, - "fsType": { - "type": "string", - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified." - }, - "storagePolicyName": { - "type": "string", - "description": "Storage Policy Based Management (SPBM) profile name." - }, - "storagePolicyID": { - "type": "string", - "description": "Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName." - } - } - }, - "v1.QuobyteVolumeSource": { - "id": "v1.QuobyteVolumeSource", - "description": "Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.", - "required": [ - "registry", - "volume" - ], - "properties": { - "registry": { - "type": "string", - "description": "Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes" - }, - "volume": { - "type": "string", - "description": "Volume is a string that references an already created Quobyte volume by name." - }, - "readOnly": { - "type": "boolean", - "description": "ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false." - }, - "user": { - "type": "string", - "description": "User to map volume access to Defaults to serivceaccount user" - }, - "group": { - "type": "string", - "description": "Group to map volume access to Default is no group" - } - } - }, - "v1.AzureDiskVolumeSource": { - "id": "v1.AzureDiskVolumeSource", - "description": "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", - "required": [ - "diskName", - "diskURI" - ], - "properties": { - "diskName": { - "type": "string", - "description": "The Name of the data disk in the blob storage" - }, - "diskURI": { - "type": "string", - "description": "The URI the data disk in the blob storage" - }, - "cachingMode": { - "$ref": "v1.AzureDataDiskCachingMode", - "description": "Host Caching mode: None, Read Only, Read Write." - }, - "fsType": { - "type": "string", - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified." - }, - "readOnly": { - "type": "boolean", - "description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts." - }, - "kind": { - "$ref": "v1.AzureDataDiskKind", - "description": "Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared" - } - } - }, - "v1.AzureDataDiskCachingMode": { - "id": "v1.AzureDataDiskCachingMode", - "properties": {} - }, - "v1.AzureDataDiskKind": { - "id": "v1.AzureDataDiskKind", - "properties": {} - }, - "v1.PhotonPersistentDiskVolumeSource": { - "id": "v1.PhotonPersistentDiskVolumeSource", - "description": "Represents a Photon Controller persistent disk resource.", - "required": [ - "pdID" - ], - "properties": { - "pdID": { - "type": "string", - "description": "ID that identifies Photon Controller persistent disk" - }, - "fsType": { - "type": "string", - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified." - } - } - }, - "v1.ProjectedVolumeSource": { - "id": "v1.ProjectedVolumeSource", - "description": "Represents a projected volume source", - "required": [ - "sources" - ], - "properties": { - "sources": { - "type": "array", - "items": { - "$ref": "v1.VolumeProjection" - }, - "description": "list of volume projections" - }, - "defaultMode": { - "type": "integer", - "format": "int32", - "description": "Mode bits to use on created files by default. Must be a value between 0 and 0777. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set." - } - } - }, - "v1.VolumeProjection": { - "id": "v1.VolumeProjection", - "description": "Projection that may be projected along with other supported volume types", - "properties": { - "secret": { - "$ref": "v1.SecretProjection", - "description": "information about the secret data to project" - }, - "downwardAPI": { - "$ref": "v1.DownwardAPIProjection", - "description": "information about the downwardAPI data to project" - }, - "configMap": { - "$ref": "v1.ConfigMapProjection", - "description": "information about the configMap data to project" - } - } - }, - "v1.SecretProjection": { - "id": "v1.SecretProjection", - "description": "Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.", - "properties": { - "name": { - "type": "string", - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - }, - "items": { - "type": "array", - "items": { - "$ref": "v1.KeyToPath" - }, - "description": "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'." - }, - "optional": { - "type": "boolean", - "description": "Specify whether the Secret or its key must be defined" - } - } - }, - "v1.DownwardAPIProjection": { - "id": "v1.DownwardAPIProjection", - "description": "Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "v1.DownwardAPIVolumeFile" - }, - "description": "Items is a list of DownwardAPIVolume file" - } - } - }, - "v1.ConfigMapProjection": { - "id": "v1.ConfigMapProjection", - "description": "Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.", - "properties": { - "name": { - "type": "string", - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - }, - "items": { - "type": "array", - "items": { - "$ref": "v1.KeyToPath" - }, - "description": "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'." - }, - "optional": { - "type": "boolean", - "description": "Specify whether the ConfigMap or it's keys must be defined" - } - } - }, - "v1.PortworxVolumeSource": { - "id": "v1.PortworxVolumeSource", - "description": "PortworxVolumeSource represents a Portworx volume resource.", - "required": [ - "volumeID" - ], - "properties": { - "volumeID": { - "type": "string", - "description": "VolumeID uniquely identifies a Portworx volume" - }, - "fsType": { - "type": "string", - "description": "FSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified." - }, - "readOnly": { - "type": "boolean", - "description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts." - } - } - }, - "v1.ScaleIOVolumeSource": { - "id": "v1.ScaleIOVolumeSource", - "description": "ScaleIOVolumeSource represents a persistent ScaleIO volume", - "required": [ - "gateway", - "system", - "secretRef" - ], - "properties": { - "gateway": { - "type": "string", - "description": "The host address of the ScaleIO API Gateway." - }, - "system": { - "type": "string", - "description": "The name of the storage system as configured in ScaleIO." - }, - "secretRef": { - "$ref": "v1.LocalObjectReference", - "description": "SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail." - }, - "sslEnabled": { - "type": "boolean", - "description": "Flag to enable/disable SSL communication with Gateway, default false" - }, - "protectionDomain": { - "type": "string", - "description": "The name of the ScaleIO Protection Domain for the configured storage." - }, - "storagePool": { - "type": "string", - "description": "The ScaleIO Storage Pool associated with the protection domain." - }, - "storageMode": { - "type": "string", - "description": "Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned." - }, - "volumeName": { - "type": "string", - "description": "The name of a volume already created in the ScaleIO system that is associated with this volume source." - }, - "fsType": { - "type": "string", - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified." - }, - "readOnly": { - "type": "boolean", - "description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts." - } - } - }, - "v1.StorageOSVolumeSource": { - "id": "v1.StorageOSVolumeSource", - "description": "Represents a StorageOS persistent volume resource.", - "properties": { - "volumeName": { - "type": "string", - "description": "VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace." - }, - "volumeNamespace": { - "type": "string", - "description": "VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created." - }, - "fsType": { - "type": "string", - "description": "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified." - }, - "readOnly": { - "type": "boolean", - "description": "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts." - }, - "secretRef": { - "$ref": "v1.LocalObjectReference", - "description": "SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted." - } - } - }, - "v1.Container": { - "id": "v1.Container", - "description": "A single application container that you want to run within a pod.", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "description": "Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated." - }, - "image": { - "type": "string", - "description": "Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets." - }, - "command": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. 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. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - }, - "args": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. 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. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - }, - "workingDir": { - "type": "string", - "description": "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated." - }, - "ports": { - "type": "array", - "items": { - "$ref": "v1.ContainerPort" - }, - "description": "List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated." - }, - "envFrom": { - "type": "array", - "items": { - "$ref": "v1.EnvFromSource" - }, - "description": "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated." - }, - "env": { - "type": "array", - "items": { - "$ref": "v1.EnvVar" - }, - "description": "List of environment variables to set in the container. Cannot be updated." - }, - "resources": { - "$ref": "v1.ResourceRequirements", - "description": "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources" - }, - "volumeMounts": { - "type": "array", - "items": { - "$ref": "v1.VolumeMount" - }, - "description": "Pod volumes to mount into the container's filesystem. Cannot be updated." - }, - "livenessProbe": { - "$ref": "v1.Probe", - "description": "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - }, - "readinessProbe": { - "$ref": "v1.Probe", - "description": "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - }, - "lifecycle": { - "$ref": "v1.Lifecycle", - "description": "Actions that the management system should take in response to container lifecycle events. Cannot be updated." - }, - "terminationMessagePath": { - "type": "string", - "description": "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated." - }, - "terminationMessagePolicy": { - "type": "string", - "description": "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated." - }, - "imagePullPolicy": { - "type": "string", - "description": "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images" - }, - "securityContext": { - "$ref": "v1.SecurityContext", - "description": "Security options the pod should run with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" - }, - "stdin": { - "type": "boolean", - "description": "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false." - }, - "stdinOnce": { - "type": "boolean", - "description": "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false" - }, - "tty": { - "type": "boolean", - "description": "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false." - } - } - }, - "v1.ContainerPort": { - "id": "v1.ContainerPort", - "description": "ContainerPort represents a network port in a single container.", - "required": [ - "containerPort" - ], - "properties": { - "name": { - "type": "string", - "description": "If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services." - }, - "hostPort": { - "type": "integer", - "format": "int32", - "description": "Number of port to expose on the host. If specified, this must be a valid port number, 0 \u003c x \u003c 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this." - }, - "containerPort": { - "type": "integer", - "format": "int32", - "description": "Number of port to expose on the pod's IP address. This must be a valid port number, 0 \u003c x \u003c 65536." - }, - "protocol": { - "type": "string", - "description": "Protocol for port. Must be UDP or TCP. Defaults to \"TCP\"." - }, - "hostIP": { - "type": "string", - "description": "What host IP to bind the external port to." - } - } - }, - "v1.EnvFromSource": { - "id": "v1.EnvFromSource", - "description": "EnvFromSource represents the source of a set of ConfigMaps", - "properties": { - "prefix": { - "type": "string", - "description": "An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER." - }, - "configMapRef": { - "$ref": "v1.ConfigMapEnvSource", - "description": "The ConfigMap to select from" - }, - "secretRef": { - "$ref": "v1.SecretEnvSource", - "description": "The Secret to select from" - } - } - }, - "v1.ConfigMapEnvSource": { - "id": "v1.ConfigMapEnvSource", - "description": "ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.", - "properties": { - "name": { - "type": "string", - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - }, - "optional": { - "type": "boolean", - "description": "Specify whether the ConfigMap must be defined" - } - } - }, - "v1.SecretEnvSource": { - "id": "v1.SecretEnvSource", - "description": "SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.", - "properties": { - "name": { - "type": "string", - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - }, - "optional": { - "type": "boolean", - "description": "Specify whether the Secret must be defined" - } - } - }, - "v1.EnvVar": { - "id": "v1.EnvVar", - "description": "EnvVar represents an environment variable present in a Container.", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "description": "Name of the environment variable. Must be a C_IDENTIFIER." - }, - "value": { - "type": "string", - "description": "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 \"\"." - }, - "valueFrom": { - "$ref": "v1.EnvVarSource", - "description": "Source for the environment variable's value. Cannot be used if value is not empty." - } - } - }, - "v1.EnvVarSource": { - "id": "v1.EnvVarSource", - "description": "EnvVarSource represents a source for the value of an EnvVar.", - "properties": { - "fieldRef": { - "$ref": "v1.ObjectFieldSelector", - "description": "Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP." - }, - "resourceFieldRef": { - "$ref": "v1.ResourceFieldSelector", - "description": "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported." - }, - "configMapKeyRef": { - "$ref": "v1.ConfigMapKeySelector", - "description": "Selects a key of a ConfigMap." - }, - "secretKeyRef": { - "$ref": "v1.SecretKeySelector", - "description": "Selects a key of a secret in the pod's namespace" - } - } - }, - "v1.ConfigMapKeySelector": { - "id": "v1.ConfigMapKeySelector", - "description": "Selects a key from a ConfigMap.", - "required": [ - "key" - ], - "properties": { - "name": { - "type": "string", - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - }, - "key": { - "type": "string", - "description": "The key to select." - }, - "optional": { - "type": "boolean", - "description": "Specify whether the ConfigMap or it's key must be defined" - } - } - }, - "v1.SecretKeySelector": { - "id": "v1.SecretKeySelector", - "description": "SecretKeySelector selects a key of a Secret.", - "required": [ - "key" - ], - "properties": { - "name": { - "type": "string", - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - }, - "key": { - "type": "string", - "description": "The key of the secret to select from. Must be a valid secret key." - }, - "optional": { - "type": "boolean", - "description": "Specify whether the Secret or it's key must be defined" - } - } - }, - "v1.ResourceRequirements": { - "id": "v1.ResourceRequirements", - "description": "ResourceRequirements describes the compute resource requirements.", - "properties": { - "limits": { - "type": "object", - "description": "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/" - }, - "requests": { - "type": "object", - "description": "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/" - } - } - }, - "v1.VolumeMount": { - "id": "v1.VolumeMount", - "description": "VolumeMount describes a mounting of a Volume within a container.", - "required": [ - "name", - "mountPath" - ], - "properties": { - "name": { - "type": "string", - "description": "This must match the Name of a Volume." - }, - "readOnly": { - "type": "boolean", - "description": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false." - }, - "mountPath": { - "type": "string", - "description": "Path within the container at which the volume should be mounted. Must not contain ':'." - }, - "subPath": { - "type": "string", - "description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)." - }, - "mountPropagation": { - "$ref": "v1.MountPropagationMode", - "description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release." - } - } - }, - "v1.MountPropagationMode": { - "id": "v1.MountPropagationMode", - "properties": {} - }, - "v1.Probe": { - "id": "v1.Probe", - "description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.", - "properties": { - "exec": { - "$ref": "v1.ExecAction", - "description": "One and only one of the following should be specified. Exec specifies the action to take." - }, - "httpGet": { - "$ref": "v1.HTTPGetAction", - "description": "HTTPGet specifies the http request to perform." - }, - "tcpSocket": { - "$ref": "v1.TCPSocketAction", - "description": "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported" - }, - "initialDelaySeconds": { - "type": "integer", - "format": "int32", - "description": "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - }, - "timeoutSeconds": { - "type": "integer", - "format": "int32", - "description": "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - }, - "periodSeconds": { - "type": "integer", - "format": "int32", - "description": "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1." - }, - "successThreshold": { - "type": "integer", - "format": "int32", - "description": "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness. Minimum value is 1." - }, - "failureThreshold": { - "type": "integer", - "format": "int32", - "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1." - } - } - }, - "v1.ExecAction": { - "id": "v1.ExecAction", - "description": "ExecAction describes a \"run in container\" action.", - "properties": { - "command": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy." - } - } - }, - "v1.HTTPGetAction": { - "id": "v1.HTTPGetAction", - "description": "HTTPGetAction describes an action based on HTTP Get requests.", - "required": [ - "port" - ], - "properties": { - "path": { - "type": "string", - "description": "Path to access on the HTTP server." - }, - "port": { - "type": "string", - "description": "Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME." - }, - "host": { - "type": "string", - "description": "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead." - }, - "scheme": { - "type": "string", - "description": "Scheme to use for connecting to the host. Defaults to HTTP." - }, - "httpHeaders": { - "type": "array", - "items": { - "$ref": "v1.HTTPHeader" - }, - "description": "Custom headers to set in the request. HTTP allows repeated headers." - } - } - }, - "v1.HTTPHeader": { - "id": "v1.HTTPHeader", - "description": "HTTPHeader describes a custom header to be used in HTTP probes", - "required": [ - "name", - "value" - ], - "properties": { - "name": { - "type": "string", - "description": "The header field name" - }, - "value": { - "type": "string", - "description": "The header field value" - } - } - }, - "v1.TCPSocketAction": { - "id": "v1.TCPSocketAction", - "description": "TCPSocketAction describes an action based on opening a socket", - "required": [ - "port" - ], - "properties": { - "port": { - "type": "string", - "description": "Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME." - }, - "host": { - "type": "string", - "description": "Optional: Host name to connect to, defaults to the pod IP." - } - } - }, - "v1.Lifecycle": { - "id": "v1.Lifecycle", - "description": "Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.", - "properties": { - "postStart": { - "$ref": "v1.Handler", - "description": "PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" - }, - "preStop": { - "$ref": "v1.Handler", - "description": "PreStop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" - } - } - }, - "v1.Handler": { - "id": "v1.Handler", - "description": "Handler defines a specific action that should be taken", - "properties": { - "exec": { - "$ref": "v1.ExecAction", - "description": "One and only one of the following should be specified. Exec specifies the action to take." - }, - "httpGet": { - "$ref": "v1.HTTPGetAction", - "description": "HTTPGet specifies the http request to perform." - }, - "tcpSocket": { - "$ref": "v1.TCPSocketAction", - "description": "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported" - } - } - }, - "v1.SecurityContext": { - "id": "v1.SecurityContext", - "description": "SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.", - "properties": { - "capabilities": { - "$ref": "v1.Capabilities", - "description": "The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime." - }, - "privileged": { - "type": "boolean", - "description": "Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false." - }, - "seLinuxOptions": { - "$ref": "v1.SELinuxOptions", - "description": "The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence." - }, - "runAsUser": { - "type": "integer", - "format": "int64", - "description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence." - }, - "runAsNonRoot": { - "type": "boolean", - "description": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence." - }, - "readOnlyRootFilesystem": { - "type": "boolean", - "description": "Whether this container has a read-only root filesystem. Default is false." - }, - "allowPrivilegeEscalation": { - "type": "boolean", - "description": "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN" - } - } - }, - "v1.Capabilities": { - "id": "v1.Capabilities", - "description": "Adds and removes POSIX capabilities from running containers.", - "properties": { - "add": { - "type": "array", - "items": { - "$ref": "v1.Capability" - }, - "description": "Added capabilities" - }, - "drop": { - "type": "array", - "items": { - "$ref": "v1.Capability" - }, - "description": "Removed capabilities" - } - } - }, - "v1.Capability": { - "id": "v1.Capability", - "properties": {} - }, - "v1.SELinuxOptions": { - "id": "v1.SELinuxOptions", - "description": "SELinuxOptions are the labels to be applied to the container", - "properties": { - "user": { - "type": "string", - "description": "User is a SELinux user label that applies to the container." - }, - "role": { - "type": "string", - "description": "Role is a SELinux role label that applies to the container." - }, - "type": { - "type": "string", - "description": "Type is a SELinux type label that applies to the container." - }, - "level": { - "type": "string", - "description": "Level is SELinux level label that applies to the container." - } - } - }, - "v1.PodSecurityContext": { - "id": "v1.PodSecurityContext", - "description": "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.", - "properties": { - "seLinuxOptions": { - "$ref": "v1.SELinuxOptions", - "description": "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container." - }, - "runAsUser": { - "type": "integer", - "format": "int64", - "description": "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container." - }, - "runAsNonRoot": { - "type": "boolean", - "description": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence." - }, - "supplementalGroups": { - "type": "array", - "items": { - "type": "integer" - }, - "description": "A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container." - }, - "fsGroup": { - "type": "integer", - "format": "int64", - "description": "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw " - } - } - }, - "v1.Affinity": { - "id": "v1.Affinity", - "description": "Affinity is a group of affinity scheduling rules.", - "properties": { - "nodeAffinity": { - "$ref": "v1.NodeAffinity", - "description": "Describes node affinity scheduling rules for the pod." - }, - "podAffinity": { - "$ref": "v1.PodAffinity", - "description": "Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s))." - }, - "podAntiAffinity": { - "$ref": "v1.PodAntiAffinity", - "description": "Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s))." - } - } - }, - "v1.NodeAffinity": { - "id": "v1.NodeAffinity", - "description": "Node affinity is a group of node affinity scheduling rules.", - "properties": { - "requiredDuringSchedulingIgnoredDuringExecution": { - "$ref": "v1.NodeSelector", - "description": "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node." - }, - "preferredDuringSchedulingIgnoredDuringExecution": { - "type": "array", - "items": { - "$ref": "v1.PreferredSchedulingTerm" - }, - "description": "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred." - } - } - }, - "v1.NodeSelector": { - "id": "v1.NodeSelector", - "description": "A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.", - "required": [ - "nodeSelectorTerms" - ], - "properties": { - "nodeSelectorTerms": { - "type": "array", - "items": { - "$ref": "v1.NodeSelectorTerm" - }, - "description": "Required. A list of node selector terms. The terms are ORed." - } - } - }, - "v1.NodeSelectorTerm": { - "id": "v1.NodeSelectorTerm", - "description": "A null or empty node selector term matches no objects.", - "required": [ - "matchExpressions" - ], - "properties": { - "matchExpressions": { - "type": "array", - "items": { - "$ref": "v1.NodeSelectorRequirement" - }, - "description": "Required. A list of node selector requirements. The requirements are ANDed." - } - } - }, - "v1.NodeSelectorRequirement": { - "id": "v1.NodeSelectorRequirement", - "description": "A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", - "required": [ - "key", - "operator" - ], - "properties": { - "key": { - "type": "string", - "description": "The label key that the selector applies to." - }, - "operator": { - "type": "string", - "description": "Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt." - }, - "values": { - "type": "array", - "items": { - "type": "string" - }, - "description": "An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch." - } - } - }, - "v1.PreferredSchedulingTerm": { - "id": "v1.PreferredSchedulingTerm", - "description": "An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).", - "required": [ - "weight", - "preference" - ], - "properties": { - "weight": { - "type": "integer", - "format": "int32", - "description": "Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100." - }, - "preference": { - "$ref": "v1.NodeSelectorTerm", - "description": "A node selector term, associated with the corresponding weight." - } - } - }, - "v1.PodAffinity": { - "id": "v1.PodAffinity", - "description": "Pod affinity is a group of inter pod affinity scheduling rules.", - "properties": { - "requiredDuringSchedulingIgnoredDuringExecution": { - "type": "array", - "items": { - "$ref": "v1.PodAffinityTerm" - }, - "description": "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied." - }, - "preferredDuringSchedulingIgnoredDuringExecution": { - "type": "array", - "items": { - "$ref": "v1.WeightedPodAffinityTerm" - }, - "description": "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred." - } - } - }, - "v1.PodAffinityTerm": { - "id": "v1.PodAffinityTerm", - "description": "Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key \u003ctopologyKey\u003e matches that of any node on which a pod of the set of pods is running", - "properties": { - "labelSelector": { - "$ref": "v1.LabelSelector", - "description": "A label query over a set of resources, in this case pods." - }, - "namespaces": { - "type": "array", - "items": { - "type": "string" - }, - "description": "namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means \"this pod's namespace\"" - }, - "topologyKey": { - "type": "string", - "description": "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. For PreferredDuringScheduling pod anti-affinity, empty topologyKey is interpreted as \"all topologies\" (\"all topologies\" here means all the topologyKeys indicated by scheduler command-line argument --failure-domains); for affinity and for RequiredDuringScheduling pod anti-affinity, empty topologyKey is not allowed." - } - } - }, - "v1.WeightedPodAffinityTerm": { - "id": "v1.WeightedPodAffinityTerm", - "description": "The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)", - "required": [ - "weight", - "podAffinityTerm" - ], - "properties": { - "weight": { - "type": "integer", - "format": "int32", - "description": "weight associated with matching the corresponding podAffinityTerm, in the range 1-100." - }, - "podAffinityTerm": { - "$ref": "v1.PodAffinityTerm", - "description": "Required. A pod affinity term, associated with the corresponding weight." - } - } - }, - "v1.PodAntiAffinity": { - "id": "v1.PodAntiAffinity", - "description": "Pod anti affinity is a group of inter pod anti affinity scheduling rules.", - "properties": { - "requiredDuringSchedulingIgnoredDuringExecution": { - "type": "array", - "items": { - "$ref": "v1.PodAffinityTerm" - }, - "description": "If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied." - }, - "preferredDuringSchedulingIgnoredDuringExecution": { - "type": "array", - "items": { - "$ref": "v1.WeightedPodAffinityTerm" - }, - "description": "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred." - } - } - }, - "v1.Toleration": { - "id": "v1.Toleration", - "description": "The pod this Toleration is attached to tolerates any taint that matches the triple \u003ckey,value,effect\u003e using the matching operator \u003coperator\u003e.", - "properties": { - "key": { - "type": "string", - "description": "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys." - }, - "operator": { - "type": "string", - "description": "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category." - }, - "value": { - "type": "string", - "description": "Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string." - }, - "effect": { - "type": "string", - "description": "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute." - }, - "tolerationSeconds": { - "type": "integer", - "format": "int64", - "description": "TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system." - } - } - }, - "v1.HostAlias": { - "id": "v1.HostAlias", - "description": "HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.", - "properties": { - "ip": { - "type": "string", - "description": "IP address of the host file entry." - }, - "hostnames": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Hostnames for the above IP address." - } - } - }, - "v1beta1.DaemonSetUpdateStrategy": { - "id": "v1beta1.DaemonSetUpdateStrategy", - "properties": { - "type": { - "type": "string", - "description": "Type of daemon set update. Can be \"RollingUpdate\" or \"OnDelete\". Default is OnDelete." - }, - "rollingUpdate": { - "$ref": "v1beta1.RollingUpdateDaemonSet", - "description": "Rolling update config params. Present only if type = \"RollingUpdate\"." - } - } - }, - "v1beta1.RollingUpdateDaemonSet": { - "id": "v1beta1.RollingUpdateDaemonSet", - "description": "Spec to control the desired behavior of daemon set rolling update.", - "properties": { - "maxUnavailable": { - "type": "string", - "description": "The maximum number of DaemonSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of DaemonSet pods at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding up. This cannot be 0. Default value is 1. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their pods stopped for an update at any given time. The update starts by stopping at most 30% of those DaemonSet pods and then brings up new DaemonSet pods in their place. Once the new pods are available, it then proceeds onto other DaemonSet pods, thus ensuring that at least 70% of original number of DaemonSet pods are available at all times during the update." - } - } - }, - "v1beta1.DaemonSetStatus": { - "id": "v1beta1.DaemonSetStatus", - "description": "DaemonSetStatus represents the current status of a daemon set.", - "required": [ - "currentNumberScheduled", - "numberMisscheduled", - "desiredNumberScheduled", - "numberReady" - ], - "properties": { - "currentNumberScheduled": { - "type": "integer", - "format": "int32", - "description": "The number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" - }, - "numberMisscheduled": { - "type": "integer", - "format": "int32", - "description": "The number of nodes that are running the daemon pod, but are not supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" - }, - "desiredNumberScheduled": { - "type": "integer", - "format": "int32", - "description": "The total number of nodes that should be running the daemon pod (including nodes correctly running the daemon pod). More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" - }, - "numberReady": { - "type": "integer", - "format": "int32", - "description": "The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and ready." - }, - "observedGeneration": { - "type": "integer", - "format": "int64", - "description": "The most recent generation observed by the daemon set controller." - }, - "updatedNumberScheduled": { - "type": "integer", - "format": "int32", - "description": "The total number of nodes that are running updated daemon pod" - }, - "numberAvailable": { - "type": "integer", - "format": "int32", - "description": "The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and available (ready for at least spec.minReadySeconds)" - }, - "numberUnavailable": { - "type": "integer", - "format": "int32", - "description": "The number of nodes that should be running the daemon pod and have none of the daemon pod running and available (ready for at least spec.minReadySeconds)" - }, - "collisionCount": { - "type": "integer", - "format": "int32", - "description": "Count of hash collisions for the DaemonSet. The DaemonSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision." - } - } - }, - "v1.WatchEvent": { - "id": "v1.WatchEvent", - "required": [ - "type", - "object" - ], - "properties": { - "type": { - "type": "string" - }, - "object": { - "type": "string" - } - } - }, - "v1.Patch": { - "id": "v1.Patch", - "description": "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.", - "properties": {} - }, - "v1.DeleteOptions": { - "id": "v1.DeleteOptions", - "description": "DeleteOptions may be provided when deleting an API object.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "gracePeriodSeconds": { - "type": "integer", - "format": "int64", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately." - }, - "preconditions": { - "$ref": "v1.Preconditions", - "description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned." - }, - "orphanDependents": { - "type": "boolean", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both." - }, - "propagationPolicy": { - "$ref": "v1.DeletionPropagation", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy." - } - } - }, - "v1.Preconditions": { - "id": "v1.Preconditions", - "description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.", - "properties": { - "uid": { - "$ref": "types.UID", - "description": "Specifies the target UID." - } - } - }, - "types.UID": { - "id": "types.UID", - "properties": {} - }, - "v1.DeletionPropagation": { - "id": "v1.DeletionPropagation", - "properties": {} - }, - "v1beta1.DeploymentList": { - "id": "v1beta1.DeploymentList", - "description": "DeploymentList is a list of Deployments.", - "required": [ - "items" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ListMeta", - "description": "Standard list metadata." - }, - "items": { - "type": "array", - "items": { - "$ref": "v1beta1.Deployment" - }, - "description": "Items is the list of Deployments." - } - } - }, - "v1beta1.Deployment": { - "id": "v1beta1.Deployment", - "description": "DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ObjectMeta", - "description": "Standard object metadata." - }, - "spec": { - "$ref": "v1beta1.DeploymentSpec", - "description": "Specification of the desired behavior of the Deployment." - }, - "status": { - "$ref": "v1beta1.DeploymentStatus", - "description": "Most recently observed status of the Deployment." - } - } - }, - "v1beta1.DeploymentSpec": { - "id": "v1beta1.DeploymentSpec", - "description": "DeploymentSpec is the specification of the desired behavior of the Deployment.", - "required": [ - "template" - ], - "properties": { - "replicas": { - "type": "integer", - "format": "int32", - "description": "Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1." - }, - "selector": { - "$ref": "v1.LabelSelector", - "description": "Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment." - }, - "template": { - "$ref": "v1.PodTemplateSpec", - "description": "Template describes the pods that will be created." - }, - "strategy": { - "$ref": "v1beta1.DeploymentStrategy", - "description": "The deployment strategy to use to replace existing pods with new ones." - }, - "minReadySeconds": { - "type": "integer", - "format": "int32", - "description": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)" - }, - "revisionHistoryLimit": { - "type": "integer", - "format": "int32", - "description": "The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified." - }, - "paused": { - "type": "boolean", - "description": "Indicates that the deployment is paused and will not be processed by the deployment controller." - }, - "rollbackTo": { - "$ref": "v1beta1.RollbackConfig", - "description": "DEPRECATED. The config this deployment is rolling back to. Will be cleared after rollback is done." - }, - "progressDeadlineSeconds": { - "type": "integer", - "format": "int32", - "description": "The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. This is not set by default." - } - } - }, - "v1beta1.DeploymentStrategy": { - "id": "v1beta1.DeploymentStrategy", - "description": "DeploymentStrategy describes how to replace existing pods with new ones.", - "properties": { - "type": { - "type": "string", - "description": "Type of deployment. Can be \"Recreate\" or \"RollingUpdate\". Default is RollingUpdate." - }, - "rollingUpdate": { - "$ref": "v1beta1.RollingUpdateDeployment", - "description": "Rolling update config params. Present only if DeploymentStrategyType = RollingUpdate." - } - } - }, - "v1beta1.RollingUpdateDeployment": { - "id": "v1beta1.RollingUpdateDeployment", - "description": "Spec to control the desired behavior of rolling update.", - "properties": { - "maxUnavailable": { - "type": "string", - "description": "The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. By default, a fixed value of 1 is used. Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old RC can be scaled down further, followed by scaling up the new RC, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods." - }, - "maxSurge": { - "type": "string", - "description": "The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. By default, a value of 1 is used. Example: when this is set to 30%, the new RC can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new RC can be scaled up further, ensuring that total number of pods running at any time during the update is atmost 130% of desired pods." - } - } - }, - "v1beta1.RollbackConfig": { - "id": "v1beta1.RollbackConfig", - "description": "DEPRECATED.", - "properties": { - "revision": { - "type": "integer", - "format": "int64", - "description": "The revision to rollback to. If set to 0, rollback to the last revision." - } - } - }, - "v1beta1.DeploymentStatus": { - "id": "v1beta1.DeploymentStatus", - "description": "DeploymentStatus is the most recently observed status of the Deployment.", - "properties": { - "observedGeneration": { - "type": "integer", - "format": "int64", - "description": "The generation observed by the deployment controller." - }, - "replicas": { - "type": "integer", - "format": "int32", - "description": "Total number of non-terminated pods targeted by this deployment (their labels match the selector)." - }, - "updatedReplicas": { - "type": "integer", - "format": "int32", - "description": "Total number of non-terminated pods targeted by this deployment that have the desired template spec." - }, - "readyReplicas": { - "type": "integer", - "format": "int32", - "description": "Total number of ready pods targeted by this deployment." - }, - "availableReplicas": { - "type": "integer", - "format": "int32", - "description": "Total number of available pods (ready for at least minReadySeconds) targeted by this deployment." - }, - "unavailableReplicas": { - "type": "integer", - "format": "int32", - "description": "Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created." - }, - "conditions": { - "type": "array", - "items": { - "$ref": "v1beta1.DeploymentCondition" - }, - "description": "Represents the latest available observations of a deployment's current state." - }, - "collisionCount": { - "type": "integer", - "format": "int32", - "description": "Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet." - } - } - }, - "v1beta1.DeploymentCondition": { - "id": "v1beta1.DeploymentCondition", - "description": "DeploymentCondition describes the state of a deployment at a certain point.", - "required": [ - "type", - "status" - ], - "properties": { - "type": { - "type": "string", - "description": "Type of deployment condition." - }, - "status": { - "type": "string", - "description": "Status of the condition, one of True, False, Unknown." - }, - "lastUpdateTime": { - "type": "string", - "description": "The last time this condition was updated." - }, - "lastTransitionTime": { - "type": "string", - "description": "Last time the condition transitioned from one status to another." - }, - "reason": { - "type": "string", - "description": "The reason for the condition's last transition." - }, - "message": { - "type": "string", - "description": "A human readable message indicating details about the transition." - } - } - }, - "v1beta1.DeploymentRollback": { - "id": "v1beta1.DeploymentRollback", - "description": "DEPRECATED. DeploymentRollback stores the information required to rollback a deployment.", - "required": [ - "name", - "rollbackTo" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "name": { - "type": "string", - "description": "Required: This must match the Name of a deployment." - }, - "updatedAnnotations": { - "type": "object", - "description": "The annotations to be updated to a deployment" - }, - "rollbackTo": { - "$ref": "v1beta1.RollbackConfig", - "description": "The config of this deployment rollback." - } - } - }, - "v1beta1.Scale": { - "id": "v1beta1.Scale", - "description": "represents a scaling request for a resource.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ObjectMeta", - "description": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata." - }, - "spec": { - "$ref": "v1beta1.ScaleSpec", - "description": "defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status." - }, - "status": { - "$ref": "v1beta1.ScaleStatus", - "description": "current status of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status. Read-only." - } - } - }, - "v1beta1.ScaleSpec": { - "id": "v1beta1.ScaleSpec", - "description": "describes the attributes of a scale subresource", - "properties": { - "replicas": { - "type": "integer", - "format": "int32", - "description": "desired number of instances for the scaled object." - } - } - }, - "v1beta1.ScaleStatus": { - "id": "v1beta1.ScaleStatus", - "description": "represents the current status of a scale subresource.", - "required": [ - "replicas" - ], - "properties": { - "replicas": { - "type": "integer", - "format": "int32", - "description": "actual number of observed instances of the scaled object." - }, - "selector": { - "type": "object", - "description": "label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors" - }, - "targetSelector": { - "type": "string", - "description": "label selector for pods that should match the replicas count. This is a serializated version of both map-based and more expressive set-based selectors. This is done to avoid introspection in the clients. The string will be in the same format as the query-param syntax. If the target type only supports map-based selectors, both this field and map-based selector field are populated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors" - } - } - }, - "v1beta1.IngressList": { - "id": "v1beta1.IngressList", - "description": "IngressList is a collection of Ingress.", - "required": [ - "items" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ListMeta", - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "items": { - "type": "array", - "items": { - "$ref": "v1beta1.Ingress" - }, - "description": "Items is the list of Ingress." - } - } - }, - "v1beta1.Ingress": { - "id": "v1beta1.Ingress", - "description": "Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ObjectMeta", - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "spec": { - "$ref": "v1beta1.IngressSpec", - "description": "Spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status" - }, - "status": { - "$ref": "v1beta1.IngressStatus", - "description": "Status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status" - } - } - }, - "v1beta1.IngressSpec": { - "id": "v1beta1.IngressSpec", - "description": "IngressSpec describes the Ingress the user wishes to exist.", - "properties": { - "backend": { - "$ref": "v1beta1.IngressBackend", - "description": "A default backend capable of servicing requests that don't match any rule. At least one of 'backend' or 'rules' must be specified. This field is optional to allow the loadbalancer controller or defaulting logic to specify a global default." - }, - "tls": { - "type": "array", - "items": { - "$ref": "v1beta1.IngressTLS" - }, - "description": "TLS configuration. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI." - }, - "rules": { - "type": "array", - "items": { - "$ref": "v1beta1.IngressRule" - }, - "description": "A list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend." - } - } - }, - "v1beta1.IngressBackend": { - "id": "v1beta1.IngressBackend", - "description": "IngressBackend describes all endpoints for a given service and port.", - "required": [ - "serviceName", - "servicePort" - ], - "properties": { - "serviceName": { - "type": "string", - "description": "Specifies the name of the referenced service." - }, - "servicePort": { - "type": "string", - "description": "Specifies the port of the referenced service." - } - } - }, - "v1beta1.IngressTLS": { - "id": "v1beta1.IngressTLS", - "description": "IngressTLS describes the transport layer security associated with an Ingress.", - "properties": { - "hosts": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Hosts are a list of hosts included in the TLS certificate. The values in this list must match the name/s used in the tlsSecret. Defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress, if left unspecified." - }, - "secretName": { - "type": "string", - "description": "SecretName is the name of the secret used to terminate SSL traffic on 443. Field is left optional to allow SSL routing based on SNI hostname alone. If the SNI host in a listener conflicts with the \"Host\" header field used by an IngressRule, the SNI host is used for termination and value of the Host header is used for routing." - } - } - }, - "v1beta1.IngressRule": { - "id": "v1beta1.IngressRule", - "description": "IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue.", - "properties": { - "host": { - "type": "string", - "description": "Host is the fully qualified domain name of a network host, as defined by RFC 3986. Note the following deviations from the \"host\" part of the URI as defined in the RFC: 1. IPs are not allowed. Currently an IngressRuleValue can only apply to the\n\t IP in the Spec of the parent Ingress.\n2. The `:` delimiter is not respected because ports are not allowed.\n\t Currently the port of an Ingress is implicitly :80 for http and\n\t :443 for https.\nBoth these may change in the future. Incoming requests are matched against the host before the IngressRuleValue. If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue." - }, - "http": { - "$ref": "v1beta1.HTTPIngressRuleValue" - } - } - }, - "v1beta1.HTTPIngressRuleValue": { - "id": "v1beta1.HTTPIngressRuleValue", - "description": "HTTPIngressRuleValue is a list of http selectors pointing to backends. In the example: http://\u003chost\u003e/\u003cpath\u003e?\u003csearchpart\u003e -\u003e backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last '/' and before the first '?' or '#'.", - "required": [ - "paths" - ], - "properties": { - "paths": { - "type": "array", - "items": { - "$ref": "v1beta1.HTTPIngressPath" - }, - "description": "A collection of paths that map requests to backends." - } - } - }, - "v1beta1.HTTPIngressPath": { - "id": "v1beta1.HTTPIngressPath", - "description": "HTTPIngressPath associates a path regex with a backend. Incoming urls matching the path are forwarded to the backend.", - "required": [ - "backend" - ], - "properties": { - "path": { - "type": "string", - "description": "Path is an extended POSIX regex as defined by IEEE Std 1003.1, (i.e this follows the egrep/unix syntax, not the perl syntax) matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional \"path\" part of a URL as defined by RFC 3986. Paths must begin with a '/'. If unspecified, the path defaults to a catch all sending traffic to the backend." - }, - "backend": { - "$ref": "v1beta1.IngressBackend", - "description": "Backend defines the referenced service endpoint to which the traffic will be forwarded to." - } - } - }, - "v1beta1.IngressStatus": { - "id": "v1beta1.IngressStatus", - "description": "IngressStatus describe the current state of the Ingress.", - "properties": { - "loadBalancer": { - "$ref": "v1.LoadBalancerStatus", - "description": "LoadBalancer contains the current status of the load-balancer." - } - } - }, - "v1.LoadBalancerStatus": { - "id": "v1.LoadBalancerStatus", - "description": "LoadBalancerStatus represents the status of a load-balancer.", - "properties": { - "ingress": { - "type": "array", - "items": { - "$ref": "v1.LoadBalancerIngress" - }, - "description": "Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points." - } - } - }, - "v1.LoadBalancerIngress": { - "id": "v1.LoadBalancerIngress", - "description": "LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.", - "properties": { - "ip": { - "type": "string", - "description": "IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)" - }, - "hostname": { - "type": "string", - "description": "Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers)" - } - } - }, - "v1beta1.ReplicaSetList": { - "id": "v1beta1.ReplicaSetList", - "description": "ReplicaSetList is a collection of ReplicaSets.", - "required": [ - "items" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ListMeta", - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "items": { - "type": "array", - "items": { - "$ref": "v1beta1.ReplicaSet" - }, - "description": "List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller" - } - } - }, - "v1beta1.ReplicaSet": { - "id": "v1beta1.ReplicaSet", - "description": "DEPRECATED - This group version of ReplicaSet is deprecated by apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ObjectMeta", - "description": "If the Labels of a ReplicaSet are empty, they are defaulted to be the same as the Pod(s) that the ReplicaSet manages. Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "spec": { - "$ref": "v1beta1.ReplicaSetSpec", - "description": "Spec defines the specification of the desired behavior of the ReplicaSet. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status" - }, - "status": { - "$ref": "v1beta1.ReplicaSetStatus", - "description": "Status is the most recently observed status of the ReplicaSet. This data may be out of date by some window of time. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status" - } - } - }, - "v1beta1.ReplicaSetSpec": { - "id": "v1beta1.ReplicaSetSpec", - "description": "ReplicaSetSpec is the specification of a ReplicaSet.", - "properties": { - "replicas": { - "type": "integer", - "format": "int32", - "description": "Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller" - }, - "minReadySeconds": { - "type": "integer", - "format": "int32", - "description": "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)" - }, - "selector": { - "$ref": "v1.LabelSelector", - "description": "Selector is a label query over pods that should match the replica count. If the selector is empty, it is defaulted to the labels present on the pod template. Label keys and values that must match in order to be controlled by this replica set. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors" - }, - "template": { - "$ref": "v1.PodTemplateSpec", - "description": "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template" - } - } - }, - "v1beta1.ReplicaSetStatus": { - "id": "v1beta1.ReplicaSetStatus", - "description": "ReplicaSetStatus represents the current status of a ReplicaSet.", - "required": [ - "replicas" - ], - "properties": { - "replicas": { - "type": "integer", - "format": "int32", - "description": "Replicas is the most recently oberved number of replicas. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller" - }, - "fullyLabeledReplicas": { - "type": "integer", - "format": "int32", - "description": "The number of pods that have labels matching the labels of the pod template of the replicaset." - }, - "readyReplicas": { - "type": "integer", - "format": "int32", - "description": "The number of ready replicas for this replica set." - }, - "availableReplicas": { - "type": "integer", - "format": "int32", - "description": "The number of available replicas (ready for at least minReadySeconds) for this replica set." - }, - "observedGeneration": { - "type": "integer", - "format": "int64", - "description": "ObservedGeneration reflects the generation of the most recently observed ReplicaSet." - }, - "conditions": { - "type": "array", - "items": { - "$ref": "v1beta1.ReplicaSetCondition" - }, - "description": "Represents the latest available observations of a replica set's current state." - } - } - }, - "v1beta1.ReplicaSetCondition": { - "id": "v1beta1.ReplicaSetCondition", - "description": "ReplicaSetCondition describes the state of a replica set at a certain point.", - "required": [ - "type", - "status" - ], - "properties": { - "type": { - "type": "string", - "description": "Type of replica set condition." - }, - "status": { - "type": "string", - "description": "Status of the condition, one of True, False, Unknown." - }, - "lastTransitionTime": { - "type": "string", - "description": "The last time the condition transitioned from one status to another." - }, - "reason": { - "type": "string", - "description": "The reason for the condition's last transition." - }, - "message": { - "type": "string", - "description": "A human readable message indicating details about the transition." - } - } - }, - "v1.APIResourceList": { - "id": "v1.APIResourceList", - "description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", - "required": [ - "groupVersion", - "resources" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "groupVersion": { - "type": "string", - "description": "groupVersion is the group and version this APIResourceList is for." - }, - "resources": { - "type": "array", - "items": { - "$ref": "v1.APIResource" - }, - "description": "resources contains the name of the resources and if they are namespaced." - } - } - }, - "v1.APIResource": { - "id": "v1.APIResource", - "description": "APIResource specifies the name of a resource and whether it is namespaced.", - "required": [ - "name", - "singularName", - "namespaced", - "kind", - "verbs" - ], - "properties": { - "name": { - "type": "string", - "description": "name is the plural name of the resource." - }, - "singularName": { - "type": "string", - "description": "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface." - }, - "namespaced": { - "type": "boolean", - "description": "namespaced indicates if a resource is namespaced or not." - }, - "group": { - "type": "string", - "description": "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\"." - }, - "version": { - "type": "string", - "description": "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\"." - }, - "kind": { - "type": "string", - "description": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')" - }, - "verbs": { - "type": "array", - "items": { - "type": "string" - }, - "description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)" - }, - "shortNames": { - "type": "array", - "items": { - "type": "string" - }, - "description": "shortNames is a list of suggested short names of the resource." - }, - "categories": { - "type": "array", - "items": { - "type": "string" - }, - "description": "categories is a list of the grouped resources this resource belongs to (e.g. 'all')" - } - } - } - } - } diff --git a/federation/apis/swagger-spec/federation.json b/federation/apis/swagger-spec/federation.json deleted file mode 100644 index cb6deba1cc..0000000000 --- a/federation/apis/swagger-spec/federation.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "swaggerVersion": "1.2", - "apiVersion": "", - "basePath": "https://10.10.10.10:6443", - "resourcePath": "/apis/federation", - "info": { - "title": "", - "description": "" - }, - "apis": [ - { - "path": "/apis/federation", - "description": "get information of a group", - "operations": [ - { - "type": "v1.APIGroup", - "method": "GET", - "summary": "get information of a group", - "nickname": "getAPIGroup", - "parameters": [], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ] - } - ] - } - ], - "models": { - "v1.APIGroup": { - "id": "v1.APIGroup", - "description": "APIGroup contains the name, the supported versions, and the preferred version of a group.", - "required": [ - "name", - "versions", - "serverAddressByClientCIDRs" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "name": { - "type": "string", - "description": "name is the name of the group." - }, - "versions": { - "type": "array", - "items": { - "$ref": "v1.GroupVersionForDiscovery" - }, - "description": "versions are the versions supported in this group." - }, - "preferredVersion": { - "$ref": "v1.GroupVersionForDiscovery", - "description": "preferredVersion is the version preferred by the API server, which probably is the storage version." - }, - "serverAddressByClientCIDRs": { - "type": "array", - "items": { - "$ref": "v1.ServerAddressByClientCIDR" - }, - "description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP." - } - } - }, - "v1.GroupVersionForDiscovery": { - "id": "v1.GroupVersionForDiscovery", - "description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.", - "required": [ - "groupVersion", - "version" - ], - "properties": { - "groupVersion": { - "type": "string", - "description": "groupVersion specifies the API group and version in the form \"group/version\"" - }, - "version": { - "type": "string", - "description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion." - } - } - }, - "v1.ServerAddressByClientCIDR": { - "id": "v1.ServerAddressByClientCIDR", - "description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.", - "required": [ - "clientCIDR", - "serverAddress" - ], - "properties": { - "clientCIDR": { - "type": "string", - "description": "The CIDR with which clients can match their IP to figure out the server address that they should use." - }, - "serverAddress": { - "type": "string", - "description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port." - } - } - } - } - } diff --git a/federation/apis/swagger-spec/federation_v1beta1.json b/federation/apis/swagger-spec/federation_v1beta1.json deleted file mode 100644 index 925cfba20f..0000000000 --- a/federation/apis/swagger-spec/federation_v1beta1.json +++ /dev/null @@ -1,1361 +0,0 @@ -{ - "swaggerVersion": "1.2", - "apiVersion": "federation/v1beta1", - "basePath": "https://10.10.10.10:6443", - "resourcePath": "/apis/federation/v1beta1", - "info": { - "title": "", - "description": "" - }, - "apis": [ - { - "path": "/apis/federation/v1beta1/clusters", - "description": "API at /apis/federation/v1beta1", - "operations": [ - { - "type": "v1beta1.ClusterList", - "method": "GET", - "summary": "list or watch objects of kind Cluster", - "nickname": "listCluster", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.ClusterList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Cluster", - "method": "POST", - "summary": "create a Cluster", - "nickname": "createCluster", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.Cluster", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Cluster" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.Cluster" - }, - { - "code": 202, - "message": "Accepted", - "responseModel": "v1beta1.Cluster" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete collection of Cluster", - "nickname": "deletecollectionCluster", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/federation/v1beta1/watch/clusters", - "description": "API at /apis/federation/v1beta1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of Cluster", - "nickname": "watchClusterList", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/federation/v1beta1/clusters/{name}", - "description": "API at /apis/federation/v1beta1", - "operations": [ - { - "type": "v1beta1.Cluster", - "method": "GET", - "summary": "read the specified Cluster", - "nickname": "readCluster", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "export", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "exact", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Cluster", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Cluster" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Cluster", - "method": "PUT", - "summary": "replace the specified Cluster", - "nickname": "replaceCluster", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.Cluster", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Cluster", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Cluster" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.Cluster" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1beta1.Cluster", - "method": "PATCH", - "summary": "partially update the specified Cluster", - "nickname": "patchCluster", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Cluster", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Cluster" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete a Cluster", - "nickname": "deleteCluster", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.DeleteOptions", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "gracePeriodSeconds", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "orphanDependents", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "propagationPolicy", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Cluster", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/federation/v1beta1/watch/clusters/{name}", - "description": "API at /apis/federation/v1beta1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch changes to an object of kind Cluster", - "nickname": "watchCluster", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Cluster", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/federation/v1beta1/clusters/{name}/status", - "description": "API at /apis/federation/v1beta1", - "operations": [ - { - "type": "v1beta1.Cluster", - "method": "PUT", - "summary": "replace status of the specified Cluster", - "nickname": "replaceClusterStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1beta1.Cluster", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Cluster", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1beta1.Cluster" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1beta1.Cluster" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/apis/federation/v1beta1", - "description": "API at /apis/federation/v1beta1", - "operations": [ - { - "type": "v1.APIResourceList", - "method": "GET", - "summary": "get available resources", - "nickname": "getAPIResources", - "parameters": [], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ] - } - ] - } - ], - "models": { - "v1beta1.ClusterList": { - "id": "v1beta1.ClusterList", - "description": "A list of all the kubernetes clusters registered to the federation", - "required": [ - "items" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ListMeta", - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "items": { - "type": "array", - "items": { - "$ref": "v1beta1.Cluster" - }, - "description": "List of Cluster objects." - } - } - }, - "v1.ListMeta": { - "id": "v1.ListMeta", - "description": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", - "properties": { - "selfLink": { - "type": "string", - "description": "selfLink is a URL representing this object. Populated by the system. Read-only." - }, - "resourceVersion": { - "type": "string", - "description": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" - }, - "continue": { - "type": "string", - "description": "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response." - } - } - }, - "v1beta1.Cluster": { - "id": "v1beta1.Cluster", - "description": "Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ObjectMeta", - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "spec": { - "$ref": "v1beta1.ClusterSpec", - "description": "Spec defines the behavior of the Cluster." - }, - "status": { - "$ref": "v1beta1.ClusterStatus", - "description": "Status describes the current status of a Cluster" - } - } - }, - "v1.ObjectMeta": { - "id": "v1.ObjectMeta", - "description": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", - "properties": { - "name": { - "type": "string", - "description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names" - }, - "generateName": { - "type": "string", - "description": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - }, - "namespace": { - "type": "string", - "description": "Namespace defines the space within each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" - }, - "selfLink": { - "type": "string", - "description": "SelfLink is a URL representing this object. Populated by the system. Read-only." - }, - "uid": { - "type": "string", - "description": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - }, - "resourceVersion": { - "type": "string", - "description": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" - }, - "generation": { - "type": "integer", - "format": "int64", - "description": "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only." - }, - "creationTimestamp": { - "type": "string", - "description": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "deletionTimestamp": { - "type": "string", - "description": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field. Once set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "deletionGracePeriodSeconds": { - "type": "integer", - "format": "int64", - "description": "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only." - }, - "labels": { - "type": "object", - "description": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels" - }, - "annotations": { - "type": "object", - "description": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations" - }, - "ownerReferences": { - "type": "array", - "items": { - "$ref": "v1.OwnerReference" - }, - "description": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller." - }, - "initializers": { - "$ref": "v1.Initializers", - "description": "An initializer is a controller which enforces some system invariant at object creation time. This field is a list of initializers that have not yet acted on this object. If nil or empty, this object has been completely initialized. Otherwise, the object is considered uninitialized and is hidden (in list/watch and get calls) from clients that haven't explicitly asked to observe uninitialized objects.\n\nWhen an object is created, the system will populate this list with the current set of initializers. Only privileged users may set or modify this list. Once it is empty, it may not be modified further by any user." - }, - "finalizers": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed." - }, - "clusterName": { - "type": "string", - "description": "The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request." - } - } - }, - "v1.OwnerReference": { - "id": "v1.OwnerReference", - "description": "OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field.", - "required": [ - "apiVersion", - "kind", - "name", - "uid" - ], - "properties": { - "apiVersion": { - "type": "string", - "description": "API version of the referent." - }, - "kind": { - "type": "string", - "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "name": { - "type": "string", - "description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names" - }, - "uid": { - "type": "string", - "description": "UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - }, - "controller": { - "type": "boolean", - "description": "If true, this reference points to the managing controller." - }, - "blockOwnerDeletion": { - "type": "boolean", - "description": "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned." - } - } - }, - "v1.Initializers": { - "id": "v1.Initializers", - "description": "Initializers tracks the progress of initialization.", - "required": [ - "pending" - ], - "properties": { - "pending": { - "type": "array", - "items": { - "$ref": "v1.Initializer" - }, - "description": "Pending is a list of initializers that must execute in order before this object is visible. When the last pending initializer is removed, and no failing result is set, the initializers struct will be set to nil and the object is considered as initialized and visible to all clients." - }, - "result": { - "$ref": "v1.Status", - "description": "If result is set with the Failure field, the object will be persisted to storage and then deleted, ensuring that other clients can observe the deletion." - } - } - }, - "v1.Initializer": { - "id": "v1.Initializer", - "description": "Initializer is information about an initializer that has not yet completed.", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "description": "name of the process that is responsible for initializing this object." - } - } - }, - "v1.Status": { - "id": "v1.Status", - "description": "Status is a return value for calls that don't return other objects.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ListMeta", - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "status": { - "type": "string", - "description": "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status" - }, - "message": { - "type": "string", - "description": "A human-readable description of the status of this operation." - }, - "reason": { - "type": "string", - "description": "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it." - }, - "details": { - "$ref": "v1.StatusDetails", - "description": "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type." - }, - "code": { - "type": "integer", - "format": "int32", - "description": "Suggested HTTP return code for this status, 0 if not set." - } - } - }, - "v1.StatusDetails": { - "id": "v1.StatusDetails", - "description": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.", - "properties": { - "name": { - "type": "string", - "description": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described)." - }, - "group": { - "type": "string", - "description": "The group attribute of the resource associated with the status StatusReason." - }, - "kind": { - "type": "string", - "description": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "uid": { - "type": "string", - "description": "UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - }, - "causes": { - "type": "array", - "items": { - "$ref": "v1.StatusCause" - }, - "description": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes." - }, - "retryAfterSeconds": { - "type": "integer", - "format": "int32", - "description": "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action." - } - } - }, - "v1.StatusCause": { - "id": "v1.StatusCause", - "description": "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.", - "properties": { - "reason": { - "type": "string", - "description": "A machine-readable description of the cause of the error. If this value is empty there is no information available." - }, - "message": { - "type": "string", - "description": "A human-readable description of the cause of the error. This field may be presented as-is to a reader." - }, - "field": { - "type": "string", - "description": "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"" - } - } - }, - "v1beta1.ClusterSpec": { - "id": "v1beta1.ClusterSpec", - "description": "ClusterSpec describes the attributes of a kubernetes cluster.", - "required": [ - "serverAddressByClientCIDRs" - ], - "properties": { - "serverAddressByClientCIDRs": { - "type": "array", - "items": { - "$ref": "v1beta1.ServerAddressByClientCIDR" - }, - "description": "A map of client CIDR to server address. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR." - }, - "secretRef": { - "$ref": "v1.LocalObjectReference", - "description": "Name of the secret containing kubeconfig to access this cluster. The secret is read from the kubernetes cluster that is hosting federation control plane. Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key \"kubeconfig\". This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets. This can be left empty if the cluster allows insecure access." - } - } - }, - "v1beta1.ServerAddressByClientCIDR": { - "id": "v1beta1.ServerAddressByClientCIDR", - "description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.", - "required": [ - "clientCIDR", - "serverAddress" - ], - "properties": { - "clientCIDR": { - "type": "string", - "description": "The CIDR with which clients can match their IP to figure out the server address that they should use." - }, - "serverAddress": { - "type": "string", - "description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port." - } - } - }, - "v1.LocalObjectReference": { - "id": "v1.LocalObjectReference", - "description": "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.", - "properties": { - "name": { - "type": "string", - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - } - } - }, - "v1beta1.ClusterStatus": { - "id": "v1beta1.ClusterStatus", - "description": "ClusterStatus is information about the current status of a cluster updated by cluster controller periodically.", - "properties": { - "conditions": { - "type": "array", - "items": { - "$ref": "v1beta1.ClusterCondition" - }, - "description": "Conditions is an array of current cluster conditions." - }, - "zones": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. These will always be in the same region." - }, - "region": { - "type": "string", - "description": "Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'." - } - } - }, - "v1beta1.ClusterCondition": { - "id": "v1beta1.ClusterCondition", - "description": "ClusterCondition describes current state of a cluster.", - "required": [ - "type", - "status" - ], - "properties": { - "type": { - "type": "string", - "description": "Type of cluster condition, Complete or Failed." - }, - "status": { - "type": "string", - "description": "Status of the condition, one of True, False, Unknown." - }, - "lastProbeTime": { - "type": "string", - "description": "Last time the condition was checked." - }, - "lastTransitionTime": { - "type": "string", - "description": "Last time the condition transit from one status to another." - }, - "reason": { - "type": "string", - "description": "(brief) reason for the condition's last transition." - }, - "message": { - "type": "string", - "description": "Human readable message indicating details about last transition." - } - } - }, - "v1.WatchEvent": { - "id": "v1.WatchEvent", - "required": [ - "type", - "object" - ], - "properties": { - "type": { - "type": "string" - }, - "object": { - "type": "string" - } - } - }, - "v1.Patch": { - "id": "v1.Patch", - "description": "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.", - "properties": {} - }, - "v1.DeleteOptions": { - "id": "v1.DeleteOptions", - "description": "DeleteOptions may be provided when deleting an API object.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "gracePeriodSeconds": { - "type": "integer", - "format": "int64", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately." - }, - "preconditions": { - "$ref": "v1.Preconditions", - "description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned." - }, - "orphanDependents": { - "type": "boolean", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both." - }, - "propagationPolicy": { - "$ref": "v1.DeletionPropagation", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy." - } - } - }, - "v1.Preconditions": { - "id": "v1.Preconditions", - "description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.", - "properties": { - "uid": { - "$ref": "types.UID", - "description": "Specifies the target UID." - } - } - }, - "types.UID": { - "id": "types.UID", - "properties": {} - }, - "v1.DeletionPropagation": { - "id": "v1.DeletionPropagation", - "properties": {} - }, - "v1.APIResourceList": { - "id": "v1.APIResourceList", - "description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", - "required": [ - "groupVersion", - "resources" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "groupVersion": { - "type": "string", - "description": "groupVersion is the group and version this APIResourceList is for." - }, - "resources": { - "type": "array", - "items": { - "$ref": "v1.APIResource" - }, - "description": "resources contains the name of the resources and if they are namespaced." - } - } - }, - "v1.APIResource": { - "id": "v1.APIResource", - "description": "APIResource specifies the name of a resource and whether it is namespaced.", - "required": [ - "name", - "singularName", - "namespaced", - "kind", - "verbs" - ], - "properties": { - "name": { - "type": "string", - "description": "name is the plural name of the resource." - }, - "singularName": { - "type": "string", - "description": "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface." - }, - "namespaced": { - "type": "boolean", - "description": "namespaced indicates if a resource is namespaced or not." - }, - "group": { - "type": "string", - "description": "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\"." - }, - "version": { - "type": "string", - "description": "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\"." - }, - "kind": { - "type": "string", - "description": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')" - }, - "verbs": { - "type": "array", - "items": { - "type": "string" - }, - "description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)" - }, - "shortNames": { - "type": "array", - "items": { - "type": "string" - }, - "description": "shortNames is a list of suggested short names of the resource." - }, - "categories": { - "type": "array", - "items": { - "type": "string" - }, - "description": "categories is a list of the grouped resources this resource belongs to (e.g. 'all')" - } - } - } - } - } diff --git a/federation/apis/swagger-spec/logs.json b/federation/apis/swagger-spec/logs.json deleted file mode 100644 index e8fae7c9a2..0000000000 --- a/federation/apis/swagger-spec/logs.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "swaggerVersion": "1.2", - "apiVersion": "", - "basePath": "https://10.10.10.10:6443", - "resourcePath": "/logs", - "info": { - "title": "", - "description": "" - }, - "apis": [ - { - "path": "/logs/{logpath}", - "description": "get log files", - "operations": [ - { - "type": "void", - "method": "GET", - "nickname": "logFileHandler", - "parameters": [ - { - "type": "string", - "paramType": "path", - "name": "logpath", - "description": "path to the log", - "required": true, - "allowMultiple": false - } - ] - } - ] - }, - { - "path": "/logs", - "description": "get log files", - "operations": [ - { - "type": "void", - "method": "GET", - "nickname": "logFileListHandler", - "parameters": [] - } - ] - } - ], - "models": {} - } diff --git a/federation/apis/swagger-spec/resourceListing.json b/federation/apis/swagger-spec/resourceListing.json deleted file mode 100644 index 6d37716351..0000000000 --- a/federation/apis/swagger-spec/resourceListing.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "swaggerVersion": "1.2", - "apis": [ - { - "path": "/version", - "description": "git code version from which this is built" - }, - { - "path": "/apis", - "description": "get available API versions" - }, - { - "path": "/logs", - "description": "get log files" - }, - { - "path": "/apis/federation/v1beta1", - "description": "API at /apis/federation/v1beta1" - }, - { - "path": "/apis/federation", - "description": "get information of a group" - }, - { - "path": "/api/v1", - "description": "API at /api/v1" - }, - { - "path": "/api", - "description": "get available API versions" - }, - { - "path": "/apis/extensions/v1beta1", - "description": "API at /apis/extensions/v1beta1" - }, - { - "path": "/apis/extensions", - "description": "get information of a group" - } - ], - "apiVersion": "", - "info": { - "title": "", - "description": "" - } - } diff --git a/federation/apis/swagger-spec/v1.json b/federation/apis/swagger-spec/v1.json deleted file mode 100644 index f9095d7626..0000000000 --- a/federation/apis/swagger-spec/v1.json +++ /dev/null @@ -1,5841 +0,0 @@ -{ - "swaggerVersion": "1.2", - "apiVersion": "v1", - "basePath": "https://10.10.10.10:6443", - "resourcePath": "/api/v1", - "info": { - "title": "", - "description": "" - }, - "apis": [ - { - "path": "/api/v1/namespaces/{namespace}/configmaps", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.ConfigMapList", - "method": "GET", - "summary": "list or watch objects of kind ConfigMap", - "nickname": "listNamespacedConfigMap", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.ConfigMapList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.ConfigMap", - "method": "POST", - "summary": "create a ConfigMap", - "nickname": "createNamespacedConfigMap", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.ConfigMap", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.ConfigMap" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1.ConfigMap" - }, - { - "code": 202, - "message": "Accepted", - "responseModel": "v1.ConfigMap" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete collection of ConfigMap", - "nickname": "deletecollectionNamespacedConfigMap", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/watch/namespaces/{namespace}/configmaps", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of ConfigMap", - "nickname": "watchNamespacedConfigMapList", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/namespaces/{namespace}/configmaps/{name}", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.ConfigMap", - "method": "GET", - "summary": "read the specified ConfigMap", - "nickname": "readNamespacedConfigMap", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "export", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "exact", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the ConfigMap", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.ConfigMap" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.ConfigMap", - "method": "PUT", - "summary": "replace the specified ConfigMap", - "nickname": "replaceNamespacedConfigMap", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.ConfigMap", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the ConfigMap", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.ConfigMap" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1.ConfigMap" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.ConfigMap", - "method": "PATCH", - "summary": "partially update the specified ConfigMap", - "nickname": "patchNamespacedConfigMap", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the ConfigMap", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.ConfigMap" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete a ConfigMap", - "nickname": "deleteNamespacedConfigMap", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.DeleteOptions", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "gracePeriodSeconds", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "orphanDependents", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "propagationPolicy", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the ConfigMap", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/watch/namespaces/{namespace}/configmaps/{name}", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch changes to an object of kind ConfigMap", - "nickname": "watchNamespacedConfigMap", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the ConfigMap", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/configmaps", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.ConfigMapList", - "method": "GET", - "summary": "list or watch objects of kind ConfigMap", - "nickname": "listConfigMapForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.ConfigMapList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/watch/configmaps", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of ConfigMap", - "nickname": "watchConfigMapListForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/namespaces/{namespace}/events", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.EventList", - "method": "GET", - "summary": "list or watch objects of kind Event", - "nickname": "listNamespacedEvent", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.EventList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Event", - "method": "POST", - "summary": "create an Event", - "nickname": "createNamespacedEvent", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Event", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Event" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1.Event" - }, - { - "code": 202, - "message": "Accepted", - "responseModel": "v1.Event" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete collection of Event", - "nickname": "deletecollectionNamespacedEvent", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/watch/namespaces/{namespace}/events", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of Event", - "nickname": "watchNamespacedEventList", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/namespaces/{namespace}/events/{name}", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.Event", - "method": "GET", - "summary": "read the specified Event", - "nickname": "readNamespacedEvent", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "export", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "exact", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Event", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Event" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Event", - "method": "PUT", - "summary": "replace the specified Event", - "nickname": "replaceNamespacedEvent", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Event", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Event", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Event" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1.Event" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Event", - "method": "PATCH", - "summary": "partially update the specified Event", - "nickname": "patchNamespacedEvent", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Event", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Event" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete an Event", - "nickname": "deleteNamespacedEvent", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.DeleteOptions", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "gracePeriodSeconds", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "orphanDependents", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "propagationPolicy", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Event", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/watch/namespaces/{namespace}/events/{name}", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch changes to an object of kind Event", - "nickname": "watchNamespacedEvent", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Event", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/events", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.EventList", - "method": "GET", - "summary": "list or watch objects of kind Event", - "nickname": "listEventForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.EventList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/watch/events", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of Event", - "nickname": "watchEventListForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/namespaces", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.NamespaceList", - "method": "GET", - "summary": "list or watch objects of kind Namespace", - "nickname": "listNamespace", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.NamespaceList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Namespace", - "method": "POST", - "summary": "create a Namespace", - "nickname": "createNamespace", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Namespace", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Namespace" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1.Namespace" - }, - { - "code": 202, - "message": "Accepted", - "responseModel": "v1.Namespace" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/watch/namespaces", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of Namespace", - "nickname": "watchNamespaceList", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/namespaces/{name}", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.Namespace", - "method": "GET", - "summary": "read the specified Namespace", - "nickname": "readNamespace", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "export", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "exact", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Namespace", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Namespace" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Namespace", - "method": "PUT", - "summary": "replace the specified Namespace", - "nickname": "replaceNamespace", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Namespace", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Namespace", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Namespace" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1.Namespace" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Namespace", - "method": "PATCH", - "summary": "partially update the specified Namespace", - "nickname": "patchNamespace", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Namespace", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Namespace" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete a Namespace", - "nickname": "deleteNamespace", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.DeleteOptions", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "gracePeriodSeconds", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "orphanDependents", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "propagationPolicy", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Namespace", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/watch/namespaces/{name}", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch changes to an object of kind Namespace", - "nickname": "watchNamespace", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Namespace", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/namespaces/{name}/finalize", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.Namespace", - "method": "PUT", - "summary": "replace finalize of the specified Namespace", - "nickname": "replaceNamespaceFinalize", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Namespace", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Namespace", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Namespace" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1.Namespace" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/namespaces/{name}/status", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.Namespace", - "method": "GET", - "summary": "read status of the specified Namespace", - "nickname": "readNamespaceStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Namespace", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Namespace" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Namespace", - "method": "PUT", - "summary": "replace status of the specified Namespace", - "nickname": "replaceNamespaceStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Namespace", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Namespace", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Namespace" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1.Namespace" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Namespace", - "method": "PATCH", - "summary": "partially update status of the specified Namespace", - "nickname": "patchNamespaceStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Namespace", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Namespace" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - } - ] - }, - { - "path": "/api/v1/namespaces/{namespace}/secrets", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.SecretList", - "method": "GET", - "summary": "list or watch objects of kind Secret", - "nickname": "listNamespacedSecret", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.SecretList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Secret", - "method": "POST", - "summary": "create a Secret", - "nickname": "createNamespacedSecret", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Secret", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Secret" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1.Secret" - }, - { - "code": 202, - "message": "Accepted", - "responseModel": "v1.Secret" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete collection of Secret", - "nickname": "deletecollectionNamespacedSecret", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/watch/namespaces/{namespace}/secrets", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of Secret", - "nickname": "watchNamespacedSecretList", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/namespaces/{namespace}/secrets/{name}", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.Secret", - "method": "GET", - "summary": "read the specified Secret", - "nickname": "readNamespacedSecret", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "export", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "exact", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Secret", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Secret" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Secret", - "method": "PUT", - "summary": "replace the specified Secret", - "nickname": "replaceNamespacedSecret", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Secret", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Secret", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Secret" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1.Secret" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Secret", - "method": "PATCH", - "summary": "partially update the specified Secret", - "nickname": "patchNamespacedSecret", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Secret", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Secret" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete a Secret", - "nickname": "deleteNamespacedSecret", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.DeleteOptions", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "gracePeriodSeconds", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "orphanDependents", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "propagationPolicy", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Secret", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/watch/namespaces/{namespace}/secrets/{name}", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch changes to an object of kind Secret", - "nickname": "watchNamespacedSecret", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Secret", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/secrets", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.SecretList", - "method": "GET", - "summary": "list or watch objects of kind Secret", - "nickname": "listSecretForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.SecretList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/watch/secrets", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of Secret", - "nickname": "watchSecretListForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/namespaces/{namespace}/services", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.ServiceList", - "method": "GET", - "summary": "list or watch objects of kind Service", - "nickname": "listNamespacedService", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.ServiceList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Service", - "method": "POST", - "summary": "create a Service", - "nickname": "createNamespacedService", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Service", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Service" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1.Service" - }, - { - "code": 202, - "message": "Accepted", - "responseModel": "v1.Service" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete collection of Service", - "nickname": "deletecollectionNamespacedService", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/watch/namespaces/{namespace}/services", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of Service", - "nickname": "watchNamespacedServiceList", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/namespaces/{namespace}/services/{name}", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.Service", - "method": "GET", - "summary": "read the specified Service", - "nickname": "readNamespacedService", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "export", - "description": "Should this value be exported. Export strips fields that a user can not specify.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "exact", - "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Service", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Service" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Service", - "method": "PUT", - "summary": "replace the specified Service", - "nickname": "replaceNamespacedService", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Service", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Service", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Service" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1.Service" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Service", - "method": "PATCH", - "summary": "partially update the specified Service", - "nickname": "patchNamespacedService", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Service", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Service" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - }, - { - "type": "v1.Status", - "method": "DELETE", - "summary": "delete a Service", - "nickname": "deleteNamespacedService", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.DeleteOptions", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "gracePeriodSeconds", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "orphanDependents", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "propagationPolicy", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Service", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Status" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/watch/namespaces/{namespace}/services/{name}", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch changes to an object of kind Service", - "nickname": "watchNamespacedService", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Service", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/services", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.ServiceList", - "method": "GET", - "summary": "list or watch objects of kind Service", - "nickname": "listServiceForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.ServiceList" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/watch/services", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.WatchEvent", - "method": "GET", - "summary": "watch individual changes to a list of Service", - "nickname": "watchServiceListForAllNamespaces", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "labelSelector", - "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "fieldSelector", - "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "includeUninitialized", - "description": "If true, partially initialized resources are included in the response.", - "required": false, - "allowMultiple": false - }, - { - "type": "boolean", - "paramType": "query", - "name": "watch", - "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "resourceVersion", - "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "timeoutSeconds", - "description": "Timeout for the list/watch call.", - "required": false, - "allowMultiple": false - }, - { - "type": "integer", - "paramType": "query", - "name": "limit", - "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "query", - "name": "continue", - "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - "required": false, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.WatchEvent" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf", - "application/json;stream=watch", - "application/vnd.kubernetes.protobuf;stream=watch" - ], - "consumes": [ - "*/*" - ] - } - ] - }, - { - "path": "/api/v1/namespaces/{namespace}/services/{name}/status", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.Service", - "method": "GET", - "summary": "read status of the specified Service", - "nickname": "readNamespacedServiceStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Service", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Service" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Service", - "method": "PUT", - "summary": "replace status of the specified Service", - "nickname": "replaceNamespacedServiceStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Service", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Service", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Service" - }, - { - "code": 201, - "message": "Created", - "responseModel": "v1.Service" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "*/*" - ] - }, - { - "type": "v1.Service", - "method": "PATCH", - "summary": "partially update status of the specified Service", - "nickname": "patchNamespacedServiceStatus", - "parameters": [ - { - "type": "string", - "paramType": "query", - "name": "pretty", - "description": "If 'true', then the output is pretty printed.", - "required": false, - "allowMultiple": false - }, - { - "type": "v1.Patch", - "paramType": "body", - "name": "body", - "description": "", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "namespace", - "description": "object name and auth scope, such as for teams and projects", - "required": true, - "allowMultiple": false - }, - { - "type": "string", - "paramType": "path", - "name": "name", - "description": "name of the Service", - "required": true, - "allowMultiple": false - } - ], - "responseMessages": [ - { - "code": 200, - "message": "OK", - "responseModel": "v1.Service" - } - ], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" - ] - } - ] - }, - { - "path": "/api/v1", - "description": "API at /api/v1", - "operations": [ - { - "type": "v1.APIResourceList", - "method": "GET", - "summary": "get available resources", - "nickname": "getAPIResources", - "parameters": [], - "produces": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ], - "consumes": [ - "application/json", - "application/yaml", - "application/vnd.kubernetes.protobuf" - ] - } - ] - } - ], - "models": { - "v1.ConfigMapList": { - "id": "v1.ConfigMapList", - "description": "ConfigMapList is a resource containing a list of ConfigMap objects.", - "required": [ - "items" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ListMeta", - "description": "More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "items": { - "type": "array", - "items": { - "$ref": "v1.ConfigMap" - }, - "description": "Items is the list of ConfigMaps." - } - } - }, - "v1.ListMeta": { - "id": "v1.ListMeta", - "description": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", - "properties": { - "selfLink": { - "type": "string", - "description": "selfLink is a URL representing this object. Populated by the system. Read-only." - }, - "resourceVersion": { - "type": "string", - "description": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" - }, - "continue": { - "type": "string", - "description": "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response." - } - } - }, - "v1.ConfigMap": { - "id": "v1.ConfigMap", - "description": "ConfigMap holds configuration data for pods to consume.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ObjectMeta", - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "data": { - "type": "object", - "description": "Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'." - } - } - }, - "v1.ObjectMeta": { - "id": "v1.ObjectMeta", - "description": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", - "properties": { - "name": { - "type": "string", - "description": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names" - }, - "generateName": { - "type": "string", - "description": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - }, - "namespace": { - "type": "string", - "description": "Namespace defines the space within each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" - }, - "selfLink": { - "type": "string", - "description": "SelfLink is a URL representing this object. Populated by the system. Read-only." - }, - "uid": { - "type": "string", - "description": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - }, - "resourceVersion": { - "type": "string", - "description": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" - }, - "generation": { - "type": "integer", - "format": "int64", - "description": "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only." - }, - "creationTimestamp": { - "type": "string", - "description": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "deletionTimestamp": { - "type": "string", - "description": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field. Once set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "deletionGracePeriodSeconds": { - "type": "integer", - "format": "int64", - "description": "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only." - }, - "labels": { - "type": "object", - "description": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels" - }, - "annotations": { - "type": "object", - "description": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations" - }, - "ownerReferences": { - "type": "array", - "items": { - "$ref": "v1.OwnerReference" - }, - "description": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller." - }, - "initializers": { - "$ref": "v1.Initializers", - "description": "An initializer is a controller which enforces some system invariant at object creation time. This field is a list of initializers that have not yet acted on this object. If nil or empty, this object has been completely initialized. Otherwise, the object is considered uninitialized and is hidden (in list/watch and get calls) from clients that haven't explicitly asked to observe uninitialized objects.\n\nWhen an object is created, the system will populate this list with the current set of initializers. Only privileged users may set or modify this list. Once it is empty, it may not be modified further by any user." - }, - "finalizers": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed." - }, - "clusterName": { - "type": "string", - "description": "The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request." - } - } - }, - "v1.OwnerReference": { - "id": "v1.OwnerReference", - "description": "OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field.", - "required": [ - "apiVersion", - "kind", - "name", - "uid" - ], - "properties": { - "apiVersion": { - "type": "string", - "description": "API version of the referent." - }, - "kind": { - "type": "string", - "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "name": { - "type": "string", - "description": "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names" - }, - "uid": { - "type": "string", - "description": "UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - }, - "controller": { - "type": "boolean", - "description": "If true, this reference points to the managing controller." - }, - "blockOwnerDeletion": { - "type": "boolean", - "description": "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned." - } - } - }, - "v1.Initializers": { - "id": "v1.Initializers", - "description": "Initializers tracks the progress of initialization.", - "required": [ - "pending" - ], - "properties": { - "pending": { - "type": "array", - "items": { - "$ref": "v1.Initializer" - }, - "description": "Pending is a list of initializers that must execute in order before this object is visible. When the last pending initializer is removed, and no failing result is set, the initializers struct will be set to nil and the object is considered as initialized and visible to all clients." - }, - "result": { - "$ref": "v1.Status", - "description": "If result is set with the Failure field, the object will be persisted to storage and then deleted, ensuring that other clients can observe the deletion." - } - } - }, - "v1.Initializer": { - "id": "v1.Initializer", - "description": "Initializer is information about an initializer that has not yet completed.", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "description": "name of the process that is responsible for initializing this object." - } - } - }, - "v1.Status": { - "id": "v1.Status", - "description": "Status is a return value for calls that don't return other objects.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ListMeta", - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "status": { - "type": "string", - "description": "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status" - }, - "message": { - "type": "string", - "description": "A human-readable description of the status of this operation." - }, - "reason": { - "type": "string", - "description": "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it." - }, - "details": { - "$ref": "v1.StatusDetails", - "description": "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type." - }, - "code": { - "type": "integer", - "format": "int32", - "description": "Suggested HTTP return code for this status, 0 if not set." - } - } - }, - "v1.StatusDetails": { - "id": "v1.StatusDetails", - "description": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.", - "properties": { - "name": { - "type": "string", - "description": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described)." - }, - "group": { - "type": "string", - "description": "The group attribute of the resource associated with the status StatusReason." - }, - "kind": { - "type": "string", - "description": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "uid": { - "type": "string", - "description": "UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - }, - "causes": { - "type": "array", - "items": { - "$ref": "v1.StatusCause" - }, - "description": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes." - }, - "retryAfterSeconds": { - "type": "integer", - "format": "int32", - "description": "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action." - } - } - }, - "v1.StatusCause": { - "id": "v1.StatusCause", - "description": "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.", - "properties": { - "reason": { - "type": "string", - "description": "A machine-readable description of the cause of the error. If this value is empty there is no information available." - }, - "message": { - "type": "string", - "description": "A human-readable description of the cause of the error. This field may be presented as-is to a reader." - }, - "field": { - "type": "string", - "description": "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"" - } - } - }, - "v1.WatchEvent": { - "id": "v1.WatchEvent", - "required": [ - "type", - "object" - ], - "properties": { - "type": { - "type": "string" - }, - "object": { - "type": "string" - } - } - }, - "v1.Patch": { - "id": "v1.Patch", - "description": "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.", - "properties": {} - }, - "v1.DeleteOptions": { - "id": "v1.DeleteOptions", - "description": "DeleteOptions may be provided when deleting an API object.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "gracePeriodSeconds": { - "type": "integer", - "format": "int64", - "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately." - }, - "preconditions": { - "$ref": "v1.Preconditions", - "description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned." - }, - "orphanDependents": { - "type": "boolean", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both." - }, - "propagationPolicy": { - "$ref": "v1.DeletionPropagation", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy." - } - } - }, - "v1.Preconditions": { - "id": "v1.Preconditions", - "description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.", - "properties": { - "uid": { - "$ref": "types.UID", - "description": "Specifies the target UID." - } - } - }, - "types.UID": { - "id": "types.UID", - "properties": {} - }, - "v1.DeletionPropagation": { - "id": "v1.DeletionPropagation", - "properties": {} - }, - "v1.EventList": { - "id": "v1.EventList", - "description": "EventList is a list of events.", - "required": [ - "items" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ListMeta", - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "items": { - "type": "array", - "items": { - "$ref": "v1.Event" - }, - "description": "List of events" - } - } - }, - "v1.Event": { - "id": "v1.Event", - "description": "Event is a report of an event somewhere in the cluster.", - "required": [ - "metadata", - "involvedObject" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ObjectMeta", - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "involvedObject": { - "$ref": "v1.ObjectReference", - "description": "The object that this event is about." - }, - "reason": { - "type": "string", - "description": "This should be a short, machine understandable string that gives the reason for the transition into the object's current status." - }, - "message": { - "type": "string", - "description": "A human-readable description of the status of this operation." - }, - "source": { - "$ref": "v1.EventSource", - "description": "The component reporting this event. Should be a short machine understandable string." - }, - "firstTimestamp": { - "type": "string", - "description": "The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)" - }, - "lastTimestamp": { - "type": "string", - "description": "The time at which the most recent occurrence of this event was recorded." - }, - "count": { - "type": "integer", - "format": "int32", - "description": "The number of times this event has occurred." - }, - "type": { - "type": "string", - "description": "Type of this event (Normal, Warning), new types could be added in the future" - } - } - }, - "v1.ObjectReference": { - "id": "v1.ObjectReference", - "description": "ObjectReference contains enough information to let you inspect or modify the referred object.", - "properties": { - "kind": { - "type": "string", - "description": "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "namespace": { - "type": "string", - "description": "Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" - }, - "name": { - "type": "string", - "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - }, - "uid": { - "type": "string", - "description": "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids" - }, - "apiVersion": { - "type": "string", - "description": "API version of the referent." - }, - "resourceVersion": { - "type": "string", - "description": "Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" - }, - "fieldPath": { - "type": "string", - "description": "If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered the event) or if no container name is specified \"spec.containers[2]\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object." - } - } - }, - "v1.EventSource": { - "id": "v1.EventSource", - "description": "EventSource contains information for an event.", - "properties": { - "component": { - "type": "string", - "description": "Component from which the event is generated." - }, - "host": { - "type": "string", - "description": "Node name on which the event is generated." - } - } - }, - "v1.NamespaceList": { - "id": "v1.NamespaceList", - "description": "NamespaceList is a list of Namespaces.", - "required": [ - "items" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ListMeta", - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "items": { - "type": "array", - "items": { - "$ref": "v1.Namespace" - }, - "description": "Items is the list of Namespace objects in the list. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" - } - } - }, - "v1.Namespace": { - "id": "v1.Namespace", - "description": "Namespace provides a scope for Names. Use of multiple namespaces is optional.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ObjectMeta", - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "spec": { - "$ref": "v1.NamespaceSpec", - "description": "Spec defines the behavior of the Namespace. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status" - }, - "status": { - "$ref": "v1.NamespaceStatus", - "description": "Status describes the current status of a Namespace. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status" - } - } - }, - "v1.NamespaceSpec": { - "id": "v1.NamespaceSpec", - "description": "NamespaceSpec describes the attributes on a Namespace.", - "properties": { - "finalizers": { - "type": "array", - "items": { - "$ref": "v1.FinalizerName" - }, - "description": "Finalizers is an opaque list of values that must be empty to permanently remove object from storage. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/" - } - } - }, - "v1.FinalizerName": { - "id": "v1.FinalizerName", - "properties": {} - }, - "v1.NamespaceStatus": { - "id": "v1.NamespaceStatus", - "description": "NamespaceStatus is information about the current status of a Namespace.", - "properties": { - "phase": { - "type": "string", - "description": "Phase is the current lifecycle phase of the namespace. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/" - } - } - }, - "v1.SecretList": { - "id": "v1.SecretList", - "description": "SecretList is a list of Secret.", - "required": [ - "items" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ListMeta", - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "items": { - "type": "array", - "items": { - "$ref": "v1.Secret" - }, - "description": "Items is a list of secret objects. More info: https://kubernetes.io/docs/concepts/configuration/secret" - } - } - }, - "v1.Secret": { - "id": "v1.Secret", - "description": "Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ObjectMeta", - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "data": { - "type": "object", - "description": "Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4" - }, - "stringData": { - "type": "object", - "description": "stringData allows specifying non-binary secret data in string form. It is provided as a write-only convenience method. All keys and values are merged into the data field on write, overwriting any existing values. It is never output when reading from the API." - }, - "type": { - "type": "string", - "description": "Used to facilitate programmatic handling of secret data." - } - } - }, - "v1.ServiceList": { - "id": "v1.ServiceList", - "description": "ServiceList holds a list of services.", - "required": [ - "items" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ListMeta", - "description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "items": { - "type": "array", - "items": { - "$ref": "v1.Service" - }, - "description": "List of services" - } - } - }, - "v1.Service": { - "id": "v1.Service", - "description": "Service is a named abstraction of software service (for example, mysql) consisting of local port (for example 3306) that the proxy listens on, and the selector that determines which pods will answer requests sent through the proxy.", - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "metadata": { - "$ref": "v1.ObjectMeta", - "description": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - }, - "spec": { - "$ref": "v1.ServiceSpec", - "description": "Spec defines the behavior of a service. https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status" - }, - "status": { - "$ref": "v1.ServiceStatus", - "description": "Most recently observed status of the service. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status" - } - } - }, - "v1.ServiceSpec": { - "id": "v1.ServiceSpec", - "description": "ServiceSpec describes the attributes that a user creates on a service.", - "properties": { - "ports": { - "type": "array", - "items": { - "$ref": "v1.ServicePort" - }, - "description": "The list of ports that are exposed by this service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies" - }, - "selector": { - "type": "object", - "description": "Route service traffic to pods with label keys and values matching this selector. If empty or not present, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/" - }, - "clusterIP": { - "type": "string", - "description": "clusterIP is the IP address of the service and is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. This field can not be changed through updates. Valid values are \"None\", empty string (\"\"), or a valid IP address. \"None\" can be specified for headless services when proxying is not required. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies" - }, - "type": { - "type": "string", - "description": "type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer. \"ExternalName\" maps to the specified externalName. \"ClusterIP\" allocates a cluster-internal IP address for load-balancing to endpoints. Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object. If clusterIP is \"None\", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a stable IP. \"NodePort\" builds on ClusterIP and allocates a port on every node which routes to the clusterIP. \"LoadBalancer\" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the clusterIP. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services " - }, - "externalIPs": { - "type": "array", - "items": { - "type": "string" - }, - "description": "externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system." - }, - "sessionAffinity": { - "type": "string", - "description": "Supports \"ClientIP\" and \"None\". Used to maintain session affinity. Enable client IP based session affinity. Must be ClientIP or None. Defaults to None. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies" - }, - "loadBalancerIP": { - "type": "string", - "description": "Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature." - }, - "loadBalancerSourceRanges": { - "type": "array", - "items": { - "type": "string" - }, - "description": "If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature.\" More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/" - }, - "externalName": { - "type": "string", - "description": "externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid DNS name and requires Type to be ExternalName." - }, - "externalTrafficPolicy": { - "type": "string", - "description": "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading." - }, - "healthCheckNodePort": { - "type": "integer", - "format": "int32", - "description": "healthCheckNodePort specifies the healthcheck nodePort for the service. If not specified, HealthCheckNodePort is created by the service api backend with the allocated nodePort. Will use user-specified nodePort value if specified by the client. Only effects when Type is set to LoadBalancer and ExternalTrafficPolicy is set to Local." - }, - "publishNotReadyAddresses": { - "type": "boolean", - "description": "publishNotReadyAddresses, when set to true, indicates that DNS implementations must publish the notReadyAddresses of subsets for the Endpoints associated with the Service. The default value is false. The primary use case for setting this field is to use a StatefulSet's Headless Service to propagate SRV records for its Pods without respect to their readiness for purpose of peer discovery. This field will replace the service.alpha.kubernetes.io/tolerate-unready-endpoints when that annotation is deprecated and all clients have been converted to use this field." - }, - "sessionAffinityConfig": { - "$ref": "v1.SessionAffinityConfig", - "description": "sessionAffinityConfig contains the configurations of session affinity." - } - } - }, - "v1.ServicePort": { - "id": "v1.ServicePort", - "description": "ServicePort contains information on service's port.", - "required": [ - "port" - ], - "properties": { - "name": { - "type": "string", - "description": "The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the 'Name' field in EndpointPort objects. Optional if only one ServicePort is defined on this service." - }, - "protocol": { - "type": "string", - "description": "The IP protocol for this port. Supports \"TCP\" and \"UDP\". Default is TCP." - }, - "port": { - "type": "integer", - "format": "int32", - "description": "The port that will be exposed by this service." - }, - "targetPort": { - "type": "string", - "description": "Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod's container ports. If this is not specified, the value of the 'port' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the 'port' field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service" - }, - "nodePort": { - "type": "integer", - "format": "int32", - "description": "The port on each node on which this service is exposed when type=NodePort or LoadBalancer. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one. More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport" - } - } - }, - "v1.SessionAffinityConfig": { - "id": "v1.SessionAffinityConfig", - "description": "SessionAffinityConfig represents the configurations of session affinity.", - "properties": { - "clientIP": { - "$ref": "v1.ClientIPConfig", - "description": "clientIP contains the configurations of Client IP based session affinity." - } - } - }, - "v1.ClientIPConfig": { - "id": "v1.ClientIPConfig", - "description": "ClientIPConfig represents the configurations of Client IP based session affinity.", - "properties": { - "timeoutSeconds": { - "type": "integer", - "format": "int32", - "description": "timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be \u003e0 \u0026\u0026 \u003c=86400(for 1 day) if ServiceAffinity == \"ClientIP\". Default value is 10800(for 3 hours)." - } - } - }, - "v1.ServiceStatus": { - "id": "v1.ServiceStatus", - "description": "ServiceStatus represents the current status of a service.", - "properties": { - "loadBalancer": { - "$ref": "v1.LoadBalancerStatus", - "description": "LoadBalancer contains the current status of the load-balancer, if one is present." - } - } - }, - "v1.LoadBalancerStatus": { - "id": "v1.LoadBalancerStatus", - "description": "LoadBalancerStatus represents the status of a load-balancer.", - "properties": { - "ingress": { - "type": "array", - "items": { - "$ref": "v1.LoadBalancerIngress" - }, - "description": "Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points." - } - } - }, - "v1.LoadBalancerIngress": { - "id": "v1.LoadBalancerIngress", - "description": "LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.", - "properties": { - "ip": { - "type": "string", - "description": "IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)" - }, - "hostname": { - "type": "string", - "description": "Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers)" - } - } - }, - "v1.APIResourceList": { - "id": "v1.APIResourceList", - "description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", - "required": [ - "groupVersion", - "resources" - ], - "properties": { - "kind": { - "type": "string", - "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "apiVersion": { - "type": "string", - "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources" - }, - "groupVersion": { - "type": "string", - "description": "groupVersion is the group and version this APIResourceList is for." - }, - "resources": { - "type": "array", - "items": { - "$ref": "v1.APIResource" - }, - "description": "resources contains the name of the resources and if they are namespaced." - } - } - }, - "v1.APIResource": { - "id": "v1.APIResource", - "description": "APIResource specifies the name of a resource and whether it is namespaced.", - "required": [ - "name", - "singularName", - "namespaced", - "kind", - "verbs" - ], - "properties": { - "name": { - "type": "string", - "description": "name is the plural name of the resource." - }, - "singularName": { - "type": "string", - "description": "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface." - }, - "namespaced": { - "type": "boolean", - "description": "namespaced indicates if a resource is namespaced or not." - }, - "group": { - "type": "string", - "description": "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\"." - }, - "version": { - "type": "string", - "description": "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\"." - }, - "kind": { - "type": "string", - "description": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')" - }, - "verbs": { - "type": "array", - "items": { - "type": "string" - }, - "description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)" - }, - "shortNames": { - "type": "array", - "items": { - "type": "string" - }, - "description": "shortNames is a list of suggested short names of the resource." - }, - "categories": { - "type": "array", - "items": { - "type": "string" - }, - "description": "categories is a list of the grouped resources this resource belongs to (e.g. 'all')" - } - } - } - } - } diff --git a/federation/apis/swagger-spec/version.json b/federation/apis/swagger-spec/version.json deleted file mode 100644 index 1b60aa14b9..0000000000 --- a/federation/apis/swagger-spec/version.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "swaggerVersion": "1.2", - "apiVersion": "", - "basePath": "https://10.10.10.10:6443", - "resourcePath": "/version", - "info": { - "title": "", - "description": "" - }, - "apis": [ - { - "path": "/version", - "description": "git code version from which this is built", - "operations": [ - { - "type": "version.Info", - "method": "GET", - "summary": "get the code version", - "nickname": "getCodeVersion", - "parameters": [], - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] - } - ] - } - ], - "models": { - "version.Info": { - "id": "version.Info", - "required": [ - "major", - "minor", - "gitVersion", - "gitCommit", - "gitTreeState", - "buildDate", - "goVersion", - "compiler", - "platform" - ], - "properties": { - "major": { - "type": "string" - }, - "minor": { - "type": "string" - }, - "gitVersion": { - "type": "string" - }, - "gitCommit": { - "type": "string" - }, - "gitTreeState": { - "type": "string" - }, - "buildDate": { - "type": "string" - }, - "goVersion": { - "type": "string" - }, - "compiler": { - "type": "string" - }, - "platform": { - "type": "string" - } - } - } - } - } diff --git a/federation/client/cache/BUILD b/federation/client/cache/BUILD deleted file mode 100644 index f0690fafee..0000000000 --- a/federation/client/cache/BUILD +++ /dev/null @@ -1,29 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["cluster_cache.go"], - importpath = "k8s.io/kubernetes/federation/client/cache", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//vendor/k8s.io/client-go/tools/cache:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/client/cache/cluster_cache.go b/federation/client/cache/cluster_cache.go deleted file mode 100644 index 82c30de3e7..0000000000 --- a/federation/client/cache/cluster_cache.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2016 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 cache - -import ( - kubecache "k8s.io/client-go/tools/cache" - "k8s.io/kubernetes/federation/apis/federation/v1beta1" -) - -// StoreToClusterLister makes a Store have the List method of the metav1.ClusterInterface -// The Store must contain (only) clusters. -type StoreToClusterLister struct { - kubecache.Store -} - -func (s *StoreToClusterLister) List() (clusters v1beta1.ClusterList, err error) { - for _, m := range s.Store.List() { - clusters.Items = append(clusters.Items, *(m.(*v1beta1.Cluster))) - } - return clusters, nil -} diff --git a/federation/client/clientset_generated/federation_clientset/BUILD b/federation/client/clientset_generated/federation_clientset/BUILD deleted file mode 100644 index 9ff95a31b3..0000000000 --- a/federation/client/clientset_generated/federation_clientset/BUILD +++ /dev/null @@ -1,50 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "clientset.go", - "doc.go", - "import_known_versions.go", - ], - importpath = "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset", - deps = [ - "//federation/apis/federation/install:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/batch/v1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/core/v1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/k8s.io/client-go/discovery:go_default_library", - "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/k8s.io/client-go/util/flowcontrol:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/client/clientset_generated/federation_clientset/fake:all-srcs", - "//federation/client/clientset_generated/federation_clientset/scheme:all-srcs", - "//federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1:all-srcs", - "//federation/client/clientset_generated/federation_clientset/typed/batch/v1:all-srcs", - "//federation/client/clientset_generated/federation_clientset/typed/core/v1:all-srcs", - "//federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1:all-srcs", - "//federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/client/clientset_generated/federation_clientset/clientset.go b/federation/client/clientset_generated/federation_clientset/clientset.go deleted file mode 100644 index 38b461c111..0000000000 --- a/federation/client/clientset_generated/federation_clientset/clientset.go +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federation_clientset - -import ( - glog "github.com/golang/glog" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" - autoscalingv1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1" - batchv1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/batch/v1" - corev1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/core/v1" - extensionsv1beta1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1" - federationv1beta1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - AutoscalingV1() autoscalingv1.AutoscalingV1Interface - // Deprecated: please explicitly pick a version if possible. - Autoscaling() autoscalingv1.AutoscalingV1Interface - BatchV1() batchv1.BatchV1Interface - // Deprecated: please explicitly pick a version if possible. - Batch() batchv1.BatchV1Interface - CoreV1() corev1.CoreV1Interface - // Deprecated: please explicitly pick a version if possible. - Core() corev1.CoreV1Interface - ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Interface - // Deprecated: please explicitly pick a version if possible. - Extensions() extensionsv1beta1.ExtensionsV1beta1Interface - FederationV1beta1() federationv1beta1.FederationV1beta1Interface - // Deprecated: please explicitly pick a version if possible. - Federation() federationv1beta1.FederationV1beta1Interface -} - -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *discovery.DiscoveryClient - autoscalingV1 *autoscalingv1.AutoscalingV1Client - batchV1 *batchv1.BatchV1Client - coreV1 *corev1.CoreV1Client - extensionsV1beta1 *extensionsv1beta1.ExtensionsV1beta1Client - federationV1beta1 *federationv1beta1.FederationV1beta1Client -} - -// AutoscalingV1 retrieves the AutoscalingV1Client -func (c *Clientset) AutoscalingV1() autoscalingv1.AutoscalingV1Interface { - return c.autoscalingV1 -} - -// Deprecated: Autoscaling retrieves the default version of AutoscalingClient. -// Please explicitly pick a version. -func (c *Clientset) Autoscaling() autoscalingv1.AutoscalingV1Interface { - return c.autoscalingV1 -} - -// BatchV1 retrieves the BatchV1Client -func (c *Clientset) BatchV1() batchv1.BatchV1Interface { - return c.batchV1 -} - -// Deprecated: Batch retrieves the default version of BatchClient. -// Please explicitly pick a version. -func (c *Clientset) Batch() batchv1.BatchV1Interface { - return c.batchV1 -} - -// CoreV1 retrieves the CoreV1Client -func (c *Clientset) CoreV1() corev1.CoreV1Interface { - return c.coreV1 -} - -// Deprecated: Core retrieves the default version of CoreClient. -// Please explicitly pick a version. -func (c *Clientset) Core() corev1.CoreV1Interface { - return c.coreV1 -} - -// ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client -func (c *Clientset) ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Interface { - return c.extensionsV1beta1 -} - -// Deprecated: Extensions retrieves the default version of ExtensionsClient. -// Please explicitly pick a version. -func (c *Clientset) Extensions() extensionsv1beta1.ExtensionsV1beta1Interface { - return c.extensionsV1beta1 -} - -// FederationV1beta1 retrieves the FederationV1beta1Client -func (c *Clientset) FederationV1beta1() federationv1beta1.FederationV1beta1Interface { - return c.federationV1beta1 -} - -// Deprecated: Federation retrieves the default version of FederationClient. -// Please explicitly pick a version. -func (c *Clientset) Federation() federationv1beta1.FederationV1beta1Interface { - return c.federationV1beta1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error - cs.autoscalingV1, err = autoscalingv1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - cs.batchV1, err = batchv1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - cs.coreV1, err = corev1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - cs.extensionsV1beta1, err = extensionsv1beta1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - cs.federationV1beta1, err = federationv1beta1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { - glog.Errorf("failed to create the DiscoveryClient: %v", err) - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.autoscalingV1 = autoscalingv1.NewForConfigOrDie(c) - cs.batchV1 = batchv1.NewForConfigOrDie(c) - cs.coreV1 = corev1.NewForConfigOrDie(c) - cs.extensionsV1beta1 = extensionsv1beta1.NewForConfigOrDie(c) - cs.federationV1beta1 = federationv1beta1.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.autoscalingV1 = autoscalingv1.New(c) - cs.batchV1 = batchv1.New(c) - cs.coreV1 = corev1.New(c) - cs.extensionsV1beta1 = extensionsv1beta1.New(c) - cs.federationV1beta1 = federationv1beta1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/federation/client/clientset_generated/federation_clientset/doc.go b/federation/client/clientset_generated/federation_clientset/doc.go deleted file mode 100644 index 3ef671cc0d..0000000000 --- a/federation/client/clientset_generated/federation_clientset/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package has the automatically generated clientset. -package federation_clientset diff --git a/federation/client/clientset_generated/federation_clientset/fake/BUILD b/federation/client/clientset_generated/federation_clientset/fake/BUILD deleted file mode 100644 index 2bbe84f4bf..0000000000 --- a/federation/client/clientset_generated/federation_clientset/fake/BUILD +++ /dev/null @@ -1,55 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "clientset_generated.go", - "doc.go", - "register.go", - ], - importpath = "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/fake", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/batch/v1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/core/v1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/core/v1/fake:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake:go_default_library", - "//vendor/k8s.io/api/autoscaling/v1:go_default_library", - "//vendor/k8s.io/api/batch/v1:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1: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/runtime/serializer:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", - "//vendor/k8s.io/client-go/discovery:go_default_library", - "//vendor/k8s.io/client-go/discovery/fake:go_default_library", - "//vendor/k8s.io/client-go/testing:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/client/clientset_generated/federation_clientset/fake/clientset_generated.go b/federation/client/clientset_generated/federation_clientset/fake/clientset_generated.go deleted file mode 100644 index 86f5810139..0000000000 --- a/federation/client/clientset_generated/federation_clientset/fake/clientset_generated.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" - clientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - autoscalingv1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1" - fakeautoscalingv1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake" - batchv1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/batch/v1" - fakebatchv1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake" - corev1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/core/v1" - fakecorev1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake" - extensionsv1beta1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1" - fakeextensionsv1beta1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake" - federationv1beta1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1" - fakefederationv1beta1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - fakePtr := testing.Fake{} - fakePtr.AddReactor("*", "*", testing.ObjectReaction(o)) - fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil)) - - return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}} -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -var _ clientset.Interface = &Clientset{} - -// AutoscalingV1 retrieves the AutoscalingV1Client -func (c *Clientset) AutoscalingV1() autoscalingv1.AutoscalingV1Interface { - return &fakeautoscalingv1.FakeAutoscalingV1{Fake: &c.Fake} -} - -// Autoscaling retrieves the AutoscalingV1Client -func (c *Clientset) Autoscaling() autoscalingv1.AutoscalingV1Interface { - return &fakeautoscalingv1.FakeAutoscalingV1{Fake: &c.Fake} -} - -// BatchV1 retrieves the BatchV1Client -func (c *Clientset) BatchV1() batchv1.BatchV1Interface { - return &fakebatchv1.FakeBatchV1{Fake: &c.Fake} -} - -// Batch retrieves the BatchV1Client -func (c *Clientset) Batch() batchv1.BatchV1Interface { - return &fakebatchv1.FakeBatchV1{Fake: &c.Fake} -} - -// CoreV1 retrieves the CoreV1Client -func (c *Clientset) CoreV1() corev1.CoreV1Interface { - return &fakecorev1.FakeCoreV1{Fake: &c.Fake} -} - -// Core retrieves the CoreV1Client -func (c *Clientset) Core() corev1.CoreV1Interface { - return &fakecorev1.FakeCoreV1{Fake: &c.Fake} -} - -// ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client -func (c *Clientset) ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Interface { - return &fakeextensionsv1beta1.FakeExtensionsV1beta1{Fake: &c.Fake} -} - -// Extensions retrieves the ExtensionsV1beta1Client -func (c *Clientset) Extensions() extensionsv1beta1.ExtensionsV1beta1Interface { - return &fakeextensionsv1beta1.FakeExtensionsV1beta1{Fake: &c.Fake} -} - -// FederationV1beta1 retrieves the FederationV1beta1Client -func (c *Clientset) FederationV1beta1() federationv1beta1.FederationV1beta1Interface { - return &fakefederationv1beta1.FakeFederationV1beta1{Fake: &c.Fake} -} - -// Federation retrieves the FederationV1beta1Client -func (c *Clientset) Federation() federationv1beta1.FederationV1beta1Interface { - return &fakefederationv1beta1.FakeFederationV1beta1{Fake: &c.Fake} -} diff --git a/federation/client/clientset_generated/federation_clientset/fake/doc.go b/federation/client/clientset_generated/federation_clientset/fake/doc.go deleted file mode 100644 index 3fd8e1e2cd..0000000000 --- a/federation/client/clientset_generated/federation_clientset/fake/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package has the automatically generated fake clientset. -package fake diff --git a/federation/client/clientset_generated/federation_clientset/fake/register.go b/federation/client/clientset_generated/federation_clientset/fake/register.go deleted file mode 100644 index 77da043a52..0000000000 --- a/federation/client/clientset_generated/federation_clientset/fake/register.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - autoscalingv1 "k8s.io/api/autoscaling/v1" - batchv1 "k8s.io/api/batch/v1" - corev1 "k8s.io/api/core/v1" - extensionsv1beta1 "k8s.io/api/extensions/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - federationv1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) -var parameterCodec = runtime.NewParameterCodec(scheme) - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - AddToScheme(scheme) -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -func AddToScheme(scheme *runtime.Scheme) { - autoscalingv1.AddToScheme(scheme) - batchv1.AddToScheme(scheme) - corev1.AddToScheme(scheme) - extensionsv1beta1.AddToScheme(scheme) - federationv1beta1.AddToScheme(scheme) - -} diff --git a/federation/client/clientset_generated/federation_clientset/import_known_versions.go b/federation/client/clientset_generated/federation_clientset/import_known_versions.go deleted file mode 100644 index eb07236607..0000000000 --- a/federation/client/clientset_generated/federation_clientset/import_known_versions.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2016 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 federation_clientset - -// These imports are the API groups the client will support. -import ( - _ "k8s.io/kubernetes/federation/apis/federation/install" -) - -func init() { -} diff --git a/federation/client/clientset_generated/federation_clientset/scheme/BUILD b/federation/client/clientset_generated/federation_clientset/scheme/BUILD deleted file mode 100644 index dcf65058e2..0000000000 --- a/federation/client/clientset_generated/federation_clientset/scheme/BUILD +++ /dev/null @@ -1,39 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "doc.go", - "register.go", - ], - importpath = "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//vendor/k8s.io/api/autoscaling/v1:go_default_library", - "//vendor/k8s.io/api/batch/v1:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1: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/runtime/serializer:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/client/clientset_generated/federation_clientset/scheme/doc.go b/federation/client/clientset_generated/federation_clientset/scheme/doc.go deleted file mode 100644 index 3ec2200d09..0000000000 --- a/federation/client/clientset_generated/federation_clientset/scheme/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/federation/client/clientset_generated/federation_clientset/scheme/register.go b/federation/client/clientset_generated/federation_clientset/scheme/register.go deleted file mode 100644 index db48b8e89b..0000000000 --- a/federation/client/clientset_generated/federation_clientset/scheme/register.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package scheme - -import ( - autoscalingv1 "k8s.io/api/autoscaling/v1" - batchv1 "k8s.io/api/batch/v1" - corev1 "k8s.io/api/core/v1" - extensionsv1beta1 "k8s.io/api/extensions/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - federationv1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - AddToScheme(Scheme) -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -func AddToScheme(scheme *runtime.Scheme) { - autoscalingv1.AddToScheme(scheme) - batchv1.AddToScheme(scheme) - corev1.AddToScheme(scheme) - extensionsv1beta1.AddToScheme(scheme) - federationv1beta1.AddToScheme(scheme) - -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/BUILD b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/BUILD deleted file mode 100644 index a98699060d..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/BUILD +++ /dev/null @@ -1,42 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "autoscaling_client.go", - "doc.go", - "generated_expansion.go", - "horizontalpodautoscaler.go", - ], - importpath = "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1", - deps = [ - "//federation/client/clientset_generated/federation_clientset/scheme:go_default_library", - "//vendor/k8s.io/api/autoscaling/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime/serializer: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", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/autoscaling_client.go b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/autoscaling_client.go deleted file mode 100644 index af02fdc6ef..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/autoscaling_client.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - v1 "k8s.io/api/autoscaling/v1" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" - "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -type AutoscalingV1Interface interface { - RESTClient() rest.Interface - HorizontalPodAutoscalersGetter -} - -// AutoscalingV1Client is used to interact with features provided by the autoscaling group. -type AutoscalingV1Client struct { - restClient rest.Interface -} - -func (c *AutoscalingV1Client) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface { - return newHorizontalPodAutoscalers(c, namespace) -} - -// NewForConfig creates a new AutoscalingV1Client for the given config. -func NewForConfig(c *rest.Config) (*AutoscalingV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &AutoscalingV1Client{client}, nil -} - -// NewForConfigOrDie creates a new AutoscalingV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *AutoscalingV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new AutoscalingV1Client for the given RESTClient. -func New(c rest.Interface) *AutoscalingV1Client { - return &AutoscalingV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - - 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 *AutoscalingV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/doc.go b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/doc.go deleted file mode 100644 index b6a2a46728..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package has the automatically generated typed clients. -package v1 diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/BUILD b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/BUILD deleted file mode 100644 index 1b524c0105..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/BUILD +++ /dev/null @@ -1,40 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "doc.go", - "fake_autoscaling_client.go", - "fake_horizontalpodautoscaler.go", - ], - importpath = "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake", - deps = [ - "//federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1:go_default_library", - "//vendor/k8s.io/api/autoscaling/v1: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", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/doc.go b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/doc.go deleted file mode 100644 index c58fac35e4..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package fake has the automatically generated clients. -package fake diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/fake_autoscaling_client.go b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/fake_autoscaling_client.go deleted file mode 100644 index f6ec657c44..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/fake_autoscaling_client.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" - v1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1" -) - -type FakeAutoscalingV1 struct { - *testing.Fake -} - -func (c *FakeAutoscalingV1) HorizontalPodAutoscalers(namespace string) v1.HorizontalPodAutoscalerInterface { - return &FakeHorizontalPodAutoscalers{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAutoscalingV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go deleted file mode 100644 index e7e660bdd7..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go +++ /dev/null @@ -1,138 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - autoscaling_v1 "k8s.io/api/autoscaling/v1" - 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" -) - -// FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface -type FakeHorizontalPodAutoscalers struct { - Fake *FakeAutoscalingV1 - ns string -} - -var horizontalpodautoscalersResource = schema.GroupVersionResource{Group: "autoscaling", Version: "v1", Resource: "horizontalpodautoscalers"} - -var horizontalpodautoscalersKind = schema.GroupVersionKind{Group: "autoscaling", Version: "v1", Kind: "HorizontalPodAutoscaler"} - -// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. -func (c *FakeHorizontalPodAutoscalers) Get(name string, options v1.GetOptions) (result *autoscaling_v1.HorizontalPodAutoscaler, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &autoscaling_v1.HorizontalPodAutoscaler{}) - - if obj == nil { - return nil, err - } - return obj.(*autoscaling_v1.HorizontalPodAutoscaler), err -} - -// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *FakeHorizontalPodAutoscalers) List(opts v1.ListOptions) (result *autoscaling_v1.HorizontalPodAutoscalerList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), &autoscaling_v1.HorizontalPodAutoscalerList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &autoscaling_v1.HorizontalPodAutoscalerList{} - for _, item := range obj.(*autoscaling_v1.HorizontalPodAutoscalerList).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 horizontalPodAutoscalers. -func (c *FakeHorizontalPodAutoscalers) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts)) - -} - -// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *FakeHorizontalPodAutoscalers) Create(horizontalPodAutoscaler *autoscaling_v1.HorizontalPodAutoscaler) (result *autoscaling_v1.HorizontalPodAutoscaler, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &autoscaling_v1.HorizontalPodAutoscaler{}) - - if obj == nil { - return nil, err - } - return obj.(*autoscaling_v1.HorizontalPodAutoscaler), err -} - -// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *FakeHorizontalPodAutoscalers) Update(horizontalPodAutoscaler *autoscaling_v1.HorizontalPodAutoscaler) (result *autoscaling_v1.HorizontalPodAutoscaler, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &autoscaling_v1.HorizontalPodAutoscaler{}) - - if obj == nil { - return nil, err - } - return obj.(*autoscaling_v1.HorizontalPodAutoscaler), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeHorizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *autoscaling_v1.HorizontalPodAutoscaler) (*autoscaling_v1.HorizontalPodAutoscaler, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &autoscaling_v1.HorizontalPodAutoscaler{}) - - if obj == nil { - return nil, err - } - return obj.(*autoscaling_v1.HorizontalPodAutoscaler), err -} - -// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &autoscaling_v1.HorizontalPodAutoscaler{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeHorizontalPodAutoscalers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &autoscaling_v1.HorizontalPodAutoscalerList{}) - return err -} - -// Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *FakeHorizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *autoscaling_v1.HorizontalPodAutoscaler, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, data, subresources...), &autoscaling_v1.HorizontalPodAutoscaler{}) - - if obj == nil { - return nil, err - } - return obj.(*autoscaling_v1.HorizontalPodAutoscaler), err -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/generated_expansion.go b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/generated_expansion.go deleted file mode 100644 index effefbd50b..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/generated_expansion.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -type HorizontalPodAutoscalerExpansion interface{} diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/horizontalpodautoscaler.go b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/horizontalpodautoscaler.go deleted file mode 100644 index 980221240c..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/horizontalpodautoscaler.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - v1 "k8s.io/api/autoscaling/v1" - meta_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" - scheme "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. -// A group's client should implement this interface. -type HorizontalPodAutoscalersGetter interface { - HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface -} - -// HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources. -type HorizontalPodAutoscalerInterface interface { - Create(*v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error) - Update(*v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error) - UpdateStatus(*v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error) - Delete(name string, options *meta_v1.DeleteOptions) error - DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error - Get(name string, options meta_v1.GetOptions) (*v1.HorizontalPodAutoscaler, error) - List(opts meta_v1.ListOptions) (*v1.HorizontalPodAutoscalerList, error) - Watch(opts meta_v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) - HorizontalPodAutoscalerExpansion -} - -// horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface -type horizontalPodAutoscalers struct { - client rest.Interface - ns string -} - -// newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers -func newHorizontalPodAutoscalers(c *AutoscalingV1Client, namespace string) *horizontalPodAutoscalers { - return &horizontalPodAutoscalers{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. -func (c *horizontalPodAutoscalers) Get(name string, options meta_v1.GetOptions) (result *v1.HorizontalPodAutoscaler, err error) { - result = &v1.HorizontalPodAutoscaler{} - err = c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) List(opts meta_v1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { - result = &v1.HorizontalPodAutoscalerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. -func (c *horizontalPodAutoscalers) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) { - result = &v1.HorizontalPodAutoscaler{} - err = c.client.Post(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Body(horizontalPodAutoscaler). - Do(). - Into(result) - return -} - -// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Update(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) { - result = &v1.HorizontalPodAutoscaler{} - err = c.client.Put(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(horizontalPodAutoscaler.Name). - Body(horizontalPodAutoscaler). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *horizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) { - result = &v1.HorizontalPodAutoscaler{} - err = c.client.Put(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(horizontalPodAutoscaler.Name). - SubResource("status"). - Body(horizontalPodAutoscaler). - Do(). - Into(result) - return -} - -// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *horizontalPodAutoscalers) Delete(name string, options *meta_v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *horizontalPodAutoscalers) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *horizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) { - result = &v1.HorizontalPodAutoscaler{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/BUILD b/federation/client/clientset_generated/federation_clientset/typed/batch/v1/BUILD deleted file mode 100644 index de8553722d..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/BUILD +++ /dev/null @@ -1,42 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "batch_client.go", - "doc.go", - "generated_expansion.go", - "job.go", - ], - importpath = "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/batch/v1", - deps = [ - "//federation/client/clientset_generated/federation_clientset/scheme:go_default_library", - "//vendor/k8s.io/api/batch/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime/serializer: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", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/batch_client.go b/federation/client/clientset_generated/federation_clientset/typed/batch/v1/batch_client.go deleted file mode 100644 index d16249a0b1..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/batch_client.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - v1 "k8s.io/api/batch/v1" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" - "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -type BatchV1Interface interface { - RESTClient() rest.Interface - JobsGetter -} - -// BatchV1Client is used to interact with features provided by the batch group. -type BatchV1Client struct { - restClient rest.Interface -} - -func (c *BatchV1Client) Jobs(namespace string) JobInterface { - return newJobs(c, namespace) -} - -// NewForConfig creates a new BatchV1Client for the given config. -func NewForConfig(c *rest.Config) (*BatchV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &BatchV1Client{client}, nil -} - -// NewForConfigOrDie creates a new BatchV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *BatchV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new BatchV1Client for the given RESTClient. -func New(c rest.Interface) *BatchV1Client { - return &BatchV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - - 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 *BatchV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/doc.go b/federation/client/clientset_generated/federation_clientset/typed/batch/v1/doc.go deleted file mode 100644 index b6a2a46728..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package has the automatically generated typed clients. -package v1 diff --git a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/BUILD b/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/BUILD deleted file mode 100644 index 732d32ebab..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/BUILD +++ /dev/null @@ -1,40 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "doc.go", - "fake_batch_client.go", - "fake_job.go", - ], - importpath = "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake", - deps = [ - "//federation/client/clientset_generated/federation_clientset/typed/batch/v1:go_default_library", - "//vendor/k8s.io/api/batch/v1: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", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/doc.go b/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/doc.go deleted file mode 100644 index c58fac35e4..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package fake has the automatically generated clients. -package fake diff --git a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/fake_batch_client.go b/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/fake_batch_client.go deleted file mode 100644 index 332d5d8f4e..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/fake_batch_client.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" - v1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/batch/v1" -) - -type FakeBatchV1 struct { - *testing.Fake -} - -func (c *FakeBatchV1) Jobs(namespace string) v1.JobInterface { - return &FakeJobs{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeBatchV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/fake_job.go b/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/fake_job.go deleted file mode 100644 index b51c8f5cd6..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/fake_job.go +++ /dev/null @@ -1,138 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - batch_v1 "k8s.io/api/batch/v1" - 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" -) - -// FakeJobs implements JobInterface -type FakeJobs struct { - Fake *FakeBatchV1 - ns string -} - -var jobsResource = schema.GroupVersionResource{Group: "batch", Version: "v1", Resource: "jobs"} - -var jobsKind = schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"} - -// Get takes name of the job, and returns the corresponding job object, and an error if there is any. -func (c *FakeJobs) Get(name string, options v1.GetOptions) (result *batch_v1.Job, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(jobsResource, c.ns, name), &batch_v1.Job{}) - - if obj == nil { - return nil, err - } - return obj.(*batch_v1.Job), err -} - -// List takes label and field selectors, and returns the list of Jobs that match those selectors. -func (c *FakeJobs) List(opts v1.ListOptions) (result *batch_v1.JobList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(jobsResource, jobsKind, c.ns, opts), &batch_v1.JobList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &batch_v1.JobList{} - for _, item := range obj.(*batch_v1.JobList).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 jobs. -func (c *FakeJobs) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(jobsResource, c.ns, opts)) - -} - -// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any. -func (c *FakeJobs) Create(job *batch_v1.Job) (result *batch_v1.Job, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(jobsResource, c.ns, job), &batch_v1.Job{}) - - if obj == nil { - return nil, err - } - return obj.(*batch_v1.Job), err -} - -// Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any. -func (c *FakeJobs) Update(job *batch_v1.Job) (result *batch_v1.Job, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), &batch_v1.Job{}) - - if obj == nil { - return nil, err - } - return obj.(*batch_v1.Job), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeJobs) UpdateStatus(job *batch_v1.Job) (*batch_v1.Job, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &batch_v1.Job{}) - - if obj == nil { - return nil, err - } - return obj.(*batch_v1.Job), err -} - -// Delete takes name of the job and deletes it. Returns an error if one occurs. -func (c *FakeJobs) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(jobsResource, c.ns, name), &batch_v1.Job{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &batch_v1.JobList{}) - return err -} - -// Patch applies the patch and returns the patched job. -func (c *FakeJobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *batch_v1.Job, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, data, subresources...), &batch_v1.Job{}) - - if obj == nil { - return nil, err - } - return obj.(*batch_v1.Job), err -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/generated_expansion.go b/federation/client/clientset_generated/federation_clientset/typed/batch/v1/generated_expansion.go deleted file mode 100644 index 68d7741fa0..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/generated_expansion.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -type JobExpansion interface{} diff --git a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/job.go b/federation/client/clientset_generated/federation_clientset/typed/batch/v1/job.go deleted file mode 100644 index 74e10550f8..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/job.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - v1 "k8s.io/api/batch/v1" - meta_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" - scheme "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -// JobsGetter has a method to return a JobInterface. -// A group's client should implement this interface. -type JobsGetter interface { - Jobs(namespace string) JobInterface -} - -// JobInterface has methods to work with Job resources. -type JobInterface interface { - Create(*v1.Job) (*v1.Job, error) - Update(*v1.Job) (*v1.Job, error) - UpdateStatus(*v1.Job) (*v1.Job, error) - Delete(name string, options *meta_v1.DeleteOptions) error - DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error - Get(name string, options meta_v1.GetOptions) (*v1.Job, error) - List(opts meta_v1.ListOptions) (*v1.JobList, error) - Watch(opts meta_v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Job, err error) - JobExpansion -} - -// jobs implements JobInterface -type jobs struct { - client rest.Interface - ns string -} - -// newJobs returns a Jobs -func newJobs(c *BatchV1Client, namespace string) *jobs { - return &jobs{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the job, and returns the corresponding job object, and an error if there is any. -func (c *jobs) Get(name string, options meta_v1.GetOptions) (result *v1.Job, err error) { - result = &v1.Job{} - err = c.client.Get(). - Namespace(c.ns). - Resource("jobs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Jobs that match those selectors. -func (c *jobs) List(opts meta_v1.ListOptions) (result *v1.JobList, err error) { - result = &v1.JobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("jobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested jobs. -func (c *jobs) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("jobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any. -func (c *jobs) Create(job *v1.Job) (result *v1.Job, err error) { - result = &v1.Job{} - err = c.client.Post(). - Namespace(c.ns). - Resource("jobs"). - Body(job). - Do(). - Into(result) - return -} - -// Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any. -func (c *jobs) Update(job *v1.Job) (result *v1.Job, err error) { - result = &v1.Job{} - err = c.client.Put(). - Namespace(c.ns). - Resource("jobs"). - Name(job.Name). - Body(job). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *jobs) UpdateStatus(job *v1.Job) (result *v1.Job, err error) { - result = &v1.Job{} - err = c.client.Put(). - Namespace(c.ns). - Resource("jobs"). - Name(job.Name). - SubResource("status"). - Body(job). - Do(). - Into(result) - return -} - -// Delete takes name of the job and deletes it. Returns an error if one occurs. -func (c *jobs) Delete(name string, options *meta_v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("jobs"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *jobs) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("jobs"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched job. -func (c *jobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Job, err error) { - result = &v1.Job{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("jobs"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/BUILD b/federation/client/clientset_generated/federation_clientset/typed/core/v1/BUILD deleted file mode 100644 index 6b2eb308a5..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/BUILD +++ /dev/null @@ -1,47 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "configmap.go", - "core_client.go", - "doc.go", - "event.go", - "generated_expansion.go", - "namespace.go", - "namespace_expansion.go", - "secret.go", - "service.go", - ], - importpath = "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/core/v1", - deps = [ - "//federation/client/clientset_generated/federation_clientset/scheme:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime/serializer: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", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/client/clientset_generated/federation_clientset/typed/core/v1/fake:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/configmap.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/configmap.go deleted file mode 100644 index d1f66980bf..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/configmap.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - v1 "k8s.io/api/core/v1" - meta_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" - scheme "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -// ConfigMapsGetter has a method to return a ConfigMapInterface. -// A group's client should implement this interface. -type ConfigMapsGetter interface { - ConfigMaps(namespace string) ConfigMapInterface -} - -// ConfigMapInterface has methods to work with ConfigMap resources. -type ConfigMapInterface interface { - Create(*v1.ConfigMap) (*v1.ConfigMap, error) - Update(*v1.ConfigMap) (*v1.ConfigMap, error) - Delete(name string, options *meta_v1.DeleteOptions) error - DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error - Get(name string, options meta_v1.GetOptions) (*v1.ConfigMap, error) - List(opts meta_v1.ListOptions) (*v1.ConfigMapList, error) - Watch(opts meta_v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error) - ConfigMapExpansion -} - -// configMaps implements ConfigMapInterface -type configMaps struct { - client rest.Interface - ns string -} - -// newConfigMaps returns a ConfigMaps -func newConfigMaps(c *CoreV1Client, namespace string) *configMaps { - return &configMaps{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the configMap, and returns the corresponding configMap object, and an error if there is any. -func (c *configMaps) Get(name string, options meta_v1.GetOptions) (result *v1.ConfigMap, err error) { - result = &v1.ConfigMap{} - err = c.client.Get(). - Namespace(c.ns). - Resource("configmaps"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. -func (c *configMaps) List(opts meta_v1.ListOptions) (result *v1.ConfigMapList, err error) { - result = &v1.ConfigMapList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("configmaps"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested configMaps. -func (c *configMaps) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("configmaps"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any. -func (c *configMaps) Create(configMap *v1.ConfigMap) (result *v1.ConfigMap, err error) { - result = &v1.ConfigMap{} - err = c.client.Post(). - Namespace(c.ns). - Resource("configmaps"). - Body(configMap). - Do(). - Into(result) - return -} - -// Update takes the representation of a configMap and updates it. Returns the server's representation of the configMap, and an error, if there is any. -func (c *configMaps) Update(configMap *v1.ConfigMap) (result *v1.ConfigMap, err error) { - result = &v1.ConfigMap{} - err = c.client.Put(). - Namespace(c.ns). - Resource("configmaps"). - Name(configMap.Name). - Body(configMap). - Do(). - Into(result) - return -} - -// Delete takes name of the configMap and deletes it. Returns an error if one occurs. -func (c *configMaps) Delete(name string, options *meta_v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("configmaps"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *configMaps) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("configmaps"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched configMap. -func (c *configMaps) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error) { - result = &v1.ConfigMap{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("configmaps"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/core_client.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/core_client.go deleted file mode 100644 index a3a96f8504..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/core_client.go +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - v1 "k8s.io/api/core/v1" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" - "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -type CoreV1Interface interface { - RESTClient() rest.Interface - ConfigMapsGetter - EventsGetter - NamespacesGetter - SecretsGetter - ServicesGetter -} - -// CoreV1Client is used to interact with features provided by the group. -type CoreV1Client struct { - restClient rest.Interface -} - -func (c *CoreV1Client) ConfigMaps(namespace string) ConfigMapInterface { - return newConfigMaps(c, namespace) -} - -func (c *CoreV1Client) Events(namespace string) EventInterface { - return newEvents(c, namespace) -} - -func (c *CoreV1Client) Namespaces() NamespaceInterface { - return newNamespaces(c) -} - -func (c *CoreV1Client) Secrets(namespace string) SecretInterface { - return newSecrets(c, namespace) -} - -func (c *CoreV1Client) Services(namespace string) ServiceInterface { - return newServices(c, namespace) -} - -// NewForConfig creates a new CoreV1Client for the given config. -func NewForConfig(c *rest.Config) (*CoreV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &CoreV1Client{client}, nil -} - -// NewForConfigOrDie creates a new CoreV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *CoreV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new CoreV1Client for the given RESTClient. -func New(c rest.Interface) *CoreV1Client { - return &CoreV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/api" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - - 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 *CoreV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/doc.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/doc.go deleted file mode 100644 index b6a2a46728..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package has the automatically generated typed clients. -package v1 diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/event.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/event.go deleted file mode 100644 index 8c9a91a348..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/event.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - v1 "k8s.io/api/core/v1" - meta_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" - scheme "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -// EventsGetter has a method to return a EventInterface. -// A group's client should implement this interface. -type EventsGetter interface { - Events(namespace string) EventInterface -} - -// EventInterface has methods to work with Event resources. -type EventInterface interface { - Create(*v1.Event) (*v1.Event, error) - Update(*v1.Event) (*v1.Event, error) - Delete(name string, options *meta_v1.DeleteOptions) error - DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error - Get(name string, options meta_v1.GetOptions) (*v1.Event, error) - List(opts meta_v1.ListOptions) (*v1.EventList, error) - Watch(opts meta_v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Event, err error) - EventExpansion -} - -// events implements EventInterface -type events struct { - client rest.Interface - ns string -} - -// newEvents returns a Events -func newEvents(c *CoreV1Client, namespace string) *events { - return &events{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the event, and returns the corresponding event object, and an error if there is any. -func (c *events) Get(name string, options meta_v1.GetOptions) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Get(). - Namespace(c.ns). - Resource("events"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Events that match those selectors. -func (c *events) List(opts meta_v1.ListOptions) (result *v1.EventList, err error) { - result = &v1.EventList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested events. -func (c *events) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. -func (c *events) Create(event *v1.Event) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Post(). - Namespace(c.ns). - Resource("events"). - Body(event). - Do(). - Into(result) - return -} - -// Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. -func (c *events) Update(event *v1.Event) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Put(). - Namespace(c.ns). - Resource("events"). - Name(event.Name). - Body(event). - Do(). - Into(result) - return -} - -// Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *events) Delete(name string, options *meta_v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("events"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *events) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("events"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched event. -func (c *events) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("events"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/BUILD b/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/BUILD deleted file mode 100644 index a74bbec58d..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/BUILD +++ /dev/null @@ -1,45 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "doc.go", - "fake_configmap.go", - "fake_core_client.go", - "fake_event.go", - "fake_namespace.go", - "fake_namespace_expansion.go", - "fake_secret.go", - "fake_service.go", - ], - importpath = "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake", - deps = [ - "//federation/client/clientset_generated/federation_clientset/typed/core/v1:go_default_library", - "//vendor/k8s.io/api/core/v1: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", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/doc.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/doc.go deleted file mode 100644 index c58fac35e4..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package fake has the automatically generated clients. -package fake diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_configmap.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_configmap.go deleted file mode 100644 index 262a4c5e80..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_configmap.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - core_v1 "k8s.io/api/core/v1" - 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" -) - -// FakeConfigMaps implements ConfigMapInterface -type FakeConfigMaps struct { - Fake *FakeCoreV1 - ns string -} - -var configmapsResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "configmaps"} - -var configmapsKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ConfigMap"} - -// Get takes name of the configMap, and returns the corresponding configMap object, and an error if there is any. -func (c *FakeConfigMaps) Get(name string, options v1.GetOptions) (result *core_v1.ConfigMap, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(configmapsResource, c.ns, name), &core_v1.ConfigMap{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.ConfigMap), err -} - -// List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. -func (c *FakeConfigMaps) List(opts v1.ListOptions) (result *core_v1.ConfigMapList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(configmapsResource, configmapsKind, c.ns, opts), &core_v1.ConfigMapList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &core_v1.ConfigMapList{} - for _, item := range obj.(*core_v1.ConfigMapList).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 configMaps. -func (c *FakeConfigMaps) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(configmapsResource, c.ns, opts)) - -} - -// Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any. -func (c *FakeConfigMaps) Create(configMap *core_v1.ConfigMap) (result *core_v1.ConfigMap, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(configmapsResource, c.ns, configMap), &core_v1.ConfigMap{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.ConfigMap), err -} - -// Update takes the representation of a configMap and updates it. Returns the server's representation of the configMap, and an error, if there is any. -func (c *FakeConfigMaps) Update(configMap *core_v1.ConfigMap) (result *core_v1.ConfigMap, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(configmapsResource, c.ns, configMap), &core_v1.ConfigMap{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.ConfigMap), err -} - -// Delete takes name of the configMap and deletes it. Returns an error if one occurs. -func (c *FakeConfigMaps) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(configmapsResource, c.ns, name), &core_v1.ConfigMap{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeConfigMaps) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(configmapsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &core_v1.ConfigMapList{}) - return err -} - -// Patch applies the patch and returns the patched configMap. -func (c *FakeConfigMaps) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *core_v1.ConfigMap, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, name, data, subresources...), &core_v1.ConfigMap{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.ConfigMap), err -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_core_client.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_core_client.go deleted file mode 100644 index 6e6b30cfe1..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_core_client.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" - v1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/core/v1" -) - -type FakeCoreV1 struct { - *testing.Fake -} - -func (c *FakeCoreV1) ConfigMaps(namespace string) v1.ConfigMapInterface { - return &FakeConfigMaps{c, namespace} -} - -func (c *FakeCoreV1) Events(namespace string) v1.EventInterface { - return &FakeEvents{c, namespace} -} - -func (c *FakeCoreV1) Namespaces() v1.NamespaceInterface { - return &FakeNamespaces{c} -} - -func (c *FakeCoreV1) Secrets(namespace string) v1.SecretInterface { - return &FakeSecrets{c, namespace} -} - -func (c *FakeCoreV1) Services(namespace string) v1.ServiceInterface { - return &FakeServices{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeCoreV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_event.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_event.go deleted file mode 100644 index 60d6b45a58..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_event.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - core_v1 "k8s.io/api/core/v1" - 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" -) - -// FakeEvents implements EventInterface -type FakeEvents struct { - Fake *FakeCoreV1 - ns string -} - -var eventsResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "events"} - -var eventsKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Event"} - -// Get takes name of the event, and returns the corresponding event object, and an error if there is any. -func (c *FakeEvents) Get(name string, options v1.GetOptions) (result *core_v1.Event, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(eventsResource, c.ns, name), &core_v1.Event{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.Event), err -} - -// List takes label and field selectors, and returns the list of Events that match those selectors. -func (c *FakeEvents) List(opts v1.ListOptions) (result *core_v1.EventList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(eventsResource, eventsKind, c.ns, opts), &core_v1.EventList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &core_v1.EventList{} - for _, item := range obj.(*core_v1.EventList).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 events. -func (c *FakeEvents) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(eventsResource, c.ns, opts)) - -} - -// Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. -func (c *FakeEvents) Create(event *core_v1.Event) (result *core_v1.Event, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(eventsResource, c.ns, event), &core_v1.Event{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.Event), err -} - -// Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. -func (c *FakeEvents) Update(event *core_v1.Event) (result *core_v1.Event, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(eventsResource, c.ns, event), &core_v1.Event{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.Event), err -} - -// Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *FakeEvents) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(eventsResource, c.ns, name), &core_v1.Event{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeEvents) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(eventsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &core_v1.EventList{}) - return err -} - -// Patch applies the patch and returns the patched event. -func (c *FakeEvents) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *core_v1.Event, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, data, subresources...), &core_v1.Event{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.Event), err -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_namespace.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_namespace.go deleted file mode 100644 index 8c03925a7f..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_namespace.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - core_v1 "k8s.io/api/core/v1" - 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" -) - -// FakeNamespaces implements NamespaceInterface -type FakeNamespaces struct { - Fake *FakeCoreV1 -} - -var namespacesResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "namespaces"} - -var namespacesKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Namespace"} - -// Get takes name of the namespace, and returns the corresponding namespace object, and an error if there is any. -func (c *FakeNamespaces) Get(name string, options v1.GetOptions) (result *core_v1.Namespace, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(namespacesResource, name), &core_v1.Namespace{}) - if obj == nil { - return nil, err - } - return obj.(*core_v1.Namespace), err -} - -// List takes label and field selectors, and returns the list of Namespaces that match those selectors. -func (c *FakeNamespaces) List(opts v1.ListOptions) (result *core_v1.NamespaceList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(namespacesResource, namespacesKind, opts), &core_v1.NamespaceList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &core_v1.NamespaceList{} - for _, item := range obj.(*core_v1.NamespaceList).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 namespaces. -func (c *FakeNamespaces) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(namespacesResource, opts)) -} - -// Create takes the representation of a namespace and creates it. Returns the server's representation of the namespace, and an error, if there is any. -func (c *FakeNamespaces) Create(namespace *core_v1.Namespace) (result *core_v1.Namespace, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(namespacesResource, namespace), &core_v1.Namespace{}) - if obj == nil { - return nil, err - } - return obj.(*core_v1.Namespace), err -} - -// Update takes the representation of a namespace and updates it. Returns the server's representation of the namespace, and an error, if there is any. -func (c *FakeNamespaces) Update(namespace *core_v1.Namespace) (result *core_v1.Namespace, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(namespacesResource, namespace), &core_v1.Namespace{}) - if obj == nil { - return nil, err - } - return obj.(*core_v1.Namespace), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeNamespaces) UpdateStatus(namespace *core_v1.Namespace) (*core_v1.Namespace, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(namespacesResource, "status", namespace), &core_v1.Namespace{}) - if obj == nil { - return nil, err - } - return obj.(*core_v1.Namespace), err -} - -// Delete takes name of the namespace and deletes it. Returns an error if one occurs. -func (c *FakeNamespaces) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(namespacesResource, name), &core_v1.Namespace{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeNamespaces) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(namespacesResource, listOptions) - - _, err := c.Fake.Invokes(action, &core_v1.NamespaceList{}) - return err -} - -// Patch applies the patch and returns the patched namespace. -func (c *FakeNamespaces) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *core_v1.Namespace, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, name, data, subresources...), &core_v1.Namespace{}) - if obj == nil { - return nil, err - } - return obj.(*core_v1.Namespace), err -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_namespace_expansion.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_namespace_expansion.go deleted file mode 100644 index 7b2cf605d3..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_namespace_expansion.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2016 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 fake - -import ( - "k8s.io/api/core/v1" - core "k8s.io/client-go/testing" -) - -func (c *FakeNamespaces) Finalize(namespace *v1.Namespace) (*v1.Namespace, error) { - action := core.CreateActionImpl{} - action.Verb = "create" - action.Resource = namespacesResource - action.Subresource = "finalize" - action.Object = namespace - - obj, err := c.Fake.Invokes(action, namespace) - if obj == nil { - return nil, err - } - - return obj.(*v1.Namespace), err -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_secret.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_secret.go deleted file mode 100644 index 58c6dc9c6d..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_secret.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - core_v1 "k8s.io/api/core/v1" - 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" -) - -// FakeSecrets implements SecretInterface -type FakeSecrets struct { - Fake *FakeCoreV1 - ns string -} - -var secretsResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "secrets"} - -var secretsKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Secret"} - -// Get takes name of the secret, and returns the corresponding secret object, and an error if there is any. -func (c *FakeSecrets) Get(name string, options v1.GetOptions) (result *core_v1.Secret, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(secretsResource, c.ns, name), &core_v1.Secret{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.Secret), err -} - -// List takes label and field selectors, and returns the list of Secrets that match those selectors. -func (c *FakeSecrets) List(opts v1.ListOptions) (result *core_v1.SecretList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(secretsResource, secretsKind, c.ns, opts), &core_v1.SecretList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &core_v1.SecretList{} - for _, item := range obj.(*core_v1.SecretList).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 secrets. -func (c *FakeSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(secretsResource, c.ns, opts)) - -} - -// Create takes the representation of a secret and creates it. Returns the server's representation of the secret, and an error, if there is any. -func (c *FakeSecrets) Create(secret *core_v1.Secret) (result *core_v1.Secret, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(secretsResource, c.ns, secret), &core_v1.Secret{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.Secret), err -} - -// Update takes the representation of a secret and updates it. Returns the server's representation of the secret, and an error, if there is any. -func (c *FakeSecrets) Update(secret *core_v1.Secret) (result *core_v1.Secret, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(secretsResource, c.ns, secret), &core_v1.Secret{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.Secret), err -} - -// Delete takes name of the secret and deletes it. Returns an error if one occurs. -func (c *FakeSecrets) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(secretsResource, c.ns, name), &core_v1.Secret{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(secretsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &core_v1.SecretList{}) - return err -} - -// Patch applies the patch and returns the patched secret. -func (c *FakeSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *core_v1.Secret, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(secretsResource, c.ns, name, data, subresources...), &core_v1.Secret{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.Secret), err -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_service.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_service.go deleted file mode 100644 index c734ff5b56..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/fake_service.go +++ /dev/null @@ -1,138 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - core_v1 "k8s.io/api/core/v1" - 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" -) - -// FakeServices implements ServiceInterface -type FakeServices struct { - Fake *FakeCoreV1 - ns string -} - -var servicesResource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "services"} - -var servicesKind = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Service"} - -// Get takes name of the service, and returns the corresponding service object, and an error if there is any. -func (c *FakeServices) Get(name string, options v1.GetOptions) (result *core_v1.Service, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(servicesResource, c.ns, name), &core_v1.Service{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.Service), err -} - -// List takes label and field selectors, and returns the list of Services that match those selectors. -func (c *FakeServices) List(opts v1.ListOptions) (result *core_v1.ServiceList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(servicesResource, servicesKind, c.ns, opts), &core_v1.ServiceList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &core_v1.ServiceList{} - for _, item := range obj.(*core_v1.ServiceList).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 services. -func (c *FakeServices) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(servicesResource, c.ns, opts)) - -} - -// Create takes the representation of a service and creates it. Returns the server's representation of the service, and an error, if there is any. -func (c *FakeServices) Create(service *core_v1.Service) (result *core_v1.Service, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(servicesResource, c.ns, service), &core_v1.Service{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.Service), err -} - -// Update takes the representation of a service and updates it. Returns the server's representation of the service, and an error, if there is any. -func (c *FakeServices) Update(service *core_v1.Service) (result *core_v1.Service, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(servicesResource, c.ns, service), &core_v1.Service{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.Service), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeServices) UpdateStatus(service *core_v1.Service) (*core_v1.Service, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(servicesResource, "status", c.ns, service), &core_v1.Service{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.Service), err -} - -// Delete takes name of the service and deletes it. Returns an error if one occurs. -func (c *FakeServices) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(servicesResource, c.ns, name), &core_v1.Service{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeServices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(servicesResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &core_v1.ServiceList{}) - return err -} - -// Patch applies the patch and returns the patched service. -func (c *FakeServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *core_v1.Service, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, name, data, subresources...), &core_v1.Service{}) - - if obj == nil { - return nil, err - } - return obj.(*core_v1.Service), err -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/generated_expansion.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/generated_expansion.go deleted file mode 100644 index 6c1fd71f35..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/generated_expansion.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -type ConfigMapExpansion interface{} - -type EventExpansion interface{} - -type SecretExpansion interface{} - -type ServiceExpansion interface{} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/namespace.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/namespace.go deleted file mode 100644 index 34f16aa6d0..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/namespace.go +++ /dev/null @@ -1,161 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - v1 "k8s.io/api/core/v1" - meta_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" - scheme "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -// NamespacesGetter has a method to return a NamespaceInterface. -// A group's client should implement this interface. -type NamespacesGetter interface { - Namespaces() NamespaceInterface -} - -// NamespaceInterface has methods to work with Namespace resources. -type NamespaceInterface interface { - Create(*v1.Namespace) (*v1.Namespace, error) - Update(*v1.Namespace) (*v1.Namespace, error) - UpdateStatus(*v1.Namespace) (*v1.Namespace, error) - Delete(name string, options *meta_v1.DeleteOptions) error - DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error - Get(name string, options meta_v1.GetOptions) (*v1.Namespace, error) - List(opts meta_v1.ListOptions) (*v1.NamespaceList, error) - Watch(opts meta_v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Namespace, err error) - NamespaceExpansion -} - -// namespaces implements NamespaceInterface -type namespaces struct { - client rest.Interface -} - -// newNamespaces returns a Namespaces -func newNamespaces(c *CoreV1Client) *namespaces { - return &namespaces{ - client: c.RESTClient(), - } -} - -// Get takes name of the namespace, and returns the corresponding namespace object, and an error if there is any. -func (c *namespaces) Get(name string, options meta_v1.GetOptions) (result *v1.Namespace, err error) { - result = &v1.Namespace{} - err = c.client.Get(). - Resource("namespaces"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Namespaces that match those selectors. -func (c *namespaces) List(opts meta_v1.ListOptions) (result *v1.NamespaceList, err error) { - result = &v1.NamespaceList{} - err = c.client.Get(). - Resource("namespaces"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested namespaces. -func (c *namespaces) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Resource("namespaces"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a namespace and creates it. Returns the server's representation of the namespace, and an error, if there is any. -func (c *namespaces) Create(namespace *v1.Namespace) (result *v1.Namespace, err error) { - result = &v1.Namespace{} - err = c.client.Post(). - Resource("namespaces"). - Body(namespace). - Do(). - Into(result) - return -} - -// Update takes the representation of a namespace and updates it. Returns the server's representation of the namespace, and an error, if there is any. -func (c *namespaces) Update(namespace *v1.Namespace) (result *v1.Namespace, err error) { - result = &v1.Namespace{} - err = c.client.Put(). - Resource("namespaces"). - Name(namespace.Name). - Body(namespace). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *namespaces) UpdateStatus(namespace *v1.Namespace) (result *v1.Namespace, err error) { - result = &v1.Namespace{} - err = c.client.Put(). - Resource("namespaces"). - Name(namespace.Name). - SubResource("status"). - Body(namespace). - Do(). - Into(result) - return -} - -// Delete takes name of the namespace and deletes it. Returns an error if one occurs. -func (c *namespaces) Delete(name string, options *meta_v1.DeleteOptions) error { - return c.client.Delete(). - Resource("namespaces"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *namespaces) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { - return c.client.Delete(). - Resource("namespaces"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched namespace. -func (c *namespaces) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Namespace, err error) { - result = &v1.Namespace{} - err = c.client.Patch(pt). - Resource("namespaces"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/namespace_expansion.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/namespace_expansion.go deleted file mode 100644 index 17effe29c6..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/namespace_expansion.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2016 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 v1 - -import "k8s.io/api/core/v1" - -// The NamespaceExpansion interface allows manually adding extra methods to the NamespaceInterface. -type NamespaceExpansion interface { - Finalize(item *v1.Namespace) (*v1.Namespace, error) -} - -// Finalize takes the representation of a namespace to update. Returns the server's representation of the namespace, and an error, if it occurs. -func (c *namespaces) Finalize(namespace *v1.Namespace) (result *v1.Namespace, err error) { - result = &v1.Namespace{} - err = c.client.Put().Resource("namespaces").Name(namespace.Name).SubResource("finalize").Body(namespace).Do().Into(result) - return -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/secret.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/secret.go deleted file mode 100644 index 1551a51ded..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/secret.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - v1 "k8s.io/api/core/v1" - meta_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" - scheme "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -// SecretsGetter has a method to return a SecretInterface. -// A group's client should implement this interface. -type SecretsGetter interface { - Secrets(namespace string) SecretInterface -} - -// SecretInterface has methods to work with Secret resources. -type SecretInterface interface { - Create(*v1.Secret) (*v1.Secret, error) - Update(*v1.Secret) (*v1.Secret, error) - Delete(name string, options *meta_v1.DeleteOptions) error - DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error - Get(name string, options meta_v1.GetOptions) (*v1.Secret, error) - List(opts meta_v1.ListOptions) (*v1.SecretList, error) - Watch(opts meta_v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Secret, err error) - SecretExpansion -} - -// secrets implements SecretInterface -type secrets struct { - client rest.Interface - ns string -} - -// newSecrets returns a Secrets -func newSecrets(c *CoreV1Client, namespace string) *secrets { - return &secrets{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the secret, and returns the corresponding secret object, and an error if there is any. -func (c *secrets) Get(name string, options meta_v1.GetOptions) (result *v1.Secret, err error) { - result = &v1.Secret{} - err = c.client.Get(). - Namespace(c.ns). - Resource("secrets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Secrets that match those selectors. -func (c *secrets) List(opts meta_v1.ListOptions) (result *v1.SecretList, err error) { - result = &v1.SecretList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("secrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested secrets. -func (c *secrets) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("secrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a secret and creates it. Returns the server's representation of the secret, and an error, if there is any. -func (c *secrets) Create(secret *v1.Secret) (result *v1.Secret, err error) { - result = &v1.Secret{} - err = c.client.Post(). - Namespace(c.ns). - Resource("secrets"). - Body(secret). - Do(). - Into(result) - return -} - -// Update takes the representation of a secret and updates it. Returns the server's representation of the secret, and an error, if there is any. -func (c *secrets) Update(secret *v1.Secret) (result *v1.Secret, err error) { - result = &v1.Secret{} - err = c.client.Put(). - Namespace(c.ns). - Resource("secrets"). - Name(secret.Name). - Body(secret). - Do(). - Into(result) - return -} - -// Delete takes name of the secret and deletes it. Returns an error if one occurs. -func (c *secrets) Delete(name string, options *meta_v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("secrets"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *secrets) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("secrets"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched secret. -func (c *secrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Secret, err error) { - result = &v1.Secret{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("secrets"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/service.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/service.go deleted file mode 100644 index 47c4ea2407..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/service.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - v1 "k8s.io/api/core/v1" - meta_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" - scheme "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -// ServicesGetter has a method to return a ServiceInterface. -// A group's client should implement this interface. -type ServicesGetter interface { - Services(namespace string) ServiceInterface -} - -// ServiceInterface has methods to work with Service resources. -type ServiceInterface interface { - Create(*v1.Service) (*v1.Service, error) - Update(*v1.Service) (*v1.Service, error) - UpdateStatus(*v1.Service) (*v1.Service, error) - Delete(name string, options *meta_v1.DeleteOptions) error - DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error - Get(name string, options meta_v1.GetOptions) (*v1.Service, error) - List(opts meta_v1.ListOptions) (*v1.ServiceList, error) - Watch(opts meta_v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Service, err error) - ServiceExpansion -} - -// services implements ServiceInterface -type services struct { - client rest.Interface - ns string -} - -// newServices returns a Services -func newServices(c *CoreV1Client, namespace string) *services { - return &services{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the service, and returns the corresponding service object, and an error if there is any. -func (c *services) Get(name string, options meta_v1.GetOptions) (result *v1.Service, err error) { - result = &v1.Service{} - err = c.client.Get(). - Namespace(c.ns). - Resource("services"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Services that match those selectors. -func (c *services) List(opts meta_v1.ListOptions) (result *v1.ServiceList, err error) { - result = &v1.ServiceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("services"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested services. -func (c *services) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("services"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a service and creates it. Returns the server's representation of the service, and an error, if there is any. -func (c *services) Create(service *v1.Service) (result *v1.Service, err error) { - result = &v1.Service{} - err = c.client.Post(). - Namespace(c.ns). - Resource("services"). - Body(service). - Do(). - Into(result) - return -} - -// Update takes the representation of a service and updates it. Returns the server's representation of the service, and an error, if there is any. -func (c *services) Update(service *v1.Service) (result *v1.Service, err error) { - result = &v1.Service{} - err = c.client.Put(). - Namespace(c.ns). - Resource("services"). - Name(service.Name). - Body(service). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *services) UpdateStatus(service *v1.Service) (result *v1.Service, err error) { - result = &v1.Service{} - err = c.client.Put(). - Namespace(c.ns). - Resource("services"). - Name(service.Name). - SubResource("status"). - Body(service). - Do(). - Into(result) - return -} - -// Delete takes name of the service and deletes it. Returns an error if one occurs. -func (c *services) Delete(name string, options *meta_v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("services"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *services) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("services"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched service. -func (c *services) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Service, err error) { - result = &v1.Service{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("services"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/BUILD b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/BUILD deleted file mode 100644 index 045f12f3f6..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/BUILD +++ /dev/null @@ -1,46 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "daemonset.go", - "deployment.go", - "deployment_expansion.go", - "doc.go", - "extensions_client.go", - "generated_expansion.go", - "ingress.go", - "replicaset.go", - ], - importpath = "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1", - deps = [ - "//federation/client/clientset_generated/federation_clientset/scheme:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime/serializer: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", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/daemonset.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/daemonset.go deleted file mode 100644 index f688789d56..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/daemonset.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - v1beta1 "k8s.io/api/extensions/v1beta1" - 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" - scheme "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -// DaemonSetsGetter has a method to return a DaemonSetInterface. -// A group's client should implement this interface. -type DaemonSetsGetter interface { - DaemonSets(namespace string) DaemonSetInterface -} - -// DaemonSetInterface has methods to work with DaemonSet resources. -type DaemonSetInterface interface { - Create(*v1beta1.DaemonSet) (*v1beta1.DaemonSet, error) - Update(*v1beta1.DaemonSet) (*v1beta1.DaemonSet, error) - UpdateStatus(*v1beta1.DaemonSet) (*v1beta1.DaemonSet, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.DaemonSet, error) - List(opts v1.ListOptions) (*v1beta1.DaemonSetList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.DaemonSet, err error) - DaemonSetExpansion -} - -// daemonSets implements DaemonSetInterface -type daemonSets struct { - client rest.Interface - ns string -} - -// newDaemonSets returns a DaemonSets -func newDaemonSets(c *ExtensionsV1beta1Client, namespace string) *daemonSets { - return &daemonSets{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. -func (c *daemonSets) Get(name string, options v1.GetOptions) (result *v1beta1.DaemonSet, err error) { - result = &v1beta1.DaemonSet{} - err = c.client.Get(). - Namespace(c.ns). - Resource("daemonsets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of DaemonSets that match those selectors. -func (c *daemonSets) List(opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) { - result = &v1beta1.DaemonSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("daemonsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested daemonSets. -func (c *daemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("daemonsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *daemonSets) Create(daemonSet *v1beta1.DaemonSet) (result *v1beta1.DaemonSet, err error) { - result = &v1beta1.DaemonSet{} - err = c.client.Post(). - Namespace(c.ns). - Resource("daemonsets"). - Body(daemonSet). - Do(). - Into(result) - return -} - -// Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *daemonSets) Update(daemonSet *v1beta1.DaemonSet) (result *v1beta1.DaemonSet, err error) { - result = &v1beta1.DaemonSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("daemonsets"). - Name(daemonSet.Name). - Body(daemonSet). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *daemonSets) UpdateStatus(daemonSet *v1beta1.DaemonSet) (result *v1beta1.DaemonSet, err error) { - result = &v1beta1.DaemonSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("daemonsets"). - Name(daemonSet.Name). - SubResource("status"). - Body(daemonSet). - Do(). - Into(result) - return -} - -// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *daemonSets) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("daemonsets"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *daemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("daemonsets"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched daemonSet. -func (c *daemonSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.DaemonSet, err error) { - result = &v1beta1.DaemonSet{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("daemonsets"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/deployment.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/deployment.go deleted file mode 100644 index f26630be8f..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/deployment.go +++ /dev/null @@ -1,203 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - v1beta1 "k8s.io/api/extensions/v1beta1" - 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" - scheme "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -// DeploymentsGetter has a method to return a DeploymentInterface. -// A group's client should implement this interface. -type DeploymentsGetter interface { - Deployments(namespace string) DeploymentInterface -} - -// DeploymentInterface has methods to work with Deployment resources. -type DeploymentInterface interface { - Create(*v1beta1.Deployment) (*v1beta1.Deployment, error) - Update(*v1beta1.Deployment) (*v1beta1.Deployment, error) - UpdateStatus(*v1beta1.Deployment) (*v1beta1.Deployment, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Deployment, error) - List(opts v1.ListOptions) (*v1beta1.DeploymentList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) - GetScale(deploymentName string, options v1.GetOptions) (*v1beta1.Scale, error) - UpdateScale(deploymentName string, scale *v1beta1.Scale) (*v1beta1.Scale, error) - - DeploymentExpansion -} - -// deployments implements DeploymentInterface -type deployments struct { - client rest.Interface - ns string -} - -// newDeployments returns a Deployments -func newDeployments(c *ExtensionsV1beta1Client, namespace string) *deployments { - return &deployments{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. -func (c *deployments) Get(name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { - result = &v1beta1.DeploymentList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested deployments. -func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Create(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Post(). - Namespace(c.ns). - Resource("deployments"). - Body(deployment). - Do(). - Into(result) - return -} - -// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Update(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Put(). - Namespace(c.ns). - Resource("deployments"). - Name(deployment.Name). - Body(deployment). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *deployments) UpdateStatus(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Put(). - Namespace(c.ns). - Resource("deployments"). - Name(deployment.Name). - SubResource("status"). - Body(deployment). - Do(). - Into(result) - return -} - -// Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *deployments) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("deployments"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *deployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched deployment. -func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("deployments"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} - -// GetScale takes name of the deployment, and returns the corresponding v1beta1.Scale object, and an error if there is any. -func (c *deployments) GetScale(deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { - result = &v1beta1.Scale{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - Name(deploymentName). - SubResource("scale"). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *deployments) UpdateScale(deploymentName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) { - result = &v1beta1.Scale{} - err = c.client.Put(). - Namespace(c.ns). - Resource("deployments"). - Name(deploymentName). - SubResource("scale"). - Body(scale). - Do(). - Into(result) - return -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/deployment_expansion.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/deployment_expansion.go deleted file mode 100644 index 24734be6a6..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/deployment_expansion.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2016 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 v1beta1 - -import "k8s.io/api/extensions/v1beta1" - -// The DeploymentExpansion interface allows manually adding extra methods to the DeploymentInterface. -type DeploymentExpansion interface { - Rollback(*v1beta1.DeploymentRollback) error -} - -// Rollback applied the provided DeploymentRollback to the named deployment in the current namespace. -func (c *deployments) Rollback(deploymentRollback *v1beta1.DeploymentRollback) error { - return c.client.Post().Namespace(c.ns).Resource("deployments").Name(deploymentRollback.Name).SubResource("rollback").Body(deploymentRollback).Do().Error() -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/doc.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/doc.go deleted file mode 100644 index 1b50aa1997..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package has the automatically generated typed clients. -package v1beta1 diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/extensions_client.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/extensions_client.go deleted file mode 100644 index 2f50f3bb02..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/extensions_client.go +++ /dev/null @@ -1,103 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - v1beta1 "k8s.io/api/extensions/v1beta1" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" - "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -type ExtensionsV1beta1Interface interface { - RESTClient() rest.Interface - DaemonSetsGetter - DeploymentsGetter - IngressesGetter - ReplicaSetsGetter -} - -// ExtensionsV1beta1Client is used to interact with features provided by the extensions group. -type ExtensionsV1beta1Client struct { - restClient rest.Interface -} - -func (c *ExtensionsV1beta1Client) DaemonSets(namespace string) DaemonSetInterface { - return newDaemonSets(c, namespace) -} - -func (c *ExtensionsV1beta1Client) Deployments(namespace string) DeploymentInterface { - return newDeployments(c, namespace) -} - -func (c *ExtensionsV1beta1Client) Ingresses(namespace string) IngressInterface { - return newIngresses(c, namespace) -} - -func (c *ExtensionsV1beta1Client) ReplicaSets(namespace string) ReplicaSetInterface { - return newReplicaSets(c, namespace) -} - -// NewForConfig creates a new ExtensionsV1beta1Client for the given config. -func NewForConfig(c *rest.Config) (*ExtensionsV1beta1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &ExtensionsV1beta1Client{client}, nil -} - -// NewForConfigOrDie creates a new ExtensionsV1beta1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ExtensionsV1beta1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ExtensionsV1beta1Client for the given RESTClient. -func New(c rest.Interface) *ExtensionsV1beta1Client { - return &ExtensionsV1beta1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1beta1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - - 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 *ExtensionsV1beta1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/BUILD b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/BUILD deleted file mode 100644 index 4aed5799bf..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/BUILD +++ /dev/null @@ -1,44 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "doc.go", - "fake_daemonset.go", - "fake_deployment.go", - "fake_deployment_expansion.go", - "fake_extensions_client.go", - "fake_ingress.go", - "fake_replicaset.go", - ], - importpath = "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake", - deps = [ - "//federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1: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", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/doc.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/doc.go deleted file mode 100644 index c58fac35e4..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package fake has the automatically generated clients. -package fake diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_daemonset.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_daemonset.go deleted file mode 100644 index 3a3220a059..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_daemonset.go +++ /dev/null @@ -1,138 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - v1beta1 "k8s.io/api/extensions/v1beta1" - 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" -) - -// FakeDaemonSets implements DaemonSetInterface -type FakeDaemonSets struct { - Fake *FakeExtensionsV1beta1 - ns string -} - -var daemonsetsResource = schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "daemonsets"} - -var daemonsetsKind = schema.GroupVersionKind{Group: "extensions", Version: "v1beta1", Kind: "DaemonSet"} - -// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. -func (c *FakeDaemonSets) Get(name string, options v1.GetOptions) (result *v1beta1.DaemonSet, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), &v1beta1.DaemonSet{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.DaemonSet), err -} - -// List takes label and field selectors, and returns the list of DaemonSets that match those selectors. -func (c *FakeDaemonSets) List(opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), &v1beta1.DaemonSetList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.DaemonSetList{} - for _, item := range obj.(*v1beta1.DaemonSetList).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 daemonSets. -func (c *FakeDaemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(daemonsetsResource, c.ns, opts)) - -} - -// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *FakeDaemonSets) Create(daemonSet *v1beta1.DaemonSet) (result *v1beta1.DaemonSet, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &v1beta1.DaemonSet{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.DaemonSet), err -} - -// Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *FakeDaemonSets) Update(daemonSet *v1beta1.DaemonSet) (result *v1beta1.DaemonSet, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &v1beta1.DaemonSet{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.DaemonSet), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeDaemonSets) UpdateStatus(daemonSet *v1beta1.DaemonSet) (*v1beta1.DaemonSet, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &v1beta1.DaemonSet{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.DaemonSet), err -} - -// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *FakeDaemonSets) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(daemonsetsResource, c.ns, name), &v1beta1.DaemonSet{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeDaemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1beta1.DaemonSetList{}) - return err -} - -// Patch applies the patch and returns the patched daemonSet. -func (c *FakeDaemonSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.DaemonSet, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, data, subresources...), &v1beta1.DaemonSet{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.DaemonSet), err -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_deployment.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_deployment.go deleted file mode 100644 index d5abace975..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_deployment.go +++ /dev/null @@ -1,160 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - v1beta1 "k8s.io/api/extensions/v1beta1" - 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" -) - -// FakeDeployments implements DeploymentInterface -type FakeDeployments struct { - Fake *FakeExtensionsV1beta1 - ns string -} - -var deploymentsResource = schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "deployments"} - -var deploymentsKind = schema.GroupVersionKind{Group: "extensions", Version: "v1beta1", Kind: "Deployment"} - -// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. -func (c *FakeDeployments) Get(name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &v1beta1.Deployment{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Deployment), err -} - -// List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *FakeDeployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &v1beta1.DeploymentList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.DeploymentList{} - for _, item := range obj.(*v1beta1.DeploymentList).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 deployments. -func (c *FakeDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(deploymentsResource, c.ns, opts)) - -} - -// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *FakeDeployments) Create(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Deployment), err -} - -// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *FakeDeployments) Update(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Deployment), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeDeployments) UpdateStatus(deployment *v1beta1.Deployment) (*v1beta1.Deployment, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &v1beta1.Deployment{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Deployment), err -} - -// Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *FakeDeployments) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(deploymentsResource, c.ns, name), &v1beta1.Deployment{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1beta1.DeploymentList{}) - return err -} - -// Patch applies the patch and returns the patched deployment. -func (c *FakeDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, data, subresources...), &v1beta1.Deployment{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Deployment), err -} - -// GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any. -func (c *FakeDeployments) GetScale(deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(deploymentsResource, c.ns, "scale", deploymentName), &v1beta1.Scale{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Scale), err -} - -// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *FakeDeployments) UpdateScale(deploymentName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "scale", c.ns, scale), &v1beta1.Scale{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Scale), err -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_deployment_expansion.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_deployment_expansion.go deleted file mode 100644 index af2bc0f713..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_deployment_expansion.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2014 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 fake - -import ( - "k8s.io/api/extensions/v1beta1" - core "k8s.io/client-go/testing" -) - -func (c *FakeDeployments) Rollback(deploymentRollback *v1beta1.DeploymentRollback) error { - action := core.CreateActionImpl{} - action.Verb = "create" - action.Resource = deploymentsResource - action.Subresource = "rollback" - action.Object = deploymentRollback - - _, err := c.Fake.Invokes(action, deploymentRollback) - return err -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_extensions_client.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_extensions_client.go deleted file mode 100644 index b6a4cd5b6f..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_extensions_client.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" - v1beta1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1" -) - -type FakeExtensionsV1beta1 struct { - *testing.Fake -} - -func (c *FakeExtensionsV1beta1) DaemonSets(namespace string) v1beta1.DaemonSetInterface { - return &FakeDaemonSets{c, namespace} -} - -func (c *FakeExtensionsV1beta1) Deployments(namespace string) v1beta1.DeploymentInterface { - return &FakeDeployments{c, namespace} -} - -func (c *FakeExtensionsV1beta1) Ingresses(namespace string) v1beta1.IngressInterface { - return &FakeIngresses{c, namespace} -} - -func (c *FakeExtensionsV1beta1) ReplicaSets(namespace string) v1beta1.ReplicaSetInterface { - return &FakeReplicaSets{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeExtensionsV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_ingress.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_ingress.go deleted file mode 100644 index 5a6f93e0e0..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_ingress.go +++ /dev/null @@ -1,138 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - v1beta1 "k8s.io/api/extensions/v1beta1" - 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" -) - -// FakeIngresses implements IngressInterface -type FakeIngresses struct { - Fake *FakeExtensionsV1beta1 - ns string -} - -var ingressesResource = schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "ingresses"} - -var ingressesKind = schema.GroupVersionKind{Group: "extensions", Version: "v1beta1", Kind: "Ingress"} - -// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. -func (c *FakeIngresses) Get(name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(ingressesResource, c.ns, name), &v1beta1.Ingress{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Ingress), err -} - -// List takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *FakeIngresses) List(opts v1.ListOptions) (result *v1beta1.IngressList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(ingressesResource, ingressesKind, c.ns, opts), &v1beta1.IngressList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.IngressList{} - for _, item := range obj.(*v1beta1.IngressList).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 ingresses. -func (c *FakeIngresses) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(ingressesResource, c.ns, opts)) - -} - -// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *FakeIngresses) Create(ingress *v1beta1.Ingress) (result *v1beta1.Ingress, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(ingressesResource, c.ns, ingress), &v1beta1.Ingress{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Ingress), err -} - -// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *FakeIngresses) Update(ingress *v1beta1.Ingress) (result *v1beta1.Ingress, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(ingressesResource, c.ns, ingress), &v1beta1.Ingress{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Ingress), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeIngresses) UpdateStatus(ingress *v1beta1.Ingress) (*v1beta1.Ingress, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), &v1beta1.Ingress{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Ingress), err -} - -// Delete takes name of the ingress and deletes it. Returns an error if one occurs. -func (c *FakeIngresses) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(ingressesResource, c.ns, name), &v1beta1.Ingress{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeIngresses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(ingressesResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1beta1.IngressList{}) - return err -} - -// Patch applies the patch and returns the patched ingress. -func (c *FakeIngresses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Ingress, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, name, data, subresources...), &v1beta1.Ingress{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Ingress), err -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_replicaset.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_replicaset.go deleted file mode 100644 index e8d22c6b49..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/fake_replicaset.go +++ /dev/null @@ -1,160 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - v1beta1 "k8s.io/api/extensions/v1beta1" - 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" -) - -// FakeReplicaSets implements ReplicaSetInterface -type FakeReplicaSets struct { - Fake *FakeExtensionsV1beta1 - ns string -} - -var replicasetsResource = schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "replicasets"} - -var replicasetsKind = schema.GroupVersionKind{Group: "extensions", Version: "v1beta1", Kind: "ReplicaSet"} - -// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. -func (c *FakeReplicaSets) Get(name string, options v1.GetOptions) (result *v1beta1.ReplicaSet, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), &v1beta1.ReplicaSet{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ReplicaSet), err -} - -// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *FakeReplicaSets) List(opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), &v1beta1.ReplicaSetList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ReplicaSetList{} - for _, item := range obj.(*v1beta1.ReplicaSetList).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 replicaSets. -func (c *FakeReplicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(replicasetsResource, c.ns, opts)) - -} - -// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *FakeReplicaSets) Create(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), &v1beta1.ReplicaSet{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ReplicaSet), err -} - -// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *FakeReplicaSets) Update(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &v1beta1.ReplicaSet{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ReplicaSet), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeReplicaSets) UpdateStatus(replicaSet *v1beta1.ReplicaSet) (*v1beta1.ReplicaSet, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &v1beta1.ReplicaSet{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ReplicaSet), err -} - -// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *FakeReplicaSets) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(replicasetsResource, c.ns, name), &v1beta1.ReplicaSet{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeReplicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1beta1.ReplicaSetList{}) - return err -} - -// Patch applies the patch and returns the patched replicaSet. -func (c *FakeReplicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, data, subresources...), &v1beta1.ReplicaSet{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ReplicaSet), err -} - -// GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any. -func (c *FakeReplicaSets) GetScale(replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), &v1beta1.Scale{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Scale), err -} - -// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *FakeReplicaSets) UpdateScale(replicaSetName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "scale", c.ns, scale), &v1beta1.Scale{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Scale), err -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/generated_expansion.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/generated_expansion.go deleted file mode 100644 index e67c4e3025..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/generated_expansion.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -type DaemonSetExpansion interface{} - -type IngressExpansion interface{} - -type ReplicaSetExpansion interface{} diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/ingress.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/ingress.go deleted file mode 100644 index 2b5e1f071e..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/ingress.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - v1beta1 "k8s.io/api/extensions/v1beta1" - 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" - scheme "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -// IngressesGetter has a method to return a IngressInterface. -// A group's client should implement this interface. -type IngressesGetter interface { - Ingresses(namespace string) IngressInterface -} - -// IngressInterface has methods to work with Ingress resources. -type IngressInterface interface { - Create(*v1beta1.Ingress) (*v1beta1.Ingress, error) - Update(*v1beta1.Ingress) (*v1beta1.Ingress, error) - UpdateStatus(*v1beta1.Ingress) (*v1beta1.Ingress, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Ingress, error) - List(opts v1.ListOptions) (*v1beta1.IngressList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Ingress, err error) - IngressExpansion -} - -// ingresses implements IngressInterface -type ingresses struct { - client rest.Interface - ns string -} - -// newIngresses returns a Ingresses -func newIngresses(c *ExtensionsV1beta1Client, namespace string) *ingresses { - return &ingresses{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. -func (c *ingresses) Get(name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Get(). - Namespace(c.ns). - Resource("ingresses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *ingresses) List(opts v1.ListOptions) (result *v1beta1.IngressList, err error) { - result = &v1beta1.IngressList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("ingresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested ingresses. -func (c *ingresses) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("ingresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *ingresses) Create(ingress *v1beta1.Ingress) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Post(). - Namespace(c.ns). - Resource("ingresses"). - Body(ingress). - Do(). - Into(result) - return -} - -// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *ingresses) Update(ingress *v1beta1.Ingress) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Put(). - Namespace(c.ns). - Resource("ingresses"). - Name(ingress.Name). - Body(ingress). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *ingresses) UpdateStatus(ingress *v1beta1.Ingress) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Put(). - Namespace(c.ns). - Resource("ingresses"). - Name(ingress.Name). - SubResource("status"). - Body(ingress). - Do(). - Into(result) - return -} - -// Delete takes name of the ingress and deletes it. Returns an error if one occurs. -func (c *ingresses) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("ingresses"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *ingresses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("ingresses"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched ingress. -func (c *ingresses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("ingresses"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/replicaset.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/replicaset.go deleted file mode 100644 index 3903878073..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/replicaset.go +++ /dev/null @@ -1,203 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - v1beta1 "k8s.io/api/extensions/v1beta1" - 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" - scheme "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -// ReplicaSetsGetter has a method to return a ReplicaSetInterface. -// A group's client should implement this interface. -type ReplicaSetsGetter interface { - ReplicaSets(namespace string) ReplicaSetInterface -} - -// ReplicaSetInterface has methods to work with ReplicaSet resources. -type ReplicaSetInterface interface { - Create(*v1beta1.ReplicaSet) (*v1beta1.ReplicaSet, error) - Update(*v1beta1.ReplicaSet) (*v1beta1.ReplicaSet, error) - UpdateStatus(*v1beta1.ReplicaSet) (*v1beta1.ReplicaSet, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.ReplicaSet, error) - List(opts v1.ListOptions) (*v1beta1.ReplicaSetList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error) - GetScale(replicaSetName string, options v1.GetOptions) (*v1beta1.Scale, error) - UpdateScale(replicaSetName string, scale *v1beta1.Scale) (*v1beta1.Scale, error) - - ReplicaSetExpansion -} - -// replicaSets implements ReplicaSetInterface -type replicaSets struct { - client rest.Interface - ns string -} - -// newReplicaSets returns a ReplicaSets -func newReplicaSets(c *ExtensionsV1beta1Client, namespace string) *replicaSets { - return &replicaSets{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. -func (c *replicaSets) Get(name string, options v1.GetOptions) (result *v1beta1.ReplicaSet, err error) { - result = &v1beta1.ReplicaSet{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicasets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *replicaSets) List(opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { - result = &v1beta1.ReplicaSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicasets"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested replicaSets. -func (c *replicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("replicasets"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *replicaSets) Create(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) { - result = &v1beta1.ReplicaSet{} - err = c.client.Post(). - Namespace(c.ns). - Resource("replicasets"). - Body(replicaSet). - Do(). - Into(result) - return -} - -// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *replicaSets) Update(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) { - result = &v1beta1.ReplicaSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("replicasets"). - Name(replicaSet.Name). - Body(replicaSet). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *replicaSets) UpdateStatus(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) { - result = &v1beta1.ReplicaSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("replicasets"). - Name(replicaSet.Name). - SubResource("status"). - Body(replicaSet). - Do(). - Into(result) - return -} - -// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *replicaSets) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("replicasets"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *replicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("replicasets"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched replicaSet. -func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error) { - result = &v1beta1.ReplicaSet{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("replicasets"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} - -// GetScale takes name of the replicaSet, and returns the corresponding v1beta1.Scale object, and an error if there is any. -func (c *replicaSets) GetScale(replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { - result = &v1beta1.Scale{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicasets"). - Name(replicaSetName). - SubResource("scale"). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *replicaSets) UpdateScale(replicaSetName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) { - result = &v1beta1.Scale{} - err = c.client.Put(). - Namespace(c.ns). - Resource("replicasets"). - Name(replicaSetName). - SubResource("scale"). - Body(scale). - Do(). - Into(result) - return -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/BUILD b/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/BUILD deleted file mode 100644 index f9668f2056..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/BUILD +++ /dev/null @@ -1,42 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "cluster.go", - "doc.go", - "federation_client.go", - "generated_expansion.go", - ], - importpath = "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/scheme:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime/serializer: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", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/cluster.go b/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/cluster.go deleted file mode 100644 index d02abdf672..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/cluster.go +++ /dev/null @@ -1,161 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - 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" - v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" - scheme "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -// ClustersGetter has a method to return a ClusterInterface. -// A group's client should implement this interface. -type ClustersGetter interface { - Clusters() ClusterInterface -} - -// ClusterInterface has methods to work with Cluster resources. -type ClusterInterface interface { - Create(*v1beta1.Cluster) (*v1beta1.Cluster, error) - Update(*v1beta1.Cluster) (*v1beta1.Cluster, error) - UpdateStatus(*v1beta1.Cluster) (*v1beta1.Cluster, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Cluster, error) - List(opts v1.ListOptions) (*v1beta1.ClusterList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Cluster, err error) - ClusterExpansion -} - -// clusters implements ClusterInterface -type clusters struct { - client rest.Interface -} - -// newClusters returns a Clusters -func newClusters(c *FederationV1beta1Client) *clusters { - return &clusters{ - client: c.RESTClient(), - } -} - -// 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 *v1beta1.Cluster, err error) { - result = &v1beta1.Cluster{} - err = c.client.Get(). - 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 *v1beta1.ClusterList, err error) { - result = &v1beta1.ClusterList{} - err = c.client.Get(). - Resource("clusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusters. -func (c *clusters) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Resource("clusters"). - VersionedParams(&opts, scheme.ParameterCodec). - 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 *v1beta1.Cluster) (result *v1beta1.Cluster, err error) { - result = &v1beta1.Cluster{} - err = c.client.Post(). - 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 *v1beta1.Cluster) (result *v1beta1.Cluster, err error) { - result = &v1beta1.Cluster{} - err = c.client.Put(). - Resource("clusters"). - Name(cluster.Name). - Body(cluster). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *clusters) UpdateStatus(cluster *v1beta1.Cluster) (result *v1beta1.Cluster, err error) { - result = &v1beta1.Cluster{} - err = c.client.Put(). - Resource("clusters"). - Name(cluster.Name). - SubResource("status"). - 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(). - 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 { - return c.client.Delete(). - Resource("clusters"). - VersionedParams(&listOptions, scheme.ParameterCodec). - 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 *v1beta1.Cluster, err error) { - result = &v1beta1.Cluster{} - err = c.client.Patch(pt). - Resource("clusters"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/doc.go b/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/doc.go deleted file mode 100644 index 1b50aa1997..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package has the automatically generated typed clients. -package v1beta1 diff --git a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/BUILD b/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/BUILD deleted file mode 100644 index c8735ad587..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/BUILD +++ /dev/null @@ -1,40 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "doc.go", - "fake_cluster.go", - "fake_federation_client.go", - ], - importpath = "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1: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", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/doc.go b/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/doc.go deleted file mode 100644 index c58fac35e4..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package fake has the automatically generated clients. -package fake diff --git a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/fake_cluster.go b/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/fake_cluster.go deleted file mode 100644 index 94478a8c8a..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/fake_cluster.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package 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" - v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" -) - -// FakeClusters implements ClusterInterface -type FakeClusters struct { - Fake *FakeFederationV1beta1 -} - -var clustersResource = schema.GroupVersionResource{Group: "federation", Version: "v1beta1", Resource: "clusters"} - -var clustersKind = schema.GroupVersionKind{Group: "federation", Version: "v1beta1", 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 *v1beta1.Cluster, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clustersResource, name), &v1beta1.Cluster{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.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 *v1beta1.ClusterList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(clustersResource, clustersKind, opts), &v1beta1.ClusterList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ClusterList{} - for _, item := range obj.(*v1beta1.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.NewRootWatchAction(clustersResource, 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 *v1beta1.Cluster) (result *v1beta1.Cluster, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clustersResource, cluster), &v1beta1.Cluster{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.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 *v1beta1.Cluster) (result *v1beta1.Cluster, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clustersResource, cluster), &v1beta1.Cluster{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Cluster), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeClusters) UpdateStatus(cluster *v1beta1.Cluster) (*v1beta1.Cluster, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(clustersResource, "status", cluster), &v1beta1.Cluster{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.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.NewRootDeleteAction(clustersResource, name), &v1beta1.Cluster{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clustersResource, listOptions) - - _, err := c.Fake.Invokes(action, &v1beta1.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 *v1beta1.Cluster, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clustersResource, name, data, subresources...), &v1beta1.Cluster{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Cluster), err -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/fake_federation_client.go b/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/fake_federation_client.go deleted file mode 100644 index 73edbff85a..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/fake_federation_client.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" - v1beta1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1" -) - -type FakeFederationV1beta1 struct { - *testing.Fake -} - -func (c *FakeFederationV1beta1) Clusters() v1beta1.ClusterInterface { - return &FakeClusters{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeFederationV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/federation_client.go b/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/federation_client.go deleted file mode 100644 index e5c8d1d040..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/federation_client.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" - v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" - "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/scheme" -) - -type FederationV1beta1Interface interface { - RESTClient() rest.Interface - ClustersGetter -} - -// FederationV1beta1Client is used to interact with features provided by the federation group. -type FederationV1beta1Client struct { - restClient rest.Interface -} - -func (c *FederationV1beta1Client) Clusters() ClusterInterface { - return newClusters(c) -} - -// NewForConfig creates a new FederationV1beta1Client for the given config. -func NewForConfig(c *rest.Config) (*FederationV1beta1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &FederationV1beta1Client{client}, nil -} - -// NewForConfigOrDie creates a new FederationV1beta1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *FederationV1beta1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new FederationV1beta1Client for the given RESTClient. -func New(c rest.Interface) *FederationV1beta1Client { - return &FederationV1beta1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1beta1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - - 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 *FederationV1beta1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/generated_expansion.go b/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/generated_expansion.go deleted file mode 100644 index fca6b51493..0000000000 --- a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/generated_expansion.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -type ClusterExpansion interface{} diff --git a/federation/cluster/BUILD b/federation/cluster/BUILD deleted file mode 100644 index 7e76248ad9..0000000000 --- a/federation/cluster/BUILD +++ /dev/null @@ -1,14 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/cluster/common.sh b/federation/cluster/common.sh deleted file mode 100644 index dba2354b4d..0000000000 --- a/federation/cluster/common.sh +++ /dev/null @@ -1,118 +0,0 @@ -# Copyright 2014 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. - -# required: -# KUBE_ROOT: path of the root of the Kubernetes repository - -: "${KUBE_ROOT?Must set KUBE_ROOT env var}" - -# Provides the kubeconfig-federation-context() function -source "${KUBE_ROOT}/cluster/kube-util.sh" - -# For `kube::log::status` function -source "${KUBE_ROOT}/cluster/lib/logging.sh" - -# kubefed configuration -FEDERATION_NAME="${FEDERATION_NAME:-e2e-federation}" -FEDERATION_NAMESPACE=${FEDERATION_NAMESPACE:-federation-system} -FEDERATION_KUBE_CONTEXT="${FEDERATION_KUBE_CONTEXT:-${FEDERATION_NAME}}" -FEDERATION_USE_PV_FOR_ETCD=${FEDERATION_USE_PV_FOR_ETCD:-false} -HOST_CLUSTER_ZONE="${FEDERATION_HOST_CLUSTER_ZONE:-}" -# If $HOST_CLUSTER_ZONE isn't specified, arbitrarily choose -# last zone as the host cluster zone. -if [[ -z "${HOST_CLUSTER_ZONE}" ]]; then - E2E_ZONES_ARR=(${E2E_ZONES:-}) - if [[ ${#E2E_ZONES_ARR[@]} > 0 ]]; then - HOST_CLUSTER_ZONE=${E2E_ZONES_ARR[-1]} - fi -fi - -HOST_CLUSTER_CONTEXT="${FEDERATION_HOST_CLUSTER_CONTEXT:-}" -if [[ -z "${HOST_CLUSTER_CONTEXT}" ]]; then - # Sets ${CLUSTER_CONTEXT} - if [[ -z "${HOST_CLUSTER_ZONE:-}" ]]; then - echo "At least one of FEDERATION_HOST_CLUSTER_CONTEXT, FEDERATION_HOST_CLUSTER_ZONE or E2E_ZONES is required." - exit 1 - fi - kubeconfig-federation-context "${HOST_CLUSTER_ZONE:-}" - HOST_CLUSTER_CONTEXT="${CLUSTER_CONTEXT}" -fi - -function federation_cluster_contexts() { - local -r contexts=$("${KUBE_ROOT}/cluster/kubectl.sh" config get-contexts -o name) - federation_contexts=() - for context in ${contexts}; do - # Skip federation context - if [[ "${context}" == "${FEDERATION_KUBE_CONTEXT}" ]]; then - continue - fi - # Skip contexts not beginning with "federation" - if [[ "${context}" != federation* ]]; then - continue - fi - federation_contexts+=("${context}") - done - echo ${federation_contexts[@]:-} -} - - -host_kubectl="${KUBE_ROOT}/cluster/kubectl.sh --namespace=${FEDERATION_NAMESPACE}" - -function cleanup-federation-api-objects { - # This is a cleanup function. We cannot stop on errors here. So disable - # errexit in this function. - set +o errexit - - echo "Cleaning Federation control plane objects" - kube::log::status "Removing namespace \"${FEDERATION_NAMESPACE}\" from \"${FEDERATION_KUBE_CONTEXT}\"" - # Try deleting until the namespace is completely gone. - while $host_kubectl --context="${FEDERATION_KUBE_CONTEXT}" delete namespace "${FEDERATION_NAMESPACE}" >/dev/null 2>&1; do - # It is usually slower to remove a namespace because it involves - # performing a cascading deletion of all the resources in the - # namespace. So we sleep a little longer than other resources - # before retrying - sleep 5 - done - kube::log::status "Removed namespace \"${FEDERATION_NAMESPACE}\" from \"${FEDERATION_KUBE_CONTEXT}\"" - - # This is a big hammer. We get rid of federation-system namespace from - # all the clusters - for context in $(federation_cluster_contexts); do - ( - local -r role="federation-controller-manager:${FEDERATION_NAME}-${context}-${HOST_CLUSTER_CONTEXT}" - kube::log::status "Removing namespace \"${FEDERATION_NAMESPACE}\", cluster role \"${role}\" and cluster role binding \"${role}\" from \"${context}\"" - # Try deleting until the namespace is completely gone. - while $host_kubectl --context="${context}" delete namespace "${FEDERATION_NAMESPACE}" >/dev/null 2>&1; do - # It is usually slower to remove a namespace because it involves - # performing a cascading deletion of all the resources in the - # namespace. So we sleep a little longer than other resources - # before retrying - sleep 5 - done - kube::log::status "Removed namespace \"${FEDERATION_NAMESPACE}\" from \"${context}\"" - - while $host_kubectl --context="${context}" delete clusterrole "${role}" >/dev/null 2>&1; do - sleep 2 - done - kube::log::status "Removed cluster role \"${role}\" from \"${context}\"" - - while $host_kubectl --context="${context}" delete clusterrolebinding "${role}" >/dev/null 2>&1; do - sleep 2 - done - kube::log::status "Removed cluster role binding \"${role}\" from \"${context}\"" - ) & - done - wait - set -o errexit -} diff --git a/federation/cluster/federation-down.sh b/federation/cluster/federation-down.sh deleted file mode 100755 index dfbe63edae..0000000000 --- a/federation/cluster/federation-down.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash - -# Copyright 2014 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. - -set -o errexit -set -o nounset -set -o pipefail - -KUBE_ROOT=$(readlink -m $(dirname "${BASH_SOURCE}")/../../) - -# For $FEDERATION_NAME, $FEDERATION_NAMESPACE, $FEDERATION_KUBE_CONTEXT, -# and $HOST_CLUSTER_CONTEXT. -source "${KUBE_ROOT}/federation/cluster/common.sh" - -# federation_clusters returns a list of all the clusters in -# federation, if at all the federation control plane exists -# and there are any clusters registered. -function federation_clusters() { - if clusters=$("${KUBE_ROOT}/cluster/kubectl.sh" \ - --context="${FEDERATION_KUBE_CONTEXT}" \ - -o jsonpath --template '{.items[*].metadata.name}' \ - get clusters) ; then - echo ${clusters} - return - fi - echo "" -} - -# unjoin_clusters unjoins all the clusters from federation. -function unjoin_clusters() { - # Unjoin only those clusters that are registered with the - # given federation. This is slightly different than - # joining clusters where we join all the clusters in the - # current kubeconfig with the "federation" prefix. - for context in $(federation_clusters); do - kube::log::status "Unjoining cluster \"${context}\" from federation \"${FEDERATION_NAME}\"" - - "${KUBE_ROOT}/federation/develop/kubefed.sh" unjoin \ - "${context}" \ - --federation-system-namespace=${FEDERATION_NAMESPACE} \ - --context="${FEDERATION_KUBE_CONTEXT}" \ - --host-cluster-context="${HOST_CLUSTER_CONTEXT}" \ - --v=4 - done -} - -unjoin_clusters - -if cleanup-federation-api-objects; then - # TODO(madhusudancs): This is an arbitrary amount of sleep to give - # Kubernetes clusters enough time to delete the underlying cloud - # provider resources corresponding to the Kubernetes resources we - # deleted as part of the test tear downs. It is shameful that we - # are doing this, but this is just a bandage to stop the bleeding. - # Please don't use this pattern anywhere. Remove this when proper - # cloud provider cleanups are implemented in the individual test - # `AfterEach` blocks. - # Also, we wait only if the cleanup succeeds. - kube::log::status "Waiting for 2 minutes to allow controllers to clean up federation components..." - sleep 2m -else - echo "Couldn't cleanup federation api objects" -fi diff --git a/federation/cluster/federation-up.sh b/federation/cluster/federation-up.sh deleted file mode 100755 index 47f985732c..0000000000 --- a/federation/cluster/federation-up.sh +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/bash - -# Copyright 2014 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. - -set -o errexit -set -o nounset -set -o pipefail - -# This script is only used for e2e tests! Don't use it in production! -# This is also a temporary bridge to slowly switch over everything to -# federation/develop.sh. Carefully moving things step-by-step, ensuring -# things don't break. -# TODO(madhusudancs): Remove this script and its dependencies. - - -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. -# For $FEDERATION_NAME, $FEDERATION_NAMESPACE, $FEDERATION_KUBE_CONTEXT, -# $HOST_CLUSTER_CONTEXT and $FEDERATION_USE_PV_FOR_ETCD. -source "${KUBE_ROOT}/federation/cluster/common.sh" - -DNS_ZONE_NAME="${FEDERATION_DNS_ZONE_NAME:-}" -DNS_PROVIDER="${FEDERATION_DNS_PROVIDER:-google-clouddns}" - -# get_version returns the version in KUBERNETES_RELEASE or defaults to the -# value in the federation `versions` file. -# TODO(madhusudancs): This is a duplicate of the function in -# federation/develop/develop.sh with a minor difference. This -# function tries to default to the version information in -# _output/federation/versions file where as the one in develop.sh -# tries to default to the version in the kubernetes versions file. -# These functions should be consolidated to read the version from -# kubernetes version defs file. -function get_version() { - local -r versions_file="${KUBE_ROOT}/_output/federation/versions" - - if [[ -n "${KUBERNETES_RELEASE:-}" ]]; then - echo "${KUBERNETES_RELEASE//+/_}" - return - fi - - if [[ ! -f "${versions_file}" ]]; then - echo "Couldn't determine the release version: neither the " \ - "KUBERNETES_RELEASE environment variable is set, nor does " \ - "the versions file exist at ${versions_file}" - exit 1 - fi - - # Read the version back from the versions file if no version is given. - local -r kube_version="$(cat "${versions_file}" | python -c '\ -import json, sys;\ -print json.load(sys.stdin)["KUBE_VERSION"]')" - - echo "${kube_version//+/_}" -} - -function wait_for_rbac() { - # The very first thing that kubefed does when it comes up is run RBAC API - # discovery. If it doesn't appear to be available, issue 'get role' to ensure - # that kubectl updates its cache. - ${KUBE_ROOT}/cluster/kubectl.sh get role - local i=1 - local timeout=60 - while [[ ${i} -le ${timeout} ]]; do - if [[ "$(${KUBE_ROOT}/cluster/kubectl.sh api-versions)" =~ "rbac.authorization.k8s.io/" ]]; then - break - fi - ${KUBE_ROOT}/cluster/kubectl.sh get role - sleep 1 - i=$((i+1)) - done - if [[ ${i} -gt ${timeout} ]]; then - kube::log::status "rbac.authorization.k8s.io API group not available after at least ${timeout} seconds:" - kube::log::status "$(${KUBE_ROOT}/cluster/kubectl.sh api-versions)" - exit 123 - fi - kube::log::status "rbac.authorization.k8s.io API group is available" -} - -# Initializes the control plane. -# TODO(madhusudancs): Move this to federation/develop.sh. -function init() { - kube::log::status "Deploying federation control plane for ${FEDERATION_NAME} in cluster ${HOST_CLUSTER_CONTEXT}" - - local -r project="${KUBE_PROJECT:-${PROJECT:-}}" - local -r kube_registry="${KUBE_REGISTRY:-gcr.io/${project}}" - local -r kube_version="$(get_version)" - - kube::log::status "DNS_ZONE_NAME: \"${DNS_ZONE_NAME}\", DNS_PROVIDER: \"${DNS_PROVIDER}\"" - kube::log::status "Image: \"${kube_registry}/hyperkube-amd64:${kube_version}\"" - - wait_for_rbac - - # Send INT after 20m and KILL 1m after that if process is still alive. - timeout --signal=INT --kill-after=1m 20m \ - "${KUBE_ROOT}/federation/develop/kubefed.sh" init \ - "${FEDERATION_NAME}" \ - --federation-system-namespace=${FEDERATION_NAMESPACE} \ - --host-cluster-context="${HOST_CLUSTER_CONTEXT}" \ - --dns-zone-name="${DNS_ZONE_NAME}" \ - --dns-provider="${DNS_PROVIDER}" \ - --image="${kube_registry}/hyperkube-amd64:${kube_version}" \ - --apiserver-enable-basic-auth=true \ - --apiserver-enable-token-auth=true \ - --apiserver-arg-overrides="--runtime-config=api/all=true,--v=4" \ - --controllermanager-arg-overrides="--v=4" \ - --etcd-persistent-storage=${FEDERATION_USE_PV_FOR_ETCD} \ - --v=4 -} - -# join_clusters joins the clusters in the local kubeconfig to federation. The clusters -# and their kubeconfig entries in the local kubeconfig are created while deploying clusters, i.e. when kube-up is run. -function join_clusters() { - for context in $(federation_cluster_contexts); do - kube::log::status "Joining cluster with name '${context}' to federation with name '${FEDERATION_NAME}'" - - "${KUBE_ROOT}/federation/develop/kubefed.sh" join \ - "${context}" \ - --federation-system-namespace=${FEDERATION_NAMESPACE} \ - --host-cluster-context="${HOST_CLUSTER_CONTEXT}" \ - --context="${FEDERATION_KUBE_CONTEXT}" \ - --v=4 - done -} - -init -join_clusters diff --git a/federation/cluster/log-dump.sh b/federation/cluster/log-dump.sh deleted file mode 100755 index 45e0e2a176..0000000000 --- a/federation/cluster/log-dump.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash - -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Call this to dump all Federation pod logs into the folder specified in $1 -# (defaults to _artifacts). - -set -o errexit -set -o nounset -set -o pipefail - -# For FEDERATION_NAMESPACE -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. -source "${KUBE_ROOT}/federation/cluster/common.sh" - -readonly REPORT_DIR="${1:-_artifacts}" -OUTPUT_DIR="${REPORT_DIR}/federation" - -# Dumps logs for all pods in a federation. -function dump_federation_pod_logs() { - local -r federation_pod_names_string="$(kubectl get pods -l 'app=federated-cluster' --namespace=${FEDERATION_NAMESPACE} -o name)" - if [[ -z "${federation_pod_names_string}" ]]; then - return - fi - - local -r federation_pod_names=(${federation_pod_names_string}) - for pod_name in ${federation_pod_names[@]}; do - # The API server pod has two containers - if [[ "${pod_name}" == *apiserver* ]]; then - dump_apiserver_pod_logs "${pod_name}" - continue - fi - - kubectl logs "${pod_name}" --namespace="${FEDERATION_NAMESPACE}" \ - >"${OUTPUT_DIR}/${pod_name#pods/}.log" - done -} - -# Dumps logs from all containers in an API server pod. -# Arguments: -# - the name of the API server pod, with a pods/ prefix. -function dump_apiserver_pod_logs() { - local -r apiserver_pod_containers=(apiserver etcd) - for container in ${apiserver_pod_containers[@]}; do - kubectl logs "${1}" -c "${container}" --namespace="${FEDERATION_NAMESPACE}" \ - >"${OUTPUT_DIR}/${1#pods/}-${container}.log" - done -} - -# Dumps logs from all containers in the DNS pods. -# TODO: This currently only grabs DNS pod logs from the host cluster. It should -# grab those logs from all clusters in the federation. -function dump_dns_pod_logs() { - local -r dns_pod_names_string="$(kubectl get pods -l 'k8s-app=kube-dns' --namespace=kube-system -o name)" - if [[ -z "${dns_pod_names_string}" ]]; then - return - fi - - local -r dns_pod_names=(${dns_pod_names_string}) - local -r dns_pod_containers=(kubedns dnsmasq sidecar) - - for pod_name in ${dns_pod_names[@]}; do - # As of 3/2017, the only pod that matches the kube-dns label is kube-dns, and - # it has three containers. - for container in ${dns_pod_containers[@]}; do - kubectl logs "${pod_name}" -c "${container}" --namespace=kube-system \ - >"${OUTPUT_DIR}/${pod_name#pods/}-${container}.log" - done - done -} - - -echo "Dumping Federation and DNS pod logs to ${REPORT_DIR}" -mkdir -p "${OUTPUT_DIR}" - -dump_federation_pod_logs -dump_dns_pod_logs diff --git a/federation/cluster/upgrade.sh b/federation/cluster/upgrade.sh deleted file mode 100755 index cf8a66b561..0000000000 --- a/federation/cluster/upgrade.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. -# For $FEDERATION_NAME, $FEDERATION_NAMESPACE, $HOST_CLUSTER_CONTEXT, -source "${KUBE_ROOT}/federation/cluster/common.sh" - -KUBE_VERSION="${1}" - -host_kubectl="${KUBE_ROOT}/cluster/kubectl.sh --context=${HOST_CLUSTER_CONTEXT} --namespace=${FEDERATION_NAMESPACE}" - -function upgrade() { - local -r project="${KUBE_PROJECT:-${PROJECT:-}}" - local -r kube_registry="${KUBE_REGISTRY:-gcr.io/${project}}" - local -r image_version="${kube_registry}/hyperkube-amd64:${KUBE_VERSION}" - - kube::log::status "Upgrading federation control plane ${FEDERATION_NAME} with image ${image_version}" - - # Upgrade apiserver image - ${host_kubectl} set image deployment/federation-apiserver apiserver=${image_version} - - # Upgrade controller-manager image - ${host_kubectl} set image deployment/federation-controller-manager controller-manager=${image_version} -} - -upgrade diff --git a/federation/cmd/federation-apiserver/BUILD b/federation/cmd/federation-apiserver/BUILD deleted file mode 100644 index 7944bd736b..0000000000 --- a/federation/cmd/federation-apiserver/BUILD +++ /dev/null @@ -1,44 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_binary", - "go_library", -) - -go_binary( - name = "federation-apiserver", - importpath = "k8s.io/kubernetes/federation/cmd/federation-apiserver", - library = ":go_default_library", -) - -go_library( - name = "go_default_library", - srcs = ["apiserver.go"], - importpath = "k8s.io/kubernetes/federation/cmd/federation-apiserver", - deps = [ - "//federation/cmd/federation-apiserver/app:go_default_library", - "//federation/cmd/federation-apiserver/app/options:go_default_library", - "//pkg/version/verflag:go_default_library", - "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/k8s.io/apiserver/pkg/util/flag:go_default_library", - "//vendor/k8s.io/apiserver/pkg/util/logs:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/cmd/federation-apiserver/app:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/cmd/federation-apiserver/OWNERS b/federation/cmd/federation-apiserver/OWNERS deleted file mode 100644 index 7d85966573..0000000000 --- a/federation/cmd/federation-apiserver/OWNERS +++ /dev/null @@ -1,10 +0,0 @@ -approvers: -- deads2k -- lavalamp -- smarterclayton -- nikhiljindal -reviewers: -- lavalamp -- smarterclayton -- nikhiljindal -- deads2k diff --git a/federation/cmd/federation-apiserver/apiserver.go b/federation/cmd/federation-apiserver/apiserver.go deleted file mode 100644 index 3423fd96e5..0000000000 --- a/federation/cmd/federation-apiserver/apiserver.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2014 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. -*/ - -// apiserver is the main api server and master for the cluster. -// it is responsible for serving the cluster management API. -package main - -import ( - "fmt" - "math/rand" - "os" - "time" - - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apiserver/pkg/util/flag" - "k8s.io/apiserver/pkg/util/logs" - "k8s.io/kubernetes/federation/cmd/federation-apiserver/app" - "k8s.io/kubernetes/federation/cmd/federation-apiserver/app/options" - "k8s.io/kubernetes/pkg/version/verflag" - - "github.com/spf13/pflag" -) - -func main() { - rand.Seed(time.Now().UTC().UnixNano()) - - s := options.NewServerRunOptions() - s.AddFlags(pflag.CommandLine) - - flag.InitFlags() - logs.InitLogs() - defer logs.FlushLogs() - - verflag.PrintAndExitIfRequested() - - if err := app.Run(s, wait.NeverStop); err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) - os.Exit(1) - } -} diff --git a/federation/cmd/federation-apiserver/app/BUILD b/federation/cmd/federation-apiserver/app/BUILD deleted file mode 100644 index 17b50f446c..0000000000 --- a/federation/cmd/federation-apiserver/app/BUILD +++ /dev/null @@ -1,105 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "autoscaling.go", - "batch.go", - "core.go", - "extensions.go", - "federation.go", - "install.go", - "plugins.go", - "server.go", - ], - importpath = "k8s.io/kubernetes/federation/cmd/federation-apiserver/app", - deps = [ - "//federation/apis/core:go_default_library", - "//federation/apis/core/install:go_default_library", - "//federation/apis/core/v1:go_default_library", - "//federation/apis/federation:go_default_library", - "//federation/apis/federation/install:go_default_library", - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/cmd/federation-apiserver/app/options:go_default_library", - "//federation/plugin/pkg/admission/schedulingpolicy:go_default_library", - "//federation/registry/cluster/etcd:go_default_library", - "//pkg/api:go_default_library", - "//pkg/api/install:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//pkg/apis/autoscaling:go_default_library", - "//pkg/apis/autoscaling/install:go_default_library", - "//pkg/apis/batch:go_default_library", - "//pkg/apis/batch/install:go_default_library", - "//pkg/apis/extensions:go_default_library", - "//pkg/apis/extensions/install:go_default_library", - "//pkg/client/clientset_generated/internalclientset:go_default_library", - "//pkg/client/informers/informers_generated/internalversion:go_default_library", - "//pkg/cloudprovider/providers:go_default_library", - "//pkg/generated/openapi:go_default_library", - "//pkg/kubeapiserver:go_default_library", - "//pkg/kubeapiserver/admission:go_default_library", - "//pkg/kubeapiserver/options:go_default_library", - "//pkg/kubeapiserver/server:go_default_library", - "//pkg/quota/install:go_default_library", - "//pkg/registry/autoscaling/horizontalpodautoscaler/storage:go_default_library", - "//pkg/registry/batch/job/storage:go_default_library", - "//pkg/registry/cachesize:go_default_library", - "//pkg/registry/core/configmap/storage:go_default_library", - "//pkg/registry/core/event/storage:go_default_library", - "//pkg/registry/core/namespace/storage:go_default_library", - "//pkg/registry/core/secret/storage:go_default_library", - "//pkg/registry/core/service/storage:go_default_library", - "//pkg/registry/extensions/daemonset/storage:go_default_library", - "//pkg/registry/extensions/deployment/storage:go_default_library", - "//pkg/registry/extensions/ingress/storage:go_default_library", - "//pkg/registry/extensions/replicaset/storage:go_default_library", - "//pkg/routes:go_default_library", - "//pkg/version:go_default_library", - "//plugin/pkg/admission/admit:go_default_library", - "//plugin/pkg/admission/deny:go_default_library", - "//plugin/pkg/admission/gc:go_default_library", - "//vendor/github.com/go-openapi/spec:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/github.com/spf13/cobra:go_default_library", - "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/k8s.io/api/apps/v1beta2:go_default_library", - "//vendor/k8s.io/api/autoscaling/v1:go_default_library", - "//vendor/k8s.io/api/batch/v1:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", - "//vendor/k8s.io/apiserver/pkg/admission:go_default_library", - "//vendor/k8s.io/apiserver/pkg/registry/generic:go_default_library", - "//vendor/k8s.io/apiserver/pkg/registry/rest:go_default_library", - "//vendor/k8s.io/apiserver/pkg/server:go_default_library", - "//vendor/k8s.io/apiserver/pkg/server/filters:go_default_library", - "//vendor/k8s.io/apiserver/pkg/server/options:go_default_library", - "//vendor/k8s.io/apiserver/pkg/server/storage:go_default_library", - "//vendor/k8s.io/client-go/informers:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/kube-openapi/pkg/common:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/cmd/federation-apiserver/app/options:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/cmd/federation-apiserver/app/autoscaling.go b/federation/cmd/federation-apiserver/app/autoscaling.go deleted file mode 100644 index d471116dd7..0000000000 --- a/federation/cmd/federation-apiserver/app/autoscaling.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2016 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 app - -import ( - "github.com/golang/glog" - autoscalingv1 "k8s.io/api/autoscaling/v1" - "k8s.io/apiserver/pkg/registry/generic" - "k8s.io/apiserver/pkg/registry/rest" - genericapiserver "k8s.io/apiserver/pkg/server" - "k8s.io/apiserver/pkg/server/storage" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/apis/autoscaling" - _ "k8s.io/kubernetes/pkg/apis/autoscaling/install" - hpastorage "k8s.io/kubernetes/pkg/registry/autoscaling/horizontalpodautoscaler/storage" -) - -func installAutoscalingAPIs(g *genericapiserver.GenericAPIServer, optsGetter generic.RESTOptionsGetter, apiResourceConfigSource storage.APIResourceConfigSource) { - hpaStorageFn := func() map[string]rest.Storage { - hpaStorage, hpaStatusStorage := hpastorage.NewREST(optsGetter) - return map[string]rest.Storage{ - "horizontalpodautoscalers": hpaStorage, - "horizontalpodautoscalers/status": hpaStatusStorage, - } - } - resourcesStorageMap := map[string]getResourcesStorageFunc{ - "horizontalpodautoscalers": hpaStorageFn, - } - shouldInstallGroup, resources := enabledResources(autoscalingv1.SchemeGroupVersion, resourcesStorageMap, apiResourceConfigSource) - if !shouldInstallGroup { - return - } - autoscalingGroupMeta := legacyscheme.Registry.GroupOrDie(autoscaling.GroupName) - apiGroupInfo := genericapiserver.APIGroupInfo{ - GroupMeta: *autoscalingGroupMeta, - VersionedResourcesStorageMap: map[string]map[string]rest.Storage{ - "v1": resources, - }, - OptionsExternalVersion: &legacyscheme.Registry.GroupOrDie(api.GroupName).GroupVersion, - Scheme: legacyscheme.Scheme, - ParameterCodec: legacyscheme.ParameterCodec, - NegotiatedSerializer: legacyscheme.Codecs, - } - if err := g.InstallAPIGroup(&apiGroupInfo); err != nil { - glog.Fatalf("Error in registering group versions: %v", err) - } -} diff --git a/federation/cmd/federation-apiserver/app/batch.go b/federation/cmd/federation-apiserver/app/batch.go deleted file mode 100644 index cea7fc2dbe..0000000000 --- a/federation/cmd/federation-apiserver/app/batch.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2016 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 app - -import ( - "github.com/golang/glog" - batchv1 "k8s.io/api/batch/v1" - "k8s.io/apiserver/pkg/registry/generic" - "k8s.io/apiserver/pkg/registry/rest" - genericapiserver "k8s.io/apiserver/pkg/server" - "k8s.io/apiserver/pkg/server/storage" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/apis/batch" - _ "k8s.io/kubernetes/pkg/apis/batch/install" - jobstorage "k8s.io/kubernetes/pkg/registry/batch/job/storage" -) - -func installBatchAPIs(g *genericapiserver.GenericAPIServer, optsGetter generic.RESTOptionsGetter, apiResourceConfigSource storage.APIResourceConfigSource) { - jobsStorageFn := func() map[string]rest.Storage { - jobStorage := jobstorage.NewStorage(optsGetter) - return map[string]rest.Storage{ - "jobs": jobStorage.Job, - "jobs/status": jobStorage.Status, - } - } - resourcesStorageMap := map[string]getResourcesStorageFunc{ - "jobs": jobsStorageFn, - } - shouldInstallGroup, resources := enabledResources(batchv1.SchemeGroupVersion, resourcesStorageMap, apiResourceConfigSource) - if !shouldInstallGroup { - return - } - batchGroupMeta := legacyscheme.Registry.GroupOrDie(batch.GroupName) - apiGroupInfo := genericapiserver.APIGroupInfo{ - GroupMeta: *batchGroupMeta, - VersionedResourcesStorageMap: map[string]map[string]rest.Storage{ - "v1": resources, - }, - OptionsExternalVersion: &legacyscheme.Registry.GroupOrDie(api.GroupName).GroupVersion, - Scheme: legacyscheme.Scheme, - ParameterCodec: legacyscheme.ParameterCodec, - NegotiatedSerializer: legacyscheme.Codecs, - } - if err := g.InstallAPIGroup(&apiGroupInfo); err != nil { - glog.Fatalf("Error in registering group versions: %v", err) - } -} diff --git a/federation/cmd/federation-apiserver/app/core.go b/federation/cmd/federation-apiserver/app/core.go deleted file mode 100644 index 4aa19523f5..0000000000 --- a/federation/cmd/federation-apiserver/app/core.go +++ /dev/null @@ -1,104 +0,0 @@ -/* -Copyright 2016 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 app - -import ( - "github.com/golang/glog" - - // HACK to ensure that rest mapper from pkg/api is registered for groupName="". - // This is required because both pkg/api/install and federation/apis/core/install - // are installing their respective groupMeta at the same groupName. - // federation/apis/core/install has only a subset of resources and hence if it gets registered first, then installation of v1 API fails in pkg/master. - // TODO(nikhiljindal): Fix this by ensuring that pkg/api/install and federation/apis/core/install do not conflict with each other. - _ "k8s.io/kubernetes/pkg/api/install" - - "k8s.io/apiserver/pkg/registry/generic" - "k8s.io/apiserver/pkg/registry/rest" - genericapiserver "k8s.io/apiserver/pkg/server" - "k8s.io/apiserver/pkg/server/storage" - "k8s.io/kubernetes/federation/apis/core" - _ "k8s.io/kubernetes/federation/apis/core/install" - corev1 "k8s.io/kubernetes/federation/apis/core/v1" - "k8s.io/kubernetes/federation/cmd/federation-apiserver/app/options" - "k8s.io/kubernetes/pkg/api/legacyscheme" - configmapstore "k8s.io/kubernetes/pkg/registry/core/configmap/storage" - eventstore "k8s.io/kubernetes/pkg/registry/core/event/storage" - namespacestore "k8s.io/kubernetes/pkg/registry/core/namespace/storage" - secretstore "k8s.io/kubernetes/pkg/registry/core/secret/storage" - servicestore "k8s.io/kubernetes/pkg/registry/core/service/storage" -) - -func installCoreAPIs(s *options.ServerRunOptions, g *genericapiserver.GenericAPIServer, optsGetter generic.RESTOptionsGetter, apiResourceConfigSource storage.APIResourceConfigSource) { - servicesStorageFn := func() map[string]rest.Storage { - serviceStore, serviceStatusStore := servicestore.NewREST(optsGetter) - return map[string]rest.Storage{ - "services": serviceStore, - "services/status": serviceStatusStore, - } - } - namespacesStorageFn := func() map[string]rest.Storage { - namespaceStore, namespaceStatusStore, namespaceFinalizeStore := namespacestore.NewREST(optsGetter) - return map[string]rest.Storage{ - "namespaces": namespaceStore, - "namespaces/status": namespaceStatusStore, - "namespaces/finalize": namespaceFinalizeStore, - } - } - secretsStorageFn := func() map[string]rest.Storage { - secretStore := secretstore.NewREST(optsGetter) - return map[string]rest.Storage{ - "secrets": secretStore, - } - } - configmapsStorageFn := func() map[string]rest.Storage { - configMapStore := configmapstore.NewREST(optsGetter) - return map[string]rest.Storage{ - "configmaps": configMapStore, - } - } - eventsStorageFn := func() map[string]rest.Storage { - eventStore := eventstore.NewREST(optsGetter, uint64(s.EventTTL.Seconds())) - return map[string]rest.Storage{ - "events": eventStore, - } - } - resourcesStorageMap := map[string]getResourcesStorageFunc{ - "services": servicesStorageFn, - "namespaces": namespacesStorageFn, - "secrets": secretsStorageFn, - "configmaps": configmapsStorageFn, - "events": eventsStorageFn, - } - shouldInstallGroup, resources := enabledResources(corev1.SchemeGroupVersion, resourcesStorageMap, apiResourceConfigSource) - if !shouldInstallGroup { - return - } - coreGroupMeta := legacyscheme.Registry.GroupOrDie(core.GroupName) - apiGroupInfo := genericapiserver.APIGroupInfo{ - GroupMeta: *coreGroupMeta, - VersionedResourcesStorageMap: map[string]map[string]rest.Storage{ - corev1.SchemeGroupVersion.Version: resources, - }, - OptionsExternalVersion: &legacyscheme.Registry.GroupOrDie(core.GroupName).GroupVersion, - Scheme: legacyscheme.Scheme, - ParameterCodec: legacyscheme.ParameterCodec, - NegotiatedSerializer: legacyscheme.Codecs, - } - if err := g.InstallLegacyAPIGroup(genericapiserver.DefaultLegacyAPIPrefix, &apiGroupInfo); err != nil { - glog.Fatalf("Error in registering group version: %+v.\n Error: %v\n", apiGroupInfo, err) - } -} diff --git a/federation/cmd/federation-apiserver/app/extensions.go b/federation/cmd/federation-apiserver/app/extensions.go deleted file mode 100644 index 493875bc49..0000000000 --- a/federation/cmd/federation-apiserver/app/extensions.go +++ /dev/null @@ -1,92 +0,0 @@ -/* -Copyright 2016 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 app - -import ( - "github.com/golang/glog" - extensionsv1beta1 "k8s.io/api/extensions/v1beta1" - "k8s.io/apiserver/pkg/registry/generic" - "k8s.io/apiserver/pkg/registry/rest" - genericapiserver "k8s.io/apiserver/pkg/server" - "k8s.io/apiserver/pkg/server/storage" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/apis/extensions" - _ "k8s.io/kubernetes/pkg/apis/extensions/install" - daemonsetstore "k8s.io/kubernetes/pkg/registry/extensions/daemonset/storage" - deploymentstore "k8s.io/kubernetes/pkg/registry/extensions/deployment/storage" - ingressstore "k8s.io/kubernetes/pkg/registry/extensions/ingress/storage" - replicasetstore "k8s.io/kubernetes/pkg/registry/extensions/replicaset/storage" -) - -func installExtensionsAPIs(g *genericapiserver.GenericAPIServer, optsGetter generic.RESTOptionsGetter, apiResourceConfigSource storage.APIResourceConfigSource) { - replicasetsStorageFn := func() map[string]rest.Storage { - replicaSetStorage := replicasetstore.NewStorage(optsGetter) - return map[string]rest.Storage{ - "replicasets": replicaSetStorage.ReplicaSet, - "replicasets/status": replicaSetStorage.Status, - "replicasets/scale": replicaSetStorage.Scale, - } - } - deploymentsStorageFn := func() map[string]rest.Storage { - deploymentStorage := deploymentstore.NewStorage(optsGetter) - return map[string]rest.Storage{ - "deployments": deploymentStorage.Deployment, - "deployments/status": deploymentStorage.Status, - "deployments/scale": deploymentStorage.Scale, - "deployments/rollback": deploymentStorage.Rollback, - } - } - ingressesStorageFn := func() map[string]rest.Storage { - ingressStorage, ingressStatusStorage := ingressstore.NewREST(optsGetter) - return map[string]rest.Storage{ - "ingresses": ingressStorage, - "ingresses/status": ingressStatusStorage, - } - } - daemonsetsStorageFn := func() map[string]rest.Storage { - daemonSetStorage, daemonSetStatusStorage := daemonsetstore.NewREST(optsGetter) - return map[string]rest.Storage{ - "daemonsets": daemonSetStorage, - "daemonsets/status": daemonSetStatusStorage, - } - } - resourcesStorageMap := map[string]getResourcesStorageFunc{ - "replicasets": replicasetsStorageFn, - "deployments": deploymentsStorageFn, - "ingresses": ingressesStorageFn, - "daemonsets": daemonsetsStorageFn, - } - shouldInstallGroup, resources := enabledResources(extensionsv1beta1.SchemeGroupVersion, resourcesStorageMap, apiResourceConfigSource) - if !shouldInstallGroup { - return - } - extensionsGroupMeta := legacyscheme.Registry.GroupOrDie(extensions.GroupName) - apiGroupInfo := genericapiserver.APIGroupInfo{ - GroupMeta: *extensionsGroupMeta, - VersionedResourcesStorageMap: map[string]map[string]rest.Storage{ - "v1beta1": resources, - }, - OptionsExternalVersion: &legacyscheme.Registry.GroupOrDie(api.GroupName).GroupVersion, - Scheme: legacyscheme.Scheme, - ParameterCodec: legacyscheme.ParameterCodec, - NegotiatedSerializer: legacyscheme.Codecs, - } - if err := g.InstallAPIGroup(&apiGroupInfo); err != nil { - glog.Fatalf("Error in registering group versions: %v", err) - } -} diff --git a/federation/cmd/federation-apiserver/app/federation.go b/federation/cmd/federation-apiserver/app/federation.go deleted file mode 100644 index 2f56421bb0..0000000000 --- a/federation/cmd/federation-apiserver/app/federation.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2016 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 app - -import ( - "github.com/golang/glog" - - "k8s.io/apiserver/pkg/registry/generic" - "k8s.io/apiserver/pkg/registry/rest" - genericapiserver "k8s.io/apiserver/pkg/server" - "k8s.io/apiserver/pkg/server/storage" - "k8s.io/kubernetes/federation/apis/federation" - _ "k8s.io/kubernetes/federation/apis/federation/install" - fedv1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" - clusteretcd "k8s.io/kubernetes/federation/registry/cluster/etcd" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/legacyscheme" -) - -func installFederationAPIs(g *genericapiserver.GenericAPIServer, optsGetter generic.RESTOptionsGetter, apiResourceConfigSource storage.APIResourceConfigSource) { - groupName := federation.GroupName - clustersStorageFn := func() map[string]rest.Storage { - clusterStorage, clusterStatusStorage := clusteretcd.NewREST(optsGetter) - return map[string]rest.Storage{ - "clusters": clusterStorage, - "clusters/status": clusterStatusStorage, - } - } - resourcesStorageMap := map[string]getResourcesStorageFunc{ - "clusters": clustersStorageFn, - } - shouldInstallGroup, resources := enabledResources(fedv1beta1.SchemeGroupVersion, resourcesStorageMap, apiResourceConfigSource) - if !shouldInstallGroup { - return - } - federationGroupMeta := legacyscheme.Registry.GroupOrDie(groupName) - apiGroupInfo := genericapiserver.APIGroupInfo{ - GroupMeta: *federationGroupMeta, - VersionedResourcesStorageMap: map[string]map[string]rest.Storage{ - "v1beta1": resources, - }, - OptionsExternalVersion: &legacyscheme.Registry.GroupOrDie(api.GroupName).GroupVersion, - Scheme: legacyscheme.Scheme, - ParameterCodec: legacyscheme.ParameterCodec, - NegotiatedSerializer: legacyscheme.Codecs, - } - if err := g.InstallAPIGroup(&apiGroupInfo); err != nil { - glog.Fatalf("Error in registering group versions: %v", err) - } -} diff --git a/federation/cmd/federation-apiserver/app/install.go b/federation/cmd/federation-apiserver/app/install.go deleted file mode 100644 index 4e75a2df1a..0000000000 --- a/federation/cmd/federation-apiserver/app/install.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package app - -import ( - "github.com/golang/glog" - - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apiserver/pkg/registry/rest" - "k8s.io/apiserver/pkg/server/storage" -) - -// Function to get a map of resources and the corresponding storages. -type getResourcesStorageFunc func() map[string]rest.Storage - -// Filters the resources from the given resources storage map to those that are enabled in the given apiResourceConfigSource. -// resourcesStorageMap is expected to contain all resources in a group version. -// Returns false if none of the resources are enabled and hence the whole group version should be disabled. -func enabledResources(groupVersion schema.GroupVersion, resourcesStorageMap map[string]getResourcesStorageFunc, apiResourceConfigSource storage.APIResourceConfigSource) (bool, map[string]rest.Storage) { - enabledResources := map[string]rest.Storage{} - groupName := groupVersion.Group - if !apiResourceConfigSource.AnyResourcesForGroupEnabled(groupName) { - glog.V(1).Infof("Skipping disabled API group %q", groupName) - return false, enabledResources - } - for resource, fn := range resourcesStorageMap { - if apiResourceConfigSource.ResourceEnabled(groupVersion.WithResource(resource)) { - resources := fn() - for k, v := range resources { - enabledResources[k] = v - } - } else { - glog.V(1).Infof("Skipping disabled resource %s in API group %q", resource, groupName) - } - } - if len(enabledResources) == 0 { - glog.V(1).Infof("Skipping API group %q since there is no enabled resource", groupName) - return false, enabledResources - } - return true, enabledResources -} diff --git a/federation/cmd/federation-apiserver/app/options/BUILD b/federation/cmd/federation-apiserver/app/options/BUILD deleted file mode 100644 index fb3c638a06..0000000000 --- a/federation/cmd/federation-apiserver/app/options/BUILD +++ /dev/null @@ -1,35 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "options.go", - "validation.go", - ], - importpath = "k8s.io/kubernetes/federation/cmd/federation-apiserver/app/options", - deps = [ - "//pkg/features:go_default_library", - "//pkg/kubeapiserver/options:go_default_library", - "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/k8s.io/apiserver/pkg/server/options:go_default_library", - "//vendor/k8s.io/apiserver/pkg/storage/storagebackend:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/cmd/federation-apiserver/app/options/options.go b/federation/cmd/federation-apiserver/app/options/options.go deleted file mode 100644 index 3dcb949242..0000000000 --- a/federation/cmd/federation-apiserver/app/options/options.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright 2016 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 options contains flags and options for initializing federation-apiserver. -package options - -import ( - "time" - - genericoptions "k8s.io/apiserver/pkg/server/options" - "k8s.io/apiserver/pkg/storage/storagebackend" - kubeoptions "k8s.io/kubernetes/pkg/kubeapiserver/options" - - // add the kubernetes feature gates - _ "k8s.io/kubernetes/pkg/features" - - "github.com/spf13/pflag" -) - -// Runtime options for the federation-apiserver. -type ServerRunOptions struct { - GenericServerRunOptions *genericoptions.ServerRunOptions - Etcd *genericoptions.EtcdOptions - SecureServing *genericoptions.SecureServingOptions - InsecureServing *kubeoptions.InsecureServingOptions - Audit *genericoptions.AuditOptions - Features *genericoptions.FeatureOptions - Admission *genericoptions.AdmissionOptions - Authentication *kubeoptions.BuiltInAuthenticationOptions - Authorization *kubeoptions.BuiltInAuthorizationOptions - CloudProvider *kubeoptions.CloudProviderOptions - StorageSerialization *kubeoptions.StorageSerializationOptions - APIEnablement *kubeoptions.APIEnablementOptions - - EventTTL time.Duration -} - -// NewServerRunOptions creates a new ServerRunOptions object with default values. -func NewServerRunOptions() *ServerRunOptions { - s := ServerRunOptions{ - GenericServerRunOptions: genericoptions.NewServerRunOptions(), - Etcd: genericoptions.NewEtcdOptions(storagebackend.NewDefaultConfig(kubeoptions.DefaultEtcdPathPrefix, nil)), - SecureServing: kubeoptions.NewSecureServingOptions(), - InsecureServing: kubeoptions.NewInsecureServingOptions(), - Audit: genericoptions.NewAuditOptions(), - Features: genericoptions.NewFeatureOptions(), - Admission: genericoptions.NewAdmissionOptions(), - Authentication: kubeoptions.NewBuiltInAuthenticationOptions().WithAll(), - Authorization: kubeoptions.NewBuiltInAuthorizationOptions(), - CloudProvider: kubeoptions.NewCloudProviderOptions(), - StorageSerialization: kubeoptions.NewStorageSerializationOptions(), - APIEnablement: kubeoptions.NewAPIEnablementOptions(), - - EventTTL: 1 * time.Hour, - } - // Overwrite the default for storage data format. - s.Etcd.DefaultStorageMediaType = "application/vnd.kubernetes.protobuf" - // Set the default for admission plugins names - s.Admission.PluginNames = []string{"AlwaysAdmit"} - return &s -} - -// AddFlags adds flags for ServerRunOptions fields to be specified via FlagSet. -func (s *ServerRunOptions) AddFlags(fs *pflag.FlagSet) { - // Add the generic flags. - s.GenericServerRunOptions.AddUniversalFlags(fs) - s.Etcd.AddFlags(fs) - s.SecureServing.AddFlags(fs) - s.InsecureServing.AddFlags(fs) - s.Audit.AddFlags(fs) - s.Features.AddFlags(fs) - s.Authentication.AddFlags(fs) - s.Authorization.AddFlags(fs) - s.CloudProvider.AddFlags(fs) - s.StorageSerialization.AddFlags(fs) - s.APIEnablement.AddFlags(fs) - s.Admission.AddFlags(fs) - - fs.DurationVar(&s.EventTTL, "event-ttl", s.EventTTL, - "Amount of time to retain events.") -} diff --git a/federation/cmd/federation-apiserver/app/options/validation.go b/federation/cmd/federation-apiserver/app/options/validation.go deleted file mode 100644 index e1f1f2310f..0000000000 --- a/federation/cmd/federation-apiserver/app/options/validation.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2016 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 options - -import "fmt" - -func (options *ServerRunOptions) Validate() []error { - var errors []error - if errs := options.GenericServerRunOptions.Validate(); len(errs) > 0 { - errors = append(errors, errs...) - } - if errs := options.Etcd.Validate(); len(errs) > 0 { - errors = append(errors, errs...) - } - if errs := options.SecureServing.Validate(); len(errs) > 0 { - errors = append(errors, errs...) - } - if errs := options.InsecureServing.Validate("insecure-port"); len(errs) > 0 { - errors = append(errors, errs...) - } - if errs := options.Audit.Validate(); len(errs) > 0 { - errors = append(errors, errs...) - } - if errs := options.Features.Validate(); len(errs) > 0 { - errors = append(errors, errs...) - } - if errs := options.Admission.Validate(); len(errs) > 0 { - errors = append(errors, errs...) - } - if errs := options.Authentication.Validate(); len(errs) > 0 { - errors = append(errors, errs...) - } - if errs := options.Authorization.Validate(); len(errs) > 0 { - errors = append(errors, errs...) - } - if errs := options.CloudProvider.Validate(); len(errs) > 0 { - errors = append(errors, errs...) - } - if options.EventTTL <= 0 { - errors = append(errors, fmt.Errorf("--event-ttl must be greater than 0")) - } - // TODO: add more checks - return errors -} diff --git a/federation/cmd/federation-apiserver/app/plugins.go b/federation/cmd/federation-apiserver/app/plugins.go deleted file mode 100644 index a10a3edbab..0000000000 --- a/federation/cmd/federation-apiserver/app/plugins.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 2014 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 app - -// This file exists to force the desired plugin implementations to be linked. -// This should probably be part of some configuration fed into the build for a -// given binary target. -import ( - // Cloud providers - _ "k8s.io/kubernetes/pkg/cloudprovider/providers" - - // Admission policies - "k8s.io/apiserver/pkg/admission" - "k8s.io/kubernetes/federation/plugin/pkg/admission/schedulingpolicy" - "k8s.io/kubernetes/plugin/pkg/admission/admit" - "k8s.io/kubernetes/plugin/pkg/admission/deny" - "k8s.io/kubernetes/plugin/pkg/admission/gc" -) - -// RegisterAllAdmissionPlugins registers all admission plugins -func RegisterAllAdmissionPlugins(plugins *admission.Plugins) { - admit.Register(plugins) - deny.Register(plugins) - gc.Register(plugins) - schedulingpolicy.Register(plugins) -} diff --git a/federation/cmd/federation-apiserver/app/server.go b/federation/cmd/federation-apiserver/app/server.go deleted file mode 100644 index 7509eb66b3..0000000000 --- a/federation/cmd/federation-apiserver/app/server.go +++ /dev/null @@ -1,484 +0,0 @@ -/* -Copyright 2014 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 app does all of the work necessary to create a Kubernetes -// APIServer by binding together the API, master and APIServer infrastructure. -// It can be configured and called directly or via the hyperkube cache. -package app - -import ( - "fmt" - "io/ioutil" - "strings" - "time" - - "github.com/go-openapi/spec" - "github.com/golang/glog" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - - appsv1beta2 "k8s.io/api/apps/v1beta2" - apiv1 "k8s.io/api/core/v1" - extensionsapiv1beta1 "k8s.io/api/extensions/v1beta1" - "k8s.io/apimachinery/pkg/runtime/schema" - utilerrors "k8s.io/apimachinery/pkg/util/errors" - "k8s.io/apimachinery/pkg/util/sets" - genericapiserver "k8s.io/apiserver/pkg/server" - "k8s.io/apiserver/pkg/server/filters" - serveroptions "k8s.io/apiserver/pkg/server/options" - serverstorage "k8s.io/apiserver/pkg/server/storage" - clientgoinformers "k8s.io/client-go/informers" - clientgoclientset "k8s.io/client-go/kubernetes" - openapicommon "k8s.io/kube-openapi/pkg/common" - federationv1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" - "k8s.io/kubernetes/federation/cmd/federation-apiserver/app/options" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" - informers "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion" - "k8s.io/kubernetes/pkg/generated/openapi" - "k8s.io/kubernetes/pkg/kubeapiserver" - kubeapiserveradmission "k8s.io/kubernetes/pkg/kubeapiserver/admission" - kubeoptions "k8s.io/kubernetes/pkg/kubeapiserver/options" - kubeserver "k8s.io/kubernetes/pkg/kubeapiserver/server" - quotainstall "k8s.io/kubernetes/pkg/quota/install" - "k8s.io/kubernetes/pkg/registry/cachesize" - "k8s.io/kubernetes/pkg/routes" - "k8s.io/kubernetes/pkg/version" -) - -// NewAPIServerCommand creates a *cobra.Command object with default parameters -func NewAPIServerCommand() *cobra.Command { - s := options.NewServerRunOptions() - s.AddFlags(pflag.CommandLine) - cmd := &cobra.Command{ - Use: "federation-apiserver", - Long: `The Kubernetes federation API server validates and configures data -for the api objects which include pods, services, replicationcontrollers, and -others. The API Server services REST operations and provides the frontend to the -cluster's shared state through which all other components interact.`, - Run: func(cmd *cobra.Command, args []string) { - }, - } - return cmd -} - -// Run runs the specified APIServer. It only returns if stopCh is closed -// or one of the ports cannot be listened on initially. -func Run(s *options.ServerRunOptions, stopCh <-chan struct{}) error { - err := NonBlockingRun(s, stopCh) - if err != nil { - return err - } - <-stopCh - return nil -} - -// NonBlockingRun runs the specified APIServer and configures it to -// stop with the given channel. -func NonBlockingRun(s *options.ServerRunOptions, stopCh <-chan struct{}) error { - // register all admission plugins - RegisterAllAdmissionPlugins(s.Admission.Plugins) - - // set defaults - if err := s.GenericServerRunOptions.DefaultAdvertiseAddress(s.SecureServing); err != nil { - return err - } - if err := kubeoptions.DefaultAdvertiseAddress(s.GenericServerRunOptions, s.InsecureServing); err != nil { - return err - } - if err := s.SecureServing.MaybeDefaultWithSelfSignedCerts(s.GenericServerRunOptions.AdvertiseAddress.String(), nil, nil); err != nil { - return fmt.Errorf("error creating self-signed certificates: %v", err) - } - if err := s.CloudProvider.DefaultExternalHost(s.GenericServerRunOptions); err != nil { - return fmt.Errorf("error setting the external host value: %v", err) - } - - s.Authentication.ApplyAuthorization(s.Authorization) - - // validate options - if errs := s.Validate(); len(errs) != 0 { - return utilerrors.NewAggregate(errs) - } - - genericConfig := genericapiserver.NewConfig(legacyscheme.Codecs) - if err := s.GenericServerRunOptions.ApplyTo(genericConfig); err != nil { - return err - } - insecureServingOptions, err := s.InsecureServing.ApplyTo(genericConfig) - if err != nil { - return err - } - if err := s.SecureServing.ApplyTo(genericConfig); err != nil { - return err - } - if err := s.Authentication.ApplyTo(genericConfig); err != nil { - return err - } - if err := s.Audit.ApplyTo(genericConfig); err != nil { - return err - } - if err := s.Features.ApplyTo(genericConfig); err != nil { - return err - } - - resourceConfig := defaultResourceConfig() - - if s.Etcd.StorageConfig.DeserializationCacheSize == 0 { - // When size of cache is not explicitly set, set it to 50000 - s.Etcd.StorageConfig.DeserializationCacheSize = 50000 - } - storageGroupsToEncodingVersion, err := s.StorageSerialization.StorageGroupsToEncodingVersion() - if err != nil { - return fmt.Errorf("error generating storage version map: %s", err) - } - storageFactory, err := kubeapiserver.NewStorageFactory( - s.Etcd.StorageConfig, s.Etcd.DefaultStorageMediaType, legacyscheme.Codecs, - serverstorage.NewDefaultResourceEncodingConfig(legacyscheme.Registry), storageGroupsToEncodingVersion, - []schema.GroupVersionResource{}, resourceConfig, s.APIEnablement.RuntimeConfig) - if err != nil { - return fmt.Errorf("error in initializing storage factory: %s", err) - } - - for _, override := range s.Etcd.EtcdServersOverrides { - tokens := strings.Split(override, "#") - if len(tokens) != 2 { - glog.Errorf("invalid value of etcd server overrides: %s", override) - continue - } - - apiresource := strings.Split(tokens[0], "/") - if len(apiresource) != 2 { - glog.Errorf("invalid resource definition: %s", tokens[0]) - continue - } - group := apiresource[0] - resource := apiresource[1] - groupResource := schema.GroupResource{Group: group, Resource: resource} - - servers := strings.Split(tokens[1], ";") - storageFactory.SetEtcdLocation(groupResource, servers) - } - if err := s.Etcd.ApplyWithStorageFactoryTo(storageFactory, genericConfig); err != nil { - return err - } - - apiAuthenticator, securityDefinitions, err := s.Authentication.ToAuthenticationConfig().New() - if err != nil { - return fmt.Errorf("invalid Authentication Config: %v", err) - } - - kubeClientConfig := genericConfig.LoopbackClientConfig - client, err := internalclientset.NewForConfig(kubeClientConfig) - if err != nil { - return fmt.Errorf("failed to create clientset: %v", err) - } - - sharedInformers := informers.NewSharedInformerFactory(client, 10*time.Minute) - clientgoExternalClient, err := clientgoclientset.NewForConfig(kubeClientConfig) - if err != nil { - return fmt.Errorf("failed to create real external clientset: %v", err) - } - versionedInformers := clientgoinformers.NewSharedInformerFactory(clientgoExternalClient, 10*time.Minute) - - authorizationConfig := s.Authorization.ToAuthorizationConfig(sharedInformers) - apiAuthorizer, _, err := authorizationConfig.New() - if err != nil { - return fmt.Errorf("invalid Authorization Config: %v", err) - } - - var cloudConfig []byte - if s.CloudProvider.CloudConfigFile != "" { - cloudConfig, err = ioutil.ReadFile(s.CloudProvider.CloudConfigFile) - if err != nil { - glog.Fatalf("Error reading from cloud configuration file %s: %#v", s.CloudProvider.CloudConfigFile, err) - } - } - - // NOTE: we do not provide informers to the quota registry because admission level decisions - // do not require us to open watches for all items tracked by quota. - quotaRegistry := quotainstall.NewRegistry(nil, nil) - pluginInitializer := kubeapiserveradmission.NewPluginInitializer(client, sharedInformers, cloudConfig, nil, quotaRegistry, nil, nil) - - err = s.Admission.ApplyTo( - genericConfig, - versionedInformers, - kubeClientConfig, - legacyscheme.Scheme, - pluginInitializer, - ) - if err != nil { - return fmt.Errorf("failed to initialize plugins: %v", err) - } - - kubeVersion := version.Get() - genericConfig.Version = &kubeVersion - genericConfig.Authenticator = apiAuthenticator - genericConfig.Authorizer = apiAuthorizer - genericConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(openapi.GetOpenAPIDefinitions, legacyscheme.Scheme) - genericConfig.OpenAPIConfig.PostProcessSpec = postProcessOpenAPISpecForBackwardCompatibility - genericConfig.OpenAPIConfig.SecurityDefinitions = securityDefinitions - genericConfig.SwaggerConfig = genericapiserver.DefaultSwaggerConfig() - genericConfig.LongRunningFunc = filters.BasicLongRunningRequestCheck( - sets.NewString("watch", "proxy"), - sets.NewString("attach", "exec", "proxy", "log", "portforward"), - ) - - // TODO: Move this to generic api server (Need to move the command line flag). - if s.Etcd.EnableWatchCache { - glog.V(2).Infof("Initializing cache sizes based on %dMB limit", s.GenericServerRunOptions.TargetRAMMB) - sizes := cachesize.NewHeuristicWatchCacheSizes(s.GenericServerRunOptions.TargetRAMMB) - if userSpecified, err := serveroptions.ParseWatchCacheSizes(s.Etcd.WatchCacheSizes); err == nil { - for resource, size := range userSpecified { - sizes[resource] = size - } - } - s.Etcd.WatchCacheSizes, err = serveroptions.WriteWatchCacheSizes(sizes) - if err != nil { - return err - } - } - - m, err := genericConfig.Complete(versionedInformers).New("federation", genericapiserver.EmptyDelegate) - if err != nil { - return err - } - - routes.UIRedirect{}.Install(m.Handler.NonGoRestfulMux) - routes.Logs{}.Install(m.Handler.GoRestfulContainer) - - apiResourceConfigSource := storageFactory.APIResourceConfigSource - installFederationAPIs(m, genericConfig.RESTOptionsGetter, apiResourceConfigSource) - installCoreAPIs(s, m, genericConfig.RESTOptionsGetter, apiResourceConfigSource) - installExtensionsAPIs(m, genericConfig.RESTOptionsGetter, apiResourceConfigSource) - installBatchAPIs(m, genericConfig.RESTOptionsGetter, apiResourceConfigSource) - installAutoscalingAPIs(m, genericConfig.RESTOptionsGetter, apiResourceConfigSource) - - // run the insecure server now - if insecureServingOptions != nil { - insecureHandlerChain := kubeserver.BuildInsecureHandlerChain(m.UnprotectedHandler(), genericConfig) - if err := kubeserver.NonBlockingRun(insecureServingOptions, insecureHandlerChain, stopCh); err != nil { - return err - } - } - - err = m.PrepareRun().NonBlockingRun(stopCh) - if err == nil { - sharedInformers.Start(stopCh) - } - return err -} - -func defaultResourceConfig() *serverstorage.ResourceConfig { - rc := serverstorage.NewResourceConfig() - - rc.EnableVersions( - federationv1beta1.SchemeGroupVersion, - ) - - // All core resources except these are disabled by default. - rc.EnableResources( - apiv1.SchemeGroupVersion.WithResource("secrets"), - apiv1.SchemeGroupVersion.WithResource("services"), - apiv1.SchemeGroupVersion.WithResource("namespaces"), - apiv1.SchemeGroupVersion.WithResource("events"), - apiv1.SchemeGroupVersion.WithResource("configmaps"), - ) - // All extension resources except these are disabled by default. - rc.EnableResources( - extensionsapiv1beta1.SchemeGroupVersion.WithResource("daemonsets"), - extensionsapiv1beta1.SchemeGroupVersion.WithResource("deployments"), - extensionsapiv1beta1.SchemeGroupVersion.WithResource("ingresses"), - extensionsapiv1beta1.SchemeGroupVersion.WithResource("replicasets"), - ) - // All apps resources except these are disabled by default. - rc.EnableResources( - appsv1beta2.SchemeGroupVersion.WithResource("daemonsets"), - appsv1beta2.SchemeGroupVersion.WithResource("deployments"), - appsv1beta2.SchemeGroupVersion.WithResource("replicasets"), - ) - return rc -} - -// PostProcessSpec adds removed definitions for backward compatibility -func postProcessOpenAPISpecForBackwardCompatibility(s *spec.Swagger) (*spec.Swagger, error) { - compatibilityMap := map[string]string{ - "v1beta1.ReplicaSetList": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.ReplicaSetList", - "v1.FlockerVolumeSource": "io.k8s.kubernetes.pkg.api.v1.FlockerVolumeSource", - "v1.FlexVolumeSource": "io.k8s.kubernetes.pkg.api.v1.FlexVolumeSource", - "v1.SecretKeySelector": "io.k8s.kubernetes.pkg.api.v1.SecretKeySelector", - "v1.DeleteOptions": "io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions", - "v1.ServiceSpec": "io.k8s.kubernetes.pkg.api.v1.ServiceSpec", - "v1.NamespaceStatus": "io.k8s.kubernetes.pkg.api.v1.NamespaceStatus", - "v1.Affinity": "io.k8s.kubernetes.pkg.api.v1.Affinity", - "v1.PodAffinity": "io.k8s.kubernetes.pkg.api.v1.PodAffinity", - "v1.EnvVarSource": "io.k8s.kubernetes.pkg.api.v1.EnvVarSource", - "v1.ListMeta": "io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta", - "v1.ObjectMeta": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta", - "v1.APIGroupList": "io.k8s.apimachinery.pkg.apis.meta.v1.APIGroupList", - "v1.EnvFromSource": "io.k8s.kubernetes.pkg.api.v1.EnvFromSource", - "v1.Service": "io.k8s.kubernetes.pkg.api.v1.Service", - "v1.HorizontalPodAutoscaler": "io.k8s.kubernetes.pkg.apis.autoscaling.v1.HorizontalPodAutoscaler", - "v1.StatusCause": "io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause", - "v1.ObjectFieldSelector": "io.k8s.kubernetes.pkg.api.v1.ObjectFieldSelector", - "v1.QuobyteVolumeSource": "io.k8s.kubernetes.pkg.api.v1.QuobyteVolumeSource", - "v1beta1.ReplicaSetSpec": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.ReplicaSetSpec", - "v1.LabelSelector": "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector", - "v1.DownwardAPIVolumeFile": "io.k8s.kubernetes.pkg.api.v1.DownwardAPIVolumeFile", - "v1.GCEPersistentDiskVolumeSource": "io.k8s.kubernetes.pkg.api.v1.GCEPersistentDiskVolumeSource", - "v1beta1.ClusterCondition": "io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterCondition", - "v1.JobCondition": "io.k8s.kubernetes.pkg.apis.batch.v1.JobCondition", - "v1.LabelSelectorRequirement": "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement", - "v1beta1.Deployment": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.Deployment", - "v1.LoadBalancerIngress": "io.k8s.kubernetes.pkg.api.v1.LoadBalancerIngress", - "v1.SecretList": "io.k8s.kubernetes.pkg.api.v1.SecretList", - "v1.ServicePort": "io.k8s.kubernetes.pkg.api.v1.ServicePort", - "v1.Namespace": "io.k8s.kubernetes.pkg.api.v1.Namespace", - "v1beta1.ReplicaSetCondition": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.ReplicaSetCondition", - "v1.CrossVersionObjectReference": "io.k8s.kubernetes.pkg.apis.autoscaling.v1.CrossVersionObjectReference", - "v1.ConfigMapVolumeSource": "io.k8s.kubernetes.pkg.api.v1.ConfigMapVolumeSource", - "v1.FCVolumeSource": "io.k8s.kubernetes.pkg.api.v1.FCVolumeSource", - "v1.GroupVersionForDiscovery": "io.k8s.apimachinery.pkg.apis.meta.v1.GroupVersionForDiscovery", - "v1beta1.ClusterStatus": "io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterStatus", - "v1.Job": "io.k8s.kubernetes.pkg.apis.batch.v1.Job", - "v1.PersistentVolumeClaimVolumeSource": "io.k8s.kubernetes.pkg.api.v1.PersistentVolumeClaimVolumeSource", - "v1.Handler": "io.k8s.kubernetes.pkg.api.v1.Handler", - "v1.ServerAddressByClientCIDR": "io.k8s.apimachinery.pkg.apis.meta.v1.ServerAddressByClientCIDR", - "v1.PodAntiAffinity": "io.k8s.kubernetes.pkg.api.v1.PodAntiAffinity", - "v1.ISCSIVolumeSource": "io.k8s.kubernetes.pkg.api.v1.ISCSIVolumeSource", - "v1.WeightedPodAffinityTerm": "io.k8s.kubernetes.pkg.api.v1.WeightedPodAffinityTerm", - "v1.HorizontalPodAutoscalerSpec": "io.k8s.kubernetes.pkg.apis.autoscaling.v1.HorizontalPodAutoscalerSpec", - "v1.HorizontalPodAutoscalerList": "io.k8s.kubernetes.pkg.apis.autoscaling.v1.HorizontalPodAutoscalerList", - "v1.Probe": "io.k8s.kubernetes.pkg.api.v1.Probe", - "v1.APIGroup": "io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup", - "v1beta1.DeploymentList": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DeploymentList", - "v1.NodeAffinity": "io.k8s.kubernetes.pkg.api.v1.NodeAffinity", - "v1.SecretEnvSource": "io.k8s.kubernetes.pkg.api.v1.SecretEnvSource", - "v1beta1.DeploymentStatus": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DeploymentStatus", - "v1.CinderVolumeSource": "io.k8s.kubernetes.pkg.api.v1.CinderVolumeSource", - "v1.NodeSelectorTerm": "io.k8s.kubernetes.pkg.api.v1.NodeSelectorTerm", - "v1.Patch": "io.k8s.apimachinery.pkg.apis.meta.v1.Patch", - "v1.SecretVolumeSource": "io.k8s.kubernetes.pkg.api.v1.SecretVolumeSource", - "v1.Secret": "io.k8s.kubernetes.pkg.api.v1.Secret", - "v1.NodeSelector": "io.k8s.kubernetes.pkg.api.v1.NodeSelector", - "runtime.RawExtension": "io.k8s.apimachinery.pkg.runtime.RawExtension", - "v1.PreferredSchedulingTerm": "io.k8s.kubernetes.pkg.api.v1.PreferredSchedulingTerm", - "v1beta1.ClusterList": "io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterList", - "v1.KeyToPath": "io.k8s.kubernetes.pkg.api.v1.KeyToPath", - "intstr.IntOrString": "io.k8s.apimachinery.pkg.util.intstr.IntOrString", - "v1beta1.ClusterSpec": "io.k8s.kubernetes.federation.apis.federation.v1beta1.ClusterSpec", - "v1.ServiceList": "io.k8s.kubernetes.pkg.api.v1.ServiceList", - "v1beta1.DeploymentStrategy": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DeploymentStrategy", - "v1beta1.IngressBackend": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.IngressBackend", - "v1.Time": "io.k8s.apimachinery.pkg.apis.meta.v1.Time", - "v1.ContainerPort": "io.k8s.kubernetes.pkg.api.v1.ContainerPort", - "v1beta1.HTTPIngressRuleValue": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.HTTPIngressRuleValue", - "v1.AzureFileVolumeSource": "io.k8s.kubernetes.pkg.api.v1.AzureFileVolumeSource", - "v1.PodTemplateSpec": "io.k8s.kubernetes.pkg.api.v1.PodTemplateSpec", - "v1.PodSpec": "io.k8s.kubernetes.pkg.api.v1.PodSpec", - "v1beta1.ReplicaSetStatus": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.ReplicaSetStatus", - "v1.CephFSVolumeSource": "io.k8s.kubernetes.pkg.api.v1.CephFSVolumeSource", - "v1.Volume": "io.k8s.kubernetes.pkg.api.v1.Volume", - "v1beta1.Ingress": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.Ingress", - "v1.PodAffinityTerm": "io.k8s.kubernetes.pkg.api.v1.PodAffinityTerm", - "v1.ObjectReference": "io.k8s.kubernetes.pkg.api.v1.ObjectReference", - "v1.ServiceStatus": "io.k8s.kubernetes.pkg.api.v1.ServiceStatus", - "v1.APIResource": "io.k8s.apimachinery.pkg.apis.meta.v1.APIResource", - "v1.AzureDiskVolumeSource": "io.k8s.kubernetes.pkg.api.v1.AzureDiskVolumeSource", - "v1.ConfigMap": "io.k8s.kubernetes.pkg.api.v1.ConfigMap", - "v1beta1.IngressSpec": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.IngressSpec", - "v1.APIVersions": "io.k8s.apimachinery.pkg.apis.meta.v1.APIVersions", - "resource.Quantity": "io.k8s.apimachinery.pkg.api.resource.Quantity", - "v1.Event": "io.k8s.kubernetes.pkg.api.v1.Event", - "v1.JobStatus": "io.k8s.kubernetes.pkg.apis.batch.v1.JobStatus", - "v1beta1.ServerAddressByClientCIDR": "io.k8s.kubernetes.federation.apis.federation.v1beta1.ServerAddressByClientCIDR", - "v1.LocalObjectReference": "io.k8s.kubernetes.pkg.api.v1.LocalObjectReference", - "v1.HostPathVolumeSource": "io.k8s.kubernetes.pkg.api.v1.HostPathVolumeSource", - "v1.LoadBalancerStatus": "io.k8s.kubernetes.pkg.api.v1.LoadBalancerStatus", - "v1beta1.HTTPIngressPath": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.HTTPIngressPath", - "v1beta1.DeploymentSpec": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DeploymentSpec", - "v1.ExecAction": "io.k8s.kubernetes.pkg.api.v1.ExecAction", - "v1.HorizontalPodAutoscalerStatus": "io.k8s.kubernetes.pkg.apis.autoscaling.v1.HorizontalPodAutoscalerStatus", - "v1.JobSpec": "io.k8s.kubernetes.pkg.apis.batch.v1.JobSpec", - "v1beta1.DaemonSetSpec": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DaemonSetSpec", - "v1.SELinuxOptions": "io.k8s.kubernetes.pkg.api.v1.SELinuxOptions", - "v1beta1.IngressTLS": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.IngressTLS", - "v1beta1.ScaleStatus": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.ScaleStatus", - "v1.NamespaceSpec": "io.k8s.kubernetes.pkg.api.v1.NamespaceSpec", - "v1.StatusDetails": "io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails", - "v1beta1.IngressList": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.IngressList", - "v1beta1.DeploymentRollback": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DeploymentRollback", - "v1.GlusterfsVolumeSource": "io.k8s.kubernetes.pkg.api.v1.GlusterfsVolumeSource", - "v1.JobList": "io.k8s.kubernetes.pkg.apis.batch.v1.JobList", - "v1.EventList": "io.k8s.kubernetes.pkg.api.v1.EventList", - "v1beta1.IngressRule": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.IngressRule", - "v1.APIResourceList": "io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList", - "v1.ConfigMapKeySelector": "io.k8s.kubernetes.pkg.api.v1.ConfigMapKeySelector", - "v1.PhotonPersistentDiskVolumeSource": "io.k8s.kubernetes.pkg.api.v1.PhotonPersistentDiskVolumeSource", - "v1.HTTPHeader": "io.k8s.kubernetes.pkg.api.v1.HTTPHeader", - "version.Info": "io.k8s.apimachinery.pkg.version.Info", - "v1.EventSource": "io.k8s.kubernetes.pkg.api.v1.EventSource", - "v1.OwnerReference": "io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference", - "v1beta1.ScaleSpec": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.ScaleSpec", - "v1.GitRepoVolumeSource": "io.k8s.kubernetes.pkg.api.v1.GitRepoVolumeSource", - "v1.ConfigMapEnvSource": "io.k8s.kubernetes.pkg.api.v1.ConfigMapEnvSource", - "v1beta1.DeploymentCondition": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DeploymentCondition", - "v1.EnvVar": "io.k8s.kubernetes.pkg.api.v1.EnvVar", - "v1.DownwardAPIVolumeSource": "io.k8s.kubernetes.pkg.api.v1.DownwardAPIVolumeSource", - "v1.SecurityContext": "io.k8s.kubernetes.pkg.api.v1.SecurityContext", - "v1beta1.IngressStatus": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.IngressStatus", - "v1beta1.Cluster": "io.k8s.kubernetes.federation.apis.federation.v1beta1.Cluster", - "v1.Capabilities": "io.k8s.kubernetes.pkg.api.v1.Capabilities", - "v1.AWSElasticBlockStoreVolumeSource": "io.k8s.kubernetes.pkg.api.v1.AWSElasticBlockStoreVolumeSource", - "v1beta1.ReplicaSet": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.ReplicaSet", - "v1.ConfigMapList": "io.k8s.kubernetes.pkg.api.v1.ConfigMapList", - "v1.Lifecycle": "io.k8s.kubernetes.pkg.api.v1.Lifecycle", - "v1beta1.Scale": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.Scale", - "v1beta1.DaemonSet": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DaemonSet", - "v1beta1.RollingUpdateDeployment": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.RollingUpdateDeployment", - "v1beta1.DaemonSetStatus": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DaemonSetStatus", - "v1.Preconditions": "io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions", - "v1beta1.DaemonSetList": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.DaemonSetList", - "v1.RBDVolumeSource": "io.k8s.kubernetes.pkg.api.v1.RBDVolumeSource", - "v1.NFSVolumeSource": "io.k8s.kubernetes.pkg.api.v1.NFSVolumeSource", - "v1.NodeSelectorRequirement": "io.k8s.kubernetes.pkg.api.v1.NodeSelectorRequirement", - "v1.ResourceRequirements": "io.k8s.kubernetes.pkg.api.v1.ResourceRequirements", - "v1.WatchEvent": "io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent", - "v1.HTTPGetAction": "io.k8s.kubernetes.pkg.api.v1.HTTPGetAction", - "v1beta1.RollbackConfig": "io.k8s.kubernetes.pkg.apis.extensions.v1beta1.RollbackConfig", - "v1.PodSecurityContext": "io.k8s.kubernetes.pkg.api.v1.PodSecurityContext", - "v1.VolumeMount": "io.k8s.kubernetes.pkg.api.v1.VolumeMount", - "v1.NamespaceList": "io.k8s.kubernetes.pkg.api.v1.NamespaceList", - "v1.TCPSocketAction": "io.k8s.kubernetes.pkg.api.v1.TCPSocketAction", - "v1.ResourceFieldSelector": "io.k8s.kubernetes.pkg.api.v1.ResourceFieldSelector", - "v1.Container": "io.k8s.kubernetes.pkg.api.v1.Container", - "v1.VsphereVirtualDiskVolumeSource": "io.k8s.kubernetes.pkg.api.v1.VsphereVirtualDiskVolumeSource", - "v1.EmptyDirVolumeSource": "io.k8s.kubernetes.pkg.api.v1.EmptyDirVolumeSource", - "v1.Status": "io.k8s.apimachinery.pkg.apis.meta.v1.Status", - } - - for k, v := range compatibilityMap { - if _, found := s.Definitions[v]; !found { - continue - } - s.Definitions[k] = spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: spec.MustCreateRef("#/definitions/" + openapicommon.EscapeJsonPointer(v)), - Description: fmt.Sprintf("Deprecated. Please use %s instead.", v), - }, - } - } - return s, nil -} diff --git a/federation/cmd/federation-controller-manager/BUILD b/federation/cmd/federation-controller-manager/BUILD deleted file mode 100644 index a1ebcd1356..0000000000 --- a/federation/cmd/federation-controller-manager/BUILD +++ /dev/null @@ -1,46 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_binary", - "go_library", -) - -go_binary( - name = "federation-controller-manager", - importpath = "k8s.io/kubernetes/federation/cmd/federation-controller-manager", - library = ":go_default_library", -) - -go_library( - name = "go_default_library", - srcs = ["controller-manager.go"], - importpath = "k8s.io/kubernetes/federation/cmd/federation-controller-manager", - deps = [ - "//federation/cmd/federation-controller-manager/app:go_default_library", - "//federation/cmd/federation-controller-manager/app/options:go_default_library", - "//pkg/util/reflector/prometheus:go_default_library", - "//pkg/util/workqueue/prometheus:go_default_library", - "//pkg/version/verflag:go_default_library", - "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/k8s.io/apiserver/pkg/server/healthz:go_default_library", - "//vendor/k8s.io/apiserver/pkg/util/flag:go_default_library", - "//vendor/k8s.io/apiserver/pkg/util/logs:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/cmd/federation-controller-manager/app:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/cmd/federation-controller-manager/OWNERS b/federation/cmd/federation-controller-manager/OWNERS deleted file mode 100644 index 571c01c052..0000000000 --- a/federation/cmd/federation-controller-manager/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -approvers: -- quinton-hoole -- nikhiljindal -- madhusudancs -reviewers: -- quinton-hoole -- nikhiljindal -- madhusudancs diff --git a/federation/cmd/federation-controller-manager/app/BUILD b/federation/cmd/federation-controller-manager/app/BUILD deleted file mode 100644 index b6aa114a8d..0000000000 --- a/federation/cmd/federation-controller-manager/app/BUILD +++ /dev/null @@ -1,82 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = [ - "controllermanager.go", - "plugins.go", - ], - importpath = "k8s.io/kubernetes/federation/cmd/federation-controller-manager/app", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//federation/cmd/federation-controller-manager/app/options:go_default_library", - "//federation/pkg/dnsprovider/providers/aws/route53:go_default_library", - "//federation/pkg/dnsprovider/providers/coredns:go_default_library", - "//federation/pkg/dnsprovider/providers/google/clouddns:go_default_library", - "//federation/pkg/federatedtypes:go_default_library", - "//federation/pkg/federation-controller/cluster:go_default_library", - "//federation/pkg/federation-controller/ingress:go_default_library", - "//federation/pkg/federation-controller/job:go_default_library", - "//federation/pkg/federation-controller/service:go_default_library", - "//federation/pkg/federation-controller/service/dns:go_default_library", - "//federation/pkg/federation-controller/sync:go_default_library", - "//federation/pkg/federation-controller/util/eventsink:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//pkg/util/configz:go_default_library", - "//pkg/version:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library", - "//vendor/github.com/spf13/cobra:go_default_library", - "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/k8s.io/apiserver/pkg/server/healthz:go_default_library", - "//vendor/k8s.io/apiserver/pkg/util/flag:go_default_library", - "//vendor/k8s.io/client-go/discovery:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/k8s.io/client-go/tools/leaderelection:go_default_library", - "//vendor/k8s.io/client-go/tools/leaderelection/resourcelock:go_default_library", - "//vendor/k8s.io/client-go/tools/record:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["controllermanager_test.go"], - importpath = "k8s.io/kubernetes/federation/cmd/federation-controller-manager/app", - library = ":go_default_library", - deps = [ - "//federation/pkg/federation-controller/ingress:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//vendor/k8s.io/apiserver/pkg/util/flag:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/cmd/federation-controller-manager/app/options:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/cmd/federation-controller-manager/app/controllermanager.go b/federation/cmd/federation-controller-manager/app/controllermanager.go deleted file mode 100644 index 67ad87b937..0000000000 --- a/federation/cmd/federation-controller-manager/app/controllermanager.go +++ /dev/null @@ -1,318 +0,0 @@ -/* -Copyright 2016 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 app implements a server that runs a set of active -// components. This includes cluster controller - -package app - -import ( - "net" - "net/http" - "net/http/pprof" - "os" - goruntime "runtime" - "strconv" - "time" - - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apiserver/pkg/server/healthz" - utilflag "k8s.io/apiserver/pkg/util/flag" - "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/client-go/tools/leaderelection" - "k8s.io/client-go/tools/leaderelection/resourcelock" - "k8s.io/client-go/tools/record" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/federation/cmd/federation-controller-manager/app/options" - "k8s.io/kubernetes/federation/pkg/federatedtypes" - clustercontroller "k8s.io/kubernetes/federation/pkg/federation-controller/cluster" - ingresscontroller "k8s.io/kubernetes/federation/pkg/federation-controller/ingress" - jobcontroller "k8s.io/kubernetes/federation/pkg/federation-controller/job" - servicecontroller "k8s.io/kubernetes/federation/pkg/federation-controller/service" - servicednscontroller "k8s.io/kubernetes/federation/pkg/federation-controller/service/dns" - synccontroller "k8s.io/kubernetes/federation/pkg/federation-controller/sync" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/eventsink" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/util/configz" - "k8s.io/kubernetes/pkg/version" - - "github.com/golang/glog" - "github.com/prometheus/client_golang/prometheus" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/client-go/discovery" -) - -const ( - apiserverWaitTimeout = 2 * time.Minute - apiserverRetryInterval = 2 * time.Second -) - -// NewControllerManagerCommand creates a *cobra.Command object with default parameters -func NewControllerManagerCommand() *cobra.Command { - s := options.NewCMServer() - s.AddFlags(pflag.CommandLine) - cmd := &cobra.Command{ - Use: "federation-controller-manager", - Long: `The federation controller manager is a daemon that embeds -the core control loops shipped with federation. In applications of robotics and -automation, a control loop is a non-terminating loop that regulates the state of -the system. In federation, a controller is a control loop that watches the shared -state of the federation cluster through the apiserver and makes changes attempting -to move the current state towards the desired state. Examples of controllers that -ship with federation today is the cluster controller.`, - Run: func(cmd *cobra.Command, args []string) { - }, - } - - return cmd -} - -// Run runs the CMServer. This should never exit. -func Run(s *options.CMServer) error { - glog.Infof("%+v", version.Get()) - if c, err := configz.New("componentconfig"); err == nil { - c.Set(s.ControllerManagerConfiguration) - } else { - glog.Errorf("unable to register configz: %s", err) - } - - restClientCfg, err := clientcmd.BuildConfigFromFlags(s.Master, s.Kubeconfig) - if err != nil || restClientCfg == nil { - glog.V(2).Infof("Couldn't build the rest client config from flags: %v", err) - return err - } - - // Override restClientCfg qps/burst settings from flags - restClientCfg.QPS = s.APIServerQPS - restClientCfg.Burst = s.APIServerBurst - - go func() { - mux := http.NewServeMux() - healthz.InstallHandler(mux) - if s.EnableProfiling { - mux.HandleFunc("/debug/pprof/", pprof.Index) - mux.HandleFunc("/debug/pprof/profile", pprof.Profile) - mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) - mux.HandleFunc("/debug/pprof/trace", pprof.Trace) - if s.EnableContentionProfiling { - goruntime.SetBlockProfileRate(1) - } - } - mux.Handle("/metrics", prometheus.Handler()) - - server := &http.Server{ - Addr: net.JoinHostPort(s.Address, strconv.Itoa(s.Port)), - Handler: mux, - } - glog.Fatal(server.ListenAndServe()) - }() - - federationClientset, err := federationclientset.NewForConfig(restclient.AddUserAgent(restClientCfg, "federation-controller-manager")) - if err != nil { - glog.Fatalf("Invalid API configuration: %v", err) - } - - run := func(stop <-chan struct{}) { - err := StartControllers(s, restClientCfg, stop) - glog.Fatalf("error running controllers: %v", err) - panic("unreachable") - } - - if !s.LeaderElection.LeaderElect { - run(nil) - // unreachable - } - - if err := ensureFederationNamespace(federationClientset, s.FederationOnlyNamespace); err != nil { - glog.Fatalf("Failed to ensure federation only namespace %s: %v", s.FederationOnlyNamespace, err) - } - - leaderElectionClient := kubernetes.NewForConfigOrDie(restclient.AddUserAgent(restClientCfg, "leader-election")) - eventBroadcaster := record.NewBroadcaster() - eventBroadcaster.StartLogging(glog.Infof) - eventBroadcaster.StartRecordingToSink(eventsink.NewFederatedEventSink(federationClientset)) - recorder := eventBroadcaster.NewRecorder(legacyscheme.Scheme, v1.EventSource{Component: "controller-manager"}) - - id, err := os.Hostname() - if err != nil { - return err - } - - rl := resourcelock.ConfigMapLock{ - ConfigMapMeta: metav1.ObjectMeta{ - Namespace: s.FederationOnlyNamespace, - Name: "federation-controller-manager-leader-election", - Annotations: map[string]string{ - federationapi.FederationClusterSelectorAnnotation: federationapi.FederationOnlyClusterSelector, - }}, - Client: leaderElectionClient.CoreV1(), - LockConfig: resourcelock.ResourceLockConfig{ - Identity: id, - EventRecorder: recorder, - }, - } - - leaderelection.RunOrDie(leaderelection.LeaderElectionConfig{ - Lock: &rl, - LeaseDuration: s.LeaderElection.LeaseDuration.Duration, - RenewDeadline: s.LeaderElection.RenewDeadline.Duration, - RetryPeriod: s.LeaderElection.RetryPeriod.Duration, - Callbacks: leaderelection.LeaderCallbacks{ - OnStartedLeading: run, - OnStoppedLeading: func() { - glog.Fatalf("leaderelection lost") - }, - }, - }) - - panic("unreachable") -} - -func StartControllers(s *options.CMServer, restClientCfg *restclient.Config, stopChan <-chan struct{}) error { - minimizeLatency := false - - discoveryClient := discovery.NewDiscoveryClientForConfigOrDie(restClientCfg) - serverResources, err := discoveryClient.ServerResources() - if err != nil { - glog.Fatalf("Could not find resources from API Server: %v", err) - } - - clustercontroller.StartClusterController(restClientCfg, stopChan, s.ClusterMonitorPeriod.Duration) - - if controllerEnabled(s.Controllers, serverResources, servicecontroller.ControllerName, servicecontroller.RequiredResources, true) { - if controllerEnabled(s.Controllers, serverResources, servicednscontroller.ControllerName, servicecontroller.RequiredResources, true) { - serviceDNScontrollerClientset := federationclientset.NewForConfigOrDie(restclient.AddUserAgent(restClientCfg, servicednscontroller.UserAgentName)) - serviceDNSController, err := servicednscontroller.NewServiceDNSController(serviceDNScontrollerClientset, s.DnsProvider, s.DnsConfigFile, s.FederationName, s.ServiceDnsSuffix, s.ZoneName, s.ZoneID) - if err != nil { - glog.Fatalf("Failed to start service dns controller: %v", err) - } else { - go serviceDNSController.DNSControllerRun(s.ConcurrentServiceSyncs, wait.NeverStop) - } - } - - glog.V(3).Infof("Loading client config for service controller %q", servicecontroller.UserAgentName) - scClientset := federationclientset.NewForConfigOrDie(restclient.AddUserAgent(restClientCfg, servicecontroller.UserAgentName)) - serviceController := servicecontroller.New(scClientset) - go serviceController.Run(s.ConcurrentServiceSyncs, stopChan) - } - - adapterSpecificArgs := make(map[string]interface{}) - adapterSpecificArgs[federatedtypes.HpaKind] = &s.HpaScaleForbiddenWindow - for kind, federatedType := range federatedtypes.FederatedTypes() { - if controllerEnabled(s.Controllers, serverResources, federatedType.ControllerName, federatedType.RequiredResources, true) { - synccontroller.StartFederationSyncController(kind, federatedType.AdapterFactory, restClientCfg, stopChan, minimizeLatency, adapterSpecificArgs) - } - } - - if controllerEnabled(s.Controllers, serverResources, jobcontroller.ControllerName, jobcontroller.RequiredResources, true) { - glog.V(3).Infof("Loading client config for job controller %q", jobcontroller.UserAgentName) - jobClientset := federationclientset.NewForConfigOrDie(restclient.AddUserAgent(restClientCfg, jobcontroller.UserAgentName)) - jobController := jobcontroller.NewJobController(jobClientset) - glog.V(3).Infof("Running job controller") - go jobController.Run(s.ConcurrentJobSyncs, wait.NeverStop) - } - - if controllerEnabled(s.Controllers, serverResources, ingresscontroller.ControllerName, ingresscontroller.RequiredResources, true) { - glog.V(3).Infof("Loading client config for ingress controller %q", ingresscontroller.UserAgentName) - ingClientset := federationclientset.NewForConfigOrDie(restclient.AddUserAgent(restClientCfg, ingresscontroller.UserAgentName)) - ingressController := ingresscontroller.NewIngressController(ingClientset) - glog.V(3).Infof("Running ingress controller") - ingressController.Run(stopChan) - } - - select {} -} - -func controllerEnabled(controllers utilflag.ConfigurationMap, serverResources []*metav1.APIResourceList, controller string, requiredResources []schema.GroupVersionResource, defaultValue bool) bool { - controllerConfig, ok := controllers[controller] - if ok { - if controllerConfig == "false" { - glog.Infof("%s controller disabled by config", controller) - return false - } - if controllerConfig == "true" { - if !hasRequiredResources(serverResources, requiredResources) { - glog.Fatalf("%s controller enabled explicitly but API Server does not have required resources", controller) - panic("unreachable") - } - return true - } - } else if defaultValue { - if !hasRequiredResources(serverResources, requiredResources) { - glog.Warningf("%s controller disabled because API Server does not have required resources", controller) - return false - } - } - return defaultValue -} - -func hasRequiredResources(serverResources []*metav1.APIResourceList, requiredResources []schema.GroupVersionResource) bool { - for _, resource := range requiredResources { - found := false - for _, serverResource := range serverResources { - if serverResource.GroupVersion == resource.GroupVersion().String() { - for _, apiResource := range serverResource.APIResources { - if apiResource.Name == resource.Resource { - found = true - break - } - } - } - } - if !found { - return false - } - } - return true -} - -func ensureFederationNamespace(clientset *federationclientset.Clientset, namespace string) error { - ns := v1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - Name: namespace, - Annotations: map[string]string{ - federationapi.FederationClusterSelectorAnnotation: federationapi.FederationOnlyClusterSelector, - }, - }, - } - // Probably this is the first operation by controller manager on api server. So retry the operation - // until timeout to handle scenario where api server is not yet ready. - err := wait.PollImmediate(apiserverRetryInterval, apiserverWaitTimeout, func() (bool, error) { - var err error - _, err = clientset.CoreV1().Namespaces().Get(namespace, metav1.GetOptions{}) - if err != nil { - if !errors.IsNotFound(err) { - glog.V(2).Infof("Failed to get namespace %s: %v", namespace, err) - return false, nil - } - _, err := clientset.CoreV1().Namespaces().Create(&ns) - if err != nil { - glog.V(2).Infof("Failed to create namespace %s: %v", namespace, err) - return false, nil - } - } - return true, nil - }) - return err -} diff --git a/federation/cmd/federation-controller-manager/app/controllermanager_test.go b/federation/cmd/federation-controller-manager/app/controllermanager_test.go deleted file mode 100644 index 0d44fe709d..0000000000 --- a/federation/cmd/federation-controller-manager/app/controllermanager_test.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2016 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 app - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - utilflag "k8s.io/apiserver/pkg/util/flag" - ingresscontroller "k8s.io/kubernetes/federation/pkg/federation-controller/ingress" - "testing" -) - -func TestControllerEnabled(t *testing.T) { - - testCases := []struct { - controllersConfig utilflag.ConfigurationMap - serverResources []*metav1.APIResourceList - controller string - requiredResources []schema.GroupVersionResource - defaultValue bool - expectedResult bool - }{ - // no override, API server has Ingress enabled - { - controllersConfig: utilflag.ConfigurationMap{}, - serverResources: []*metav1.APIResourceList{ - { - GroupVersion: "extensions/v1beta1", - APIResources: []metav1.APIResource{ - {Name: "ingresses", Namespaced: true, Kind: "Ingress"}, - }, - }, - }, - controller: ingresscontroller.ControllerName, - requiredResources: ingresscontroller.RequiredResources, - defaultValue: true, - expectedResult: true, - }, - // no override, API server has Ingress disabled - { - controllersConfig: utilflag.ConfigurationMap{}, - serverResources: []*metav1.APIResourceList{}, - controller: ingresscontroller.ControllerName, - requiredResources: ingresscontroller.RequiredResources, - defaultValue: true, - expectedResult: false, - }, - // API server has Ingress enabled, override config to disable Ingress controller - { - controllersConfig: utilflag.ConfigurationMap{ - ingresscontroller.ControllerName: "false", - }, - serverResources: []*metav1.APIResourceList{ - { - GroupVersion: "extensions/v1beta1", - APIResources: []metav1.APIResource{ - {Name: "ingresses", Namespaced: true, Kind: "Ingress"}, - }, - }, - }, - controller: ingresscontroller.ControllerName, - requiredResources: ingresscontroller.RequiredResources, - defaultValue: true, - expectedResult: false, - }, - } - - for _, test := range testCases { - actualEnabled := controllerEnabled(test.controllersConfig, test.serverResources, test.controller, test.requiredResources, test.defaultValue) - if actualEnabled != test.expectedResult { - t.Errorf("%s controller: expected %v, got %v", test.controller, test.expectedResult, actualEnabled) - } - } -} diff --git a/federation/cmd/federation-controller-manager/app/options/BUILD b/federation/cmd/federation-controller-manager/app/options/BUILD deleted file mode 100644 index 7794cd9365..0000000000 --- a/federation/cmd/federation-controller-manager/app/options/BUILD +++ /dev/null @@ -1,33 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["options.go"], - importpath = "k8s.io/kubernetes/federation/cmd/federation-controller-manager/app/options", - deps = [ - "//federation/pkg/dnsprovider:go_default_library", - "//pkg/apis/componentconfig:go_default_library", - "//pkg/client/leaderelectionconfig:go_default_library", - "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apiserver/pkg/util/flag:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/cmd/federation-controller-manager/app/options/options.go b/federation/cmd/federation-controller-manager/app/options/options.go deleted file mode 100644 index 470d61e605..0000000000 --- a/federation/cmd/federation-controller-manager/app/options/options.go +++ /dev/null @@ -1,152 +0,0 @@ -/* -Copyright 2016 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 options provides the flags used for the controller manager. - -package options - -import ( - "fmt" - "time" - - "github.com/spf13/pflag" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - utilflag "k8s.io/apiserver/pkg/util/flag" - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/pkg/apis/componentconfig" - "k8s.io/kubernetes/pkg/client/leaderelectionconfig" -) - -type ControllerManagerConfiguration struct { - // port is the port that the controller-manager's http service runs on. - Port int `json:"port"` - // address is the IP address to serve on (set to 0.0.0.0 for all interfaces). - Address string `json:"address"` - // federation name. - FederationName string `json:"federationName"` - // zone name, like example.com. - ZoneName string `json:"zoneName"` - // zone ID, for use when zoneName is ambiguous. - ZoneID string `json:"zoneID"` - // ServiceDnsSuffix is the dns suffix to use when publishing federated services. - ServiceDnsSuffix string `json:"serviceDnsSuffix"` - // dnsProvider is the provider for dns services. - DnsProvider string `json:"dnsProvider"` - // dnsConfigFile is the path to the dns provider configuration file. - DnsConfigFile string `json:"dnsConfigFile"` - // concurrentServiceSyncs is the number of services that are - // allowed to sync concurrently. Larger number = more responsive service - // management, but more CPU (and network) load. - ConcurrentServiceSyncs int `json:"concurrentServiceSyncs"` - // concurrentReplicaSetSyncs is the number of ReplicaSets that are - // allowed to sync concurrently. Larger number = more responsive service - // management, but more CPU (and network) load. - ConcurrentReplicaSetSyncs int `json:"concurrentReplicaSetSyncs"` - // concurrentJobSyncs is the number of Jobs that are - // allowed to sync concurrently. Larger number = more responsive service - // management, but more CPU (and network) load. - ConcurrentJobSyncs int `json:"concurrentJobSyncs"` - // clusterMonitorPeriod is the period for syncing ClusterStatus in cluster controller. - ClusterMonitorPeriod metav1.Duration `json:"clusterMonitorPeriod"` - // APIServerQPS is the QPS to use while talking with federation apiserver. - APIServerQPS float32 `json:"federatedAPIQPS"` - // APIServerBurst is the burst to use while talking with federation apiserver. - APIServerBurst int `json:"federatedAPIBurst"` - // enableProfiling enables profiling via web interface host:port/debug/pprof/ - EnableProfiling bool `json:"enableProfiling"` - // enableContentionProfiling enables lock contention profiling, if enableProfiling is true. - EnableContentionProfiling bool `json:"enableContentionProfiling"` - // leaderElection defines the configuration of leader election client. - LeaderElection componentconfig.LeaderElectionConfiguration `json:"leaderElection"` - // contentType is contentType of requests sent to apiserver. - ContentType string `json:"contentType"` - // ConfigurationMap determining which controllers should be enabled or disabled - Controllers utilflag.ConfigurationMap `json:"controllers"` - // HpaScaleForbiddenWindow is the duration used by federation hpa controller to - // determine if it can move max and/or min replicas around (or not), of a cluster local - // hpa object, by comparing current time with the last scaled time of that cluster local hpa. - // Lower value will result in faster response to scalibility conditions achieved - // by cluster local hpas on local replicas, but too low a value can result in thrashing. - // Higher values will result in slower response to scalibility conditions on local replicas. - HpaScaleForbiddenWindow metav1.Duration `json:"HpaScaleForbiddenWindow"` - // pre-configured namespace name that would be created only in federation control plane - FederationOnlyNamespace string `json:"federationOnlyNamespaceName"` -} - -// CMServer is the main context object for the controller manager. -type CMServer struct { - ControllerManagerConfiguration - Master string - Kubeconfig string -} - -const ( - // FederatedControllerManagerPort is the default port for the federation controller manager status server. - // May be overridden by a flag at startup. - FederatedControllerManagerPort = 10253 -) - -// NewCMServer creates a new CMServer with a default config. -func NewCMServer() *CMServer { - s := CMServer{ - ControllerManagerConfiguration: ControllerManagerConfiguration{ - Port: FederatedControllerManagerPort, - Address: "0.0.0.0", - ConcurrentServiceSyncs: 10, - ConcurrentReplicaSetSyncs: 10, - ClusterMonitorPeriod: metav1.Duration{Duration: 40 * time.Second}, - ConcurrentJobSyncs: 10, - APIServerQPS: 20.0, - APIServerBurst: 30, - LeaderElection: leaderelectionconfig.DefaultLeaderElectionConfiguration(), - Controllers: make(utilflag.ConfigurationMap), - HpaScaleForbiddenWindow: metav1.Duration{Duration: 2 * time.Minute}, - FederationOnlyNamespace: "federation-only", - }, - } - return &s -} - -// AddFlags adds flags for a specific CMServer to the specified FlagSet -func (s *CMServer) AddFlags(fs *pflag.FlagSet) { - fs.IntVar(&s.Port, "port", s.Port, "The port that the controller-manager's http service runs on") - fs.Var(componentconfig.IPVar{Val: &s.Address}, "address", "The IP address to serve on (set to 0.0.0.0 for all interfaces)") - fs.StringVar(&s.FederationName, "federation-name", s.FederationName, "Federation name.") - fs.StringVar(&s.ZoneName, "zone-name", s.ZoneName, "Zone name, like example.com.") - fs.StringVar(&s.ZoneID, "zone-id", s.ZoneID, "Zone ID, needed if the zone name is not unique.") - fs.StringVar(&s.ServiceDnsSuffix, "service-dns-suffix", s.ServiceDnsSuffix, "DNS Suffix to use when publishing federated service names. Defaults to zone-name") - fs.IntVar(&s.ConcurrentServiceSyncs, "concurrent-service-syncs", s.ConcurrentServiceSyncs, "The number of service syncing operations that will be done concurrently. Larger number = faster endpoint updating, but more CPU (and network) load") - fs.IntVar(&s.ConcurrentReplicaSetSyncs, "concurrent-replicaset-syncs", s.ConcurrentReplicaSetSyncs, "The number of ReplicaSets syncing operations that will be done concurrently. Larger number = faster endpoint updating, but more CPU (and network) load") - fs.IntVar(&s.ConcurrentJobSyncs, "concurrent-job-syncs", s.ConcurrentJobSyncs, "The number of Jobs syncing operations that will be done concurrently. Larger number = faster endpoint updating, but more CPU (and network) load") - fs.DurationVar(&s.ClusterMonitorPeriod.Duration, "cluster-monitor-period", s.ClusterMonitorPeriod.Duration, "The period for syncing ClusterStatus in ClusterController.") - fs.BoolVar(&s.EnableProfiling, "profiling", true, "Enable profiling via web interface host:port/debug/pprof/") - fs.BoolVar(&s.EnableContentionProfiling, "contention-profiling", false, "Enable lock contention profiling, if profiling is enabled") - fs.StringVar(&s.Master, "master", s.Master, "The address of the federation API server (overrides any value in kubeconfig)") - fs.StringVar(&s.Kubeconfig, "kubeconfig", s.Kubeconfig, "Path to kubeconfig file with authorization and master location information.") - fs.StringVar(&s.ContentType, "kube-api-content-type", s.ContentType, "ContentType of requests sent to apiserver. Passing application/vnd.kubernetes.protobuf is an experimental feature now.") - fs.Float32Var(&s.APIServerQPS, "federated-api-qps", s.APIServerQPS, "QPS to use while talking with federation apiserver") - fs.IntVar(&s.APIServerBurst, "federated-api-burst", s.APIServerBurst, "Burst to use while talking with federation apiserver") - fs.StringVar(&s.DnsProvider, "dns-provider", s.DnsProvider, "DNS provider. Valid values are: "+fmt.Sprintf("%q", dnsprovider.RegisteredDnsProviders())) - fs.StringVar(&s.DnsConfigFile, "dns-provider-config", s.DnsConfigFile, "Path to config file for configuring DNS provider.") - fs.DurationVar(&s.HpaScaleForbiddenWindow.Duration, "hpa-scale-forbidden-window", s.HpaScaleForbiddenWindow.Duration, "The time window wrt cluster local hpa lastscale time, during which federated hpa would not move the hpa max/min replicas around") - fs.Var(&s.Controllers, "controllers", ""+ - "A set of key=value pairs that describe controller configuration "+ - "to enable/disable specific controllers. Key should be the resource name (like services) and value should be true or false. "+ - "For example: services=false,ingresses=false") - fs.StringVar(&s.FederationOnlyNamespace, "federation-only-namespace", s.FederationOnlyNamespace, "Name of the namespace that would be created only in federation control plane.") - leaderelectionconfig.BindFlags(&s.LeaderElection, fs) -} diff --git a/federation/cmd/federation-controller-manager/app/plugins.go b/federation/cmd/federation-controller-manager/app/plugins.go deleted file mode 100644 index ad6e0fb1ef..0000000000 --- a/federation/cmd/federation-controller-manager/app/plugins.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2016 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 app - -// This file exists to force the desired plugin implementations to be linked. -// This should probably be part of some configuration fed into the build for a -// given binary target. -import ( - // DNS providers - _ "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/aws/route53" - _ "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/coredns" - _ "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns" -) diff --git a/federation/cmd/federation-controller-manager/controller-manager.go b/federation/cmd/federation-controller-manager/controller-manager.go deleted file mode 100644 index 69ba6f21ef..0000000000 --- a/federation/cmd/federation-controller-manager/controller-manager.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "fmt" - "os" - - "github.com/spf13/pflag" - "k8s.io/apiserver/pkg/server/healthz" - "k8s.io/apiserver/pkg/util/flag" - "k8s.io/apiserver/pkg/util/logs" - "k8s.io/kubernetes/federation/cmd/federation-controller-manager/app" - "k8s.io/kubernetes/federation/cmd/federation-controller-manager/app/options" - _ "k8s.io/kubernetes/pkg/util/reflector/prometheus" // for reflector metric registration - _ "k8s.io/kubernetes/pkg/util/workqueue/prometheus" // for workqueue metric registration - "k8s.io/kubernetes/pkg/version/verflag" -) - -func init() { - healthz.DefaultHealthz() -} - -func main() { - s := options.NewCMServer() - s.AddFlags(pflag.CommandLine) - - flag.InitFlags() - logs.InitLogs() - defer logs.FlushLogs() - - verflag.PrintAndExitIfRequested() - - if err := app.Run(s); err != nil { - fmt.Fprintf(os.Stderr, "%v\n", err) - os.Exit(1) - } -} diff --git a/federation/cmd/genfeddocs/BUILD b/federation/cmd/genfeddocs/BUILD deleted file mode 100644 index 0a537a48d5..0000000000 --- a/federation/cmd/genfeddocs/BUILD +++ /dev/null @@ -1,41 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_binary", - "go_library", -) - -go_binary( - name = "genfeddocs", - importpath = "k8s.io/kubernetes/federation/cmd/genfeddocs", - library = ":go_default_library", -) - -go_library( - name = "go_default_library", - srcs = ["gen_fed_docs.go"], - importpath = "k8s.io/kubernetes/federation/cmd/genfeddocs", - deps = [ - "//cmd/genutils:go_default_library", - "//federation/cmd/federation-apiserver/app:go_default_library", - "//federation/cmd/federation-controller-manager/app:go_default_library", - "//federation/cmd/kubefed/app:go_default_library", - "//federation/pkg/kubefed:go_default_library", - "//pkg/kubectl/cmd/util:go_default_library", - "//vendor/github.com/spf13/cobra/doc:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/cmd/genfeddocs/gen_fed_docs.go b/federation/cmd/genfeddocs/gen_fed_docs.go deleted file mode 100644 index 237120837c..0000000000 --- a/federation/cmd/genfeddocs/gen_fed_docs.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "fmt" - "os" - - "github.com/spf13/cobra/doc" - "k8s.io/kubernetes/cmd/genutils" - fedapiservapp "k8s.io/kubernetes/federation/cmd/federation-apiserver/app" - fedcmapp "k8s.io/kubernetes/federation/cmd/federation-controller-manager/app" - kubefedapp "k8s.io/kubernetes/federation/cmd/kubefed/app" - "k8s.io/kubernetes/federation/pkg/kubefed" - cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" -) - -// Note: We have a separate binary for generating federation docs and kube docs because of the way api groups are api.Registry. -// If we import both kube-apiserver and federation-apiserver in the same binary then api groups from both kube and federation will get registered in both the apiservers -// and hence will produce incorrect flag values. -// We can potentially merge cmd/kubegendocs and this when we have fixed that problem. -func main() { - // use os.Args instead of "flags" because "flags" will mess up the man pages! - path := "" - module := "" - if len(os.Args) == 3 { - path = os.Args[1] - module = os.Args[2] - } else { - fmt.Fprintf(os.Stderr, "usage: %s [output directory] [module] \n", os.Args[0]) - os.Exit(1) - } - - outDir, err := genutils.OutDir(path) - if err != nil { - fmt.Fprintf(os.Stderr, "failed to get output directory: %v\n", err) - os.Exit(1) - } - - switch module { - case "federation-apiserver": - // generate docs for federated-apiserver - apiserver := fedapiservapp.NewAPIServerCommand() - doc.GenMarkdownTree(apiserver, outDir) - case "federation-controller-manager": - // generate docs for kube-controller-manager - controllermanager := fedcmapp.NewControllerManagerCommand() - doc.GenMarkdownTree(controllermanager, outDir) - case "kubefed": - // generate docs for kubefed - kubefed := kubefed.NewKubeFedCommand(cmdutil.NewFactory(nil), os.Stdin, os.Stdout, os.Stderr, kubefedapp.GetDefaultServerImage(), kubefedapp.DefaultEtcdImage) - doc.GenMarkdownTree(kubefed, outDir) - default: - fmt.Fprintf(os.Stderr, "Module %s is not supported", module) - os.Exit(1) - } -} diff --git a/federation/cmd/kubefed/BUILD b/federation/cmd/kubefed/BUILD deleted file mode 100644 index 9a3734d932..0000000000 --- a/federation/cmd/kubefed/BUILD +++ /dev/null @@ -1,36 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_binary", - "go_library", -) - -go_binary( - name = "kubefed", - importpath = "k8s.io/kubernetes/federation/cmd/kubefed", - library = ":go_default_library", -) - -go_library( - name = "go_default_library", - srcs = ["kubefed.go"], - importpath = "k8s.io/kubernetes/federation/cmd/kubefed", - deps = ["//federation/cmd/kubefed/app:go_default_library"], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/cmd/kubefed/app:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/cmd/kubefed/app/BUILD b/federation/cmd/kubefed/app/BUILD deleted file mode 100644 index 76307bbd72..0000000000 --- a/federation/cmd/kubefed/app/BUILD +++ /dev/null @@ -1,33 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["kubefed.go"], - importpath = "k8s.io/kubernetes/federation/cmd/kubefed/app", - deps = [ - "//federation/pkg/kubefed:go_default_library", - "//pkg/client/metrics/prometheus:go_default_library", - "//pkg/kubectl/cmd/util:go_default_library", - "//pkg/kubectl/util/logs:go_default_library", - "//pkg/version:go_default_library", - "//pkg/version/prometheus:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/cmd/kubefed/app/kubefed.go b/federation/cmd/kubefed/app/kubefed.go deleted file mode 100644 index 72ccb7faca..0000000000 --- a/federation/cmd/kubefed/app/kubefed.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright 2016 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 app - -import ( - "fmt" - "os" - "strings" - - "k8s.io/kubernetes/federation/pkg/kubefed" - _ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration - cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" - "k8s.io/kubernetes/pkg/kubectl/util/logs" - "k8s.io/kubernetes/pkg/version" - _ "k8s.io/kubernetes/pkg/version/prometheus" // for version metric registration -) - -const ( - hyperkubeImageName = "gcr.io/google_containers/hyperkube-amd64" - DefaultEtcdImage = "gcr.io/google_containers/etcd:3.1.10" -) - -func GetDefaultServerImage() string { - return fmt.Sprintf("%s:%s", hyperkubeImageName, strings.Replace(version.Get().String(), "+", "_", 1)) -} - -func Run() error { - logs.InitLogs() - defer logs.FlushLogs() - - cmd := kubefed.NewKubeFedCommand(cmdutil.NewFactory(nil), os.Stdin, os.Stdout, os.Stderr, GetDefaultServerImage(), DefaultEtcdImage) - return cmd.Execute() -} diff --git a/federation/cmd/kubefed/kubefed.go b/federation/cmd/kubefed/kubefed.go deleted file mode 100644 index 72a03efc6f..0000000000 --- a/federation/cmd/kubefed/kubefed.go +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "os" - - "k8s.io/kubernetes/federation/cmd/kubefed/app" -) - -func main() { - if err := app.Run(); err != nil { - os.Exit(1) - } - os.Exit(0) -} diff --git a/federation/deploy/config.json.sample b/federation/deploy/config.json.sample deleted file mode 100644 index 9bb7e0a732..0000000000 --- a/federation/deploy/config.json.sample +++ /dev/null @@ -1,83 +0,0 @@ -[ - { - "phase1": { - "num_nodes": 3, - "cluster_name": "cluster1-kubernetes", - "cloud_provider": "gce", - "cluster_cidr": "10.180.0.0/14", - "gce": { - "os_image": "ubuntu-1604-xenial-v20160420c", - "instance_type": "n1-standard-2", - "project": "", - "region": "us-central1", - "zone": "us-central1-a", - "network": "federation" - } - }, - "phase2": { - "docker_registry": "gcr.io/google-containers", - "kubernetes_version": "v1.4.0" - }, - "phase3": { - "run_addons": true, - "kube_proxy": true, - "dashboard": true, - "heapster": true, - "kube_dns": true - } - }, - { - "phase1": { - "num_nodes": 3, - "cluster_name": "cluster2-kubernetes", - "cloud_provider": "gce", - "cluster_cidr": "10.184.0.0/14", - "gce": { - "os_image": "ubuntu-1604-xenial-v20160420c", - "instance_type": "n1-standard-2", - "project": "", - "region": "us-central1", - "zone": "us-central1-b", - "network": "federation" - } - }, - "phase2": { - "docker_registry": "gcr.io/google-containers", - "kubernetes_version": "v1.4.0" - }, - "phase3": { - "run_addons": true, - "kube_proxy": true, - "dashboard": true, - "heapster": true, - "kube_dns": true - } - }, - { - "phase1": { - "num_nodes": 3, - "cluster_name": "cluster3-kubernetes", - "cloud_provider": "gce", - "cluster_cidr": "10.188.0.0/14", - "gce": { - "os_image": "ubuntu-1604-xenial-v20160420c", - "instance_type": "n1-standard-2", - "project": "", - "region": "us-central1", - "zone": "us-central1-f", - "network": "federation" - } - }, - "phase2": { - "docker_registry": "gcr.io/google-containers", - "kubernetes_version": "v1.4.0" - }, - "phase3": { - "run_addons": true, - "kube_proxy": true, - "dashboard": true, - "heapster": true, - "kube_dns": true - } - } -] diff --git a/federation/deploy/deploy.sh b/federation/deploy/deploy.sh deleted file mode 100755 index c8e2383df8..0000000000 --- a/federation/deploy/deploy.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2016 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. - -# This script turns up/turns down Kubernetes clusters and federation -# components using the built hyperkube image. -# e.g. run as: -# FEDERATION_OUTPUT_ROOT="./_output" ./deploy.sh deploy_clusters -# -# will deploy the kubernetes clusters using the configuration specified -# in $FEDERATION_OUTPUT_ROOT/config.json. -# -# See config.json.sample for a config.json example. - -set -o errexit -set -o nounset -set -o pipefail - -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. - -# Provides the $KUBERNETES_PROVIDER variable and detect-project function -source "${KUBE_ROOT}/cluster/kube-util.sh" -# Provides logging facilities -source "${KUBE_ROOT}/cluster/lib/logging.sh" - -readonly KUBE_ANYWHERE_FEDERATION_IMAGE="gcr.io/madhusudancs-containers/kubernetes-anywhere-federation" -readonly KUBE_ANYWHERE_FEDERATION_VERSION="v0.9.0" -readonly KUBE_ANYWHERE_FEDERATION_CHARTS_IMAGE="gcr.io/madhusudancs-containers/federation-charts" -readonly KUBE_ANYWHERE_FEDERATION_CHARTS_VERSION="v0.9.1" - -readonly GOOGLE_APPLICATION_CREDENTIALS="${GOOGLE_APPLICATION_CREDENTIALS:-${HOME}/.config/gcloud/application_default_credentials.json}" -readonly KUBE_CONFIG_DIR="${KUBE_CONFIG_DIR:-${HOME}/.kube}" -readonly KUBE_CONFIG="${KUBE_CONFIG:-${HOME}/.kube/config}" - -function pull_installer() { - kube::log::status "Pulling installer images" - docker pull "${KUBE_ANYWHERE_FEDERATION_IMAGE}:${KUBE_ANYWHERE_FEDERATION_VERSION}" - docker pull "${KUBE_ANYWHERE_FEDERATION_CHARTS_IMAGE}:${KUBE_ANYWHERE_FEDERATION_CHARTS_VERSION}" -} - -function ensure_files() { - kube::log::status "Ensure provider is supported" - if [[ "${KUBERNETES_PROVIDER:-}" != "gce" && "${KUBERNETES_PROVIDER:-}" != "gke" ]]; then - echo "Supported providers: \"gce\", \"gke\"" - exit 1 - fi - - kube::log::status "Ensure credential files exist" - if [[ ! -f "${GOOGLE_APPLICATION_CREDENTIALS}" ]]; then - echo "Please ensure Google credentials file \""${GOOGLE_APPLICATION_CREDENTIALS}"\" exists." - exit 1 - fi - - if [[ ! -f "${KUBE_CONFIG}" ]]; then - echo "Please ensure kubeconfig file \""${KUBE_CONFIG}"\" exists." - exit 1 - fi -} - -function kube_action() { - : "${FEDERATION_OUTPUT_ROOT:?must be set}" - - local -r action="${1:-}" - kube::log::status "Action: ${action} clusters" - docker run \ - --user="$(id -u):$(id -g)" \ - -m 12G \ - -v "${GOOGLE_APPLICATION_CREDENTIALS}:/.config/gcloud/application_default_credentials.json:ro" \ - -v "${KUBE_CONFIG_DIR}:/.kube" \ - -v "${FEDERATION_OUTPUT_ROOT}:/_output" \ - "${KUBE_ANYWHERE_FEDERATION_IMAGE}:${KUBE_ANYWHERE_FEDERATION_VERSION}" \ - "${action}" -} - -function federation_action() { - : "${FEDERATION_OUTPUT_ROOT:?must be set}" - - local -r action="${1:-}" - kube::log::status "Action: ${action} federation components" - # For non-GKE clusters just mounting kubeconfig is sufficient. But we - # need gcloud credentials for GKE clusters, so we pass both kubeconfig - # and gcloud credentials - docker run \ - -m 12G \ - -v "${GOOGLE_APPLICATION_CREDENTIALS}:/root/.config/gcloud/application_default_credentials.json:ro" \ - -v "${KUBE_CONFIG}:/root/.kube/config" \ - -v "${FEDERATION_OUTPUT_ROOT}:/_output" \ - "${KUBE_ANYWHERE_FEDERATION_CHARTS_IMAGE}:${KUBE_ANYWHERE_FEDERATION_CHARTS_VERSION}" \ - "${action}" -} - -function redeploy_federation() { - : "${FEDERATION_OUTPUT_ROOT:?must be set}" - - local -r action="${1:-}" - kube::log::status "${action} federation components" - docker run \ - -m 12G \ - -v "${KUBE_CONFIG}:/root/.kube/config:ro" \ - -v "${FEDERATION_OUTPUT_ROOT}:/_output" \ - "${KUBE_ANYWHERE_FEDERATION_CHARTS_IMAGE}:${KUBE_ANYWHERE_FEDERATION_CHARTS_VERSION}" \ - "${action}" -} - -readonly ACTION="${1:-}" -case "${ACTION}" in - "") - echo 'Action must be one of [init, deploy_clusters, deploy_federation, \ - destroy_federation, destroy_clusters, redeploy_federation], \ - got: '"${ACTION}" - exit 1 - ;; - "init") - pull_installer - ;; - "deploy_clusters") - ensure_files - kube_action deploy - ;; - "deploy_federation") - ensure_files - federation_action deploy - ;; - "destroy_federation") - federation_action destroy - ;; - "destroy_clusters") - kube_action destroy - ;; - "redeploy_federation") - redeploy_federation - ;; -esac diff --git a/federation/develop/BUILD b/federation/develop/BUILD deleted file mode 100644 index 7e76248ad9..0000000000 --- a/federation/develop/BUILD +++ /dev/null @@ -1,14 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/develop/develop.sh b/federation/develop/develop.sh deleted file mode 100755 index 1a6859b98d..0000000000 --- a/federation/develop/develop.sh +++ /dev/null @@ -1,196 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2016 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. - -# This script will build the hyperkube image and push it to the repository -# referred to by KUBE_REGISTRY. The image will be given a version tag with -# the value from KUBE_VERSION. -# e.g. run as: -# KUBE_REGISTRY=localhost:5000/anushku \ -# KUBE_VERSION=1.3.0-dev ./build.sh build_image -# -# will build the Docker images with the specified repository name and the -# image version tag. - -set -o errexit -set -o nounset -set -o pipefail - -KUBE_ROOT="$(dirname "${BASH_SOURCE}")/../.." -DEPLOY_ROOT="${KUBE_ROOT}/federation/deploy" -CUR_ROOT="$(pwd)" - -source "${KUBE_ROOT}/build/common.sh" -source "${KUBE_ROOT}/build/util.sh" -# Provides the detect-project function -source "${KUBE_ROOT}/cluster/kube-util.sh" -# Provides logging facilities -source "${KUBE_ROOT}/cluster/lib/logging.sh" - -readonly TMP_DIR="$(mktemp -d)" -readonly FEDERATION_OUTPUT_ROOT="${LOCAL_OUTPUT_ROOT}/federation" -readonly VERSIONS_FILE="${FEDERATION_OUTPUT_ROOT}/versions" - -if [[ "${KUBERNETES_PROVIDER}" == "gke" || "${KUBERNETES_PROVIDER}" == "gce" ]]; then - detect-project - readonly KUBE_PROJECT="${KUBE_PROJECT:-${PROJECT:-}}" - readonly KUBE_REGISTRY="${KUBE_REGISTRY:-gcr.io/${KUBE_PROJECT}}" -else - readonly KUBE_PROJECT="${KUBE_PROJECT:-${PROJECT:-federation}}" - readonly KUBE_REGISTRY="${KUBE_REGISTRY:-localhost:5000/${KUBE_PROJECT}}" -fi - -# In dev environments this value must be recomputed after build. See -# the build_image() function. So not making it readonly -KUBE_VERSION="${KUBE_VERSION:-}" - - -function cleanup { - rm -rf "${TMP_DIR}" - cd "${CUR_ROOT}" -} -trap cleanup EXIT - -function dirty_sha() { - local -r index="${KUBE_ROOT}/.git/index" - local -r objects_dir="${KUBE_ROOT}/.git/objects" - - local -r tmp_dir="${TMP_DIR}/.git" - local -r tmp_index="${tmp_dir}/index" - local -r tmp_objects_dir="${tmp_dir}/objects" - - mkdir -p "${tmp_objects_dir}" - cp "${index}" "${tmp_index}" - - local -r files=$(git ls-files -m -o -d --exclude-standard) - GIT_INDEX_FILE="${tmp_index}" git add ${files} - GIT_ALTERNATE_OBJECT_DIRECTORIES="${objects_dir}" GIT_OBJECT_DIRECTORY="${tmp_objects_dir}" GIT_INDEX_FILE="${tmp_index}" git write-tree -} - -function build_binaries() { - cd "${KUBE_ROOT}" - kube::build::verify_prereqs - kube::build::build_image - kube::build::run_build_command make WHAT="cmd/kubectl cmd/hyperkube" - kube::build::copy_output -} - -function build_image() { - # Recompute KUBE_VERSION because it might have changed after rebuild. - local kube_version="" - if [[ -n "${KUBE_VERSION:-}" ]]; then - kube_version="${KUBE_VERSION}" - else - kube_version="$(kube::release::semantic_image_tag_version)" - # Also append the dirty tree SHA to keep the versions unique across - # builds. - if [[ "${kube_version}" == *-dirty ]]; then - kube_version+=".$(dirty_sha)" - fi - fi - - # Write the generated version to the output versions file so that we can - # reuse it. - mkdir -p "${FEDERATION_OUTPUT_ROOT}" - echo "{ - \"KUBE_VERSION\": \"${kube_version}\" -}" > "${VERSIONS_FILE}" - kube::log::status "Wrote to version file ${VERSIONS_FILE}: ${kube_version}" - - BASEIMAGE="ubuntu:16.04" \ - REGISTRY="${KUBE_REGISTRY}" \ - VERSION="${kube_version}" \ - make -C "${KUBE_ROOT}/cluster/images/hyperkube" build -} - -function get_version() { - local kube_version="" - if [[ -n "${KUBE_VERSION:-}" ]]; then - kube_version="${KUBE_VERSION}" - else - # Read the version back from the versions file if no version is given. - kube_version="$(cat ${VERSIONS_FILE} | python -c '\ -import json, sys;\ -print json.load(sys.stdin)["KUBE_VERSION"]')" - fi - echo "${kube_version}" -} - -function push() { - local -r kube_version="$(get_version)" - - kube::log::status "Pushing hyperkube image to the registry" - gcloud docker -- push "${KUBE_REGISTRY}/hyperkube-amd64:${kube_version}" -} - -readonly ACTION="${1:-}" -case "${ACTION}" in - "") - echo 'Action must be one of [init, build_binaries, build_image, push, \ - deploy_clusters, deploy_federation, destroy_federation, destroy_clusters \ - redeploy_federation], \ - got: '"${ACTION}" - exit 1 - ;; - "build_binaries") - build_binaries - ;; - "build_image") - build_image - ;; - "push") - push - ;; - # Following functions belong to deploy.sh, they are driven from here - # convenience during development because FEDERATION_OUTPUT_ROOT is - # already defined during development here in this script. Also, we - # execute the following commands in their own subshells to avoid them - # messing with variables in this script. - "init") - ( - "${DEPLOY_ROOT}/deploy.sh" init - ) - ;; - "deploy_clusters") - ( - export FEDERATION_OUTPUT_ROOT - "${DEPLOY_ROOT}/deploy.sh" deploy_clusters - ) - ;; - "deploy_federation") - ( - export FEDERATION_OUTPUT_ROOT - "${DEPLOY_ROOT}/deploy.sh" deploy_federation - ) - ;; - "destroy_federation") - ( - export FEDERATION_OUTPUT_ROOT - "${DEPLOY_ROOT}/deploy.sh" destroy_federation - ) - ;; - "destroy_clusters") - ( - export FEDERATION_OUTPUT_ROOT - "${DEPLOY_ROOT}/deploy.sh" destroy_clusters - ) - ;; - "redeploy_federation") - ( - export FEDERATION_OUTPUT_ROOT - "${DEPLOY_ROOT}/deploy.sh" redeploy_federation - ) - ;; -esac diff --git a/federation/develop/kubefed.sh b/federation/develop/kubefed.sh deleted file mode 100755 index 4c3caf81d2..0000000000 --- a/federation/develop/kubefed.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# Copyright 2016 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. - -set -o errexit -set -o nounset -set -o pipefail - -# "-=-=-=-=-=-=-=-=-=-=" -# This script is only for CI testing purposes. Don't use it in production. -# "-=-=-=-=-=-=-=-=-=-=" - -KUBE_ROOT=${KUBE_ROOT:-$(dirname "${BASH_SOURCE}")/../..} -source "${KUBE_ROOT}/cluster/clientbin.sh" - -# If KUBEFED_PATH isn't set, gather up the list of likely places and use ls -# to find the latest one. -if [[ -z "${KUBEFED_PATH:-}" ]]; then - kubefed=$( get_bin "kubefed" "federation/cmd/kubefed" ) - - if [[ ! -x "$kubefed" ]]; then - print_error "kubefed" - exit 1 - fi -elif [[ ! -x "${KUBEFED_PATH}" ]]; then - { - echo "KUBEFED_PATH environment variable set to '${KUBEFED_PATH}', but " - echo "this doesn't seem to be a valid executable." - } >&2 - exit 1 -fi -kubefed="${KUBEFED_PATH:-${kubefed}}" - -# Use the arguments to the script if it is set, a null string -# otherwise. -"${kubefed}" "${@+$@}" diff --git a/federation/develop/push-federation-images.sh b/federation/develop/push-federation-images.sh deleted file mode 100755 index 06c5f0821f..0000000000 --- a/federation/develop/push-federation-images.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# Copyright 2014 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. - -# Pushes federation container images to existing repositories - -set -o errexit -set -o nounset -set -o pipefail - -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. - -make -C "${KUBE_ROOT}/federation/" build_image -make -C "${KUBE_ROOT}/federation/" push diff --git a/federation/docs/api-reference/README.md b/federation/docs/api-reference/README.md deleted file mode 100644 index 7a361053ef..0000000000 --- a/federation/docs/api-reference/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# API Reference - -Federation API server supports the following group versions: - -* federation/v1beta1: [operations](https://htmlpreview.github.io/?https://github.com/kubernetes/kubernetes/blob/HEAD/federation/docs/api-reference/federation/v1beta1/operations.html), [model definitions](https://htmlpreview.github.io/?https://github.com/kubernetes/kubernetes/blob/HEAD/federation/docs/api-reference/federation/v1beta1/definitions.html) -* v1: [operations](https://htmlpreview.github.io/?https://github.com/kubernetes/kubernetes/blob/HEAD/federation/docs/api-reference/v1/operations.html), [model definitions](https://htmlpreview.github.io/?https://github.com/kubernetes/kubernetes/blob/HEAD/federation/docs/api-reference/v1/definitions.html) -* extensions/v1beta1: [operations](https://htmlpreview.github.io/?https://github.com/kubernetes/kubernetes/blob/HEAD/federation/docs/api-reference/extensions/v1beta1/operations.html), [model definitions](https://htmlpreview.github.io/?https://github.com/kubernetes/kubernetes/blob/HEAD/federation/docs/api-reference/extensions/v1beta1/definitions.html) - - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/federation/docs/api-reference/README.md?pixel)]() - diff --git a/federation/docs/api-reference/extensions/v1beta1/definitions.html b/federation/docs/api-reference/extensions/v1beta1/definitions.html deleted file mode 100755 index c88c408608..0000000000 --- a/federation/docs/api-reference/extensions/v1beta1/definitions.html +++ /dev/null @@ -1,7374 +0,0 @@ - - - - - - -Top Level API Objects - - - - -
- -
-

Definitions

-
-
-

v1beta1.DeploymentStatus

-
-

DeploymentStatus is the most recently observed status of the Deployment.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

observedGeneration

The generation observed by the deployment controller.

false

integer (int64)

replicas

Total number of non-terminated pods targeted by this deployment (their labels match the selector).

false

integer (int32)

updatedReplicas

Total number of non-terminated pods targeted by this deployment that have the desired template spec.

false

integer (int32)

readyReplicas

Total number of ready pods targeted by this deployment.

false

integer (int32)

availableReplicas

Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.

false

integer (int32)

unavailableReplicas

Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.

false

integer (int32)

conditions

Represents the latest available observations of a deployment’s current state.

false

v1beta1.DeploymentCondition array

collisionCount

Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.

false

integer (int32)

- -
-
-

v1.APIResourceList

-
-

APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

groupVersion

groupVersion is the group and version this APIResourceList is for.

true

string

resources

resources contains the name of the resources and if they are namespaced.

true

v1.APIResource array

- -
-
-

v1.Affinity

-
-

Affinity is a group of affinity scheduling rules.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

nodeAffinity

Describes node affinity scheduling rules for the pod.

false

v1.NodeAffinity

podAffinity

Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).

false

v1.PodAffinity

podAntiAffinity

Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).

false

v1.PodAntiAffinity

- -
-
-

v1beta1.DaemonSetStatus

-
-

DaemonSetStatus represents the current status of a daemon set.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

currentNumberScheduled

The number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/

true

integer (int32)

numberMisscheduled

The number of nodes that are running the daemon pod, but are not supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/

true

integer (int32)

desiredNumberScheduled

The total number of nodes that should be running the daemon pod (including nodes correctly running the daemon pod). More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/

true

integer (int32)

numberReady

The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and ready.

true

integer (int32)

observedGeneration

The most recent generation observed by the daemon set controller.

false

integer (int64)

updatedNumberScheduled

The total number of nodes that are running updated daemon pod

false

integer (int32)

numberAvailable

The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and available (ready for at least spec.minReadySeconds)

false

integer (int32)

numberUnavailable

The number of nodes that should be running the daemon pod and have none of the daemon pod running and available (ready for at least spec.minReadySeconds)

false

integer (int32)

collisionCount

Count of hash collisions for the DaemonSet. The DaemonSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision.

false

integer (int32)

- -
-
-

v1.NodeSelectorTerm

-
-

A null or empty node selector term matches no objects.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

matchExpressions

Required. A list of node selector requirements. The requirements are ANDed.

true

v1.NodeSelectorRequirement array

- -
-
-

v1.Preconditions

-
-

Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

uid

Specifies the target UID.

false

types.UID

- -
-
-

v1.ObjectFieldSelector

-
-

ObjectFieldSelector selects an APIVersioned field of an object.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

apiVersion

Version of the schema the FieldPath is written in terms of, defaults to "v1".

false

string

fieldPath

Path of the field to select in the specified API version.

true

string

- -
-
-

v1.SELinuxOptions

-
-

SELinuxOptions are the labels to be applied to the container

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

user

User is a SELinux user label that applies to the container.

false

string

role

Role is a SELinux role label that applies to the container.

false

string

type

Type is a SELinux type label that applies to the container.

false

string

level

Level is SELinux level label that applies to the container.

false

string

- -
-
-

v1beta1.IngressSpec

-
-

IngressSpec describes the Ingress the user wishes to exist.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

backend

A default backend capable of servicing requests that don’t match any rule. At least one of backend or rules must be specified. This field is optional to allow the loadbalancer controller or defaulting logic to specify a global default.

false

v1beta1.IngressBackend

tls

TLS configuration. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI.

false

v1beta1.IngressTLS array

rules

A list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend.

false

v1beta1.IngressRule array

- -
-
-

v1.VolumeMount

-
-

VolumeMount describes a mounting of a Volume within a container.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

This must match the Name of a Volume.

true

string

readOnly

Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.

false

boolean

false

mountPath

Path within the container at which the volume should be mounted. Must not contain :.

true

string

subPath

Path within the volume from which the container’s volume should be mounted. Defaults to "" (volume’s root).

false

string

mountPropagation

mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release.

false

v1.MountPropagationMode

- -
-
-

v1.MountPropagationMode

- -
-
-

v1.DownwardAPIProjection

-
-

Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

items

Items is a list of DownwardAPIVolume file

false

v1.DownwardAPIVolumeFile array

- -
-
-

v1.LabelSelector

-
-

A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

matchLabels

matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.

false

object

matchExpressions

matchExpressions is a list of label selector requirements. The requirements are ANDed.

false

v1.LabelSelectorRequirement array

- -
-
-

v1beta1.IngressBackend

-
-

IngressBackend describes all endpoints for a given service and port.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

serviceName

Specifies the name of the referenced service.

true

string

servicePort

Specifies the port of the referenced service.

true

string

- -
-
-

v1beta1.ReplicaSetList

-
-

ReplicaSetList is a collection of ReplicaSets.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

v1.ListMeta

items

List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller

true

v1beta1.ReplicaSet array

- -
-
-

v1.CephFSVolumeSource

-
-

Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

monitors

Required: Monitors is a collection of Ceph monitors More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it

true

string array

path

Optional: Used as the mounted root, rather than the full Ceph tree, default is /

false

string

user

Optional: User is the rados user name, default is admin More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it

false

string

secretFile

Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it

false

string

secretRef

Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it

false

v1.LocalObjectReference

readOnly

Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it

false

boolean

false

- -
-
-

v1beta1.IngressStatus

-
-

IngressStatus describe the current state of the Ingress.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

loadBalancer

LoadBalancer contains the current status of the load-balancer.

false

v1.LoadBalancerStatus

- -
-
-

v1.DownwardAPIVolumeSource

-
-

DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

items

Items is a list of downward API volume file

false

v1.DownwardAPIVolumeFile array

defaultMode

Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

false

integer (int32)

- -
-
-

v1beta1.ReplicaSetCondition

-
-

ReplicaSetCondition describes the state of a replica set at a certain point.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

type

Type of replica set condition.

true

string

status

Status of the condition, one of True, False, Unknown.

true

string

lastTransitionTime

The last time the condition transitioned from one status to another.

false

string

reason

The reason for the condition’s last transition.

false

string

message

A human readable message indicating details about the transition.

false

string

- -
-
-

v1.GCEPersistentDiskVolumeSource

-
-

Represents a Persistent Disk resource in Google Compute Engine.

-
-
-

A GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

pdName

Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk

true

string

fsType

Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk

false

string

partition

The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk

false

integer (int32)

readOnly

ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk

false

boolean

false

- -
-
-

v1beta1.RollingUpdateDeployment

-
-

Spec to control the desired behavior of rolling update.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

maxUnavailable

The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. By default, a fixed value of 1 is used. Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old RC can be scaled down further, followed by scaling up the new RC, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods.

false

string

maxSurge

The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. By default, a value of 1 is used. Example: when this is set to 30%, the new RC can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new RC can be scaled up further, ensuring that total number of pods running at any time during the update is atmost 130% of desired pods.

false

string

- -
-
-

v1beta1.HTTPIngressRuleValue

-
-

HTTPIngressRuleValue is a list of http selectors pointing to backends. In the example: http://<host>/<path>?<searchpart> → backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last / and before the first ? or #.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

paths

A collection of paths that map requests to backends.

true

v1beta1.HTTPIngressPath array

- -
-
-

v1.ConfigMapVolumeSource

-
-

Adapts a ConfigMap into a volume.

-
-
-

The contents of the target ConfigMap’s Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

false

string

items

If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the .. path or start with ...

false

v1.KeyToPath array

defaultMode

Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

false

integer (int32)

optional

Specify whether the ConfigMap or it’s keys must be defined

false

boolean

false

- -
-
-

v1.GitRepoVolumeSource

-
-

Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

repository

Repository URL

true

string

revision

Commit hash for the specified revision.

false

string

directory

Target directory name. Must not contain or start with ... If . is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.

false

string

- -
-
-

v1.SecretEnvSource

-
-

SecretEnvSource selects a Secret to populate the environment variables with.

-
-
-

The contents of the target Secret’s Data field will represent the key-value pairs as environment variables.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

false

string

optional

Specify whether the Secret must be defined

false

boolean

false

- -
-
-

v1.PortworxVolumeSource

-
-

PortworxVolumeSource represents a Portworx volume resource.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

volumeID

VolumeID uniquely identifies a Portworx volume

true

string

fsType

FSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified.

false

string

readOnly

Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

false

boolean

false

- -
-
-

v1.Capabilities

-
-

Adds and removes POSIX capabilities from running containers.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

add

Added capabilities

false

v1.Capability array

drop

Removed capabilities

false

v1.Capability array

- -
-
-

v1.Initializer

-
-

Initializer is information about an initializer that has not yet completed.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

name of the process that is responsible for initializing this object.

true

string

- -
-
-

v1.LocalObjectReference

-
-

LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

false

string

- -
-
-

v1.ProjectedVolumeSource

-
-

Represents a projected volume source

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

sources

list of volume projections

true

v1.VolumeProjection array

defaultMode

Mode bits to use on created files by default. Must be a value between 0 and 0777. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

false

integer (int32)

- -
-
-

v1.ExecAction

-
-

ExecAction describes a "run in container" action.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

command

Command is the command line to execute inside the container, the working directory for the command is root (/) in the container’s filesystem. The command is simply exec’d, it is not run inside a shell, so traditional shell instructions ('

', etc) won’t work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.

false

string array

- -
-
-

v1beta1.RollingUpdateDaemonSet

-
-

Spec to control the desired behavior of daemon set rolling update.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

maxUnavailable

The maximum number of DaemonSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of DaemonSet pods at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding up. This cannot be 0. Default value is 1. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their pods stopped for an update at any given time. The update starts by stopping at most 30% of those DaemonSet pods and then brings up new DaemonSet pods in their place. Once the new pods are available, it then proceeds onto other DaemonSet pods, thus ensuring that at least 70% of original number of DaemonSet pods are available at all times during the update.

false

string

- -
-
-

v1.ObjectMeta

-
-

ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names

false

string

generateName

GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.
-
-If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).
-
-Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency

false

string

namespace

Namespace defines the space within each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.
-
-Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces

false

string

selfLink

SelfLink is a URL representing this object. Populated by the system. Read-only.

false

string

uid

UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.
-
-Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids

false

string

resourceVersion

An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.
-
-Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency

false

string

generation

A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.

false

integer (int64)

creationTimestamp

CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.
-
-Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

string

deletionTimestamp

DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field. Once set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.
-
-Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

string

deletionGracePeriodSeconds

Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.

false

integer (int64)

labels

Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels

false

object

annotations

Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations

false

object

ownerReferences

List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.

false

v1.OwnerReference array

initializers

An initializer is a controller which enforces some system invariant at object creation time. This field is a list of initializers that have not yet acted on this object. If nil or empty, this object has been completely initialized. Otherwise, the object is considered uninitialized and is hidden (in list/watch and get calls) from clients that haven’t explicitly asked to observe uninitialized objects.
-
-When an object is created, the system will populate this list with the current set of initializers. Only privileged users may set or modify this list. Once it is empty, it may not be modified further by any user.

false

v1.Initializers

finalizers

Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed.

false

string array

clusterName

The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.

false

string

- -
-
-

v1beta1.ReplicaSetSpec

-
-

ReplicaSetSpec is the specification of a ReplicaSet.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

replicas

Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller

false

integer (int32)

minReadySeconds

Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)

false

integer (int32)

selector

Selector is a label query over pods that should match the replica count. If the selector is empty, it is defaulted to the labels present on the pod template. Label keys and values that must match in order to be controlled by this replica set. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors

false

v1.LabelSelector

template

Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template

false

v1.PodTemplateSpec

- -
-
-

v1beta1.Deployment

-
-

DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard object metadata.

false

v1.ObjectMeta

spec

Specification of the desired behavior of the Deployment.

false

v1beta1.DeploymentSpec

status

Most recently observed status of the Deployment.

false

v1beta1.DeploymentStatus

- -
-
-

v1beta1.DaemonSetSpec

-
-

DaemonSetSpec is the specification of a daemon set.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

selector

A label query over pods that are managed by the daemon set. Must match in order to be controlled. If empty, defaulted to labels on Pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors

false

v1.LabelSelector

template

An object that describes the pod that will be created. The DaemonSet will create exactly one copy of this pod on every node that matches the template’s node selector (or on every node if no node selector is specified). More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template

true

v1.PodTemplateSpec

updateStrategy

An update strategy to replace existing DaemonSet pods with new pods.

false

v1beta1.DaemonSetUpdateStrategy

minReadySeconds

The minimum number of seconds for which a newly created DaemonSet pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready).

false

integer (int32)

templateGeneration

DEPRECATED. A sequence number representing a specific generation of the template. Populated by the system. It can be set only during the creation.

false

integer (int64)

revisionHistoryLimit

The number of old history to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10.

false

integer (int32)

- -
-
-

types.UID

- -
-
-

v1.AzureFileVolumeSource

-
-

AzureFile represents an Azure File Service mount on the host and bind mount to the pod.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

secretName

the name of secret that contains Azure Storage Account Name and Key

true

string

shareName

Share Name

true

string

readOnly

Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

false

boolean

false

- -
-
-

v1.ISCSIVolumeSource

-
-

Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

targetPortal

iSCSI target portal. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).

true

string

iqn

Target iSCSI Qualified Name.

true

string

lun

iSCSI target lun number.

true

integer (int32)

iscsiInterface

Optional: Defaults to default (tcp). iSCSI interface name that uses an iSCSI transport.

false

string

fsType

Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi

false

string

readOnly

ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.

false

boolean

false

portals

iSCSI target portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).

false

string array

chapAuthDiscovery

whether support iSCSI Discovery CHAP authentication

false

boolean

false

chapAuthSession

whether support iSCSI Session CHAP authentication

false

boolean

false

secretRef

CHAP secret for iSCSI target and initiator authentication

false

v1.LocalObjectReference

initiatorName

Custom iSCSI initiator name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface <target portal>:<volume name> will be created for the connection.

false

string

- -
-
-

v1beta1.IngressList

-
-

IngressList is a collection of Ingress.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

v1.ListMeta

items

Items is the list of Ingress.

true

v1beta1.Ingress array

- -
-
-

v1.EmptyDirVolumeSource

-
-

Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

medium

What type of storage medium should back this directory. The default is "" which means to use the node’s default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir

false

string

sizeLimit

Total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir

false

string

- -
-
-

v1beta1.ScaleSpec

-
-

describes the attributes of a scale subresource

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

replicas

desired number of instances for the scaled object.

false

integer (int32)

- -
-
-

v1.PodAffinityTerm

-
-

Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key <topologyKey> matches that of any node on which a pod of the set of pods is running

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

labelSelector

A label query over a set of resources, in this case pods.

false

v1.LabelSelector

namespaces

namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means "this pod’s namespace"

false

string array

topologyKey

This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. For PreferredDuringScheduling pod anti-affinity, empty topologyKey is interpreted as "all topologies" ("all topologies" here means all the topologyKeys indicated by scheduler command-line argument --failure-domains); for affinity and for RequiredDuringScheduling pod anti-affinity, empty topologyKey is not allowed.

false

string

- -
-
-

v1.EnvFromSource

-
-

EnvFromSource represents the source of a set of ConfigMaps

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

prefix

An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.

false

string

configMapRef

The ConfigMap to select from

false

v1.ConfigMapEnvSource

secretRef

The Secret to select from

false

v1.SecretEnvSource

- -
-
-

v1.PodAffinity

-
-

Pod affinity is a group of inter pod affinity scheduling rules.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

requiredDuringSchedulingIgnoredDuringExecution

If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.

false

v1.PodAffinityTerm array

preferredDuringSchedulingIgnoredDuringExecution

The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.

false

v1.WeightedPodAffinityTerm array

- -
-
-

v1.FlockerVolumeSource

-
-

Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

datasetName

Name of the dataset stored as metadata → name on the dataset for Flocker should be considered as deprecated

false

string

datasetUUID

UUID of the dataset. This is unique identifier of a Flocker dataset

false

string

- -
-
-

v1.PersistentVolumeClaimVolumeSource

-
-

PersistentVolumeClaimVolumeSource references the user’s PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

claimName

ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims

true

string

readOnly

Will force the ReadOnly setting in VolumeMounts. Default false.

false

boolean

false

- -
-
-

v1.ListMeta

-
-

ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

selfLink

selfLink is a URL representing this object. Populated by the system. Read-only.

false

string

resourceVersion

String that identifies the server’s internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency

false

string

continue

continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response.

false

string

- -
-
-

v1beta1.RollbackConfig

-
-

DEPRECATED.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

revision

The revision to rollback to. If set to 0, rollback to the last revision.

false

integer (int64)

- -
-
-

v1.SecretVolumeSource

-
-

Adapts a Secret into a volume.

-
-
-

The contents of the target Secret’s Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

secretName

Name of the secret in the pod’s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret

false

string

items

If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the .. path or start with ...

false

v1.KeyToPath array

defaultMode

Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

false

integer (int32)

optional

Specify whether the Secret or it’s keys must be defined

false

boolean

false

- -
-
-

v1.FlexVolumeSource

-
-

FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

driver

Driver is the name of the driver to use for this volume.

true

string

fsType

Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script.

false

string

secretRef

Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.

false

v1.LocalObjectReference

readOnly

Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

false

boolean

false

options

Optional: Extra command options if any.

false

object

- -
-
-

v1.EnvVarSource

-
-

EnvVarSource represents a source for the value of an EnvVar.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

fieldRef

Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP.

false

v1.ObjectFieldSelector

resourceFieldRef

Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.

false

v1.ResourceFieldSelector

configMapKeyRef

Selects a key of a ConfigMap.

false

v1.ConfigMapKeySelector

secretKeyRef

Selects a key of a secret in the pod’s namespace

false

v1.SecretKeySelector

- -
-
-

v1.LoadBalancerIngress

-
-

LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

ip

IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)

false

string

hostname

Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers)

false

string

- -
-
-

v1.AzureDiskVolumeSource

-
-

AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

diskName

The Name of the data disk in the blob storage

true

string

diskURI

The URI the data disk in the blob storage

true

string

cachingMode

Host Caching mode: None, Read Only, Read Write.

false

v1.AzureDataDiskCachingMode

fsType

Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.

false

string

readOnly

Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

false

boolean

false

kind

Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared

false

v1.AzureDataDiskKind

- -
-
-

v1.KeyToPath

-
-

Maps a string key to a path within a volume.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

key

The key to project.

true

string

path

The relative path of the file to map the key to. May not be an absolute path. May not contain the path element ... May not start with the string ...

true

string

mode

Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

false

integer (int32)

- -
-
-

v1beta1.DaemonSetUpdateStrategy

- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

type

Type of daemon set update. Can be "RollingUpdate" or "OnDelete". Default is OnDelete.

false

string

rollingUpdate

Rolling update config params. Present only if type = "RollingUpdate".

false

v1beta1.RollingUpdateDaemonSet

- -
-
-

v1.VsphereVirtualDiskVolumeSource

-
-

Represents a vSphere volume resource.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

volumePath

Path that identifies vSphere volume vmdk

true

string

fsType

Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.

false

string

storagePolicyName

Storage Policy Based Management (SPBM) profile name.

false

string

storagePolicyID

Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.

false

string

- -
-
-

v1.DeleteOptions

-
-

DeleteOptions may be provided when deleting an API object.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

gracePeriodSeconds

The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.

false

integer (int64)

preconditions

Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.

false

v1.Preconditions

orphanDependents

Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object’s finalizers list. Either this field or PropagationPolicy may be set, but not both.

false

boolean

false

propagationPolicy

Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

false

v1.DeletionPropagation

- -
-
-

v1beta1.DaemonSetList

-
-

DaemonSetList is a collection of daemon sets.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

v1.ListMeta

items

A list of daemon sets.

true

v1beta1.DaemonSet array

- -
-
-

v1.Volume

-
-

Volume represents a named volume in a pod that may be accessed by any container in the pod.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Volume’s name. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

true

string

hostPath

HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath

false

v1.HostPathVolumeSource

emptyDir

EmptyDir represents a temporary directory that shares a pod’s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir

false

v1.EmptyDirVolumeSource

gcePersistentDisk

GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet’s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk

false

v1.GCEPersistentDiskVolumeSource

awsElasticBlockStore

AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet’s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore

false

v1.AWSElasticBlockStoreVolumeSource

gitRepo

GitRepo represents a git repository at a particular revision.

false

v1.GitRepoVolumeSource

secret

Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret

false

v1.SecretVolumeSource

nfs

NFS represents an NFS mount on the host that shares a pod’s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs

false

v1.NFSVolumeSource

iscsi

ISCSI represents an ISCSI Disk resource that is attached to a kubelet’s host machine and then exposed to the pod. More info: https://releases.k8s.io/HEAD/examples/volumes/iscsi/README.md

false

v1.ISCSIVolumeSource

glusterfs

Glusterfs represents a Glusterfs mount on the host that shares a pod’s lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md

false

v1.GlusterfsVolumeSource

persistentVolumeClaim

PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims

false

v1.PersistentVolumeClaimVolumeSource

rbd

RBD represents a Rados Block Device mount on the host that shares a pod’s lifetime. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md

false

v1.RBDVolumeSource

flexVolume

FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. This is an alpha feature and may change in future.

false

v1.FlexVolumeSource

cinder

Cinder represents a cinder volume attached and mounted on kubelets host machine More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md

false

v1.CinderVolumeSource

cephfs

CephFS represents a Ceph FS mount on the host that shares a pod’s lifetime

false

v1.CephFSVolumeSource

flocker

Flocker represents a Flocker volume attached to a kubelet’s host machine. This depends on the Flocker control service being running

false

v1.FlockerVolumeSource

downwardAPI

DownwardAPI represents downward API about the pod that should populate this volume

false

v1.DownwardAPIVolumeSource

fc

FC represents a Fibre Channel resource that is attached to a kubelet’s host machine and then exposed to the pod.

false

v1.FCVolumeSource

azureFile

AzureFile represents an Azure File Service mount on the host and bind mount to the pod.

false

v1.AzureFileVolumeSource

configMap

ConfigMap represents a configMap that should populate this volume

false

v1.ConfigMapVolumeSource

vsphereVolume

VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine

false

v1.VsphereVirtualDiskVolumeSource

quobyte

Quobyte represents a Quobyte mount on the host that shares a pod’s lifetime

false

v1.QuobyteVolumeSource

azureDisk

AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.

false

v1.AzureDiskVolumeSource

photonPersistentDisk

PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine

false

v1.PhotonPersistentDiskVolumeSource

projected

Items for all in one resources secrets, configmaps, and downward API

false

v1.ProjectedVolumeSource

portworxVolume

PortworxVolume represents a portworx volume attached and mounted on kubelets host machine

false

v1.PortworxVolumeSource

scaleIO

ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.

false

v1.ScaleIOVolumeSource

storageos

StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.

false

v1.StorageOSVolumeSource

- -
-
-

v1.ResourceFieldSelector

-
-

ResourceFieldSelector represents container resources (cpu, memory) and their output format

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

containerName

Container name: required for volumes, optional for env vars

false

string

resource

Required: resource to select

true

string

divisor

Specifies the output format of the exposed resources, defaults to "1"

false

string

- -
-
-

v1.VolumeProjection

-
-

Projection that may be projected along with other supported volume types

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

secret

information about the secret data to project

false

v1.SecretProjection

downwardAPI

information about the downwardAPI data to project

false

v1.DownwardAPIProjection

configMap

information about the configMap data to project

false

v1.ConfigMapProjection

- -
-
-

v1.Probe

-
-

Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

exec

One and only one of the following should be specified. Exec specifies the action to take.

false

v1.ExecAction

httpGet

HTTPGet specifies the http request to perform.

false

v1.HTTPGetAction

tcpSocket

TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported

false

v1.TCPSocketAction

initialDelaySeconds

Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes

false

integer (int32)

timeoutSeconds

Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes

false

integer (int32)

periodSeconds

How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.

false

integer (int32)

successThreshold

Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness. Minimum value is 1.

false

integer (int32)

failureThreshold

Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.

false

integer (int32)

- -
-
-

v1.WeightedPodAffinityTerm

-
-

The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

weight

weight associated with matching the corresponding podAffinityTerm, in the range 1-100.

true

integer (int32)

podAffinityTerm

Required. A pod affinity term, associated with the corresponding weight.

true

v1.PodAffinityTerm

- -
-
-

v1beta1.DeploymentSpec

-
-

DeploymentSpec is the specification of the desired behavior of the Deployment.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

replicas

Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.

false

integer (int32)

selector

Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment.

false

v1.LabelSelector

template

Template describes the pods that will be created.

true

v1.PodTemplateSpec

strategy

The deployment strategy to use to replace existing pods with new ones.

false

v1beta1.DeploymentStrategy

minReadySeconds

Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)

false

integer (int32)

revisionHistoryLimit

The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified.

false

integer (int32)

paused

Indicates that the deployment is paused and will not be processed by the deployment controller.

false

boolean

false

rollbackTo

DEPRECATED. The config this deployment is rolling back to. Will be cleared after rollback is done.

false

v1beta1.RollbackConfig

progressDeadlineSeconds

The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. This is not set by default.

false

integer (int32)

- -
-
-

v1.SecretKeySelector

-
-

SecretKeySelector selects a key of a Secret.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

false

string

key

The key of the secret to select from. Must be a valid secret key.

true

string

optional

Specify whether the Secret or it’s key must be defined

false

boolean

false

- -
-
-

v1.Capability

- -
-
-

v1.DownwardAPIVolumeFile

-
-

DownwardAPIVolumeFile represents information to create the file containing the pod field

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

path

Required: Path is the relative path name of the file to be created. Must not be absolute or contain the .. path. Must be utf-8 encoded. The first item of the relative path must not start with ..

true

string

fieldRef

Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.

false

v1.ObjectFieldSelector

resourceFieldRef

Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.

false

v1.ResourceFieldSelector

mode

Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

false

integer (int32)

- -
-
-

v1.PodSpec

-
-

PodSpec is a description of a pod.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

volumes

List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes

false

v1.Volume array

initContainers

List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, or Liveness probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/

false

v1.Container array

containers

List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.

true

v1.Container array

restartPolicy

Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy

false

string

terminationGracePeriodSeconds

Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.

false

integer (int64)

activeDeadlineSeconds

Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.

false

integer (int64)

dnsPolicy

Set DNS policy for containers within the pod. One of ClusterFirstWithHostNet, ClusterFirst or Default. Defaults to "ClusterFirst". To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to ClusterFirstWithHostNet.

false

string

nodeSelector

NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node’s labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/

false

object

serviceAccountName

ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/

false

string

serviceAccount

DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.

false

string

automountServiceAccountToken

AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.

false

boolean

false

nodeName

NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.

false

string

hostNetwork

Host networking requested for this pod. Use the host’s network namespace. If this option is set, the ports that will be used must be specified. Default to false.

false

boolean

false

hostPID

Use the host’s pid namespace. Optional: Default to false.

false

boolean

false

hostIPC

Use the host’s ipc namespace. Optional: Default to false.

false

boolean

false

securityContext

SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.

false

v1.PodSecurityContext

imagePullSecrets

ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod

false

v1.LocalObjectReference array

hostname

Specifies the hostname of the Pod If not specified, the pod’s hostname will be set to a system-defined value.

false

string

subdomain

If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>". If not specified, the pod will not have a domainname at all.

false

string

affinity

If specified, the pod’s scheduling constraints

false

v1.Affinity

schedulerName

If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.

false

string

tolerations

If specified, the pod’s tolerations.

false

v1.Toleration array

hostAliases

HostAliases is an optional list of hosts and IPs that will be injected into the pod’s hosts file if specified. This is only valid for non-hostNetwork pods.

false

v1.HostAlias array

priorityClassName

If specified, indicates the pod’s priority. "SYSTEM" is a special keyword which indicates the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.

false

string

priority

The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.

false

integer (int32)

- -
-
-

v1.ContainerPort

-
-

ContainerPort represents a network port in a single container.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.

false

string

hostPort

Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.

false

integer (int32)

containerPort

Number of port to expose on the pod’s IP address. This must be a valid port number, 0 < x < 65536.

true

integer (int32)

protocol

Protocol for port. Must be UDP or TCP. Defaults to "TCP".

false

string

hostIP

What host IP to bind the external port to.

false

string

- -
-
-

v1.Lifecycle

-
-

Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

postStart

PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks

false

v1.Handler

preStop

PreStop is called immediately before a container is terminated. The container is terminated after the handler completes. The reason for termination is passed to the handler. Regardless of the outcome of the handler, the container is eventually terminated. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks

false

v1.Handler

- -
-
-

v1.GlusterfsVolumeSource

-
-

Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

endpoints

EndpointsName is the endpoint name that details Glusterfs topology. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod

true

string

path

Path is the Glusterfs volume path. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod

true

string

readOnly

ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod

false

boolean

false

- -
-
-

v1.Handler

-
-

Handler defines a specific action that should be taken

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

exec

One and only one of the following should be specified. Exec specifies the action to take.

false

v1.ExecAction

httpGet

HTTPGet specifies the http request to perform.

false

v1.HTTPGetAction

tcpSocket

TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported

false

v1.TCPSocketAction

- -
-
-

v1.Toleration

-
-

The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

key

Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.

false

string

operator

Operator represents a key’s relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.

false

string

value

Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.

false

string

effect

Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.

false

string

tolerationSeconds

TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.

false

integer (int64)

- -
-
-

v1beta1.IngressTLS

-
-

IngressTLS describes the transport layer security associated with an Ingress.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

hosts

Hosts are a list of hosts included in the TLS certificate. The values in this list must match the name/s used in the tlsSecret. Defaults to the wildcard host setting for the loadbalancer controller fulfilling this Ingress, if left unspecified.

false

string array

secretName

SecretName is the name of the secret used to terminate SSL traffic on 443. Field is left optional to allow SSL routing based on SNI hostname alone. If the SNI host in a listener conflicts with the "Host" header field used by an IngressRule, the SNI host is used for termination and value of the Host header is used for routing.

false

string

- -
-
-

v1.StatusCause

-
-

StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

reason

A machine-readable description of the cause of the error. If this value is empty there is no information available.

false

string

message

A human-readable description of the cause of the error. This field may be presented as-is to a reader.

false

string

field

The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.
-
-Examples:
- "name" - the field "name" on the current resource
- "items[0].name" - the field "name" on the first array entry in "items"

false

string

- -
-
-

v1beta1.Scale

-
-

represents a scaling request for a resource.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.

false

v1.ObjectMeta

spec

defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.

false

v1beta1.ScaleSpec

status

current status of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status. Read-only.

false

v1beta1.ScaleStatus

- -
-
-

v1.RBDVolumeSource

-
-

Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

monitors

A collection of Ceph monitors. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it

true

string array

image

The rados image name. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it

true

string

fsType

Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd

false

string

pool

The rados pool name. Default is rbd. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it

false

string

user

The rados user name. Default is admin. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it

false

string

keyring

Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it

false

string

secretRef

SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it

false

v1.LocalObjectReference

readOnly

ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it

false

boolean

false

- -
-
-

v1.ConfigMapProjection

-
-

Adapts a ConfigMap into a projected volume.

-
-
-

The contents of the target ConfigMap’s Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

false

string

items

If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the .. path or start with ...

false

v1.KeyToPath array

optional

Specify whether the ConfigMap or it’s keys must be defined

false

boolean

false

- -
-
-

v1.PhotonPersistentDiskVolumeSource

-
-

Represents a Photon Controller persistent disk resource.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

pdID

ID that identifies Photon Controller persistent disk

true

string

fsType

Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.

false

string

- -
-
-

v1.ScaleIOVolumeSource

-
-

ScaleIOVolumeSource represents a persistent ScaleIO volume

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

gateway

The host address of the ScaleIO API Gateway.

true

string

system

The name of the storage system as configured in ScaleIO.

true

string

secretRef

SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.

true

v1.LocalObjectReference

sslEnabled

Flag to enable/disable SSL communication with Gateway, default false

false

boolean

false

protectionDomain

The name of the ScaleIO Protection Domain for the configured storage.

false

string

storagePool

The ScaleIO Storage Pool associated with the protection domain.

false

string

storageMode

Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.

false

string

volumeName

The name of a volume already created in the ScaleIO system that is associated with this volume source.

false

string

fsType

Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.

false

string

readOnly

Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

false

boolean

false

- -
-
-

v1.HostPathType

- -
-
-

v1.Initializers

-
-

Initializers tracks the progress of initialization.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

pending

Pending is a list of initializers that must execute in order before this object is visible. When the last pending initializer is removed, and no failing result is set, the initializers struct will be set to nil and the object is considered as initialized and visible to all clients.

true

v1.Initializer array

result

If result is set with the Failure field, the object will be persisted to storage and then deleted, ensuring that other clients can observe the deletion.

false

v1.Status

- -
-
-

v1.Status

-
-

Status is a return value for calls that don’t return other objects.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

v1.ListMeta

status

Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status

false

string

message

A human-readable description of the status of this operation.

false

string

reason

A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.

false

string

details

Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.

false

v1.StatusDetails

code

Suggested HTTP return code for this status, 0 if not set.

false

integer (int32)

- -
-
-

v1beta1.ScaleStatus

-
-

represents the current status of a scale subresource.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

replicas

actual number of observed instances of the scaled object.

true

integer (int32)

selector

label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors

false

object

targetSelector

label selector for pods that should match the replicas count. This is a serializated version of both map-based and more expressive set-based selectors. This is done to avoid introspection in the clients. The string will be in the same format as the query-param syntax. If the target type only supports map-based selectors, both this field and map-based selector field are populated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors

false

string

- -
-
-

v1.NFSVolumeSource

-
-

Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

server

Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs

true

string

path

Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs

true

string

readOnly

ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs

false

boolean

false

- -
-
-

v1beta1.DeploymentList

-
-

DeploymentList is a list of Deployments.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard list metadata.

false

v1.ListMeta

items

Items is the list of Deployments.

true

v1beta1.Deployment array

- -
-
-

v1beta1.DeploymentRollback

-
-

DEPRECATED. DeploymentRollback stores the information required to rollback a deployment.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

name

Required: This must match the Name of a deployment.

true

string

updatedAnnotations

The annotations to be updated to a deployment

false

object

rollbackTo

The config of this deployment rollback.

true

v1beta1.RollbackConfig

- -
-
-

v1.HTTPHeader

-
-

HTTPHeader describes a custom header to be used in HTTP probes

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

The header field name

true

string

value

The header field value

true

string

- -
-
-

v1.FCVolumeSource

-
-

Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

targetWWNs

Optional: FC target worldwide names (WWNs)

false

string array

lun

Optional: FC target lun number

false

integer (int32)

fsType

Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.

false

string

readOnly

Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

false

boolean

false

wwids

Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.

false

string array

- -
-
-

v1.PodAntiAffinity

-
-

Pod anti affinity is a group of inter pod anti affinity scheduling rules.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

requiredDuringSchedulingIgnoredDuringExecution

If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.

false

v1.PodAffinityTerm array

preferredDuringSchedulingIgnoredDuringExecution

The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.

false

v1.WeightedPodAffinityTerm array

- -
-
-

v1.DeletionPropagation

- -
-
-

v1beta1.DeploymentStrategy

-
-

DeploymentStrategy describes how to replace existing pods with new ones.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

type

Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.

false

string

rollingUpdate

Rolling update config params. Present only if DeploymentStrategyType = RollingUpdate.

false

v1beta1.RollingUpdateDeployment

- -
-
-

v1.TCPSocketAction

-
-

TCPSocketAction describes an action based on opening a socket

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

port

Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.

true

string

host

Optional: Host name to connect to, defaults to the pod IP.

false

string

- -
-
-

v1beta1.IngressRule

-
-

IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

host

Host is the fully qualified domain name of a network host, as defined by RFC 3986. Note the following deviations from the "host" part of the URI as defined in the RFC: 1. IPs are not allowed. Currently an IngressRuleValue can only apply to the
- IP in the Spec of the parent Ingress.
-2. The : delimiter is not respected because ports are not allowed.
- Currently the port of an Ingress is implicitly :80 for http and
- :443 for https.
-Both these may change in the future. Incoming requests are matched against the host before the IngressRuleValue. If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue.

false

string

http

false

v1beta1.HTTPIngressRuleValue

- -
-
-

v1.HTTPGetAction

-
-

HTTPGetAction describes an action based on HTTP Get requests.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

path

Path to access on the HTTP server.

false

string

port

Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.

true

string

host

Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead.

false

string

scheme

Scheme to use for connecting to the host. Defaults to HTTP.

false

string

httpHeaders

Custom headers to set in the request. HTTP allows repeated headers.

false

v1.HTTPHeader array

- -
-
-

v1.StatusDetails

-
-

StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).

false

string

group

The group attribute of the resource associated with the status StatusReason.

false

string

kind

The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

uid

UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids

false

string

causes

The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.

false

v1.StatusCause array

retryAfterSeconds

If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.

false

integer (int32)

- -
-
-

v1.LoadBalancerStatus

-
-

LoadBalancerStatus represents the status of a load-balancer.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

ingress

Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points.

false

v1.LoadBalancerIngress array

- -
-
-

v1.Container

-
-

A single application container that you want to run within a pod.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.

true

string

image

Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.

false

string

command

Entrypoint array. Not executed within a shell. The docker image’s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container’s environment. 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. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell

false

string array

args

Arguments to the entrypoint. The docker image’s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container’s environment. 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. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell

false

string array

workingDir

Container’s working directory. If not specified, the container runtime’s default will be used, which might be configured in the container image. Cannot be updated.

false

string

ports

List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default "0.0.0.0" address inside a container will be accessible from the network. Cannot be updated.

false

v1.ContainerPort array

envFrom

List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.

false

v1.EnvFromSource array

env

List of environment variables to set in the container. Cannot be updated.

false

v1.EnvVar array

resources

Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources

false

v1.ResourceRequirements

volumeMounts

Pod volumes to mount into the container’s filesystem. Cannot be updated.

false

v1.VolumeMount array

livenessProbe

Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes

false

v1.Probe

readinessProbe

Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes

false

v1.Probe

lifecycle

Actions that the management system should take in response to container lifecycle events. Cannot be updated.

false

v1.Lifecycle

terminationMessagePath

Optional: Path at which the file to which the container’s termination message will be written is mounted into the container’s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.

false

string

terminationMessagePolicy

Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.

false

string

imagePullPolicy

Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images

false

string

securityContext

Security options the pod should run with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/

false

v1.SecurityContext

stdin

Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.

false

boolean

false

stdinOnce

Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false

false

boolean

false

tty

Whether this container should allocate a TTY for itself, also requires stdin to be true. Default is false.

false

boolean

false

- -
-
-

v1.PodSecurityContext

-
-

PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

seLinuxOptions

The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.

false

v1.SELinuxOptions

runAsUser

The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.

false

integer (int64)

runAsNonRoot

Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

false

boolean

false

supplementalGroups

A list of groups applied to the first process run in each container, in addition to the container’s primary GID. If unspecified, no groups will be added to any container.

false

integer (int32) array

fsGroup

A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:
-
-1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR’d with rw-rw

false

integer (int64)

- -
-
-

v1.OwnerReference

-
-

OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

apiVersion

API version of the referent.

true

string

kind

Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

true

string

name

Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names

true

string

uid

UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids

true

string

controller

If true, this reference points to the managing controller.

false

boolean

false

blockOwnerDeletion

If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.

false

boolean

false

- -
-
-

v1beta1.ReplicaSetStatus

-
-

ReplicaSetStatus represents the current status of a ReplicaSet.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

replicas

Replicas is the most recently oberved number of replicas. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller

true

integer (int32)

fullyLabeledReplicas

The number of pods that have labels matching the labels of the pod template of the replicaset.

false

integer (int32)

readyReplicas

The number of ready replicas for this replica set.

false

integer (int32)

availableReplicas

The number of available replicas (ready for at least minReadySeconds) for this replica set.

false

integer (int32)

observedGeneration

ObservedGeneration reflects the generation of the most recently observed ReplicaSet.

false

integer (int64)

conditions

Represents the latest available observations of a replica set’s current state.

false

v1beta1.ReplicaSetCondition array

- -
-
-

v1.APIResource

-
-

APIResource specifies the name of a resource and whether it is namespaced.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

name is the plural name of the resource.

true

string

singularName

singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.

true

string

namespaced

namespaced indicates if a resource is namespaced or not.

true

boolean

false

group

group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale".

false

string

version

version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource’s group)".

false

string

kind

kind is the kind for the resource (e.g. Foo is the kind for a resource foo)

true

string

verbs

verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)

true

string array

shortNames

shortNames is a list of suggested short names of the resource.

false

string array

categories

categories is a list of the grouped resources this resource belongs to (e.g. all)

false

string array

- -
-
-

v1.NodeSelectorRequirement

-
-

A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

key

The label key that the selector applies to.

true

string

operator

Represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.

true

string

values

An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.

false

string array

- -
-
-

v1beta1.ReplicaSet

-
-

DEPRECATED - This group version of ReplicaSet is deprecated by apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

If the Labels of a ReplicaSet are empty, they are defaulted to be the same as the Pod(s) that the ReplicaSet manages. Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

v1.ObjectMeta

spec

Spec defines the specification of the desired behavior of the ReplicaSet. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status

false

v1beta1.ReplicaSetSpec

status

Status is the most recently observed status of the ReplicaSet. This data may be out of date by some window of time. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status

false

v1beta1.ReplicaSetStatus

- -
-
-

v1.HostPathVolumeSource

-
-

Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

path

Path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath

true

string

type

Type for HostPath Volume Defaults to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath

false

v1.HostPathType

- -
-
-

v1.SecretProjection

-
-

Adapts a secret into a projected volume.

-
-
-

The contents of the target Secret’s Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

false

string

items

If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the .. path or start with ...

false

v1.KeyToPath array

optional

Specify whether the Secret or its key must be defined

false

boolean

false

- -
-
-

v1beta1.DaemonSet

-
-

DEPRECATED - This group version of DaemonSet is deprecated by apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

v1.ObjectMeta

spec

The desired behavior of this daemon set. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status

false

v1beta1.DaemonSetSpec

status

The current status of this daemon set. This data may be out of date by some window of time. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status

false

v1beta1.DaemonSetStatus

- -
-
-

v1.CinderVolumeSource

-
-

Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

volumeID

volume id used to identify the volume in cinder More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md

true

string

fsType

Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md

false

string

readOnly

Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md

false

boolean

false

- -
-
-

v1.SecurityContext

-
-

SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

capabilities

The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime.

false

v1.Capabilities

privileged

Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false.

false

boolean

false

seLinuxOptions

The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

false

v1.SELinuxOptions

runAsUser

The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

false

integer (int64)

runAsNonRoot

Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

false

boolean

false

readOnlyRootFilesystem

Whether this container has a read-only root filesystem. Default is false.

false

boolean

false

allowPrivilegeEscalation

AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN

false

boolean

false

- -
-
-

v1.AWSElasticBlockStoreVolumeSource

-
-

Represents a Persistent Disk resource in AWS.

-
-
-

An AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

volumeID

Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore

true

string

fsType

Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore

false

string

partition

The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).

false

integer (int32)

readOnly

Specify "true" to force and set the ReadOnly property in VolumeMounts to "true". If omitted, the default is "false". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore

false

boolean

false

- -
-
-

v1.QuobyteVolumeSource

-
-

Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

registry

Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes

true

string

volume

Volume is a string that references an already created Quobyte volume by name.

true

string

readOnly

ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.

false

boolean

false

user

User to map volume access to Defaults to serivceaccount user

false

string

group

Group to map volume access to Default is no group

false

string

- -
-
-

v1.WatchEvent

- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

type

true

string

object

true

string

- -
-
-

v1.LabelSelectorRequirement

-
-

A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

key

key is the label key that the selector applies to.

true

string

operator

operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.

true

string

values

values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.

false

string array

- -
-
-

v1.EnvVar

-
-

EnvVar represents an environment variable present in a Container.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Name of the environment variable. Must be a C_IDENTIFIER.

true

string

value

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 "".

false

string

valueFrom

Source for the environment variable’s value. Cannot be used if value is not empty.

false

v1.EnvVarSource

- -
-
-

v1.ResourceRequirements

-
-

ResourceRequirements describes the compute resource requirements.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

limits

Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/

false

object

requests

Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/

false

object

- -
-
-

v1.HostAlias

-
-

HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod’s hosts file.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

ip

IP address of the host file entry.

false

string

hostnames

Hostnames for the above IP address.

false

string array

- -
-
-

v1.PodTemplateSpec

-
-

PodTemplateSpec describes the data a pod should have when created from a template

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

metadata

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

v1.ObjectMeta

spec

Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status

false

v1.PodSpec

- -
-
-

v1.NodeSelector

-
-

A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

nodeSelectorTerms

Required. A list of node selector terms. The terms are ORed.

true

v1.NodeSelectorTerm array

- -
-
-

v1.Patch

-
-

Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.

-
-
-
-

v1beta1.DeploymentCondition

-
-

DeploymentCondition describes the state of a deployment at a certain point.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

type

Type of deployment condition.

true

string

status

Status of the condition, one of True, False, Unknown.

true

string

lastUpdateTime

The last time this condition was updated.

false

string

lastTransitionTime

Last time the condition transitioned from one status to another.

false

string

reason

The reason for the condition’s last transition.

false

string

message

A human readable message indicating details about the transition.

false

string

- -
-
-

v1.ConfigMapEnvSource

-
-

ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.

-
-
-

The contents of the target ConfigMap’s Data field will represent the key-value pairs as environment variables.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

false

string

optional

Specify whether the ConfigMap must be defined

false

boolean

false

- -
-
-

v1.StorageOSVolumeSource

-
-

Represents a StorageOS persistent volume resource.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

volumeName

VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.

false

string

volumeNamespace

VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod’s namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to "default" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.

false

string

fsType

Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.

false

string

readOnly

Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

false

boolean

false

secretRef

SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.

false

v1.LocalObjectReference

- -
-
-

v1.NodeAffinity

-
-

Node affinity is a group of node affinity scheduling rules.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

requiredDuringSchedulingIgnoredDuringExecution

If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.

false

v1.NodeSelector

preferredDuringSchedulingIgnoredDuringExecution

The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.

false

v1.PreferredSchedulingTerm array

- -
-
-

v1.AzureDataDiskKind

- -
-
-

v1.PreferredSchedulingTerm

-
-

An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it’s a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

weight

Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.

true

integer (int32)

preference

A node selector term, associated with the corresponding weight.

true

v1.NodeSelectorTerm

- -
-
-

v1.ConfigMapKeySelector

-
-

Selects a key from a ConfigMap.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

false

string

key

The key to select.

true

string

optional

Specify whether the ConfigMap or it’s key must be defined

false

boolean

false

- -
-
-

v1beta1.HTTPIngressPath

-
-

HTTPIngressPath associates a path regex with a backend. Incoming urls matching the path are forwarded to the backend.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

path

Path is an extended POSIX regex as defined by IEEE Std 1003.1, (i.e this follows the egrep/unix syntax, not the perl syntax) matched against the path of an incoming request. Currently it can contain characters disallowed from the conventional "path" part of a URL as defined by RFC 3986. Paths must begin with a /. If unspecified, the path defaults to a catch all sending traffic to the backend.

false

string

backend

Backend defines the referenced service endpoint to which the traffic will be forwarded to.

true

v1beta1.IngressBackend

- -
-
-

v1beta1.Ingress

-
-

Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

v1.ObjectMeta

spec

Spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status

false

v1beta1.IngressSpec

status

Status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status

false

v1beta1.IngressStatus

- -
-
-

v1.AzureDataDiskCachingMode

- -
-
-

any

-
-

Represents an untyped JSON map - see the description of the field for more info about the structure of this object.

-
-
-
-
-
- - - \ No newline at end of file diff --git a/federation/docs/api-reference/extensions/v1beta1/operations.html b/federation/docs/api-reference/extensions/v1beta1/operations.html deleted file mode 100755 index f7c0c67969..0000000000 --- a/federation/docs/api-reference/extensions/v1beta1/operations.html +++ /dev/null @@ -1,9927 +0,0 @@ - - - - - - -Operations - - - - -
-
-

Operations

-
-
-

get available resources

-
-
-
GET /apis/extensions/v1beta1
-
-
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

default

success

v1.APIResourceList

- -
-
-

Consumes

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

list or watch objects of kind DaemonSet

-
-
-
GET /apis/extensions/v1beta1/daemonsets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.DaemonSetList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

list or watch objects of kind Deployment

-
-
-
GET /apis/extensions/v1beta1/deployments
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.DeploymentList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

list or watch objects of kind Ingress

-
-
-
GET /apis/extensions/v1beta1/ingresses
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.IngressList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

list or watch objects of kind DaemonSet

-
-
-
GET /apis/extensions/v1beta1/namespaces/{namespace}/daemonsets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.DaemonSetList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

delete collection of DaemonSet

-
-
-
DELETE /apis/extensions/v1beta1/namespaces/{namespace}/daemonsets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

create a DaemonSet

-
-
-
POST /apis/extensions/v1beta1/namespaces/{namespace}/daemonsets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.DaemonSet

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

202

Accepted

v1beta1.DaemonSet

200

success

v1beta1.DaemonSet

201

Created

v1beta1.DaemonSet

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

read the specified DaemonSet

-
-
-
GET /apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

export

Should this value be exported. Export strips fields that a user can not specify.

false

boolean

QueryParameter

exact

Should the export be exact. Exact export maintains cluster-specific fields like Namespace.

false

boolean

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the DaemonSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.DaemonSet

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

replace the specified DaemonSet

-
-
-
PUT /apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.DaemonSet

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the DaemonSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.DaemonSet

201

Created

v1beta1.DaemonSet

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

delete a DaemonSet

-
-
-
DELETE /apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.DeleteOptions

QueryParameter

gracePeriodSeconds

The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.

false

integer (int32)

QueryParameter

orphanDependents

Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object’s finalizers list. Either this field or PropagationPolicy may be set, but not both.

false

boolean

QueryParameter

propagationPolicy

Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the DaemonSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

partially update the specified DaemonSet

-
-
-
PATCH /apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the DaemonSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.DaemonSet

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

read status of the specified DaemonSet

-
-
-
GET /apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the DaemonSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.DaemonSet

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

replace status of the specified DaemonSet

-
-
-
PUT /apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.DaemonSet

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the DaemonSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.DaemonSet

201

Created

v1beta1.DaemonSet

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

partially update status of the specified DaemonSet

-
-
-
PATCH /apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the DaemonSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.DaemonSet

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

list or watch objects of kind Deployment

-
-
-
GET /apis/extensions/v1beta1/namespaces/{namespace}/deployments
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.DeploymentList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

delete collection of Deployment

-
-
-
DELETE /apis/extensions/v1beta1/namespaces/{namespace}/deployments
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

create a Deployment

-
-
-
POST /apis/extensions/v1beta1/namespaces/{namespace}/deployments
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.Deployment

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

202

Accepted

v1beta1.Deployment

200

success

v1beta1.Deployment

201

Created

v1beta1.Deployment

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

read the specified Deployment

-
-
-
GET /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

export

Should this value be exported. Export strips fields that a user can not specify.

false

boolean

QueryParameter

exact

Should the export be exact. Exact export maintains cluster-specific fields like Namespace.

false

boolean

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Deployment

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Deployment

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

replace the specified Deployment

-
-
-
PUT /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.Deployment

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Deployment

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Deployment

201

Created

v1beta1.Deployment

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

delete a Deployment

-
-
-
DELETE /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.DeleteOptions

QueryParameter

gracePeriodSeconds

The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.

false

integer (int32)

QueryParameter

orphanDependents

Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object’s finalizers list. Either this field or PropagationPolicy may be set, but not both.

false

boolean

QueryParameter

propagationPolicy

Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Deployment

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

partially update the specified Deployment

-
-
-
PATCH /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Deployment

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Deployment

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

create rollback of a Deployment

-
-
-
POST /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.DeploymentRollback

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the DeploymentRollback

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

202

Accepted

v1beta1.DeploymentRollback

200

success

v1beta1.DeploymentRollback

201

Created

v1beta1.DeploymentRollback

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

read scale of the specified Deployment

-
-
-
GET /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Scale

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Scale

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

replace scale of the specified Deployment

-
-
-
PUT /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.Scale

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Scale

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Scale

201

Created

v1beta1.Scale

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

partially update scale of the specified Deployment

-
-
-
PATCH /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Scale

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Scale

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

read status of the specified Deployment

-
-
-
GET /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Deployment

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Deployment

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

replace status of the specified Deployment

-
-
-
PUT /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.Deployment

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Deployment

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Deployment

201

Created

v1beta1.Deployment

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

partially update status of the specified Deployment

-
-
-
PATCH /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Deployment

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Deployment

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

list or watch objects of kind Ingress

-
-
-
GET /apis/extensions/v1beta1/namespaces/{namespace}/ingresses
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.IngressList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

delete collection of Ingress

-
-
-
DELETE /apis/extensions/v1beta1/namespaces/{namespace}/ingresses
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

create an Ingress

-
-
-
POST /apis/extensions/v1beta1/namespaces/{namespace}/ingresses
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.Ingress

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

202

Accepted

v1beta1.Ingress

200

success

v1beta1.Ingress

201

Created

v1beta1.Ingress

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

read the specified Ingress

-
-
-
GET /apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

export

Should this value be exported. Export strips fields that a user can not specify.

false

boolean

QueryParameter

exact

Should the export be exact. Exact export maintains cluster-specific fields like Namespace.

false

boolean

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Ingress

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Ingress

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

replace the specified Ingress

-
-
-
PUT /apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.Ingress

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Ingress

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Ingress

201

Created

v1beta1.Ingress

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

delete an Ingress

-
-
-
DELETE /apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.DeleteOptions

QueryParameter

gracePeriodSeconds

The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.

false

integer (int32)

QueryParameter

orphanDependents

Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object’s finalizers list. Either this field or PropagationPolicy may be set, but not both.

false

boolean

QueryParameter

propagationPolicy

Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Ingress

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

partially update the specified Ingress

-
-
-
PATCH /apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Ingress

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Ingress

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

read status of the specified Ingress

-
-
-
GET /apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Ingress

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Ingress

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

replace status of the specified Ingress

-
-
-
PUT /apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.Ingress

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Ingress

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Ingress

201

Created

v1beta1.Ingress

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

partially update status of the specified Ingress

-
-
-
PATCH /apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Ingress

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Ingress

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

list or watch objects of kind ReplicaSet

-
-
-
GET /apis/extensions/v1beta1/namespaces/{namespace}/replicasets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.ReplicaSetList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

delete collection of ReplicaSet

-
-
-
DELETE /apis/extensions/v1beta1/namespaces/{namespace}/replicasets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

create a ReplicaSet

-
-
-
POST /apis/extensions/v1beta1/namespaces/{namespace}/replicasets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.ReplicaSet

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

202

Accepted

v1beta1.ReplicaSet

200

success

v1beta1.ReplicaSet

201

Created

v1beta1.ReplicaSet

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

read the specified ReplicaSet

-
-
-
GET /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

export

Should this value be exported. Export strips fields that a user can not specify.

false

boolean

QueryParameter

exact

Should the export be exact. Exact export maintains cluster-specific fields like Namespace.

false

boolean

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the ReplicaSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.ReplicaSet

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

replace the specified ReplicaSet

-
-
-
PUT /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.ReplicaSet

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the ReplicaSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.ReplicaSet

201

Created

v1beta1.ReplicaSet

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

delete a ReplicaSet

-
-
-
DELETE /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.DeleteOptions

QueryParameter

gracePeriodSeconds

The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.

false

integer (int32)

QueryParameter

orphanDependents

Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object’s finalizers list. Either this field or PropagationPolicy may be set, but not both.

false

boolean

QueryParameter

propagationPolicy

Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the ReplicaSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

partially update the specified ReplicaSet

-
-
-
PATCH /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the ReplicaSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.ReplicaSet

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

read scale of the specified ReplicaSet

-
-
-
GET /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Scale

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Scale

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

replace scale of the specified ReplicaSet

-
-
-
PUT /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.Scale

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Scale

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Scale

201

Created

v1beta1.Scale

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

partially update scale of the specified ReplicaSet

-
-
-
PATCH /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/scale
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Scale

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Scale

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

read status of the specified ReplicaSet

-
-
-
GET /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the ReplicaSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.ReplicaSet

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

replace status of the specified ReplicaSet

-
-
-
PUT /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.ReplicaSet

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the ReplicaSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.ReplicaSet

201

Created

v1beta1.ReplicaSet

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

partially update status of the specified ReplicaSet

-
-
-
PATCH /apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the ReplicaSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.ReplicaSet

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

list or watch objects of kind ReplicaSet

-
-
-
GET /apis/extensions/v1beta1/replicasets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.ReplicaSetList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

watch individual changes to a list of DaemonSet

-
-
-
GET /apis/extensions/v1beta1/watch/daemonsets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

watch individual changes to a list of Deployment

-
-
-
GET /apis/extensions/v1beta1/watch/deployments
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

watch individual changes to a list of Ingress

-
-
-
GET /apis/extensions/v1beta1/watch/ingresses
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

watch individual changes to a list of DaemonSet

-
-
-
GET /apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

watch changes to an object of kind DaemonSet

-
-
-
GET /apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the DaemonSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

watch individual changes to a list of Deployment

-
-
-
GET /apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

watch changes to an object of kind Deployment

-
-
-
GET /apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Deployment

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

watch individual changes to a list of Ingress

-
-
-
GET /apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

watch changes to an object of kind Ingress

-
-
-
GET /apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Ingress

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

watch individual changes to a list of ReplicaSet

-
-
-
GET /apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

watch changes to an object of kind ReplicaSet

-
-
-
GET /apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the ReplicaSet

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-

watch individual changes to a list of ReplicaSet

-
-
-
GET /apis/extensions/v1beta1/watch/replicasets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisextensionsv1beta1

    -
  • -
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/federation/docs/api-reference/federation/v1beta1/definitions.html b/federation/docs/api-reference/federation/v1beta1/definitions.html deleted file mode 100755 index d9d1083923..0000000000 --- a/federation/docs/api-reference/federation/v1beta1/definitions.html +++ /dev/null @@ -1,1601 +0,0 @@ - - - - - - -Top Level API Objects - - - - -
-
-

Top Level API Objects

- -
-
-

Definitions

-
-
-

v1.APIResourceList

-
-

APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

groupVersion

groupVersion is the group and version this APIResourceList is for.

true

string

resources

resources contains the name of the resources and if they are namespaced.

true

v1.APIResource array

- -
-
-

v1.Patch

-
-

Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.

-
-
-
-

v1.DeleteOptions

-
-

DeleteOptions may be provided when deleting an API object.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

gracePeriodSeconds

The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.

false

integer (int64)

preconditions

Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.

false

v1.Preconditions

orphanDependents

Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object’s finalizers list. Either this field or PropagationPolicy may be set, but not both.

false

boolean

false

propagationPolicy

Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

false

v1.DeletionPropagation

- -
-
-

v1beta1.ServerAddressByClientCIDR

-
-

ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

clientCIDR

The CIDR with which clients can match their IP to figure out the server address that they should use.

true

string

serverAddress

Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.

true

string

- -
-
-

v1beta1.ClusterList

-
-

A list of all the kubernetes clusters registered to the federation

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

v1.ListMeta

items

List of Cluster objects.

true

v1beta1.Cluster array

- -
-
-

v1.ListMeta

-
-

ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

selfLink

selfLink is a URL representing this object. Populated by the system. Read-only.

false

string

resourceVersion

String that identifies the server’s internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency

false

string

continue

continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response.

false

string

- -
-
-

v1.StatusDetails

-
-

StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).

false

string

group

The group attribute of the resource associated with the status StatusReason.

false

string

kind

The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

uid

UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids

false

string

causes

The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.

false

v1.StatusCause array

retryAfterSeconds

If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.

false

integer (int32)

- -
-
-

v1beta1.ClusterStatus

-
-

ClusterStatus is information about the current status of a cluster updated by cluster controller periodically.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

conditions

Conditions is an array of current cluster conditions.

false

v1beta1.ClusterCondition array

zones

Zones is the list of availability zones in which the nodes of the cluster exist, e.g. us-east1-a. These will always be in the same region.

false

string array

region

Region is the name of the region in which all of the nodes in the cluster exist. e.g. us-east1.

false

string

- -
-
-

v1.Preconditions

-
-

Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

uid

Specifies the target UID.

false

types.UID

- -
-
-

v1.Initializers

-
-

Initializers tracks the progress of initialization.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

pending

Pending is a list of initializers that must execute in order before this object is visible. When the last pending initializer is removed, and no failing result is set, the initializers struct will be set to nil and the object is considered as initialized and visible to all clients.

true

v1.Initializer array

result

If result is set with the Failure field, the object will be persisted to storage and then deleted, ensuring that other clients can observe the deletion.

false

v1.Status

- -
-
-

v1.Initializer

-
-

Initializer is information about an initializer that has not yet completed.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

name of the process that is responsible for initializing this object.

true

string

- -
-
-

v1.LocalObjectReference

-
-

LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

false

string

- -
-
-

v1.Status

-
-

Status is a return value for calls that don’t return other objects.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

v1.ListMeta

status

Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status

false

string

message

A human-readable description of the status of this operation.

false

string

reason

A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.

false

string

details

Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.

false

v1.StatusDetails

code

Suggested HTTP return code for this status, 0 if not set.

false

integer (int32)

- -
-
-

v1beta1.ClusterSpec

-
-

ClusterSpec describes the attributes of a kubernetes cluster.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

serverAddressByClientCIDRs

A map of client CIDR to server address. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR.

true

v1beta1.ServerAddressByClientCIDR array

secretRef

Name of the secret containing kubeconfig to access this cluster. The secret is read from the kubernetes cluster that is hosting federation control plane. Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key "kubeconfig". This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets. This can be left empty if the cluster allows insecure access.

false

v1.LocalObjectReference

- -
-
-

v1.WatchEvent

- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

type

true

string

object

true

string

- -
-
-

v1beta1.ClusterCondition

-
-

ClusterCondition describes current state of a cluster.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

type

Type of cluster condition, Complete or Failed.

true

string

status

Status of the condition, one of True, False, Unknown.

true

string

lastProbeTime

Last time the condition was checked.

false

string

lastTransitionTime

Last time the condition transit from one status to another.

false

string

reason

(brief) reason for the condition’s last transition.

false

string

message

Human readable message indicating details about last transition.

false

string

- -
-
-

v1.ObjectMeta

-
-

ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names

false

string

generateName

GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.
-
-If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).
-
-Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency

false

string

namespace

Namespace defines the space within each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.
-
-Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces

false

string

selfLink

SelfLink is a URL representing this object. Populated by the system. Read-only.

false

string

uid

UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.
-
-Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids

false

string

resourceVersion

An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.
-
-Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency

false

string

generation

A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.

false

integer (int64)

creationTimestamp

CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.
-
-Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

string

deletionTimestamp

DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field. Once set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.
-
-Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

string

deletionGracePeriodSeconds

Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.

false

integer (int64)

labels

Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels

false

object

annotations

Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations

false

object

ownerReferences

List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.

false

v1.OwnerReference array

initializers

An initializer is a controller which enforces some system invariant at object creation time. This field is a list of initializers that have not yet acted on this object. If nil or empty, this object has been completely initialized. Otherwise, the object is considered uninitialized and is hidden (in list/watch and get calls) from clients that haven’t explicitly asked to observe uninitialized objects.
-
-When an object is created, the system will populate this list with the current set of initializers. Only privileged users may set or modify this list. Once it is empty, it may not be modified further by any user.

false

v1.Initializers

finalizers

Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed.

false

string array

clusterName

The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.

false

string

- -
-
-

v1.OwnerReference

-
-

OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

apiVersion

API version of the referent.

true

string

kind

Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

true

string

name

Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names

true

string

uid

UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids

true

string

controller

If true, this reference points to the managing controller.

false

boolean

false

blockOwnerDeletion

If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.

false

boolean

false

- -
-
-

v1.APIResource

-
-

APIResource specifies the name of a resource and whether it is namespaced.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

name is the plural name of the resource.

true

string

singularName

singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.

true

string

namespaced

namespaced indicates if a resource is namespaced or not.

true

boolean

false

group

group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale".

false

string

version

version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource’s group)".

false

string

kind

kind is the kind for the resource (e.g. Foo is the kind for a resource foo)

true

string

verbs

verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)

true

string array

shortNames

shortNames is a list of suggested short names of the resource.

false

string array

categories

categories is a list of the grouped resources this resource belongs to (e.g. all)

false

string array

- -
-
-

types.UID

- -
-
-

v1.StatusCause

-
-

StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

reason

A machine-readable description of the cause of the error. If this value is empty there is no information available.

false

string

message

A human-readable description of the cause of the error. This field may be presented as-is to a reader.

false

string

field

The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.
-
-Examples:
- "name" - the field "name" on the current resource
- "items[0].name" - the field "name" on the first array entry in "items"

false

string

- -
-
-

v1.DeletionPropagation

- -
-
-

v1beta1.Cluster

-
-

Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

v1.ObjectMeta

spec

Spec defines the behavior of the Cluster.

false

v1beta1.ClusterSpec

status

Status describes the current status of a Cluster

false

v1beta1.ClusterStatus

- -
-
-

any

-
-

Represents an untyped JSON map - see the description of the field for more info about the structure of this object.

-
-
-
-
-
- - - \ No newline at end of file diff --git a/federation/docs/api-reference/federation/v1beta1/operations.html b/federation/docs/api-reference/federation/v1beta1/operations.html deleted file mode 100755 index 7a5dc69ea9..0000000000 --- a/federation/docs/api-reference/federation/v1beta1/operations.html +++ /dev/null @@ -1,1916 +0,0 @@ - - - - - - -Operations - - - - -
-
-

Operations

-
-
-

get available resources

-
-
-
GET /apis/federation/v1beta1
-
-
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

default

success

v1.APIResourceList

- -
-
-

Consumes

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisfederationv1beta1

    -
  • -
-
-
-
-
-

list or watch objects of kind Cluster

-
-
-
GET /apis/federation/v1beta1/clusters
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.ClusterList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisfederationv1beta1

    -
  • -
-
-
-
-
-

delete collection of Cluster

-
-
-
DELETE /apis/federation/v1beta1/clusters
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisfederationv1beta1

    -
  • -
-
-
-
-
-

create a Cluster

-
-
-
POST /apis/federation/v1beta1/clusters
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.Cluster

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

202

Accepted

v1beta1.Cluster

200

success

v1beta1.Cluster

201

Created

v1beta1.Cluster

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisfederationv1beta1

    -
  • -
-
-
-
-
-

read the specified Cluster

-
-
-
GET /apis/federation/v1beta1/clusters/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

export

Should this value be exported. Export strips fields that a user can not specify.

false

boolean

QueryParameter

exact

Should the export be exact. Exact export maintains cluster-specific fields like Namespace.

false

boolean

PathParameter

name

name of the Cluster

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Cluster

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisfederationv1beta1

    -
  • -
-
-
-
-
-

replace the specified Cluster

-
-
-
PUT /apis/federation/v1beta1/clusters/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.Cluster

PathParameter

name

name of the Cluster

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Cluster

201

Created

v1beta1.Cluster

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisfederationv1beta1

    -
  • -
-
-
-
-
-

delete a Cluster

-
-
-
DELETE /apis/federation/v1beta1/clusters/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.DeleteOptions

QueryParameter

gracePeriodSeconds

The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.

false

integer (int32)

QueryParameter

orphanDependents

Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object’s finalizers list. Either this field or PropagationPolicy may be set, but not both.

false

boolean

QueryParameter

propagationPolicy

Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

false

string

PathParameter

name

name of the Cluster

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisfederationv1beta1

    -
  • -
-
-
-
-
-

partially update the specified Cluster

-
-
-
PATCH /apis/federation/v1beta1/clusters/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

name

name of the Cluster

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Cluster

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisfederationv1beta1

    -
  • -
-
-
-
-
-

replace status of the specified Cluster

-
-
-
PUT /apis/federation/v1beta1/clusters/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1beta1.Cluster

PathParameter

name

name of the Cluster

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1beta1.Cluster

201

Created

v1beta1.Cluster

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisfederationv1beta1

    -
  • -
-
-
-
-
-

watch individual changes to a list of Cluster

-
-
-
GET /apis/federation/v1beta1/watch/clusters
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisfederationv1beta1

    -
  • -
-
-
-
-
-

watch changes to an object of kind Cluster

-
-
-
GET /apis/federation/v1beta1/watch/clusters/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

name

name of the Cluster

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apisfederationv1beta1

    -
  • -
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/federation/docs/api-reference/v1/definitions.html b/federation/docs/api-reference/v1/definitions.html deleted file mode 100755 index fda3d8ec24..0000000000 --- a/federation/docs/api-reference/v1/definitions.html +++ /dev/null @@ -1,2448 +0,0 @@ - - - - - - -Top Level API Objects - - - - -
-
-

Top Level API Objects

- -
-
-

Definitions

-
-
-

v1.APIResourceList

-
-

APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

groupVersion

groupVersion is the group and version this APIResourceList is for.

true

string

resources

resources contains the name of the resources and if they are namespaced.

true

v1.APIResource array

- -
-
-

v1.NamespaceList

-
-

NamespaceList is a list of Namespaces.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

v1.ListMeta

items

Items is the list of Namespace objects in the list. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

true

v1.Namespace array

- -
-
-

v1.ListMeta

-
-

ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

selfLink

selfLink is a URL representing this object. Populated by the system. Read-only.

false

string

resourceVersion

String that identifies the server’s internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency

false

string

continue

continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response.

false

string

- -
-
-

v1.Namespace

-
-

Namespace provides a scope for Names. Use of multiple namespaces is optional.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

v1.ObjectMeta

spec

Spec defines the behavior of the Namespace. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status

false

v1.NamespaceSpec

status

Status describes the current status of a Namespace. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status

false

v1.NamespaceStatus

- -
-
-

v1.Initializers

-
-

Initializers tracks the progress of initialization.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

pending

Pending is a list of initializers that must execute in order before this object is visible. When the last pending initializer is removed, and no failing result is set, the initializers struct will be set to nil and the object is considered as initialized and visible to all clients.

true

v1.Initializer array

result

If result is set with the Failure field, the object will be persisted to storage and then deleted, ensuring that other clients can observe the deletion.

false

v1.Status

- -
-
-

v1.Preconditions

-
-

Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

uid

Specifies the target UID.

false

types.UID

- -
-
-

v1.Status

-
-

Status is a return value for calls that don’t return other objects.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

v1.ListMeta

status

Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status

false

string

message

A human-readable description of the status of this operation.

false

string

reason

A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.

false

string

details

Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.

false

v1.StatusDetails

code

Suggested HTTP return code for this status, 0 if not set.

false

integer (int32)

- -
-
-

v1.ServiceStatus

-
-

ServiceStatus represents the current status of a service.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

loadBalancer

LoadBalancer contains the current status of the load-balancer, if one is present.

false

v1.LoadBalancerStatus

- -
-
-

v1.Secret

-
-

Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

v1.ObjectMeta

data

Data contains the secret data. Each key must consist of alphanumeric characters, -, _ or .. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4

false

object

stringData

stringData allows specifying non-binary secret data in string form. It is provided as a write-only convenience method. All keys and values are merged into the data field on write, overwriting any existing values. It is never output when reading from the API.

false

object

type

Used to facilitate programmatic handling of secret data.

false

string

- -
-
-

v1.WatchEvent

- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

type

true

string

object

true

string

- -
-
-

v1.Event

-
-

Event is a report of an event somewhere in the cluster.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

true

v1.ObjectMeta

involvedObject

The object that this event is about.

true

v1.ObjectReference

reason

This should be a short, machine understandable string that gives the reason for the transition into the object’s current status.

false

string

message

A human-readable description of the status of this operation.

false

string

source

The component reporting this event. Should be a short machine understandable string.

false

v1.EventSource

firstTimestamp

The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)

false

string

lastTimestamp

The time at which the most recent occurrence of this event was recorded.

false

string

count

The number of times this event has occurred.

false

integer (int32)

type

Type of this event (Normal, Warning), new types could be added in the future

false

string

- -
-
-

v1.LoadBalancerIngress

-
-

LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

ip

IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)

false

string

hostname

Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers)

false

string

- -
-
-

v1.DeletionPropagation

- -
-
-

v1.NamespaceStatus

-
-

NamespaceStatus is information about the current status of a Namespace.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

phase

Phase is the current lifecycle phase of the namespace. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/

false

string

- -
-
-

v1.ServiceList

-
-

ServiceList holds a list of services.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

v1.ListMeta

items

List of services

true

v1.Service array

- -
-
-

v1.NamespaceSpec

-
-

NamespaceSpec describes the attributes on a Namespace.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

finalizers

Finalizers is an opaque list of values that must be empty to permanently remove object from storage. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/

false

v1.FinalizerName array

- -
-
-

v1.Service

-
-

Service is a named abstraction of software service (for example, mysql) consisting of local port (for example 3306) that the proxy listens on, and the selector that determines which pods will answer requests sent through the proxy.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

v1.ObjectMeta

spec

Spec defines the behavior of a service. https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status

false

v1.ServiceSpec

status

Most recently observed status of the service. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status

false

v1.ServiceStatus

- -
-
-

v1.Patch

-
-

Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.

-
-
-
-

v1.ConfigMapList

-
-

ConfigMapList is a resource containing a list of ConfigMap objects.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

v1.ListMeta

items

Items is the list of ConfigMaps.

true

v1.ConfigMap array

- -
-
-

v1.DeleteOptions

-
-

DeleteOptions may be provided when deleting an API object.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

gracePeriodSeconds

The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.

false

integer (int64)

preconditions

Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.

false

v1.Preconditions

orphanDependents

Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object’s finalizers list. Either this field or PropagationPolicy may be set, but not both.

false

boolean

false

propagationPolicy

Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

false

v1.DeletionPropagation

- -
-
-

v1.StatusDetails

-
-

StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).

false

string

group

The group attribute of the resource associated with the status StatusReason.

false

string

kind

The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

uid

UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids

false

string

causes

The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.

false

v1.StatusCause array

retryAfterSeconds

If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.

false

integer (int32)

- -
-
-

v1.ConfigMap

-
-

ConfigMap holds configuration data for pods to consume.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

v1.ObjectMeta

data

Data contains the configuration data. Each key must consist of alphanumeric characters, -, _ or ..

false

object

- -
-
-

v1.Initializer

-
-

Initializer is information about an initializer that has not yet completed.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

name of the process that is responsible for initializing this object.

true

string

- -
-
-

v1.ObjectReference

-
-

ObjectReference contains enough information to let you inspect or modify the referred object.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

namespace

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

false

string

name

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

false

string

uid

UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids

false

string

apiVersion

API version of the referent.

false

string

resourceVersion

Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency

false

string

fieldPath

If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.

false

string

- -
-
-

v1.LoadBalancerStatus

-
-

LoadBalancerStatus represents the status of a load-balancer.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

ingress

Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points.

false

v1.LoadBalancerIngress array

- -
-
-

v1.SecretList

-
-

SecretList is a list of Secret.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

v1.ListMeta

items

Items is a list of secret objects. More info: https://kubernetes.io/docs/concepts/configuration/secret

true

v1.Secret array

- -
-
-

v1.FinalizerName

- -
-
-

v1.ServicePort

-
-

ServicePort contains information on service’s port.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the Name field in EndpointPort objects. Optional if only one ServicePort is defined on this service.

false

string

protocol

The IP protocol for this port. Supports "TCP" and "UDP". Default is TCP.

false

string

port

The port that will be exposed by this service.

true

integer (int32)

targetPort

Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod’s container ports. If this is not specified, the value of the port field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the port field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service

false

string

nodePort

The port on each node on which this service is exposed when type=NodePort or LoadBalancer. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one. More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport

false

integer (int32)

- -
-
-

v1.OwnerReference

-
-

OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

apiVersion

API version of the referent.

true

string

kind

Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

true

string

name

Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names

true

string

uid

UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids

true

string

controller

If true, this reference points to the managing controller.

false

boolean

false

blockOwnerDeletion

If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.

false

boolean

false

- -
-
-

v1.ObjectMeta

-
-

ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names

false

string

generateName

GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.
-
-If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).
-
-Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency

false

string

namespace

Namespace defines the space within each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.
-
-Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces

false

string

selfLink

SelfLink is a URL representing this object. Populated by the system. Read-only.

false

string

uid

UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.
-
-Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids

false

string

resourceVersion

An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.
-
-Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency

false

string

generation

A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.

false

integer (int64)

creationTimestamp

CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.
-
-Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

string

deletionTimestamp

DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field. Once set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.
-
-Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

false

string

deletionGracePeriodSeconds

Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.

false

integer (int64)

labels

Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels

false

object

annotations

Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations

false

object

ownerReferences

List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.

false

v1.OwnerReference array

initializers

An initializer is a controller which enforces some system invariant at object creation time. This field is a list of initializers that have not yet acted on this object. If nil or empty, this object has been completely initialized. Otherwise, the object is considered uninitialized and is hidden (in list/watch and get calls) from clients that haven’t explicitly asked to observe uninitialized objects.
-
-When an object is created, the system will populate this list with the current set of initializers. Only privileged users may set or modify this list. Once it is empty, it may not be modified further by any user.

false

v1.Initializers

finalizers

Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed.

false

string array

clusterName

The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.

false

string

- -
-
-

v1.EventList

-
-

EventList is a list of events.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

kind

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

string

apiVersion

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

false

string

metadata

Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

false

v1.ListMeta

items

List of events

true

v1.Event array

- -
-
-

v1.ClientIPConfig

-
-

ClientIPConfig represents the configurations of Client IP based session affinity.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

timeoutSeconds

timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && ⇐86400(for 1 day) if ServiceAffinity == "ClientIP". Default value is 10800(for 3 hours).

false

integer (int32)

- -
-
-

v1.APIResource

-
-

APIResource specifies the name of a resource and whether it is namespaced.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

name

name is the plural name of the resource.

true

string

singularName

singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.

true

string

namespaced

namespaced indicates if a resource is namespaced or not.

true

boolean

false

group

group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale".

false

string

version

version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource’s group)".

false

string

kind

kind is the kind for the resource (e.g. Foo is the kind for a resource foo)

true

string

verbs

verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)

true

string array

shortNames

shortNames is a list of suggested short names of the resource.

false

string array

categories

categories is a list of the grouped resources this resource belongs to (e.g. all)

false

string array

- -
-
-

v1.ServiceSpec

-
-

ServiceSpec describes the attributes that a user creates on a service.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

ports

The list of ports that are exposed by this service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies

false

v1.ServicePort array

selector

Route service traffic to pods with label keys and values matching this selector. If empty or not present, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/

false

object

clusterIP

clusterIP is the IP address of the service and is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. This field can not be changed through updates. Valid values are "None", empty string (""), or a valid IP address. "None" can be specified for headless services when proxying is not required. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies

false

string

type

type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer. "ExternalName" maps to the specified externalName. "ClusterIP" allocates a cluster-internal IP address for load-balancing to endpoints. Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object. If clusterIP is "None", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a stable IP. "NodePort" builds on ClusterIP and allocates a port on every node which routes to the clusterIP. "LoadBalancer" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the clusterIP. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services

false

string

externalIPs

externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system.

false

string array

sessionAffinity

Supports "ClientIP" and "None". Used to maintain session affinity. Enable client IP based session affinity. Must be ClientIP or None. Defaults to None. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies

false

string

loadBalancerIP

Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature.

false

string

loadBalancerSourceRanges

If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature." More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/

false

string array

externalName

externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid DNS name and requires Type to be ExternalName.

false

string

externalTrafficPolicy

externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. "Local" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. "Cluster" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.

false

string

healthCheckNodePort

healthCheckNodePort specifies the healthcheck nodePort for the service. If not specified, HealthCheckNodePort is created by the service api backend with the allocated nodePort. Will use user-specified nodePort value if specified by the client. Only effects when Type is set to LoadBalancer and ExternalTrafficPolicy is set to Local.

false

integer (int32)

publishNotReadyAddresses

publishNotReadyAddresses, when set to true, indicates that DNS implementations must publish the notReadyAddresses of subsets for the Endpoints associated with the Service. The default value is false. The primary use case for setting this field is to use a StatefulSet’s Headless Service to propagate SRV records for its Pods without respect to their readiness for purpose of peer discovery. This field will replace the service.alpha.kubernetes.io/tolerate-unready-endpoints when that annotation is deprecated and all clients have been converted to use this field.

false

boolean

false

sessionAffinityConfig

sessionAffinityConfig contains the configurations of session affinity.

false

v1.SessionAffinityConfig

- -
-
-

v1.EventSource

-
-

EventSource contains information for an event.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

component

Component from which the event is generated.

false

string

host

Node name on which the event is generated.

false

string

- -
-
-

types.UID

- -
-
-

v1.StatusCause

-
-

StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.

-
- ------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

reason

A machine-readable description of the cause of the error. If this value is empty there is no information available.

false

string

message

A human-readable description of the cause of the error. This field may be presented as-is to a reader.

false

string

field

The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.
-
-Examples:
- "name" - the field "name" on the current resource
- "items[0].name" - the field "name" on the first array entry in "items"

false

string

- -
-
-

v1.SessionAffinityConfig

-
-

SessionAffinityConfig represents the configurations of session affinity.

-
- ------- - - - - - - - - - - - - - - - - - - -
NameDescriptionRequiredSchemaDefault

clientIP

clientIP contains the configurations of Client IP based session affinity.

false

v1.ClientIPConfig

- -
-
-

any

-
-

Represents an untyped JSON map - see the description of the field for more info about the structure of this object.

-
-
-
-
-
- - - \ No newline at end of file diff --git a/federation/docs/api-reference/v1/operations.html b/federation/docs/api-reference/v1/operations.html deleted file mode 100755 index e9558c4025..0000000000 --- a/federation/docs/api-reference/v1/operations.html +++ /dev/null @@ -1,9524 +0,0 @@ - - - - - - -Operations - - - - -
-
-

Operations

-
-
-

get available resources

-
-
-
GET /api/v1
-
-
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

default

success

v1.APIResourceList

- -
-
-

Consumes

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

list or watch objects of kind ConfigMap

-
-
-
GET /api/v1/configmaps
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.ConfigMapList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

list or watch objects of kind Event

-
-
-
GET /api/v1/events
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.EventList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

list or watch objects of kind Namespace

-
-
-
GET /api/v1/namespaces
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.NamespaceList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

create a Namespace

-
-
-
POST /api/v1/namespaces
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Namespace

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

202

Accepted

v1.Namespace

200

success

v1.Namespace

201

Created

v1.Namespace

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

list or watch objects of kind ConfigMap

-
-
-
GET /api/v1/namespaces/{namespace}/configmaps
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.ConfigMapList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

delete collection of ConfigMap

-
-
-
DELETE /api/v1/namespaces/{namespace}/configmaps
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

create a ConfigMap

-
-
-
POST /api/v1/namespaces/{namespace}/configmaps
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.ConfigMap

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

202

Accepted

v1.ConfigMap

200

success

v1.ConfigMap

201

Created

v1.ConfigMap

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

read the specified ConfigMap

-
-
-
GET /api/v1/namespaces/{namespace}/configmaps/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

export

Should this value be exported. Export strips fields that a user can not specify.

false

boolean

QueryParameter

exact

Should the export be exact. Exact export maintains cluster-specific fields like Namespace.

false

boolean

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the ConfigMap

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.ConfigMap

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

replace the specified ConfigMap

-
-
-
PUT /api/v1/namespaces/{namespace}/configmaps/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.ConfigMap

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the ConfigMap

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.ConfigMap

201

Created

v1.ConfigMap

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

delete a ConfigMap

-
-
-
DELETE /api/v1/namespaces/{namespace}/configmaps/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.DeleteOptions

QueryParameter

gracePeriodSeconds

The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.

false

integer (int32)

QueryParameter

orphanDependents

Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object’s finalizers list. Either this field or PropagationPolicy may be set, but not both.

false

boolean

QueryParameter

propagationPolicy

Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the ConfigMap

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

partially update the specified ConfigMap

-
-
-
PATCH /api/v1/namespaces/{namespace}/configmaps/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the ConfigMap

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.ConfigMap

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

list or watch objects of kind Event

-
-
-
GET /api/v1/namespaces/{namespace}/events
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.EventList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

delete collection of Event

-
-
-
DELETE /api/v1/namespaces/{namespace}/events
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

create an Event

-
-
-
POST /api/v1/namespaces/{namespace}/events
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Event

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

202

Accepted

v1.Event

200

success

v1.Event

201

Created

v1.Event

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

read the specified Event

-
-
-
GET /api/v1/namespaces/{namespace}/events/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

export

Should this value be exported. Export strips fields that a user can not specify.

false

boolean

QueryParameter

exact

Should the export be exact. Exact export maintains cluster-specific fields like Namespace.

false

boolean

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Event

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Event

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

replace the specified Event

-
-
-
PUT /api/v1/namespaces/{namespace}/events/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Event

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Event

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Event

201

Created

v1.Event

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

delete an Event

-
-
-
DELETE /api/v1/namespaces/{namespace}/events/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.DeleteOptions

QueryParameter

gracePeriodSeconds

The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.

false

integer (int32)

QueryParameter

orphanDependents

Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object’s finalizers list. Either this field or PropagationPolicy may be set, but not both.

false

boolean

QueryParameter

propagationPolicy

Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Event

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

partially update the specified Event

-
-
-
PATCH /api/v1/namespaces/{namespace}/events/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Event

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Event

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

list or watch objects of kind Secret

-
-
-
GET /api/v1/namespaces/{namespace}/secrets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.SecretList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

delete collection of Secret

-
-
-
DELETE /api/v1/namespaces/{namespace}/secrets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

create a Secret

-
-
-
POST /api/v1/namespaces/{namespace}/secrets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Secret

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

202

Accepted

v1.Secret

200

success

v1.Secret

201

Created

v1.Secret

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

read the specified Secret

-
-
-
GET /api/v1/namespaces/{namespace}/secrets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

export

Should this value be exported. Export strips fields that a user can not specify.

false

boolean

QueryParameter

exact

Should the export be exact. Exact export maintains cluster-specific fields like Namespace.

false

boolean

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Secret

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Secret

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

replace the specified Secret

-
-
-
PUT /api/v1/namespaces/{namespace}/secrets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Secret

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Secret

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Secret

201

Created

v1.Secret

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

delete a Secret

-
-
-
DELETE /api/v1/namespaces/{namespace}/secrets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.DeleteOptions

QueryParameter

gracePeriodSeconds

The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.

false

integer (int32)

QueryParameter

orphanDependents

Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object’s finalizers list. Either this field or PropagationPolicy may be set, but not both.

false

boolean

QueryParameter

propagationPolicy

Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Secret

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

partially update the specified Secret

-
-
-
PATCH /api/v1/namespaces/{namespace}/secrets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Secret

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Secret

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

list or watch objects of kind Service

-
-
-
GET /api/v1/namespaces/{namespace}/services
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.ServiceList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

delete collection of Service

-
-
-
DELETE /api/v1/namespaces/{namespace}/services
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

create a Service

-
-
-
POST /api/v1/namespaces/{namespace}/services
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Service

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

202

Accepted

v1.Service

200

success

v1.Service

201

Created

v1.Service

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

read the specified Service

-
-
-
GET /api/v1/namespaces/{namespace}/services/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

export

Should this value be exported. Export strips fields that a user can not specify.

false

boolean

QueryParameter

exact

Should the export be exact. Exact export maintains cluster-specific fields like Namespace.

false

boolean

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Service

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Service

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

replace the specified Service

-
-
-
PUT /api/v1/namespaces/{namespace}/services/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Service

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Service

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Service

201

Created

v1.Service

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

delete a Service

-
-
-
DELETE /api/v1/namespaces/{namespace}/services/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.DeleteOptions

QueryParameter

gracePeriodSeconds

The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.

false

integer (int32)

QueryParameter

orphanDependents

Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object’s finalizers list. Either this field or PropagationPolicy may be set, but not both.

false

boolean

QueryParameter

propagationPolicy

Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Service

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

partially update the specified Service

-
-
-
PATCH /api/v1/namespaces/{namespace}/services/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Service

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Service

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

read status of the specified Service

-
-
-
GET /api/v1/namespaces/{namespace}/services/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Service

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Service

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

replace status of the specified Service

-
-
-
PUT /api/v1/namespaces/{namespace}/services/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Service

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Service

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Service

201

Created

v1.Service

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

partially update status of the specified Service

-
-
-
PATCH /api/v1/namespaces/{namespace}/services/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Service

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Service

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

read the specified Namespace

-
-
-
GET /api/v1/namespaces/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

export

Should this value be exported. Export strips fields that a user can not specify.

false

boolean

QueryParameter

exact

Should the export be exact. Exact export maintains cluster-specific fields like Namespace.

false

boolean

PathParameter

name

name of the Namespace

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Namespace

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

replace the specified Namespace

-
-
-
PUT /api/v1/namespaces/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Namespace

PathParameter

name

name of the Namespace

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Namespace

201

Created

v1.Namespace

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

delete a Namespace

-
-
-
DELETE /api/v1/namespaces/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.DeleteOptions

QueryParameter

gracePeriodSeconds

The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.

false

integer (int32)

QueryParameter

orphanDependents

Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object’s finalizers list. Either this field or PropagationPolicy may be set, but not both.

false

boolean

QueryParameter

propagationPolicy

Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

false

string

PathParameter

name

name of the Namespace

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Status

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

partially update the specified Namespace

-
-
-
PATCH /api/v1/namespaces/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

name

name of the Namespace

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Namespace

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

replace finalize of the specified Namespace

-
-
-
PUT /api/v1/namespaces/{name}/finalize
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Namespace

PathParameter

name

name of the Namespace

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Namespace

201

Created

v1.Namespace

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

read status of the specified Namespace

-
-
-
GET /api/v1/namespaces/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

PathParameter

name

name of the Namespace

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Namespace

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

replace status of the specified Namespace

-
-
-
PUT /api/v1/namespaces/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Namespace

PathParameter

name

name of the Namespace

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Namespace

201

Created

v1.Namespace

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

partially update status of the specified Namespace

-
-
-
PATCH /api/v1/namespaces/{name}/status
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

BodyParameter

body

true

v1.Patch

PathParameter

name

name of the Namespace

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.Namespace

- -
-
-

Consumes

-
-
    -
  • -

    application/json-patch+json

    -
  • -
  • -

    application/merge-patch+json

    -
  • -
  • -

    application/strategic-merge-patch+json

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

list or watch objects of kind Secret

-
-
-
GET /api/v1/secrets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.SecretList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

list or watch objects of kind Service

-
-
-
GET /api/v1/services
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.ServiceList

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

watch individual changes to a list of ConfigMap

-
-
-
GET /api/v1/watch/configmaps
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

watch individual changes to a list of Event

-
-
-
GET /api/v1/watch/events
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

watch individual changes to a list of Namespace

-
-
-
GET /api/v1/watch/namespaces
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

watch individual changes to a list of ConfigMap

-
-
-
GET /api/v1/watch/namespaces/{namespace}/configmaps
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

watch changes to an object of kind ConfigMap

-
-
-
GET /api/v1/watch/namespaces/{namespace}/configmaps/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the ConfigMap

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

watch individual changes to a list of Event

-
-
-
GET /api/v1/watch/namespaces/{namespace}/events
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

watch changes to an object of kind Event

-
-
-
GET /api/v1/watch/namespaces/{namespace}/events/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Event

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

watch individual changes to a list of Secret

-
-
-
GET /api/v1/watch/namespaces/{namespace}/secrets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

watch changes to an object of kind Secret

-
-
-
GET /api/v1/watch/namespaces/{namespace}/secrets/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Secret

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

watch individual changes to a list of Service

-
-
-
GET /api/v1/watch/namespaces/{namespace}/services
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

watch changes to an object of kind Service

-
-
-
GET /api/v1/watch/namespaces/{namespace}/services/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

namespace

object name and auth scope, such as for teams and projects

true

string

PathParameter

name

name of the Service

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

watch changes to an object of kind Namespace

-
-
-
GET /api/v1/watch/namespaces/{name}
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

PathParameter

name

name of the Namespace

true

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

watch individual changes to a list of Secret

-
-
-
GET /api/v1/watch/secrets
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-

watch individual changes to a list of Service

-
-
-
GET /api/v1/watch/services
-
-
-
-

Parameters

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionRequiredSchemaDefault

QueryParameter

pretty

If true, then the output is pretty printed.

false

string

QueryParameter

labelSelector

A selector to restrict the list of returned objects by their labels. Defaults to everything.

false

string

QueryParameter

fieldSelector

A selector to restrict the list of returned objects by their fields. Defaults to everything.

false

string

QueryParameter

includeUninitialized

If true, partially initialized resources are included in the response.

false

boolean

QueryParameter

watch

Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.

false

boolean

QueryParameter

resourceVersion

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it’s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

false

string

QueryParameter

timeoutSeconds

Timeout for the list/watch call.

false

integer (int32)

QueryParameter

limit

limit is a maximum number of responses to return for a list call. If more items exist, the server will set the continue field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. -

The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.

false

integer (int32)

QueryParameter

continue

The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.

false

string

- -
-
-

Responses

- ----- - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

success

v1.WatchEvent

- -
-
-

Consumes

-
-
    -
  • -

    /

    -
  • -
-
-
-
-

Produces

-
-
    -
  • -

    application/json

    -
  • -
  • -

    application/yaml

    -
  • -
  • -

    application/vnd.kubernetes.protobuf

    -
  • -
  • -

    application/json;stream=watch

    -
  • -
  • -

    application/vnd.kubernetes.protobuf;stream=watch

    -
  • -
-
-
-
-

Tags

-
-
    -
  • -

    apiv1

    -
  • -
-
-
-
-
-
-
- - - \ No newline at end of file diff --git a/federation/pkg/dnsprovider/BUILD b/federation/pkg/dnsprovider/BUILD deleted file mode 100644 index 47159f4316..0000000000 --- a/federation/pkg/dnsprovider/BUILD +++ /dev/null @@ -1,49 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = [ - "dns.go", - "doc.go", - "plugins.go", - ], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider", - deps = [ - "//federation/pkg/dnsprovider/rrstype:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["dns_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider", - library = ":go_default_library", - deps = ["//federation/pkg/dnsprovider/rrstype:go_default_library"], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/pkg/dnsprovider/providers/aws/route53:all-srcs", - "//federation/pkg/dnsprovider/providers/coredns:all-srcs", - "//federation/pkg/dnsprovider/providers/google/clouddns:all-srcs", - "//federation/pkg/dnsprovider/rrstype:all-srcs", - "//federation/pkg/dnsprovider/tests:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/pkg/dnsprovider/dns.go b/federation/pkg/dnsprovider/dns.go deleted file mode 100644 index aa11974b1d..0000000000 --- a/federation/pkg/dnsprovider/dns.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright 2016 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 dnsprovider - -import ( - "reflect" - - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" -) - -// Interface is an abstract, pluggable interface for DNS providers. -type Interface interface { - // Zones returns the provider's Zones interface, or false if not supported. - Zones() (Zones, bool) -} - -type Zones interface { - // List returns the (possibly empty) list of managed Zones, or an error if the list operation failed. - List() ([]Zone, error) - // Add creates and returns a new managed zone, or an error if the operation failed - Add(Zone) (Zone, error) - // Remove deletes a managed zone, or returns an error if the operation failed. - Remove(Zone) error - // New allocates a new Zone, which can then be passed to Add() - // Arguments are as per the Zone interface below. - New(name string) (Zone, error) -} - -type Zone interface { - // Name returns the name of the zone, e.g. "example.com" - Name() string - // ID returns the unique provider identifier for the zone - ID() string - // ResourceRecordSets returns the provider's ResourceRecordSets interface, or false if not supported. - ResourceRecordSets() (ResourceRecordSets, bool) -} - -type ResourceRecordSets interface { - // List returns the ResourceRecordSets of the Zone, or an error if the list operation failed. - List() ([]ResourceRecordSet, error) - // Get returns the ResourceRecordSet list with the name in the Zone. - // This is a list because there might be multiple records of different - // types for a given name. If the named resource record sets do not - // exist, but no error occurred, the returned record set will be empty - // and error will be nil. - Get(name string) ([]ResourceRecordSet, error) - // New allocates a new ResourceRecordSet, which can then be passed to ResourceRecordChangeset Add() or Remove() - // Arguments are as per the ResourceRecordSet interface below. - New(name string, rrdatas []string, ttl int64, rrstype rrstype.RrsType) ResourceRecordSet - // StartChangeset begins a new batch operation of changes against the Zone - StartChangeset() ResourceRecordChangeset - // Zone returns the parent zone - Zone() Zone -} - -// ResourceRecordChangeset accumulates a set of changes, that can then be applied with Apply -type ResourceRecordChangeset interface { - // Add adds the creation of a ResourceRecordSet in the Zone to the changeset - Add(ResourceRecordSet) ResourceRecordChangeset - // Remove adds the removal of a ResourceRecordSet in the Zone to the changeset - // The supplied ResourceRecordSet must match one of the existing recordsets (obtained via List()) exactly. - Remove(ResourceRecordSet) ResourceRecordChangeset - // Upsert adds an "create or update" operation for the ResourceRecordSet in the Zone to the changeset - // Note: the implementation may translate this into a Remove followed by an Add operation. - // If you have the pre-image, it will likely be more efficient to call Remove and Add. - Upsert(ResourceRecordSet) ResourceRecordChangeset - // Apply applies the accumulated operations to the Zone. - Apply() error - // IsEmpty returns true if there are no accumulated operations. - IsEmpty() bool - // ResourceRecordSets returns the parent ResourceRecordSets - ResourceRecordSets() ResourceRecordSets -} - -type ResourceRecordSet interface { - // Name returns the name of the ResourceRecordSet, e.g. "www.example.com". - Name() string - // Rrdatas returns the Resource Record Datas of the record set. - Rrdatas() []string - // Ttl returns the time-to-live of the record set, in seconds. - Ttl() int64 - // Type returns the type of the record set (A, CNAME, SRV, etc) - Type() rrstype.RrsType -} - -/* ResourceRecordSetsEquivalent compares two ResourceRecordSets for semantic equivalence. - Go's equality operator doesn't work the way we want it to in this case, - hence the need for this function. - More specifically (from the Go spec): - "Two struct values are equal if their corresponding non-blank fields are equal." - In our case, there may be some private internal member variables that may not be not equal, - but we want the two structs to be considered equivalent anyway, if the fields exposed - via their interfaces are equal. -*/ -func ResourceRecordSetsEquivalent(r1, r2 ResourceRecordSet) bool { - if r1.Name() == r2.Name() && reflect.DeepEqual(r1.Rrdatas(), r2.Rrdatas()) && r1.Ttl() == r2.Ttl() && r1.Type() == r2.Type() { - return true - } - return false -} diff --git a/federation/pkg/dnsprovider/dns_test.go b/federation/pkg/dnsprovider/dns_test.go deleted file mode 100644 index b5a2344c35..0000000000 --- a/federation/pkg/dnsprovider/dns_test.go +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright 2016 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 dnsprovider - -import ( - "testing" - - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" -) - -// Compile time interface check -var _ ResourceRecordSet = record{} - -type record struct { - name string - rrdatas []string - ttl int64 - type_ string -} - -func (r record) Name() string { - return r.name -} - -func (r record) Ttl() int64 { - return r.ttl -} - -func (r record) Rrdatas() []string { - return r.rrdatas -} - -func (r record) Type() rrstype.RrsType { - return rrstype.RrsType(r.type_) -} - -const testDNSZone string = "foo.com" - -var testData = []struct { - inputs [2]record - expectedOutput bool -}{ - { - [2]record{ - {"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}, // Identical - {"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}}, true, - }, - { - [2]record{ - {"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}, // Identical except Name - {"bar", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}}, false, - }, - { - [2]record{ - {"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}, // Identical except Rrdata - {"foo", []string{"1.2.3.4", "5,6,7,9"}, 180, "A"}}, false, - }, - { - [2]record{ - {"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}, // Identical except Rrdata ordering reversed - {"foo", []string{"5,6,7,8", "1.2.3.4"}, 180, "A"}}, false, - }, - { - [2]record{ - {"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}, // Identical except TTL - {"foo", []string{"1.2.3.4", "5,6,7,8"}, 150, "A"}}, false, - }, - { - [2]record{ - {"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "A"}, // Identical except Type - {"foo", []string{"1.2.3.4", "5,6,7,8"}, 180, "CNAME"}}, false, - }, -} - -func TestEquivalent(t *testing.T) { - for _, test := range testData { - output := ResourceRecordSetsEquivalent(test.inputs[0], test.inputs[1]) - if output != test.expectedOutput { - t.Errorf("Expected equivalence comparison of %q and %q to yield %v, but it vielded %v", test.inputs[0], test.inputs[1], test.expectedOutput, output) - } - } -} diff --git a/federation/pkg/dnsprovider/doc.go b/federation/pkg/dnsprovider/doc.go deleted file mode 100644 index 201c57a050..0000000000 --- a/federation/pkg/dnsprovider/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2016 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. -*/ - -/* -dnsprovider supplies interfaces for dns service providers (e.g. Google Cloud DNS, AWS route53, etc). -Implementations exist in the providers sub-package -*/ -package dnsprovider // import "k8s.io/kubernetes/federation/pkg/dnsprovider" diff --git a/federation/pkg/dnsprovider/plugins.go b/federation/pkg/dnsprovider/plugins.go deleted file mode 100644 index affaf404e3..0000000000 --- a/federation/pkg/dnsprovider/plugins.go +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright 2016 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 dnsprovider - -import ( - "fmt" - "io" - "os" - "sync" - - "github.com/golang/glog" -) - -// Factory is a function that returns a dnsprovider.Interface. -// The config parameter provides an io.Reader handler to the factory in -// order to load specific configurations. If no configuration is provided -// the parameter is nil. -type Factory func(config io.Reader) (Interface, error) - -// All registered dns providers. -var providersMutex sync.Mutex -var providers = make(map[string]Factory) - -// RegisterDnsProvider registers a dnsprovider.Factory by name. This -// is expected to happen during startup. -func RegisterDnsProvider(name string, cloud Factory) { - providersMutex.Lock() - defer providersMutex.Unlock() - if _, found := providers[name]; found { - glog.Fatalf("DNS provider %q was registered twice", name) - } - glog.V(1).Infof("Registered DNS provider %q", name) - providers[name] = cloud -} - -// GetDnsProvider creates an instance of the named DNS provider, or nil if -// the name is not known. The error return is only used if the named provider -// was known but failed to initialize. The config parameter specifies the -// io.Reader handler of the configuration file for the DNS provider, or nil -// for no configuration. -func GetDnsProvider(name string, config io.Reader) (Interface, error) { - providersMutex.Lock() - defer providersMutex.Unlock() - f, found := providers[name] - if !found { - return nil, nil - } - return f(config) -} - -// Returns a list of registered dns providers. -func RegisteredDnsProviders() []string { - registeredProviders := make([]string, len(providers)) - i := 0 - for provider := range providers { - registeredProviders[i] = provider - i = i + 1 - } - return registeredProviders -} - -// InitDnsProvider creates an instance of the named DNS provider. -func InitDnsProvider(name string, configFilePath string) (Interface, error) { - var dns Interface - var err error - - if name == "" { - glog.Info("No DNS provider specified.") - return nil, nil - } - - if configFilePath != "" { - var config *os.File - config, err = os.Open(configFilePath) - if err != nil { - return nil, fmt.Errorf("Couldn't open DNS provider configuration %s: %#v", configFilePath, err) - } - - defer config.Close() - dns, err = GetDnsProvider(name, config) - } else { - // Pass explicit nil so plugins can actually check for nil. See - // "Why is my nil error value not equal to nil?" in golang.org/doc/faq. - dns, err = GetDnsProvider(name, nil) - } - - if err != nil { - return nil, fmt.Errorf("could not init DNS provider %q: %v", name, err) - } - if dns == nil { - return nil, fmt.Errorf("unknown DNS provider %q", name) - } - - return dns, nil -} diff --git a/federation/pkg/dnsprovider/providers/aws/route53/BUILD b/federation/pkg/dnsprovider/providers/aws/route53/BUILD deleted file mode 100644 index 38a6e11a33..0000000000 --- a/federation/pkg/dnsprovider/providers/aws/route53/BUILD +++ /dev/null @@ -1,64 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = [ - "interface.go", - "route53.go", - "rrchangeset.go", - "rrset.go", - "rrsets.go", - "zone.go", - "zones.go", - ], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/aws/route53", - deps = [ - "//federation/pkg/dnsprovider:go_default_library", - "//federation/pkg/dnsprovider/providers/aws/route53/stubs:go_default_library", - "//federation/pkg/dnsprovider/rrstype:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/aws/session:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/service/route53:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/uuid:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["route53_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/aws/route53", - library = ":go_default_library", - deps = [ - "//federation/pkg/dnsprovider:go_default_library", - "//federation/pkg/dnsprovider/providers/aws/route53/stubs:go_default_library", - "//federation/pkg/dnsprovider/rrstype:go_default_library", - "//federation/pkg/dnsprovider/tests:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/service/route53:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/pkg/dnsprovider/providers/aws/route53/stubs:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/pkg/dnsprovider/providers/aws/route53/interface.go b/federation/pkg/dnsprovider/providers/aws/route53/interface.go deleted file mode 100644 index b5f1718872..0000000000 --- a/federation/pkg/dnsprovider/providers/aws/route53/interface.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2016 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 route53 - -import ( - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/aws/route53/stubs" -) - -// Compile time check for interface adherence -var _ dnsprovider.Interface = Interface{} - -type Interface struct { - service stubs.Route53API -} - -// New builds an Interface, with a specified Route53API implementation. -// This is useful for testing purposes, but also if we want an instance with with custom AWS options. -func New(service stubs.Route53API) *Interface { - return &Interface{service} -} - -func (i Interface) Zones() (zones dnsprovider.Zones, supported bool) { - return Zones{&i}, true -} diff --git a/federation/pkg/dnsprovider/providers/aws/route53/route53.go b/federation/pkg/dnsprovider/providers/aws/route53/route53.go deleted file mode 100644 index 4e440f7a3d..0000000000 --- a/federation/pkg/dnsprovider/providers/aws/route53/route53.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright 2016 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. -*/ - -// route53 is the implementation of pkg/dnsprovider interface for AWS Route53 -package route53 - -import ( - "io" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/route53" - "github.com/golang/glog" - "k8s.io/kubernetes/federation/pkg/dnsprovider" -) - -const ( - ProviderName = "aws-route53" -) - -func init() { - dnsprovider.RegisterDnsProvider(ProviderName, func(config io.Reader) (dnsprovider.Interface, error) { - return newRoute53(config) - }) -} - -// route53HandlerLogger is a request handler for aws-sdk-go that logs route53 requests -func route53HandlerLogger(req *request.Request) { - service := req.ClientInfo.ServiceName - - name := "?" - if req.Operation != nil { - name = req.Operation.Name - } - - glog.V(4).Infof("AWS request: %s %s", service, name) -} - -// newRoute53 creates a new instance of an AWS Route53 DNS Interface. -func newRoute53(config io.Reader) (*Interface, error) { - // Connect to AWS Route53 - TODO: Do more sophisticated auth - - awsConfig := aws.NewConfig() - - // This avoids a confusing error message when we fail to get credentials - // e.g. https://github.com/kubernetes/kops/issues/605 - awsConfig = awsConfig.WithCredentialsChainVerboseErrors(true) - - svc := route53.New(session.New(), awsConfig) - - // Add our handler that will log requests - svc.Handlers.Sign.PushFrontNamed(request.NamedHandler{ - Name: "k8s/logger", - Fn: route53HandlerLogger, - }) - - return New(svc), nil -} diff --git a/federation/pkg/dnsprovider/providers/aws/route53/route53_test.go b/federation/pkg/dnsprovider/providers/aws/route53/route53_test.go deleted file mode 100644 index 19d8967fde..0000000000 --- a/federation/pkg/dnsprovider/providers/aws/route53/route53_test.go +++ /dev/null @@ -1,295 +0,0 @@ -/* -Copyright 2016 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 route53 - -import ( - "flag" - "fmt" - "os" - "testing" - - "k8s.io/kubernetes/federation/pkg/dnsprovider" - route53testing "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/aws/route53/stubs" - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/route53" - "k8s.io/kubernetes/federation/pkg/dnsprovider/tests" -) - -func newTestInterface() (dnsprovider.Interface, error) { - // Use this to test the real cloud service. - // return dnsprovider.GetDnsProvider(ProviderName, strings.NewReader("\n[global]\nproject-id = federation0-cluster00")) - return newFakeInterface() // Use this to stub out the entire cloud service -} - -func newFakeInterface() (dnsprovider.Interface, error) { - var service route53testing.Route53API - service = route53testing.NewRoute53APIStub() - iface := New(service) - // Add a fake zone to test against. - params := &route53.CreateHostedZoneInput{ - CallerReference: aws.String("Nonce"), // Required - Name: aws.String("example.com"), // Required - } - _, err := iface.service.CreateHostedZone(params) - if err != nil { - return nil, err - } - return iface, nil -} - -var interface_ dnsprovider.Interface - -func TestMain(m *testing.M) { - fmt.Printf("Parsing flags.\n") - flag.Parse() - var err error - fmt.Printf("Getting new test interface.\n") - interface_, err = newTestInterface() - if err != nil { - fmt.Printf("Error creating interface: %v", err) - os.Exit(1) - } - fmt.Printf("Running tests...\n") - os.Exit(m.Run()) -} - -// zones returns the zones interface for the configured dns provider account/project, -// or fails if it can't be found -func zones(t *testing.T) dnsprovider.Zones { - zonesInterface, supported := interface_.Zones() - if !supported { - t.Fatalf("Zones interface not supported by interface %v", interface_) - } else { - t.Logf("Got zones %v\n", zonesInterface) - } - return zonesInterface -} - -// firstZone returns the first zone for the configured dns provider account/project, -// or fails if it can't be found -func firstZone(t *testing.T) dnsprovider.Zone { - t.Logf("Getting zones") - z := zones(t) - zones, err := z.List() - if err != nil { - t.Fatalf("Failed to list zones: %v", err) - } else { - t.Logf("Got zone list: %v\n", zones) - } - if len(zones) < 1 { - t.Fatalf("Zone listing returned %d, expected >= %d", len(zones), 1) - } else { - t.Logf("Got at least 1 zone in list:%v\n", zones[0]) - } - return zones[0] -} - -/* rrs returns the ResourceRecordSets interface for a given zone */ -func rrs(t *testing.T, zone dnsprovider.Zone) (r dnsprovider.ResourceRecordSets) { - rrsets, supported := zone.ResourceRecordSets() - if !supported { - t.Fatalf("ResourceRecordSets interface not supported by zone %v", zone) - return r - } - return rrsets -} - -func listRrsOrFail(t *testing.T, rrsets dnsprovider.ResourceRecordSets) []dnsprovider.ResourceRecordSet { - rrset, err := rrsets.List() - if err != nil { - t.Fatalf("Failed to list recordsets: %v", err) - } else { - if len(rrset) < 0 { - t.Fatalf("Record set length=%d, expected >=0", len(rrset)) - } else { - t.Logf("Got %d recordsets: %v", len(rrset), rrset) - } - } - return rrset -} - -func getExampleRrs(zone dnsprovider.Zone) dnsprovider.ResourceRecordSet { - rrsets, _ := zone.ResourceRecordSets() - return rrsets.New("www11."+zone.Name(), []string{"10.10.10.10", "169.20.20.20"}, 180, rrstype.A) -} - -func getInvalidRrs(zone dnsprovider.Zone) dnsprovider.ResourceRecordSet { - rrsets, _ := zone.ResourceRecordSets() - return rrsets.New("www12."+zone.Name(), []string{"rubbish", "rubbish"}, 180, rrstype.A) -} - -func addRrsetOrFail(t *testing.T, rrsets dnsprovider.ResourceRecordSets, rrset dnsprovider.ResourceRecordSet) { - err := rrsets.StartChangeset().Add(rrset).Apply() - if err != nil { - t.Fatalf("Failed to add recordsets: %v", err) - } -} - -/* TestZonesList verifies that listing of zones succeeds */ -func TestZonesList(t *testing.T) { - firstZone(t) -} - -/* TestZonesID verifies that the id of the zone is returned with the prefix removed */ -func TestZonesID(t *testing.T) { - zone := firstZone(t) - - // Check /hostedzone/ prefix is removed - zoneID := zone.ID() - if zoneID != zone.Name() { - t.Fatalf("Unexpected zone id: %q", zoneID) - } -} - -/* TestZoneAddSuccess verifies that addition of a valid managed DNS zone succeeds */ -func TestZoneAddSuccess(t *testing.T) { - testZoneName := "ubernetes.testing" - z := zones(t) - input, err := z.New(testZoneName) - if err != nil { - t.Errorf("Failed to allocate new zone object %s: %v", testZoneName, err) - } - zone, err := z.Add(input) - if err != nil { - t.Errorf("Failed to create new managed DNS zone %s: %v", testZoneName, err) - } - defer func(zone dnsprovider.Zone) { - if zone != nil { - if err := z.Remove(zone); err != nil { - t.Errorf("Failed to delete zone %v: %v", zone, err) - } - } - }(zone) - t.Logf("Successfully added managed DNS zone: %v", zone) -} - -/* TestResourceRecordSetsList verifies that listing of RRS's succeeds */ -func TestResourceRecordSetsList(t *testing.T) { - listRrsOrFail(t, rrs(t, firstZone(t))) -} - -/* TestResourceRecordSetsAddSuccess verifies that addition of a valid RRS succeeds */ -func TestResourceRecordSetsAddSuccess(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - set := getExampleRrs(zone) - addRrsetOrFail(t, sets, set) - defer sets.StartChangeset().Remove(set).Apply() - t.Logf("Successfully added resource record set: %v", set) -} - -/* TestResourceRecordSetsAdditionVisible verifies that added RRS is visible after addition */ -func TestResourceRecordSetsAdditionVisible(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - rrset := getExampleRrs(zone) - addRrsetOrFail(t, sets, rrset) - defer sets.StartChangeset().Remove(rrset).Apply() - t.Logf("Successfully added resource record set: %v", rrset) - found := false - for _, record := range listRrsOrFail(t, sets) { - if record.Name() == rrset.Name() { - found = true - break - } - } - if !found { - t.Errorf("Failed to find added resource record set %s", rrset.Name()) - } -} - -/* TestResourceRecordSetsAddDuplicateFail verifies that addition of a duplicate RRS fails */ -func TestResourceRecordSetsAddDuplicateFail(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - rrset := getExampleRrs(zone) - addRrsetOrFail(t, sets, rrset) - defer sets.StartChangeset().Remove(rrset).Apply() - t.Logf("Successfully added resource record set: %v", rrset) - // Try to add it again, and verify that the call fails. - err := sets.StartChangeset().Add(rrset).Apply() - if err == nil { - defer sets.StartChangeset().Remove(rrset).Apply() - t.Errorf("Should have failed to add duplicate resource record %v, but succeeded instead.", rrset) - } else { - t.Logf("Correctly failed to add duplicate resource record %v: %v", rrset, err) - } -} - -/* TestResourceRecordSetsRemove verifies that the removal of an existing RRS succeeds */ -func TestResourceRecordSetsRemove(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - rrset := getExampleRrs(zone) - addRrsetOrFail(t, sets, rrset) - err := sets.StartChangeset().Remove(rrset).Apply() - if err != nil { - // Try again to clean up. - defer sets.StartChangeset().Remove(rrset).Apply() - t.Errorf("Failed to remove resource record set %v after adding", rrset) - } else { - t.Logf("Successfully removed resource set %v after adding", rrset) - } -} - -/* TestResourceRecordSetsRemoveGone verifies that a removed RRS no longer exists */ -func TestResourceRecordSetsRemoveGone(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - rrset := getExampleRrs(zone) - addRrsetOrFail(t, sets, rrset) - err := sets.StartChangeset().Remove(rrset).Apply() - if err != nil { - // Try again to clean up. - defer sets.StartChangeset().Remove(rrset).Apply() - t.Errorf("Failed to remove resource record set %v after adding", rrset) - } else { - t.Logf("Successfully removed resource set %v after adding", rrset) - } - // Check that it's gone - list := listRrsOrFail(t, sets) - found := false - for _, set := range list { - if set.Name() == rrset.Name() { - found = true - break - } - } - if found { - t.Errorf("Deleted resource record set %v is still present", rrset) - } -} - -/* TestResourceRecordSetsReplace verifies that replacing an RRS works */ -func TestResourceRecordSetsReplace(t *testing.T) { - zone := firstZone(t) - tests.CommonTestResourceRecordSetsReplace(t, zone) -} - -/* TestResourceRecordSetsReplaceAll verifies that we can remove an RRS and create one with a different name*/ -func TestResourceRecordSetsReplaceAll(t *testing.T) { - zone := firstZone(t) - tests.CommonTestResourceRecordSetsReplaceAll(t, zone) -} - -/* TestResourceRecordSetsDifferentTypes verifies that we can add records of the same name but different types */ -func TestResourceRecordSetsDifferentTypes(t *testing.T) { - zone := firstZone(t) - tests.CommonTestResourceRecordSetsDifferentTypes(t, zone) -} diff --git a/federation/pkg/dnsprovider/providers/aws/route53/rrchangeset.go b/federation/pkg/dnsprovider/providers/aws/route53/rrchangeset.go deleted file mode 100644 index 7727159fa3..0000000000 --- a/federation/pkg/dnsprovider/providers/aws/route53/rrchangeset.go +++ /dev/null @@ -1,134 +0,0 @@ -/* -Copyright 2016 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 route53 - -import ( - "bytes" - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/route53" - "github.com/golang/glog" - "k8s.io/kubernetes/federation/pkg/dnsprovider" -) - -// Compile time check for interface adherence -var _ dnsprovider.ResourceRecordChangeset = &ResourceRecordChangeset{} - -type ResourceRecordChangeset struct { - zone *Zone - rrsets *ResourceRecordSets - - additions []dnsprovider.ResourceRecordSet - removals []dnsprovider.ResourceRecordSet - upserts []dnsprovider.ResourceRecordSet -} - -func (c *ResourceRecordChangeset) Add(rrset dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordChangeset { - c.additions = append(c.additions, rrset) - return c -} - -func (c *ResourceRecordChangeset) Remove(rrset dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordChangeset { - c.removals = append(c.removals, rrset) - return c -} - -func (c *ResourceRecordChangeset) Upsert(rrset dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordChangeset { - c.upserts = append(c.upserts, rrset) - return c -} - -// buildChange converts a dnsprovider.ResourceRecordSet to a route53.Change request -func buildChange(action string, rrs dnsprovider.ResourceRecordSet) *route53.Change { - change := &route53.Change{ - Action: aws.String(action), - ResourceRecordSet: &route53.ResourceRecordSet{ - Name: aws.String(rrs.Name()), - Type: aws.String(string(rrs.Type())), - TTL: aws.Int64(rrs.Ttl()), - }, - } - - for _, rrdata := range rrs.Rrdatas() { - rr := &route53.ResourceRecord{ - Value: aws.String(rrdata), - } - change.ResourceRecordSet.ResourceRecords = append(change.ResourceRecordSet.ResourceRecords, rr) - } - return change -} - -func (c *ResourceRecordChangeset) Apply() error { - hostedZoneID := c.zone.impl.Id - - var changes []*route53.Change - - for _, removal := range c.removals { - change := buildChange(route53.ChangeActionDelete, removal) - changes = append(changes, change) - } - - for _, addition := range c.additions { - change := buildChange(route53.ChangeActionCreate, addition) - changes = append(changes, change) - } - - for _, upsert := range c.upserts { - change := buildChange(route53.ChangeActionUpsert, upsert) - changes = append(changes, change) - } - - if len(changes) == 0 { - return nil - } - - if glog.V(8) { - var sb bytes.Buffer - for _, change := range changes { - sb.WriteString(fmt.Sprintf("\t%s %s %s\n", aws.StringValue(change.Action), aws.StringValue(change.ResourceRecordSet.Type), aws.StringValue(change.ResourceRecordSet.Name))) - } - - glog.V(8).Infof("Route53 Changeset:\n%s", sb.String()) - } - - service := c.zone.zones.interface_.service - - request := &route53.ChangeResourceRecordSetsInput{ - ChangeBatch: &route53.ChangeBatch{ - Changes: changes, - }, - HostedZoneId: hostedZoneID, - } - - _, err := service.ChangeResourceRecordSets(request) - if err != nil { - // Cast err to awserr.Error to get the Code and - // Message from an error. - return err - } - return nil -} - -func (c *ResourceRecordChangeset) IsEmpty() bool { - return len(c.removals) == 0 && len(c.additions) == 0 -} - -// ResourceRecordSets returns the parent ResourceRecordSets -func (c *ResourceRecordChangeset) ResourceRecordSets() dnsprovider.ResourceRecordSets { - return c.rrsets -} diff --git a/federation/pkg/dnsprovider/providers/aws/route53/rrset.go b/federation/pkg/dnsprovider/providers/aws/route53/rrset.go deleted file mode 100644 index cee6fcc342..0000000000 --- a/federation/pkg/dnsprovider/providers/aws/route53/rrset.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2016 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 route53 - -import ( - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/route53" -) - -// Compile time check for interface adherence -var _ dnsprovider.ResourceRecordSet = ResourceRecordSet{} - -type ResourceRecordSet struct { - impl *route53.ResourceRecordSet - rrsets *ResourceRecordSets -} - -func (rrset ResourceRecordSet) Name() string { - return aws.StringValue(rrset.impl.Name) -} - -func (rrset ResourceRecordSet) Rrdatas() []string { - // Sigh - need to unpack the strings out of the route53 ResourceRecords - result := make([]string, len(rrset.impl.ResourceRecords)) - for i, record := range rrset.impl.ResourceRecords { - result[i] = aws.StringValue(record.Value) - } - return result -} - -func (rrset ResourceRecordSet) Ttl() int64 { - return aws.Int64Value(rrset.impl.TTL) -} - -func (rrset ResourceRecordSet) Type() rrstype.RrsType { - return rrstype.RrsType(aws.StringValue(rrset.impl.Type)) -} - -// Route53ResourceRecordSet returns the route53 ResourceRecordSet object for the ResourceRecordSet -// This is a "back door" that allows for limited access to the ResourceRecordSet, -// without having to requery it, so that we can expose AWS specific functionality. -// Using this method should be avoided where possible; instead prefer to add functionality -// to the cross-provider ResourceRecordSet interface. -func (rrset ResourceRecordSet) Route53ResourceRecordSet() *route53.ResourceRecordSet { - return rrset.impl -} diff --git a/federation/pkg/dnsprovider/providers/aws/route53/rrsets.go b/federation/pkg/dnsprovider/providers/aws/route53/rrsets.go deleted file mode 100644 index 67470c8778..0000000000 --- a/federation/pkg/dnsprovider/providers/aws/route53/rrsets.go +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2016 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 route53 - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/route53" - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" -) - -// Compile time check for interface adherence -var _ dnsprovider.ResourceRecordSets = ResourceRecordSets{} - -type ResourceRecordSets struct { - zone *Zone -} - -func (rrsets ResourceRecordSets) List() ([]dnsprovider.ResourceRecordSet, error) { - input := route53.ListResourceRecordSetsInput{ - HostedZoneId: rrsets.zone.impl.Id, - } - - var list []dnsprovider.ResourceRecordSet - err := rrsets.zone.zones.interface_.service.ListResourceRecordSetsPages(&input, func(page *route53.ListResourceRecordSetsOutput, lastPage bool) bool { - for _, rrset := range page.ResourceRecordSets { - list = append(list, &ResourceRecordSet{rrset, &rrsets}) - } - return true - }) - if err != nil { - return nil, err - } - return list, nil -} - -func (rrsets ResourceRecordSets) Get(name string) ([]dnsprovider.ResourceRecordSet, error) { - // This list implementation is very similar to the one implemented in - // the List() method above, but it restricts the retrieved list to - // the records whose name match the given `name`. - input := route53.ListResourceRecordSetsInput{ - HostedZoneId: rrsets.zone.impl.Id, - StartRecordName: aws.String(name), - } - - var list []dnsprovider.ResourceRecordSet - err := rrsets.zone.zones.interface_.service.ListResourceRecordSetsPages(&input, func(page *route53.ListResourceRecordSetsOutput, lastPage bool) bool { - for _, rrset := range page.ResourceRecordSets { - if aws.StringValue(rrset.Name) != name { - return false - } - list = append(list, &ResourceRecordSet{rrset, &rrsets}) - } - return true - }) - if err != nil { - return nil, err - } - - return list, nil -} - -func (r ResourceRecordSets) StartChangeset() dnsprovider.ResourceRecordChangeset { - return &ResourceRecordChangeset{ - zone: r.zone, - rrsets: &r, - } -} - -func (r ResourceRecordSets) New(name string, rrdatas []string, ttl int64, rrstype rrstype.RrsType) dnsprovider.ResourceRecordSet { - rrstypeStr := string(rrstype) - rrs := &route53.ResourceRecordSet{ - Name: &name, - Type: &rrstypeStr, - TTL: &ttl, - } - for _, rrdata := range rrdatas { - rrs.ResourceRecords = append(rrs.ResourceRecords, &route53.ResourceRecord{ - Value: aws.String(rrdata), - }) - } - - return ResourceRecordSet{ - rrs, - &r, - } -} - -// Zone returns the parent zone -func (rrset ResourceRecordSets) Zone() dnsprovider.Zone { - return rrset.zone -} diff --git a/federation/pkg/dnsprovider/providers/aws/route53/stubs/BUILD b/federation/pkg/dnsprovider/providers/aws/route53/stubs/BUILD deleted file mode 100644 index 13f4e589b4..0000000000 --- a/federation/pkg/dnsprovider/providers/aws/route53/stubs/BUILD +++ /dev/null @@ -1,29 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["route53api.go"], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/aws/route53/stubs", - deps = [ - "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/service/route53:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/dnsprovider/providers/aws/route53/stubs/route53api.go b/federation/pkg/dnsprovider/providers/aws/route53/stubs/route53api.go deleted file mode 100644 index b09155a6da..0000000000 --- a/federation/pkg/dnsprovider/providers/aws/route53/stubs/route53api.go +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright 2016 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. -*/ - -/* internal implements a stub for the AWS Route53 API, used primarily for unit testing purposes */ -package stubs - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/route53" -) - -// Compile time check for interface conformance -var _ Route53API = &Route53APIStub{} - -/* Route53API is the subset of the AWS Route53 API that we actually use. Add methods as required. Signatures must match exactly. */ -type Route53API interface { - ListResourceRecordSetsPages(input *route53.ListResourceRecordSetsInput, fn func(p *route53.ListResourceRecordSetsOutput, lastPage bool) (shouldContinue bool)) error - ChangeResourceRecordSets(*route53.ChangeResourceRecordSetsInput) (*route53.ChangeResourceRecordSetsOutput, error) - ListHostedZonesPages(input *route53.ListHostedZonesInput, fn func(p *route53.ListHostedZonesOutput, lastPage bool) (shouldContinue bool)) error - CreateHostedZone(*route53.CreateHostedZoneInput) (*route53.CreateHostedZoneOutput, error) - DeleteHostedZone(*route53.DeleteHostedZoneInput) (*route53.DeleteHostedZoneOutput, error) -} - -// Route53APIStub is a minimal implementation of Route53API, used primarily for unit testing. -// See http://http://docs.aws.amazon.com/sdk-for-go/api/service/route53.html for descriptions -// of all of its methods. -type Route53APIStub struct { - zones map[string]*route53.HostedZone - recordSets map[string]map[string][]*route53.ResourceRecordSet -} - -// NewRoute53APIStub returns an initialized Route53APIStub -func NewRoute53APIStub() *Route53APIStub { - return &Route53APIStub{ - zones: make(map[string]*route53.HostedZone), - recordSets: make(map[string]map[string][]*route53.ResourceRecordSet), - } -} - -func (r *Route53APIStub) ListResourceRecordSetsPages(input *route53.ListResourceRecordSetsInput, fn func(p *route53.ListResourceRecordSetsOutput, lastPage bool) (shouldContinue bool)) error { - output := route53.ListResourceRecordSetsOutput{} // TODO: Support optional input args. - if len(r.recordSets) <= 0 { - output.ResourceRecordSets = []*route53.ResourceRecordSet{} - } else if _, ok := r.recordSets[*input.HostedZoneId]; !ok { - output.ResourceRecordSets = []*route53.ResourceRecordSet{} - } else { - for _, rrsets := range r.recordSets[*input.HostedZoneId] { - for _, rrset := range rrsets { - output.ResourceRecordSets = append(output.ResourceRecordSets, rrset) - } - } - } - lastPage := true - fn(&output, lastPage) - return nil -} - -func (r *Route53APIStub) ChangeResourceRecordSets(input *route53.ChangeResourceRecordSetsInput) (*route53.ChangeResourceRecordSetsOutput, error) { - output := &route53.ChangeResourceRecordSetsOutput{} - recordSets, ok := r.recordSets[*input.HostedZoneId] - if !ok { - recordSets = make(map[string][]*route53.ResourceRecordSet) - } - - for _, change := range input.ChangeBatch.Changes { - key := *change.ResourceRecordSet.Name + "::" + *change.ResourceRecordSet.Type - switch *change.Action { - case route53.ChangeActionCreate: - if _, found := recordSets[key]; found { - return nil, fmt.Errorf("Attempt to create duplicate rrset %s", key) // TODO: Return AWS errors with codes etc - } - recordSets[key] = append(recordSets[key], change.ResourceRecordSet) - case route53.ChangeActionDelete: - if _, found := recordSets[key]; !found { - return nil, fmt.Errorf("Attempt to delete non-existent rrset %s", key) // TODO: Check other fields too - } - delete(recordSets, key) - case route53.ChangeActionUpsert: - // TODO - not used yet - } - } - r.recordSets[*input.HostedZoneId] = recordSets - return output, nil // TODO: We should ideally return status etc, but we don't' use that yet. -} - -func (r *Route53APIStub) ListHostedZonesPages(input *route53.ListHostedZonesInput, fn func(p *route53.ListHostedZonesOutput, lastPage bool) (shouldContinue bool)) error { - output := &route53.ListHostedZonesOutput{} - for _, zone := range r.zones { - output.HostedZones = append(output.HostedZones, zone) - } - lastPage := true - fn(output, lastPage) - return nil -} - -func (r *Route53APIStub) CreateHostedZone(input *route53.CreateHostedZoneInput) (*route53.CreateHostedZoneOutput, error) { - name := aws.StringValue(input.Name) - id := "/hostedzone/" + name - if _, ok := r.zones[id]; ok { - return nil, fmt.Errorf("Error creating hosted DNS zone: %s already exists", id) - } - r.zones[id] = &route53.HostedZone{ - Id: aws.String(id), - Name: aws.String(name), - } - return &route53.CreateHostedZoneOutput{HostedZone: r.zones[id]}, nil -} - -func (r *Route53APIStub) DeleteHostedZone(input *route53.DeleteHostedZoneInput) (*route53.DeleteHostedZoneOutput, error) { - if _, ok := r.zones[*input.Id]; !ok { - return nil, fmt.Errorf("Error deleting hosted DNS zone: %s does not exist", *input.Id) - } - if len(r.recordSets[*input.Id]) > 0 { - return nil, fmt.Errorf("Error deleting hosted DNS zone: %s has resource records", *input.Id) - } - delete(r.zones, *input.Id) - return &route53.DeleteHostedZoneOutput{}, nil -} diff --git a/federation/pkg/dnsprovider/providers/aws/route53/zone.go b/federation/pkg/dnsprovider/providers/aws/route53/zone.go deleted file mode 100644 index 7d82783ba0..0000000000 --- a/federation/pkg/dnsprovider/providers/aws/route53/zone.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2016 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 route53 - -import ( - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/route53" - "k8s.io/kubernetes/federation/pkg/dnsprovider" -) - -// Compile time check for interface adherence -var _ dnsprovider.Zone = &Zone{} - -type Zone struct { - impl *route53.HostedZone - zones *Zones -} - -func (zone *Zone) Name() string { - return aws.StringValue(zone.impl.Name) -} - -func (zone *Zone) ID() string { - id := aws.StringValue(zone.impl.Id) - id = strings.TrimPrefix(id, "/hostedzone/") - return id -} - -func (zone *Zone) ResourceRecordSets() (dnsprovider.ResourceRecordSets, bool) { - return &ResourceRecordSets{zone}, true -} - -// Route53HostedZone returns the route53 HostedZone object for the zone. -// This is a "back door" that allows for limited access to the HostedZone, -// without having to requery it, so that we can expose AWS specific functionality. -// Using this method should be avoided where possible; instead prefer to add functionality -// to the cross-provider Zone interface. -func (zone *Zone) Route53HostedZone() *route53.HostedZone { - return zone.impl -} diff --git a/federation/pkg/dnsprovider/providers/aws/route53/zones.go b/federation/pkg/dnsprovider/providers/aws/route53/zones.go deleted file mode 100644 index f5af6be0c7..0000000000 --- a/federation/pkg/dnsprovider/providers/aws/route53/zones.go +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright 2016 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 route53 - -import ( - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/route53" - - "k8s.io/apimachinery/pkg/util/uuid" - "k8s.io/kubernetes/federation/pkg/dnsprovider" -) - -// Compile time check for interface adherence -var _ dnsprovider.Zones = Zones{} - -type Zones struct { - interface_ *Interface -} - -func (zones Zones) List() ([]dnsprovider.Zone, error) { - var zoneList []dnsprovider.Zone - - input := route53.ListHostedZonesInput{} - err := zones.interface_.service.ListHostedZonesPages(&input, func(page *route53.ListHostedZonesOutput, lastPage bool) bool { - for _, zone := range page.HostedZones { - zoneList = append(zoneList, &Zone{zone, &zones}) - } - return true - }) - if err != nil { - if apiErr, ok := err.(awserr.Error); ok && - apiErr.Code() == "DelegationSetNotReusable" || - apiErr.Code() == "NoSuchDelegationSet" || - apiErr.Code() == "InvalidInput" { - return []dnsprovider.Zone{}, nil - } - return []dnsprovider.Zone{}, err - } - return zoneList, nil -} - -func (zones Zones) Add(zone dnsprovider.Zone) (dnsprovider.Zone, error) { - dnsName := zone.Name() - callerReference := string(uuid.NewUUID()) - input := route53.CreateHostedZoneInput{Name: &dnsName, CallerReference: &callerReference} - output, err := zones.interface_.service.CreateHostedZone(&input) - if err != nil { - return nil, err - } - return &Zone{output.HostedZone, &zones}, nil -} - -func (zones Zones) Remove(zone dnsprovider.Zone) error { - zoneId := zone.(*Zone).impl.Id - input := route53.DeleteHostedZoneInput{Id: zoneId} - _, err := zones.interface_.service.DeleteHostedZone(&input) - if err != nil { - return err - } - return nil -} -func (zones Zones) New(name string) (dnsprovider.Zone, error) { - id := string(uuid.NewUUID()) - managedZone := route53.HostedZone{Id: &id, Name: &name} - return &Zone{&managedZone, &zones}, nil -} diff --git a/federation/pkg/dnsprovider/providers/coredns/BUILD b/federation/pkg/dnsprovider/providers/coredns/BUILD deleted file mode 100644 index 856dca37c6..0000000000 --- a/federation/pkg/dnsprovider/providers/coredns/BUILD +++ /dev/null @@ -1,62 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = [ - "coredns.go", - "interface.go", - "rrchangeset.go", - "rrset.go", - "rrsets.go", - "zone.go", - "zones.go", - ], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/coredns", - deps = [ - "//federation/pkg/dnsprovider:go_default_library", - "//federation/pkg/dnsprovider/providers/coredns/stubs:go_default_library", - "//federation/pkg/dnsprovider/rrstype:go_default_library", - "//vendor/github.com/coreos/etcd/client:go_default_library", - "//vendor/github.com/coreos/etcd/pkg/transport:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/github.com/miekg/coredns/middleware/etcd/msg:go_default_library", - "//vendor/golang.org/x/net/context:go_default_library", - "//vendor/gopkg.in/gcfg.v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["coredns_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/coredns", - library = ":go_default_library", - deps = [ - "//federation/pkg/dnsprovider:go_default_library", - "//federation/pkg/dnsprovider/providers/coredns/stubs:go_default_library", - "//federation/pkg/dnsprovider/rrstype:go_default_library", - "//federation/pkg/dnsprovider/tests:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/pkg/dnsprovider/providers/coredns/stubs:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/pkg/dnsprovider/providers/coredns/coredns.go b/federation/pkg/dnsprovider/providers/coredns/coredns.go deleted file mode 100644 index 02f50e3363..0000000000 --- a/federation/pkg/dnsprovider/providers/coredns/coredns.go +++ /dev/null @@ -1,144 +0,0 @@ -/* -Copyright 2016 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 coredns is the implementation of pkg/dnsprovider interface for CoreDNS -package coredns - -import ( - "crypto/tls" - "fmt" - "io" - "net" - "net/http" - "strconv" - "strings" - "time" - - etcdc "github.com/coreos/etcd/client" - "github.com/coreos/etcd/pkg/transport" - "github.com/golang/glog" - "gopkg.in/gcfg.v1" - utilnet "k8s.io/apimachinery/pkg/util/net" - "k8s.io/kubernetes/federation/pkg/dnsprovider" -) - -// "coredns" should be used to use this DNS provider -const ( - ProviderName = "coredns" -) - -// Config to override defaults -type Config struct { - Global struct { - EtcdEndpoints string `gcfg:"etcd-endpoints"` - CertFile string `gcfg:"etcd-cert-file"` - KeyFile string `gcfg:"etcd-key-file"` - CAFile string `gcfg:"etcd-ca-file"` - DNSZones string `gcfg:"zones"` - CoreDNSEndpoints string `gcfg:"coredns-endpoints"` - } -} - -func init() { - dnsprovider.RegisterDnsProvider(ProviderName, func(config io.Reader) (dnsprovider.Interface, error) { - return newCoreDNSProviderInterface(config) - }) -} - -func newTransportForETCD2(certFile, keyFile, caFile string) (*http.Transport, error) { - var cfg *tls.Config - if len(certFile) == 0 && len(keyFile) == 0 && len(caFile) == 0 { - cfg = nil - } else { - info := transport.TLSInfo{ - CertFile: certFile, - KeyFile: keyFile, - CAFile: caFile, - } - var err error - cfg, err = info.ClientConfig() - if err != nil { - return nil, fmt.Errorf("error creating tls config: %v", err) - } - } - // Copied from etcd.DefaultTransport declaration. - // TODO: Determine if transport needs optimization - tr := utilnet.SetTransportDefaults(&http.Transport{ - Proxy: http.ProxyFromEnvironment, - Dial: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - }).Dial, - TLSHandshakeTimeout: 10 * time.Second, - TLSClientConfig: cfg, - }) - return tr, nil -} - -// newCoreDnsProviderInterface creates a new instance of an CoreDNS DNS Interface. -func newCoreDNSProviderInterface(config io.Reader) (*Interface, error) { - etcdEndpoints := "http://federation-dns-server-etcd:2379" - etcdPathPrefix := "skydns" - dnsZones := "" - var certFile, keyFile, caFile string - - // Possibly override defaults with config below - if config != nil { - var cfg Config - if err := gcfg.ReadInto(&cfg, config); err != nil { - glog.Errorf("Couldn't read config: %v", err) - return nil, err - } - etcdEndpoints = cfg.Global.EtcdEndpoints - dnsZones = cfg.Global.DNSZones - certFile = cfg.Global.CertFile - caFile = cfg.Global.CAFile - keyFile = cfg.Global.KeyFile - } - glog.Infof("Using CoreDNS DNS provider") - - if dnsZones == "" { - return nil, fmt.Errorf("Need to provide at least one DNS Zone") - } - glog.Infof("Creating etcd transport with %s, %s, %s", certFile, keyFile, caFile) - etcdTransport, err := newTransportForETCD2(certFile, keyFile, caFile) - if err != nil { - return nil, fmt.Errorf("error creating transport for etcd: %v", err) - } - - etcdCfg := etcdc.Config{ - Endpoints: strings.Split(etcdEndpoints, ","), - Transport: etcdTransport, - } - - c, err := etcdc.New(etcdCfg) - if err != nil { - return nil, fmt.Errorf("Create etcd client from the config failed") - } - etcdKeysAPI := etcdc.NewKeysAPI(c) - - intf := newInterfaceWithStub(etcdKeysAPI) - intf.etcdPathPrefix = etcdPathPrefix - zoneList := strings.Split(dnsZones, ",") - - intf.zones = Zones{intf: intf} - for index, zoneName := range zoneList { - zone := Zone{domain: zoneName, id: strconv.Itoa(index), zones: &intf.zones} - intf.zones.zoneList = append(intf.zones.zoneList, zone) - } - - return intf, nil -} diff --git a/federation/pkg/dnsprovider/providers/coredns/coredns_test.go b/federation/pkg/dnsprovider/providers/coredns/coredns_test.go deleted file mode 100644 index 39012573fd..0000000000 --- a/federation/pkg/dnsprovider/providers/coredns/coredns_test.go +++ /dev/null @@ -1,270 +0,0 @@ -/* -Copyright 2016 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 coredns - -import ( - "flag" - "fmt" - "os" - "strconv" - "testing" - - "k8s.io/kubernetes/federation/pkg/dnsprovider" - corednstesting "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/coredns/stubs" - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" - - "k8s.io/kubernetes/federation/pkg/dnsprovider/tests" - "strings" -) - -func newTestInterface() (dnsprovider.Interface, error) { - // Use this to test the real cloud service. - // return dnsprovider.GetDnsProvider(ProviderName, strings.NewReader("\n[global]\nproject-id = federation0-cluster00")) - return newFakeInterface() // Use this to stub out the entire cloud service -} - -func newFakeInterface() (dnsprovider.Interface, error) { - var service corednstesting.EtcdKeysAPI - service = corednstesting.NewEtcdKeysAPIStub() - intf := newInterfaceWithStub(service) - intf.etcdPathPrefix = "skydns" - - zoneList := strings.Split("example.com,federation.io", ",") - intf.zones = Zones{intf: intf} - for index, zoneName := range zoneList { - zone := Zone{domain: zoneName, id: strconv.Itoa(index), zones: &intf.zones} - intf.zones.zoneList = append(intf.zones.zoneList, zone) - } - - return intf, nil -} - -var intf dnsprovider.Interface - -func TestMain(m *testing.M) { - fmt.Printf("Parsing flags.\n") - flag.Parse() - var err error - fmt.Printf("Getting new test interface.\n") - intf, err = newTestInterface() - if err != nil { - fmt.Printf("Error creating interface: %v", err) - os.Exit(1) - } - fmt.Printf("Running tests...\n") - os.Exit(m.Run()) -} - -// zones returns the zones interface for the configured dns provider account/project, -// or fails if it can't be found -func zones(t *testing.T) dnsprovider.Zones { - zonesInterface, supported := intf.Zones() - if !supported { - t.Fatalf("Zones interface not supported by interface %v", intf) - } else { - t.Logf("Got zones %v\n", zonesInterface) - } - return zonesInterface -} - -// firstZone returns the first zone for the configured dns provider account/project, -// or fails if it can't be found -func firstZone(t *testing.T) dnsprovider.Zone { - t.Logf("Getting zones") - z := zones(t) - zones, err := z.List() - if err != nil { - t.Fatalf("Failed to list zones: %v", err) - } else { - t.Logf("Got zone list: %v\n", zones) - } - if len(zones) < 1 { - t.Fatalf("Zone listing returned %d, expected >= %d", len(zones), 1) - } else { - t.Logf("Got at least 1 zone in list:%v\n", zones[0]) - } - return zones[0] -} - -/* rrs returns the ResourceRecordSets interface for a given zone */ -func rrs(t *testing.T, zone dnsprovider.Zone) (r dnsprovider.ResourceRecordSets) { - rrsets, supported := zone.ResourceRecordSets() - if !supported { - t.Fatalf("ResourceRecordSets interface not supported by zone %v", zone) - return r - } - return rrsets -} - -func listRrsOrFail(t *testing.T, rrsets dnsprovider.ResourceRecordSets) []dnsprovider.ResourceRecordSet { - rrset, err := rrsets.List() - if err != nil { - t.Fatalf("Failed to list recordsets: %v", err) - } else { - if len(rrset) < 0 { - t.Fatalf("Record set length=%d, expected >=0", len(rrset)) - } else { - t.Logf("Got %d recordsets: %v", len(rrset), rrset) - } - } - return rrset -} - -func getRrOrFail(t *testing.T, rrsets dnsprovider.ResourceRecordSets, name string) []dnsprovider.ResourceRecordSet { - rrsetList, err := rrsets.Get(name) - if err != nil { - t.Fatalf("Failed to get recordset: %v", err) - } else if len(rrsetList) == 0 { - t.Logf("Did not Get recordset: %v", name) - } else { - t.Logf("Got recordsets: %v", rrsetList) - } - return rrsetList -} - -func getExampleRrs(zone dnsprovider.Zone) dnsprovider.ResourceRecordSet { - rrsets, _ := zone.ResourceRecordSets() - return rrsets.New("www11."+zone.Name(), []string{"10.10.10.10", "169.20.20.20"}, 180, rrstype.A) -} - -func addRrsetOrFail(t *testing.T, rrsets dnsprovider.ResourceRecordSets, rrset dnsprovider.ResourceRecordSet) { - err := rrsets.StartChangeset().Add(rrset).Apply() - if err != nil { - t.Fatalf("Failed to add recordsets: %v", err) - } -} - -/* TestZonesList verifies that listing of zones succeeds */ -func TestZonesList(t *testing.T) { - firstZone(t) -} - -/* TestZonesID verifies that the id of the zone is unique */ -func TestZonesID(t *testing.T) { - zone := firstZone(t) - - zoneID := zone.ID() - if zoneID != "0" { - t.Fatalf("Unexpected zone id: %q", zoneID) - } -} - -/* TestResourceRecordSetsGet verifies that getting of RRS succeeds */ -func TestResourceRecordSetsGet(t *testing.T) { - getRrOrFail(t, rrs(t, firstZone(t)), "example.com") -} - -/* TestResourceRecordSetsAddSuccess verifies that addition of a valid RRS succeeds */ -func TestResourceRecordSetsAddSuccess(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - set := getExampleRrs(zone) - addRrsetOrFail(t, sets, set) - defer sets.StartChangeset().Remove(set).Apply() - t.Logf("Successfully added resource record set: %v", set) - if sets.Zone().ID() != zone.ID() { - t.Errorf("Zone for rrset does not match expected") - } -} - -/* TestResourceRecordSetsAdditionVisible verifies that added RRS is visible after addition */ -func TestResourceRecordSetsAdditionVisible(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - rrset := getExampleRrs(zone) - addRrsetOrFail(t, sets, rrset) - defer sets.StartChangeset().Remove(rrset).Apply() - t.Logf("Successfully added resource record set: %v", rrset) - - record := getRrOrFail(t, sets, rrset.Name()) - if record == nil { - t.Errorf("Failed to find added resource record set %s", rrset.Name()) - } -} - -/* TestResourceRecordSetsAddDuplicateFail verifies that addition of a duplicate RRS fails */ -func TestResourceRecordSetsAddDuplicateFail(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - rrset := getExampleRrs(zone) - addRrsetOrFail(t, sets, rrset) - defer sets.StartChangeset().Remove(rrset).Apply() - t.Logf("Successfully added resource record set: %v", rrset) - // Try to add it again, and verify that the call fails. - err := sets.StartChangeset().Add(rrset).Apply() - if err == nil { - defer sets.StartChangeset().Remove(rrset).Apply() - t.Errorf("Should have failed to add duplicate resource record %v, but succeeded instead.", rrset) - } else { - t.Logf("Correctly failed to add duplicate resource record %v: %v", rrset, err) - } -} - -/* TestResourceRecordSetsRemove verifies that the removal of an existing RRS succeeds */ -func TestResourceRecordSetsRemove(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - rrset := getExampleRrs(zone) - addRrsetOrFail(t, sets, rrset) - err := sets.StartChangeset().Remove(rrset).Apply() - if err != nil { - // Try again to clean up. - defer sets.StartChangeset().Remove(rrset).Apply() - t.Errorf("Failed to remove resource record set %v after adding", rrset) - } else { - t.Logf("Successfully removed resource set %v after adding", rrset) - } -} - -/* TestResourceRecordSetsRemoveGone verifies that a removed RRS no longer exists */ -func TestResourceRecordSetsRemoveGone(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - rrset := getExampleRrs(zone) - addRrsetOrFail(t, sets, rrset) - err := sets.StartChangeset().Remove(rrset).Apply() - if err != nil { - // Try again to clean up. - defer sets.StartChangeset().Remove(rrset).Apply() - t.Errorf("Failed to remove resource record set %v after adding", rrset) - } else { - t.Logf("Successfully removed resource set %v after adding", rrset) - } - - record := getRrOrFail(t, sets, rrset.Name()) - if record != nil { - t.Errorf("Deleted resource record set %v is still present", rrset) - } -} - -/* TestResourceRecordSetsReplace verifies that replacing an RRS works */ -func TestResourceRecordSetsReplace(t *testing.T) { - zone := firstZone(t) - tests.CommonTestResourceRecordSetsReplace(t, zone) -} - -/* TestResourceRecordSetsReplaceAll verifies that we can remove an RRS and create one with a different name */ -func TestResourceRecordSetsReplaceAll(t *testing.T) { - zone := firstZone(t) - tests.CommonTestResourceRecordSetsReplaceAll(t, zone) -} - -/* TestResourceRecordSetsDifferentTypes verifies that we can add records with same name, but different types */ -func TestResourceRecordSetsDifferentTypes(t *testing.T) { - zone := firstZone(t) - tests.CommonTestResourceRecordSetsDifferentTypes(t, zone) -} diff --git a/federation/pkg/dnsprovider/providers/coredns/interface.go b/federation/pkg/dnsprovider/providers/coredns/interface.go deleted file mode 100644 index d579fd4725..0000000000 --- a/federation/pkg/dnsprovider/providers/coredns/interface.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2016 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 coredns - -import ( - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/coredns/stubs" -) - -// Compile time check for interface adherence -var _ dnsprovider.Interface = Interface{} - -type Interface struct { - etcdKeysAPI stubs.EtcdKeysAPI - etcdPathPrefix string - zones Zones -} - -// newInterfaceWithStub facilitates stubbing out the underlying etcd -// library for testing purposes. It returns an provider-independent interface. -func newInterfaceWithStub(etcdKeysAPI stubs.EtcdKeysAPI) *Interface { - return &Interface{etcdKeysAPI: etcdKeysAPI} -} - -func (i Interface) Zones() (dnsprovider.Zones, bool) { - return i.zones, true -} diff --git a/federation/pkg/dnsprovider/providers/coredns/rrchangeset.go b/federation/pkg/dnsprovider/providers/coredns/rrchangeset.go deleted file mode 100644 index a2f4bab516..0000000000 --- a/federation/pkg/dnsprovider/providers/coredns/rrchangeset.go +++ /dev/null @@ -1,148 +0,0 @@ -/* -Copyright 2016 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 coredns - -import ( - "encoding/json" - "fmt" - "hash/fnv" - - etcdc "github.com/coreos/etcd/client" - dnsmsg "github.com/miekg/coredns/middleware/etcd/msg" - "golang.org/x/net/context" - "k8s.io/kubernetes/federation/pkg/dnsprovider" -) - -// Compile time check for interface adherence -var _ dnsprovider.ResourceRecordChangeset = &ResourceRecordChangeset{} - -type ChangeSetType string - -const ( - ADDITION = ChangeSetType("ADDITION") - DELETION = ChangeSetType("DELETION") - UPSERT = ChangeSetType("UPSERT") -) - -type ChangeSet struct { - cstype ChangeSetType - rrset dnsprovider.ResourceRecordSet -} - -type ResourceRecordChangeset struct { - zone *Zone - rrsets *ResourceRecordSets - - changeset []ChangeSet -} - -func (c *ResourceRecordChangeset) Add(rrset dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordChangeset { - c.changeset = append(c.changeset, ChangeSet{cstype: ADDITION, rrset: rrset}) - return c -} - -func (c *ResourceRecordChangeset) Remove(rrset dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordChangeset { - c.changeset = append(c.changeset, ChangeSet{cstype: DELETION, rrset: rrset}) - return c -} - -func (c *ResourceRecordChangeset) IsEmpty() bool { - return len(c.changeset) == 0 -} - -func (c *ResourceRecordChangeset) Upsert(rrset dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordChangeset { - c.changeset = append(c.changeset, ChangeSet{cstype: UPSERT, rrset: rrset}) - return c -} - -func (c *ResourceRecordChangeset) Apply() error { - ctx := context.Background() - etcdPathPrefix := c.zone.zones.intf.etcdPathPrefix - getOpts := &etcdc.GetOptions{} - setOpts := &etcdc.SetOptions{} - deleteOpts := &etcdc.DeleteOptions{ - Recursive: true, - } - - for _, changeset := range c.changeset { - switch changeset.cstype { - case ADDITION, UPSERT: - checkNotExists := changeset.cstype == ADDITION - - // TODO: I think the semantics of the other providers are different; they operate at the record level, not the individual rrdata level - // In other words: we should insert/replace all the records for the key - for _, rrdata := range changeset.rrset.Rrdatas() { - b, err := json.Marshal(&dnsmsg.Service{Host: rrdata, TTL: uint32(changeset.rrset.Ttl()), Group: changeset.rrset.Name()}) - if err != nil { - return err - } - recordValue := string(b) - recordLabel := getHash(rrdata) - recordKey := buildDNSNameString(changeset.rrset.Name(), recordLabel) - - if checkNotExists { - response, err := c.zone.zones.intf.etcdKeysAPI.Get(ctx, dnsmsg.Path(recordKey, etcdPathPrefix), getOpts) - if err == nil && response != nil { - return fmt.Errorf("Key already exist, key: %v", recordKey) - } - } - - _, err = c.zone.zones.intf.etcdKeysAPI.Set(ctx, dnsmsg.Path(recordKey, etcdPathPrefix), recordValue, setOpts) - if err != nil { - return err - } - } - - case DELETION: - // TODO: I think the semantics of the other providers are different; they operate at the record level, not the individual rrdata level - // In other words: we should delete all the records for the key, only if it matches exactly - for _, rrdata := range changeset.rrset.Rrdatas() { - recordLabel := getHash(rrdata) - recordKey := buildDNSNameString(changeset.rrset.Name(), recordLabel) - _, err := c.zone.zones.intf.etcdKeysAPI.Delete(ctx, dnsmsg.Path(recordKey, etcdPathPrefix), deleteOpts) - if err != nil { - return err - } - } - // TODO: We need to cleanup empty dirs in etcd - } - } - return nil -} - -// ResourceRecordSets returns the parent ResourceRecordSets -func (c *ResourceRecordChangeset) ResourceRecordSets() dnsprovider.ResourceRecordSets { - return c.rrsets -} - -func getHash(text string) string { - h := fnv.New32a() - h.Write([]byte(text)) - return fmt.Sprintf("%x", h.Sum32()) -} - -func buildDNSNameString(labels ...string) string { - var res string - for _, label := range labels { - if res == "" { - res = label - } else { - res = fmt.Sprintf("%s.%s", label, res) - } - } - return res -} diff --git a/federation/pkg/dnsprovider/providers/coredns/rrset.go b/federation/pkg/dnsprovider/providers/coredns/rrset.go deleted file mode 100644 index 394303667e..0000000000 --- a/federation/pkg/dnsprovider/providers/coredns/rrset.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2016 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 coredns - -import ( - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" -) - -// Compile time check for interface adherence -var _ dnsprovider.ResourceRecordSet = ResourceRecordSet{} - -type ResourceRecordSet struct { - name string - rrdatas []string - ttl int64 - rrsType rrstype.RrsType - rrsets *ResourceRecordSets -} - -func (rrset ResourceRecordSet) Name() string { - return rrset.name -} - -func (rrset ResourceRecordSet) Rrdatas() []string { - return rrset.rrdatas -} - -func (rrset ResourceRecordSet) Ttl() int64 { - return rrset.ttl -} - -func (rrset ResourceRecordSet) Type() rrstype.RrsType { - return rrset.rrsType -} diff --git a/federation/pkg/dnsprovider/providers/coredns/rrsets.go b/federation/pkg/dnsprovider/providers/coredns/rrsets.go deleted file mode 100644 index dbd85cab35..0000000000 --- a/federation/pkg/dnsprovider/providers/coredns/rrsets.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright 2016 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 coredns - -import ( - "encoding/json" - "fmt" - etcdc "github.com/coreos/etcd/client" - "github.com/golang/glog" - dnsmsg "github.com/miekg/coredns/middleware/etcd/msg" - "golang.org/x/net/context" - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" - "net" -) - -// Compile time check for interface adherence -var _ dnsprovider.ResourceRecordSets = ResourceRecordSets{} - -type ResourceRecordSets struct { - zone *Zone -} - -func (rrsets ResourceRecordSets) List() ([]dnsprovider.ResourceRecordSet, error) { - var list []dnsprovider.ResourceRecordSet - return list, fmt.Errorf("OperationNotSupported") -} - -func (rrsets ResourceRecordSets) Get(name string) ([]dnsprovider.ResourceRecordSet, error) { - getOpts := &etcdc.GetOptions{ - Recursive: true, - } - etcdPathPrefix := rrsets.zone.zones.intf.etcdPathPrefix - response, err := rrsets.zone.zones.intf.etcdKeysAPI.Get(context.Background(), dnsmsg.Path(name, etcdPathPrefix), getOpts) - if err != nil { - if etcdc.IsKeyNotFound(err) { - glog.V(2).Infof("Subdomain %q does not exist", name) - return nil, nil - } - return nil, fmt.Errorf("Failed to get service from etcd, err: %v", err) - } - if emptyResponse(response) { - glog.V(2).Infof("Subdomain %q does not exist in etcd", name) - return nil, nil - } - - var list []dnsprovider.ResourceRecordSet - - for _, node := range response.Node.Nodes { - service := dnsmsg.Service{} - err = json.Unmarshal([]byte(node.Value), &service) - if err != nil { - return nil, fmt.Errorf("Failed to unmarshall json data, err: %v", err) - } - - rrset := ResourceRecordSet{name: name, rrdatas: []string{}, rrsets: &rrsets} - ip := net.ParseIP(service.Host) - switch { - case ip == nil: - rrset.rrsType = rrstype.CNAME - case ip.To4() != nil: - rrset.rrsType = rrstype.A - case ip.To16() != nil: - rrset.rrsType = rrstype.AAAA - default: - // Cannot occur - } - rrset.rrdatas = append(rrset.rrdatas, service.Host) - rrset.ttl = int64(service.TTL) - list = append(list, rrset) - } - - return list, nil -} - -func (rrsets ResourceRecordSets) StartChangeset() dnsprovider.ResourceRecordChangeset { - return &ResourceRecordChangeset{ - zone: rrsets.zone, - rrsets: &rrsets, - } -} - -func (rrsets ResourceRecordSets) New(name string, rrdatas []string, ttl int64, rrsType rrstype.RrsType) dnsprovider.ResourceRecordSet { - return ResourceRecordSet{ - name: name, - rrdatas: rrdatas, - ttl: ttl, - rrsType: rrsType, - rrsets: &rrsets, - } -} - -// Zone returns the parent zone -func (rrset ResourceRecordSets) Zone() dnsprovider.Zone { - return rrset.zone -} - -func emptyResponse(resp *etcdc.Response) bool { - return resp == nil || resp.Node == nil || (len(resp.Node.Value) == 0 && len(resp.Node.Nodes) == 0) -} diff --git a/federation/pkg/dnsprovider/providers/coredns/stubs/BUILD b/federation/pkg/dnsprovider/providers/coredns/stubs/BUILD deleted file mode 100644 index 775a3844aa..0000000000 --- a/federation/pkg/dnsprovider/providers/coredns/stubs/BUILD +++ /dev/null @@ -1,29 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["corednsapi.go"], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/coredns/stubs", - deps = [ - "//vendor/github.com/coreos/etcd/client:go_default_library", - "//vendor/golang.org/x/net/context:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/dnsprovider/providers/coredns/stubs/corednsapi.go b/federation/pkg/dnsprovider/providers/coredns/stubs/corednsapi.go deleted file mode 100644 index 4e392257bb..0000000000 --- a/federation/pkg/dnsprovider/providers/coredns/stubs/corednsapi.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2016 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 stubs implements a stub for the EtcdKeysAPI, used primarily for unit testing purposes -package stubs - -import ( - "strings" - - etcd "github.com/coreos/etcd/client" - "golang.org/x/net/context" -) - -// Compile time check for interface conformance -var _ EtcdKeysAPI = &EtcdKeysAPIStub{} - -type EtcdKeysAPI interface { - Set(context context.Context, key, value string, options *etcd.SetOptions) (*etcd.Response, error) - Get(context context.Context, key string, options *etcd.GetOptions) (*etcd.Response, error) - Delete(context context.Context, key string, options *etcd.DeleteOptions) (*etcd.Response, error) -} - -type EtcdKeysAPIStub struct { - writes map[string]string -} - -// NewEtcdKeysAPIStub returns an initialized EtcdKeysAPIStub -func NewEtcdKeysAPIStub() *EtcdKeysAPIStub { - return &EtcdKeysAPIStub{make(map[string]string)} -} - -func (ec *EtcdKeysAPIStub) Set(context context.Context, key, value string, options *etcd.SetOptions) (*etcd.Response, error) { - ec.writes[key] = value - return nil, nil -} - -func (ec *EtcdKeysAPIStub) Delete(context context.Context, key string, options *etcd.DeleteOptions) (*etcd.Response, error) { - for p := range ec.writes { - if (options.Recursive && strings.HasPrefix(p, key)) || (!options.Recursive && p == key) { - delete(ec.writes, p) - } - } - return nil, nil -} - -func (ec *EtcdKeysAPIStub) Get(context context.Context, key string, options *etcd.GetOptions) (*etcd.Response, error) { - nodes := ec.GetAll(key) - if len(nodes) == 0 { - return nil, nil - } - if len(nodes) == 1 && nodes[key] != "" { - return &etcd.Response{Node: &etcd.Node{Key: key, Value: nodes[key], Dir: false}}, nil - } - - node := &etcd.Node{Key: key, Dir: true, Nodes: etcd.Nodes{}} - for k, v := range nodes { - n := &etcd.Node{Key: k, Value: v} - node.Nodes = append(node.Nodes, n) - } - return &etcd.Response{Node: node}, nil -} - -func (ec *EtcdKeysAPIStub) GetAll(key string) map[string]string { - nodes := make(map[string]string) - key = strings.ToLower(key) - for path := range ec.writes { - if strings.HasPrefix(path, key) { - nodes[path] = ec.writes[path] - } - } - return nodes -} diff --git a/federation/pkg/dnsprovider/providers/coredns/zone.go b/federation/pkg/dnsprovider/providers/coredns/zone.go deleted file mode 100644 index 66cb7bb487..0000000000 --- a/federation/pkg/dnsprovider/providers/coredns/zone.go +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2016 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 coredns - -import ( - "k8s.io/kubernetes/federation/pkg/dnsprovider" -) - -// Compile time check for interface adherence -var _ dnsprovider.Zone = Zone{} - -type Zone struct { - domain string - id string - zones *Zones -} - -func (zone Zone) Name() string { - return zone.domain -} - -func (zone Zone) ID() string { - return zone.id -} - -func (zone Zone) ResourceRecordSets() (dnsprovider.ResourceRecordSets, bool) { - return &ResourceRecordSets{zone: &zone}, true -} diff --git a/federation/pkg/dnsprovider/providers/coredns/zones.go b/federation/pkg/dnsprovider/providers/coredns/zones.go deleted file mode 100644 index 14e34d9665..0000000000 --- a/federation/pkg/dnsprovider/providers/coredns/zones.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2016 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 coredns - -import ( - "fmt" - "k8s.io/kubernetes/federation/pkg/dnsprovider" -) - -// Compile time check for interface adherence -var _ dnsprovider.Zones = Zones{} - -type Zones struct { - intf *Interface - zoneList []Zone -} - -func (zones Zones) List() ([]dnsprovider.Zone, error) { - var zoneList []dnsprovider.Zone - for _, zone := range zones.zoneList { - zoneList = append(zoneList, zone) - } - return zoneList, nil -} - -func (zones Zones) Add(zone dnsprovider.Zone) (dnsprovider.Zone, error) { - return &Zone{}, fmt.Errorf("OperationNotSupported") -} - -func (zones Zones) Remove(zone dnsprovider.Zone) error { - return fmt.Errorf("OperationNotSupported") -} -func (zones Zones) New(name string) (dnsprovider.Zone, error) { - return &Zone{}, fmt.Errorf("OperationNotSupported") -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/BUILD b/federation/pkg/dnsprovider/providers/google/clouddns/BUILD deleted file mode 100644 index 506561c9de..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/BUILD +++ /dev/null @@ -1,65 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = [ - "clouddns.go", - "interface.go", - "rrchangeset.go", - "rrset.go", - "rrsets.go", - "zone.go", - "zones.go", - ], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns", - deps = [ - "//federation/pkg/dnsprovider:go_default_library", - "//federation/pkg/dnsprovider/providers/google/clouddns/internal:go_default_library", - "//federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces:go_default_library", - "//federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs:go_default_library", - "//federation/pkg/dnsprovider/rrstype:go_default_library", - "//pkg/cloudprovider/providers/gce:go_default_library", - "//vendor/cloud.google.com/go/compute/metadata:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/golang.org/x/oauth2:go_default_library", - "//vendor/golang.org/x/oauth2/google:go_default_library", - "//vendor/google.golang.org/api/compute/v1:go_default_library", - "//vendor/google.golang.org/api/dns/v1:go_default_library", - "//vendor/google.golang.org/api/googleapi:go_default_library", - "//vendor/gopkg.in/gcfg.v1:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["clouddns_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns", - library = ":go_default_library", - deps = [ - "//federation/pkg/dnsprovider:go_default_library", - "//federation/pkg/dnsprovider/rrstype:go_default_library", - "//federation/pkg/dnsprovider/tests:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/pkg/dnsprovider/providers/google/clouddns/internal:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/clouddns.go b/federation/pkg/dnsprovider/providers/google/clouddns/clouddns.go deleted file mode 100644 index 0242087b1f..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/clouddns.go +++ /dev/null @@ -1,116 +0,0 @@ -/* -Copyright 2016 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. -*/ - -// clouddns is the implementation of pkg/dnsprovider interface for Google Cloud DNS -package clouddns - -import ( - "io" - - "cloud.google.com/go/compute/metadata" - "github.com/golang/glog" - "golang.org/x/oauth2" - "golang.org/x/oauth2/google" - compute "google.golang.org/api/compute/v1" - dns "google.golang.org/api/dns/v1" - gcfg "gopkg.in/gcfg.v1" - - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs" - "k8s.io/kubernetes/pkg/cloudprovider/providers/gce" -) - -const ( - ProviderName = "google-clouddns" -) - -func init() { - dnsprovider.RegisterDnsProvider(ProviderName, func(config io.Reader) (dnsprovider.Interface, error) { - return newCloudDns(config) - }) -} - -type Config struct { - Global struct { - TokenURL string `gcfg:"token-url"` - TokenBody string `gcfg:"token-body"` - ProjectID string `gcfg:"project-id"` - } -} - -// newCloudDns creates a new instance of a Google Cloud DNS Interface. -func newCloudDns(config io.Reader) (*Interface, error) { - projectID, _ := metadata.ProjectID() // On error we get an empty string, which is fine for now. - var tokenSource oauth2.TokenSource - // Possibly override defaults with config below - if config != nil { - var cfg Config - if err := gcfg.ReadInto(&cfg, config); err != nil { - glog.Errorf("Couldn't read config: %v", err) - return nil, err - } - glog.Infof("Using Google Cloud DNS provider config %+v", cfg) - if cfg.Global.ProjectID != "" { - projectID = cfg.Global.ProjectID - } - if cfg.Global.TokenURL != "" { - tokenSource = gce.NewAltTokenSource(cfg.Global.TokenURL, cfg.Global.TokenBody) - } - } - return CreateInterface(projectID, tokenSource) -} - -// CreateInterface creates a clouddns.Interface object using the specified parameters. -// If no tokenSource is specified, uses oauth2.DefaultTokenSource. -func CreateInterface(projectID string, tokenSource oauth2.TokenSource) (*Interface, error) { - if tokenSource == nil { - var err error - tokenSource, err = google.DefaultTokenSource( - oauth2.NoContext, - compute.CloudPlatformScope, - compute.ComputeScope) - glog.Infof("Using DefaultTokenSource %#v", tokenSource) - if err != nil { - return nil, err - } - } else { - glog.Infof("Using existing Token Source %#v", tokenSource) - } - - oauthClient := oauth2.NewClient(oauth2.NoContext, tokenSource) - - service, err := dns.New(oauthClient) - if err != nil { - glog.Errorf("Failed to get Cloud DNS client: %v", err) - } - glog.Infof("Successfully got DNS service: %v\n", service) - return newInterfaceWithStub(projectID, internal.NewService(service)), nil -} - -// NewFakeInterface returns a fake clouddns interface, useful for unit testing purposes. -func NewFakeInterface() (dnsprovider.Interface, error) { - service := stubs.NewService() - interface_ := newInterfaceWithStub("", service) - zones := service.ManagedZones_ - // Add a fake zone to test against. - zone := &stubs.ManagedZone{Service: zones, Name_: "example.com", Rrsets: []stubs.ResourceRecordSet{}, Id_: 1} - call := zones.Create(interface_.project(), zone) - if _, err := call.Do(); err != nil { - return nil, err - } - return interface_, nil -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/clouddns_test.go b/federation/pkg/dnsprovider/providers/google/clouddns/clouddns_test.go deleted file mode 100644 index 705bb145d5..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/clouddns_test.go +++ /dev/null @@ -1,273 +0,0 @@ -/* -Copyright 2016 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 clouddns - -import ( - "flag" - "fmt" - "os" - "testing" - - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" - "k8s.io/kubernetes/federation/pkg/dnsprovider/tests" -) - -func newTestInterface() (dnsprovider.Interface, error) { - // Use this to test the real cloud service - insert appropriate project-id. Default token source will be used. See - // https://github.com/golang/oauth2/blob/master/google/default.go for details. - // return dnsprovider.GetDnsProvider(ProviderName, strings.NewReader("\n[global]\nproject-id = federation0-cluster00")) - return NewFakeInterface() // Use this to stub out the entire cloud service -} - -var interface_ dnsprovider.Interface - -func TestMain(m *testing.M) { - flag.Parse() - var err error - interface_, err = newTestInterface() - if err != nil { - fmt.Printf("Error creating interface: %v", err) - os.Exit(1) - } - os.Exit(m.Run()) -} - -// zones returns the zones interface for the configured dns provider account/project, -// or fails if it can't be found -func zones(t *testing.T) dnsprovider.Zones { - zonesInterface, supported := interface_.Zones() - if !supported { - t.Fatalf("Zones interface not supported by interface %v", interface_) - } else { - t.Logf("Got zones %v\n", zonesInterface) - } - return zonesInterface -} - -// firstZone returns the first zone for the configured dns provider account/project, -// or fails if it can't be found -func firstZone(t *testing.T) dnsprovider.Zone { - t.Logf("Getting zones") - zones, err := zones(t).List() - if err != nil { - t.Fatalf("Failed to list zones: %v", err) - } else { - t.Logf("Got zone list: %v\n", zones) - } - if len(zones) < 1 { - t.Fatalf("Zone listing returned %d, expected >= %d", len(zones), 1) - } else { - t.Logf("Got at least 1 zone in list:%v\n", zones[0]) - } - return zones[0] -} - -/* rrs returns the ResourceRecordSets interface for a given zone */ -func rrs(t *testing.T, zone dnsprovider.Zone) (r dnsprovider.ResourceRecordSets) { - rrsets, supported := zone.ResourceRecordSets() - if !supported { - t.Fatalf("ResourceRecordSets interface not supported by zone %v", zone) - return r - } - return rrsets -} - -func listRrsOrFail(t *testing.T, rrsets dnsprovider.ResourceRecordSets) []dnsprovider.ResourceRecordSet { - rrset, err := rrsets.List() - if err != nil { - t.Fatalf("Failed to list recordsets: %v", err) - } else { - if len(rrset) < 0 { - t.Fatalf("Record set length=%d, expected >=0", len(rrset)) - } else { - t.Logf("Got %d recordsets: %v", len(rrset), rrset) - } - } - return rrset -} - -func getExampleRrs(zone dnsprovider.Zone) dnsprovider.ResourceRecordSet { - rrsets, _ := zone.ResourceRecordSets() - return rrsets.New("www11."+zone.Name(), []string{"10.10.10.10", "169.20.20.20"}, 180, rrstype.A) -} - -func getInvalidRrs(zone dnsprovider.Zone) dnsprovider.ResourceRecordSet { - rrsets, _ := zone.ResourceRecordSets() - return rrsets.New("www12."+zone.Name(), []string{"rubbish", "rubbish"}, 180, rrstype.A) -} - -func addRrsetOrFail(t *testing.T, rrsets dnsprovider.ResourceRecordSets, rrset dnsprovider.ResourceRecordSet) { - err := rrsets.StartChangeset().Add(rrset).Apply() - if err != nil { - t.Fatalf("Failed to add recordsets: %v", err) - } -} - -/* TestZonesList verifies that listing of zones succeeds */ -func TestZonesList(t *testing.T) { - firstZone(t) -} - -/* TestZonesID verifies that the id of the zone is returned with the prefix removed */ -func TestZonesID(t *testing.T) { - zone := firstZone(t) - - zoneID := zone.ID() - if zoneID != "1" { - t.Fatalf("Unexpected zone id: %q", zoneID) - } -} - -/* TestZoneAddSuccess verifies that addition of a valid managed DNS zone succeeds */ -func TestZoneAddSuccess(t *testing.T) { - testZoneName := "ubernetesv2.test." - t.Logf("Getting zones") - z := zones(t) - t.Logf("Got zones, making new Zone") - input, err := z.New(testZoneName) - if err != nil { - t.Errorf("Failed to allocate new zone object %s: %v", testZoneName, err) - } - zone, err := z.Add(input) - if err != nil { - t.Errorf("Failed to create new managed DNS zone %s: %v", testZoneName, err) - } - defer func(zone dnsprovider.Zone) { - if zone != nil { - if err := z.Remove(zone); err != nil { - t.Errorf("Failed to delete zone %v: %v", zone, err) - } - } - }(zone) - t.Logf("Successfully added managed DNS zone: %v", zone) -} - -/* TestResourceRecordSetsList verifies that listing of RRS's succeeds */ -func TestResourceRecordSetsList(t *testing.T) { - listRrsOrFail(t, rrs(t, firstZone(t))) -} - -/* TestResourceRecordSetsAddSuccess verifies that addition of a valid RRS succeeds */ -func TestResourceRecordSetsAddSuccess(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - set := getExampleRrs(zone) - addRrsetOrFail(t, sets, set) - defer sets.StartChangeset().Remove(set).Apply() - t.Logf("Successfully added resource record set: %v", set) -} - -/* TestResourceRecordSetsAdditionVisible verifies that added RRS is visible after addition */ -func TestResourceRecordSetsAdditionVisible(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - rrset := getExampleRrs(zone) - addRrsetOrFail(t, sets, rrset) - defer sets.StartChangeset().Remove(rrset).Apply() - t.Logf("Successfully added resource record set: %v", rrset) - found := false - for _, record := range listRrsOrFail(t, sets) { - if record.Name() == rrset.Name() { - found = true - break - } - } - if !found { - t.Errorf("Failed to find added resource record set %s", rrset.Name()) - } -} - -/* TestResourceRecordSetsAddDuplicateFail verifies that addition of a duplicate RRS fails */ -func TestResourceRecordSetsAddDuplicateFail(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - rrset := getExampleRrs(zone) - addRrsetOrFail(t, sets, rrset) - defer sets.StartChangeset().Remove(rrset).Apply() - t.Logf("Successfully added resource record set: %v", rrset) - // Try to add it again, and verify that the call fails. - err := sets.StartChangeset().Add(rrset).Apply() - if err == nil { - defer sets.StartChangeset().Remove(rrset).Apply() - t.Errorf("Should have failed to add duplicate resource record %v, but succeeded instead.", rrset) - } else { - t.Logf("Correctly failed to add duplicate resource record %v: %v", rrset, err) - } -} - -/* TestResourceRecordSetsRemove verifies that the removal of an existing RRS succeeds */ -func TestResourceRecordSetsRemove(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - rrset := getExampleRrs(zone) - addRrsetOrFail(t, sets, rrset) - err := sets.StartChangeset().Remove(rrset).Apply() - if err != nil { - // Try again to clean up. - defer sets.StartChangeset().Remove(rrset).Apply() - t.Errorf("Failed to remove resource record set %v after adding: %v", rrset, err) - } else { - t.Logf("Successfully removed resource set %v after adding", rrset) - } -} - -/* TestResourceRecordSetsRemoveGone verifies that a removed RRS no longer exists */ -func TestResourceRecordSetsRemoveGone(t *testing.T) { - zone := firstZone(t) - sets := rrs(t, zone) - rrset := getExampleRrs(zone) - addRrsetOrFail(t, sets, rrset) - err := sets.StartChangeset().Remove(rrset).Apply() - if err != nil { - // Try again to clean up. - defer sets.StartChangeset().Remove(rrset).Apply() - t.Errorf("Failed to remove resource record set %v after adding: %v", rrset, err) - } else { - t.Logf("Successfully removed resource set %v after adding", rrset) - } - // Check that it's gone - list := listRrsOrFail(t, sets) - found := false - for _, set := range list { - if set.Name() == rrset.Name() { - found = true - break - } - } - if found { - t.Errorf("Deleted resource record set %v is still present", rrset) - } -} - -/* TestResourceRecordSetsReplace verifies that replacing an RRS works */ -func TestResourceRecordSetsReplace(t *testing.T) { - zone := firstZone(t) - tests.CommonTestResourceRecordSetsReplace(t, zone) -} - -/* TestResourceRecordSetsReplaceAll verifies that we can remove an RRS and create one with a different name*/ -func TestResourceRecordSetsReplaceAll(t *testing.T) { - zone := firstZone(t) - tests.CommonTestResourceRecordSetsReplaceAll(t, zone) -} - -/* TestResourceRecordSetsDifferentType verifies that we can add records of the same name but different types */ -func TestResourceRecordSetsDifferentTypes(t *testing.T) { - zone := firstZone(t) - tests.CommonTestResourceRecordSetsDifferentTypes(t, zone) -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/interface.go b/federation/pkg/dnsprovider/providers/google/clouddns/interface.go deleted file mode 100644 index 6fca4eb84c..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/interface.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2016 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 clouddns - -import ( - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -var _ dnsprovider.Interface = Interface{} - -type Interface struct { - project_ string - service interfaces.Service -} - -// newInterfaceWithStub facilitates stubbing out the underlying Google Cloud DNS -// library for testing purposes. It returns an provider-independent interface. -func newInterfaceWithStub(project string, service interfaces.Service) *Interface { - return &Interface{project, service} -} - -func (i Interface) Zones() (zones dnsprovider.Zones, supported bool) { - return Zones{i.service.ManagedZones(), &i}, true -} - -func (i Interface) project() string { - return i.project_ -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/BUILD b/federation/pkg/dnsprovider/providers/google/clouddns/internal/BUILD deleted file mode 100644 index 570e4e243c..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/BUILD +++ /dev/null @@ -1,53 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "change.go", - "changes_create_call.go", - "changes_service.go", - "clouddns.go", - "managed_zone.go", - "managed_zone_create_call.go", - "managed_zones_delete_call.go", - "managed_zones_get_call.go", - "managed_zones_list_call.go", - "managed_zones_list_response.go", - "managed_zones_service.go", - "rrset.go", - "rrsets_list_call.go", - "rrsets_list_response.go", - "rrsets_service.go", - "service.go", - ], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal", - deps = [ - "//federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces:go_default_library", - "//federation/pkg/dnsprovider/rrstype:go_default_library", - "//vendor/google.golang.org/api/dns/v1:go_default_library", - "//vendor/google.golang.org/api/googleapi:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/uuid:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces:all-srcs", - "//federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/change.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/change.go deleted file mode 100644 index e229a7954d..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/change.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - dns "google.golang.org/api/dns/v1" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.Change = Change{} - -type Change struct{ impl *dns.Change } - -func (c Change) Additions() (rrsets []interfaces.ResourceRecordSet) { - rrsets = make([]interfaces.ResourceRecordSet, len(c.impl.Additions)) - for index, addition := range c.impl.Additions { - rrsets[index] = interfaces.ResourceRecordSet(&ResourceRecordSet{addition}) - } - return rrsets -} - -func (c Change) Deletions() (rrsets []interfaces.ResourceRecordSet) { - rrsets = make([]interfaces.ResourceRecordSet, len(c.impl.Deletions)) - for index, deletion := range c.impl.Deletions { - rrsets[index] = interfaces.ResourceRecordSet(&ResourceRecordSet{deletion}) - } - return rrsets -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/changes_create_call.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/changes_create_call.go deleted file mode 100644 index b1a8310bcd..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/changes_create_call.go +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - dns "google.golang.org/api/dns/v1" - "google.golang.org/api/googleapi" - - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ChangesCreateCall = ChangesCreateCall{} - -type ChangesCreateCall struct{ impl *dns.ChangesCreateCall } - -func (c ChangesCreateCall) Do(opts ...googleapi.CallOption) (interfaces.Change, error) { - ch, err := c.impl.Do(opts...) - return &Change{ch}, err -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/changes_service.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/changes_service.go deleted file mode 100644 index 887ed9df27..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/changes_service.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - dns "google.golang.org/api/dns/v1" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ChangesService = ChangesService{} - -type ChangesService struct{ impl *dns.ChangesService } - -func (c ChangesService) Create(project string, managedZone string, change interfaces.Change) interfaces.ChangesCreateCall { - return &ChangesCreateCall{c.impl.Create(project, managedZone, change.(*Change).impl)} -} - -func (c ChangesService) NewChange(additions, deletions []interfaces.ResourceRecordSet) interfaces.Change { - adds := make([]*dns.ResourceRecordSet, len(additions)) - deletes := make([]*dns.ResourceRecordSet, len(deletions)) - for i, a := range additions { - adds[i] = a.(*ResourceRecordSet).impl - } - for i, d := range deletions { - deletes[i] = d.(*ResourceRecordSet).impl - } - return &Change{&dns.Change{Additions: adds, Deletions: deletes}} -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/clouddns.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/clouddns.go deleted file mode 100644 index 3c8f8c5339..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/clouddns.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2016 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 internal - -// Implementation of internal/interfaces/* on top of Google Cloud DNS API. -// See https://godoc.org/google.golang.org/api/dns/v1 for details -// This facilitates stubbing out Google Cloud DNS for unit testing. -// Only the parts of the API that we use are included. -// Others can be added as needed. - -import dns "google.golang.org/api/dns/v1" - -type ( - Project struct{ impl *dns.Project } - - ProjectsGetCall struct{ impl *dns.ProjectsGetCall } - - ProjectsService struct{ impl *dns.ProjectsService } - - Quota struct{ impl *dns.Quota } -) diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces/BUILD b/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces/BUILD deleted file mode 100644 index 7304f95375..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces/BUILD +++ /dev/null @@ -1,29 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["interfaces.go"], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces", - deps = [ - "//federation/pkg/dnsprovider/rrstype:go_default_library", - "//vendor/google.golang.org/api/googleapi:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces/interfaces.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces/interfaces.go deleted file mode 100644 index 7d9f166398..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces/interfaces.go +++ /dev/null @@ -1,212 +0,0 @@ -/* -Copyright 2016 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 interfaces - -import ( - "context" - - "google.golang.org/api/googleapi" - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" -) - -// Interfaces to directly mirror the Google Cloud DNS API structures. -// See https://godoc.org/google.golang.org/api/dns/v1 for details -// This facilitates stubbing out Google Cloud DNS for unit testing. -// Only the parts of the API that we use are included. -// Others can be added as needed. - -type ( - Change interface { - Additions() []ResourceRecordSet - Deletions() []ResourceRecordSet - // Id() string // TODO: Add as needed - // Kind() string // TODO: Add as needed - // StartTime() string // TODO: Add as needed - // Status() string // TODO: Add as needed - } - - ChangesCreateCall interface { - // Context(ctx context.Context) *ChangesCreateCall // TODO: Add as needed - Do(opts ...googleapi.CallOption) (Change, error) - // Fields(s ...googleapi.Field) *ChangesCreateCall // TODO: Add as needed - } - - ChangesGetCall interface { - // Context(ctx context.Context) *ChangesGetCall // TODO: Add as needed - Do(opts ...googleapi.CallOption) (*Change, error) - // Fields(s ...googleapi.Field) *ChangesGetCall // TODO: Add as needed - // IfNoneMatch(entityTag string) *ChangesGetCall // TODO: Add as needed - } - - ChangesListCall interface { - // Context(ctx context.Context) *ChangesListCall // TODO: Add as needed - Do(opts ...googleapi.CallOption) (*ChangesListResponse, error) - // Fields(s ...googleapi.Field) *ChangesListCall // TODO: Add as needed - // IfNoneMatch(entityTag string) *ChangesListCall // TODO: Add as needed - // MaxResults(maxResults int64) *ChangesListCall // TODO: Add as needed - // PageToken(pageToken string) *ChangesListCall // TODO: Add as needed - // Pages(ctx context.Context, f func(*ChangesListResponse) error) error // TODO: Add as needed - // SortBy(sortBy string) *ChangesListCall // TODO: Add as needed - // SortOrder(sortOrder string) *ChangesListCall // TODO: Add as needed - } - - ChangesListResponse interface { - // Changes() []*Change // TODO: Add as needed - // Kind() string // TODO: Add as needed - // NextPageToken() string // TODO: Add as needed - // ServerResponse() googleapi.ServerResponse // TODO: Add as needed - // ForceSendFields() []string // TODO: Add as needed - } - - ChangesService interface { - // Create(project string, managedZone string, change *Change) *ChangesCreateCall // TODO: Add as needed - Create(project string, managedZone string, change Change) ChangesCreateCall - NewChange(additions, deletions []ResourceRecordSet) Change - - // Get(project string, managedZone string, changeId string) *ChangesGetCall // TODO: Add as needed - // List(project string, managedZone string) *ChangesListCall // TODO: Add as needed - } - - ManagedZone interface { - // CreationTime() string // TODO: Add as needed - // Description() string // TODO: Add as needed - DnsName() string - Id() uint64 - // Kind() string // TODO: Add as needed - Name() string - // NameServerSet() string // TODO: Add as needed - // NameServers() []string // TODO: Add as needed - // ServerResponse() googleapi.ServerResponse // TODO: Add as needed - // ForceSendFields() []string // TODO: Add as needed - } - - ManagedZonesCreateCall interface { - // Context(ctx context.Context) *ManagedZonesCreateCall // TODO: Add as needed - Do(opts ...googleapi.CallOption) (ManagedZone, error) - // Fields(s ...googleapi.Field) *ManagedZonesCreateCall // TODO: Add as needed - } - - ManagedZonesDeleteCall interface { - // Context(ctx context.Context) *ManagedZonesDeleteCall // TODO: Add as needed - Do(opts ...googleapi.CallOption) error - // Fields(s ...googleapi.Field) *ManagedZonesDeleteCall // TODO: Add as needed - } - - ManagedZonesGetCall interface { - // Context(ctx context.Context) *ManagedZonesGetCall // TODO: Add as needed - Do(opts ...googleapi.CallOption) (ManagedZone, error) - // Fields(s ...googleapi.Field) *ManagedZonesGetCall // TODO: Add as needed - // IfNoneMatch(entityTag string) *ManagedZonesGetCall // TODO: Add as needed - } - - ManagedZonesListCall interface { - // Context(ctx context.Context) *ManagedZonesListCall // TODO: Add as needed - DnsName(dnsName string) ManagedZonesListCall - Do(opts ...googleapi.CallOption) (ManagedZonesListResponse, error) - // Fields(s ...googleapi.Field) *ManagedZonesListCall // TODO: Add as needed - // IfNoneMatch(entityTag string) *ManagedZonesListCall // TODO: Add as needed - // MaxResults(maxResults int64) *ManagedZonesListCall // TODO: Add as needed - // PageToken(pageToken string) *ManagedZonesListCall // TODO: Add as needed - // Pages(ctx context.Context, f func(*ManagedZonesListResponse) error) error // TODO: Add as needed - } - - ManagedZonesListResponse interface { - // Kind() string // TODO: Add as needed - // ManagedZones() []*ManagedZone // TODO: Add as needed - ManagedZones() []ManagedZone - // NextPageToken string // TODO: Add as needed - // ServerResponse() googleapi.ServerResponse // TODO: Add as needed - // ForceSendFields() []string // TODO: Add as needed - } - - ManagedZonesService interface { - // NewManagedZonesService(s *Service) *ManagedZonesService // TODO: Add to service if needed - Create(project string, managedZone ManagedZone) ManagedZonesCreateCall - Delete(project string, managedZone string) ManagedZonesDeleteCall - Get(project string, managedZone string) ManagedZonesGetCall - List(project string) ManagedZonesListCall - NewManagedZone(dnsName string) ManagedZone - } - - Project interface { - // Id() string // TODO: Add as needed - // Kind() string // TODO: Add as needed - // Number() uint64 // TODO: Add as needed - // Quota() *Quota // TODO: Add as needed - // ServerResponse() googleapi.ServerResponse // TODO: Add as needed - // ForceSendFields() []string // TODO: Add as needed - } - - ProjectsGetCall interface { - // TODO: Add as needed - } - - ProjectsService interface { - // TODO: Add as needed - } - - Quota interface { - // TODO: Add as needed - } - - ResourceRecordSet interface { - // Kind() string // TODO: Add as needed - Name() string - Rrdatas() []string - Ttl() int64 - Type() string - // ForceSendFields []string // TODO: Add as needed - } - - ResourceRecordSetsListCall interface { - // Context(ctx context.Context) *ResourceRecordSetsListCall // TODO: Add as needed - Do(opts ...googleapi.CallOption) (ResourceRecordSetsListResponse, error) - Pages(ctx context.Context, f func(ResourceRecordSetsListResponse) error) error - // Fields(s ...googleapi.Field) *ResourceRecordSetsListCall // TODO: Add as needed - // IfNoneMatch(entityTag string) *ResourceRecordSetsListCall // TODO: Add as needed - // MaxResults(maxResults int64) *ResourceRecordSetsListCall // TODO: Add as needed - Name(name string) ResourceRecordSetsListCall - // PageToken(pageToken string) *ResourceRecordSetsListCall // TODO: Add as needed - Type(type_ string) ResourceRecordSetsListCall - } - - ResourceRecordSetsListResponse interface { - // Kind() string // TODO: Add as needed - // NextPageToken() string // TODO: Add as needed - Rrsets() []ResourceRecordSet - // ServerResponse() googleapi.ServerResponse // TODO: Add as needed - // ForceSendFields() []string // TODO: Add as needed - } - - ResourceRecordSetsService interface { - List(project string, managedZone string) ResourceRecordSetsListCall - // Get returns a list of resources records with the matching name - Get(project, managedZone, name string) ResourceRecordSetsListCall - // NewResourceRecordSetsService(s *Service) *ResourceRecordSetsService // TODO: add to service as needed - NewResourceRecordSet(name string, rrdatas []string, ttl int64, type_ rrstype.RrsType) ResourceRecordSet - } - - Service interface { - // BasePath() string // TODO: Add as needed - // UserAgent() string // TODO: Add as needed - Changes() ChangesService - ManagedZones() ManagedZonesService - Projects() ProjectsService - ResourceRecordSets() ResourceRecordSetsService - } - // New(client *http.Client) (*Service, error) // TODO: Add as needed -) diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zone.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zone.go deleted file mode 100644 index 862897743f..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zone.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - dns "google.golang.org/api/dns/v1" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ManagedZone = ManagedZone{} - -type ManagedZone struct{ impl *dns.ManagedZone } - -func (m ManagedZone) Name() string { - return m.impl.Name -} - -func (m ManagedZone) Id() uint64 { - return m.impl.Id -} - -func (m ManagedZone) DnsName() string { - return m.impl.DnsName -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zone_create_call.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zone_create_call.go deleted file mode 100644 index 133cd145b4..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zone_create_call.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - dns "google.golang.org/api/dns/v1" - "google.golang.org/api/googleapi" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ManagedZonesCreateCall = ManagedZonesCreateCall{} - -type ManagedZonesCreateCall struct{ impl *dns.ManagedZonesCreateCall } - -func (call ManagedZonesCreateCall) Do(opts ...googleapi.CallOption) (interfaces.ManagedZone, error) { - m, err := call.impl.Do(opts...) - return &ManagedZone{m}, err -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_delete_call.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_delete_call.go deleted file mode 100644 index 2e96763e01..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_delete_call.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - dns "google.golang.org/api/dns/v1" - "google.golang.org/api/googleapi" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ManagedZonesDeleteCall = ManagedZonesDeleteCall{} - -type ManagedZonesDeleteCall struct{ impl *dns.ManagedZonesDeleteCall } - -func (call ManagedZonesDeleteCall) Do(opts ...googleapi.CallOption) error { - return call.impl.Do(opts...) -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_get_call.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_get_call.go deleted file mode 100644 index 2a6cadfed9..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_get_call.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - dns "google.golang.org/api/dns/v1" - "google.golang.org/api/googleapi" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ManagedZonesGetCall = ManagedZonesGetCall{} - -type ManagedZonesGetCall struct{ impl *dns.ManagedZonesGetCall } - -func (call ManagedZonesGetCall) Do(opts ...googleapi.CallOption) (interfaces.ManagedZone, error) { - m, err := call.impl.Do(opts...) - return &ManagedZone{m}, err -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_list_call.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_list_call.go deleted file mode 100644 index b704104647..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_list_call.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - dns "google.golang.org/api/dns/v1" - "google.golang.org/api/googleapi" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ManagedZonesListCall = &ManagedZonesListCall{} - -type ManagedZonesListCall struct{ impl *dns.ManagedZonesListCall } - -func (call *ManagedZonesListCall) Do(opts ...googleapi.CallOption) (interfaces.ManagedZonesListResponse, error) { - response, err := call.impl.Do(opts...) - return &ManagedZonesListResponse{response}, err -} - -func (call *ManagedZonesListCall) DnsName(dnsName string) interfaces.ManagedZonesListCall { - call.impl.DnsName(dnsName) - return call -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_list_response.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_list_response.go deleted file mode 100644 index b254f5eb56..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_list_response.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - dns "google.golang.org/api/dns/v1" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ManagedZonesListResponse = &ManagedZonesListResponse{} - -type ManagedZonesListResponse struct{ impl *dns.ManagedZonesListResponse } - -func (response *ManagedZonesListResponse) ManagedZones() []interfaces.ManagedZone { - zones := make([]interfaces.ManagedZone, len(response.impl.ManagedZones)) - for i, z := range response.impl.ManagedZones { - zones[i] = &ManagedZone{z} - } - return zones -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_service.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_service.go deleted file mode 100644 index 2ea9e2484f..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/managed_zones_service.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - "strings" - - dns "google.golang.org/api/dns/v1" - "k8s.io/apimachinery/pkg/util/uuid" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ManagedZonesService = &ManagedZonesService{} - -type ManagedZonesService struct{ impl *dns.ManagedZonesService } - -func (m *ManagedZonesService) Create(project string, managedzone interfaces.ManagedZone) interfaces.ManagedZonesCreateCall { - return &ManagedZonesCreateCall{m.impl.Create(project, managedzone.(*ManagedZone).impl)} -} - -func (m *ManagedZonesService) Delete(project, managedZone string) interfaces.ManagedZonesDeleteCall { - return &ManagedZonesDeleteCall{m.impl.Delete(project, managedZone)} -} - -func (m *ManagedZonesService) Get(project, managedZone string) interfaces.ManagedZonesGetCall { - return &ManagedZonesGetCall{m.impl.Get(project, managedZone)} -} - -func (m *ManagedZonesService) List(project string) interfaces.ManagedZonesListCall { - return &ManagedZonesListCall{m.impl.List(project)} -} - -func (m *ManagedZonesService) NewManagedZone(dnsName string) interfaces.ManagedZone { - name := "x" + strings.Replace(string(uuid.NewUUID()), "-", "", -1)[0:30] // Unique name, strip out the "-" chars to shorten it, start with a lower case alpha, and truncate to Cloud DNS 32 character limit - return &ManagedZone{impl: &dns.ManagedZone{Name: name, Description: "Kubernetes Federated Service", DnsName: dnsName}} -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/rrset.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/rrset.go deleted file mode 100644 index 2b7c0ce24e..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/rrset.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - dns "google.golang.org/api/dns/v1" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ResourceRecordSet = ResourceRecordSet{} - -type ResourceRecordSet struct{ impl *dns.ResourceRecordSet } - -func (r ResourceRecordSet) Name() string { return r.impl.Name } -func (r ResourceRecordSet) Rrdatas() []string { return r.impl.Rrdatas } -func (r ResourceRecordSet) Ttl() int64 { return r.impl.Ttl } -func (r ResourceRecordSet) Type() string { return r.impl.Type } diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/rrsets_list_call.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/rrsets_list_call.go deleted file mode 100644 index f497ebcfbc..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/rrsets_list_call.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - "context" - - dns "google.golang.org/api/dns/v1" - "google.golang.org/api/googleapi" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ResourceRecordSetsListCall = &ResourceRecordSetsListCall{} - -type ResourceRecordSetsListCall struct { - impl *dns.ResourceRecordSetsListCall -} - -func (call *ResourceRecordSetsListCall) Do(opts ...googleapi.CallOption) (interfaces.ResourceRecordSetsListResponse, error) { - response, err := call.impl.Do(opts...) - return &ResourceRecordSetsListResponse{response}, err -} - -func (call *ResourceRecordSetsListCall) Pages(ctx context.Context, f func(interfaces.ResourceRecordSetsListResponse) error) error { - return call.impl.Pages(ctx, func(page *dns.ResourceRecordSetsListResponse) error { - return f(&ResourceRecordSetsListResponse{page}) - }) -} - -func (call *ResourceRecordSetsListCall) Name(name string) interfaces.ResourceRecordSetsListCall { - call.impl.Name(name) - return call -} - -func (call *ResourceRecordSetsListCall) Type(type_ string) interfaces.ResourceRecordSetsListCall { - call.impl.Type(type_) - return call -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/rrsets_list_response.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/rrsets_list_response.go deleted file mode 100644 index a6ff28df8f..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/rrsets_list_response.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - dns "google.golang.org/api/dns/v1" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ResourceRecordSetsListResponse = &ResourceRecordSetsListResponse{} - -type ResourceRecordSetsListResponse struct { - impl *dns.ResourceRecordSetsListResponse -} - -func (response *ResourceRecordSetsListResponse) Rrsets() []interfaces.ResourceRecordSet { - rrsets := make([]interfaces.ResourceRecordSet, len(response.impl.Rrsets)) - for i, rrset := range response.impl.Rrsets { - rrsets[i] = &ResourceRecordSet{rrset} - } - return rrsets - -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/rrsets_service.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/rrsets_service.go deleted file mode 100644 index a971fd7513..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/rrsets_service.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - dns "google.golang.org/api/dns/v1" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" -) - -// Compile time check for interface adherence -var _ interfaces.ResourceRecordSetsService = &ResourceRecordSetsService{} - -type ResourceRecordSetsService struct { - impl *dns.ResourceRecordSetsService -} - -func (service ResourceRecordSetsService) List(project string, managedZone string) interfaces.ResourceRecordSetsListCall { - return &ResourceRecordSetsListCall{service.impl.List(project, managedZone)} -} - -func (service ResourceRecordSetsService) Get(project, managedZone, name string) interfaces.ResourceRecordSetsListCall { - return &ResourceRecordSetsListCall{service.impl.List(project, managedZone).Name(name)} -} - -func (service ResourceRecordSetsService) NewResourceRecordSet(name string, rrdatas []string, ttl int64, type_ rrstype.RrsType) interfaces.ResourceRecordSet { - rrset := dns.ResourceRecordSet{Name: name, Rrdatas: rrdatas, Ttl: ttl, Type: string(type_)} - return &ResourceRecordSet{&rrset} -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/service.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/service.go deleted file mode 100644 index 8ac5e63b74..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/service.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2016 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 internal - -import ( - dns "google.golang.org/api/dns/v1" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.Service = &Service{} - -type Service struct { - impl *dns.Service -} - -func NewService(service *dns.Service) *Service { - return &Service{service} -} - -func (s *Service) Changes() interfaces.ChangesService { - return &ChangesService{s.impl.Changes} -} - -func (s *Service) ManagedZones() interfaces.ManagedZonesService { - return &ManagedZonesService{s.impl.ManagedZones} -} - -func (s *Service) Projects() interfaces.ProjectsService { - return &ProjectsService{s.impl.Projects} -} - -func (s *Service) ResourceRecordSets() interfaces.ResourceRecordSetsService { - return &ResourceRecordSetsService{s.impl.ResourceRecordSets} -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/BUILD b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/BUILD deleted file mode 100644 index 5013c4117e..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/BUILD +++ /dev/null @@ -1,48 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "change.go", - "changes_create_call.go", - "changes_service.go", - "clouddns.go", - "managed_zone.go", - "managed_zone_create_call.go", - "managed_zones_delete_call.go", - "managed_zones_get_call.go", - "managed_zones_list_call.go", - "managed_zones_list_response.go", - "managed_zones_service.go", - "rrset.go", - "rrsets_list_call.go", - "rrsets_list_response.go", - "rrsets_service.go", - "service.go", - ], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs", - deps = [ - "//federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces:go_default_library", - "//federation/pkg/dnsprovider/rrstype:go_default_library", - "//vendor/google.golang.org/api/dns/v1:go_default_library", - "//vendor/google.golang.org/api/googleapi:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/change.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/change.go deleted file mode 100644 index 83e5d94796..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/change.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2016 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 stubs - -import "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" - -// Compile time check for interface adherence -var _ interfaces.Change = &Change{} - -type Change struct { - Service *ChangesService - Additions_ []interfaces.ResourceRecordSet - Deletions_ []interfaces.ResourceRecordSet -} - -func (c *Change) Additions() (rrsets []interfaces.ResourceRecordSet) { - return c.Additions_ -} - -func (c *Change) Deletions() (rrsets []interfaces.ResourceRecordSet) { - return c.Deletions_ -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/changes_create_call.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/changes_create_call.go deleted file mode 100644 index ab27a12f75..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/changes_create_call.go +++ /dev/null @@ -1,67 +0,0 @@ -/* -Copyright 2016 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 stubs - -import ( - "fmt" - - "google.golang.org/api/googleapi" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ChangesCreateCall = ChangesCreateCall{} - -type ChangesCreateCall struct { - Service *ChangesService - Project string - Zone string - Change interfaces.Change - Error error // Use this to over-ride response if necessary -} - -func hashKey(set interfaces.ResourceRecordSet) string { - return fmt.Sprintf("%s-%d-%s", set.Name(), set.Ttl(), string(set.Type())) -} - -func (c ChangesCreateCall) Do(opts ...googleapi.CallOption) (interfaces.Change, error) { - if c.Error != nil { - return nil, c.Error - } - zone := (c.Service.Service.ManagedZones_.Impl[c.Project][c.Zone]).(*ManagedZone) - rrsets := map[string]ResourceRecordSet{} // compute the new state - for _, set := range zone.Rrsets { - rrsets[hashKey(set)] = set - } - for _, del := range c.Change.Deletions() { - if _, found := rrsets[hashKey(del)]; !found { - return nil, fmt.Errorf("Attempt to delete non-existent rrset %v", del) - } - delete(rrsets, hashKey(del)) - } - for _, add := range c.Change.Additions() { - if _, found := rrsets[hashKey(add)]; found { - return nil, fmt.Errorf("Attempt to insert duplicate rrset %v", add) - } - rrsets[hashKey(add)] = add.(ResourceRecordSet) - } - zone.Rrsets = []ResourceRecordSet{} - for _, rrset := range rrsets { - zone.Rrsets = append(zone.Rrsets, rrset) - } - return c.Change, nil -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/changes_service.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/changes_service.go deleted file mode 100644 index 39b8bd14f2..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/changes_service.go +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2016 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 stubs - -import "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" - -// Compile time check for interface adherence -var _ interfaces.ChangesService = &ChangesService{} - -type ChangesService struct { - Service *Service -} - -func (c *ChangesService) Create(project string, managedZone string, change interfaces.Change) interfaces.ChangesCreateCall { - return &ChangesCreateCall{c, project, managedZone, change, nil} -} - -func (c *ChangesService) NewChange(additions, deletions []interfaces.ResourceRecordSet) interfaces.Change { - return &Change{c, additions, deletions} -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/clouddns.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/clouddns.go deleted file mode 100644 index e870ee4091..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/clouddns.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2016 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 stubs - -// Implementation of internal/interfaces/* on top of Google Cloud DNS API. -// See https://godoc.org/google.golang.org/api/dns/v1 for details -// This facilitates stubbing out Google Cloud DNS for unit testing. -// Only the parts of the API that we use are included. -// Others can be added as needed. - -import dns "google.golang.org/api/dns/v1" - -type ( - // TODO: We don't need these yet, so they remain unimplemented. Add later as required. - Project struct{ impl *dns.Project } - ProjectsGetCall struct{ impl *dns.ProjectsGetCall } - ProjectsService struct{ impl *dns.ProjectsService } - Quota struct{ impl *dns.Quota } -) diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zone.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zone.go deleted file mode 100644 index 2096da400b..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zone.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2016 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 stubs - -import "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" - -// Compile time check for interface adherence -var _ interfaces.ManagedZone = ManagedZone{} - -type ManagedZone struct { - Service *ManagedZonesService - Name_ string - Id_ uint64 - Rrsets []ResourceRecordSet -} - -func (m ManagedZone) Name() string { - return m.Name_ -} - -func (m ManagedZone) Id() uint64 { - return m.Id_ -} - -func (m ManagedZone) DnsName() string { - return m.Name_ // Don't bother storing a separate DNS name -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zone_create_call.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zone_create_call.go deleted file mode 100644 index f35f585cb5..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zone_create_call.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2016 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 stubs - -import ( - "fmt" - - "google.golang.org/api/googleapi" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ManagedZonesCreateCall = ManagedZonesCreateCall{} - -type ManagedZonesCreateCall struct { - Error *error // Use to override response for testing - Service *ManagedZonesService - Project string - ManagedZone interfaces.ManagedZone -} - -func (call ManagedZonesCreateCall) Do(opts ...googleapi.CallOption) (interfaces.ManagedZone, error) { - if call.Error != nil { - return nil, *call.Error - } - if call.Service.Impl[call.Project][call.ManagedZone.DnsName()] != nil { - return nil, fmt.Errorf("Error - attempt to create duplicate zone %s in project %s.", - call.ManagedZone.DnsName(), call.Project) - } - if call.Service.Impl == nil { - call.Service.Impl = map[string]map[string]interfaces.ManagedZone{} - } - if call.Service.Impl[call.Project] == nil { - call.Service.Impl[call.Project] = map[string]interfaces.ManagedZone{} - } - call.Service.Impl[call.Project][call.ManagedZone.DnsName()] = call.ManagedZone - return call.ManagedZone, nil -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_delete_call.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_delete_call.go deleted file mode 100644 index c518e76eba..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_delete_call.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2016 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 stubs - -import ( - "fmt" - - "google.golang.org/api/googleapi" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ManagedZonesDeleteCall = ManagedZonesDeleteCall{} - -type ManagedZonesDeleteCall struct { - Service *ManagedZonesService - Project string - ZoneName string - Error *error // Use this to override response for testing if required -} - -func (call ManagedZonesDeleteCall) Do(opts ...googleapi.CallOption) error { - if call.Error != nil { // Return the override value - return *call.Error - } else { // Just try to delete it from the in-memory array. - project, ok := call.Service.Impl[call.Project] - if ok { - zone, ok := project[call.ZoneName] - if ok { - delete(project, zone.Name()) - return nil - } else { - return fmt.Errorf("Failed to find zone %s in project %s to delete it", call.ZoneName, call.Project) - } - } else { - return fmt.Errorf("Failed to find project %s to delete zone %s from it", call.Project, call.ZoneName) - } - } -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_get_call.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_get_call.go deleted file mode 100644 index f2923c3abd..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_get_call.go +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2016 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 stubs - -import ( - "google.golang.org/api/googleapi" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ManagedZonesGetCall = ManagedZonesGetCall{} - -type ManagedZonesGetCall struct { - Service *ManagedZonesService - Project string - ZoneName string - Response interfaces.ManagedZone // Use this to override response if required - Error *error // Use this to override response if required - DnsName_ string -} - -func (call ManagedZonesGetCall) Do(opts ...googleapi.CallOption) (interfaces.ManagedZone, error) { - if call.Response != nil { - return call.Response, *call.Error - } else { - return call.Service.Impl[call.Project][call.ZoneName], nil - } -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_list_call.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_list_call.go deleted file mode 100644 index 4b7156ffbc..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_list_call.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright 2016 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 stubs - -import ( - "fmt" - - "google.golang.org/api/googleapi" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ManagedZonesListCall = &ManagedZonesListCall{} - -type ManagedZonesListCall struct { - Service *ManagedZonesService - Project string - Response *interfaces.ManagedZonesListResponse // Use this to override response if required - Error *error // Use this to override response if required - DnsName_ string -} - -func (call *ManagedZonesListCall) Do(opts ...googleapi.CallOption) (interfaces.ManagedZonesListResponse, error) { - if call.Response != nil { - return *call.Response, *call.Error - } else { - proj, projectFound := call.Service.Impl[call.Project] - if !projectFound { - return nil, fmt.Errorf("Project %s not found.", call.Project) - } - if call.DnsName_ != "" { - return &ManagedZonesListResponse{[]interfaces.ManagedZone{proj[call.DnsName_]}}, nil - } - list := []interfaces.ManagedZone{} - for _, zone := range proj { - list = append(list, zone) - } - return &ManagedZonesListResponse{list}, nil - } -} - -func (call *ManagedZonesListCall) DnsName(dnsName string) interfaces.ManagedZonesListCall { - call.DnsName_ = dnsName - return call -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_list_response.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_list_response.go deleted file mode 100644 index 095cae2ba8..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_list_response.go +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright 2016 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 stubs - -import "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" - -// Compile time check for interface adherence -var _ interfaces.ManagedZonesListResponse = &ManagedZonesListResponse{} - -type ManagedZonesListResponse struct{ ManagedZones_ []interfaces.ManagedZone } - -func (response *ManagedZonesListResponse) ManagedZones() []interfaces.ManagedZone { - return response.ManagedZones_ -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_service.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_service.go deleted file mode 100644 index 5b8513f2f7..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/managed_zones_service.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2016 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 stubs - -import "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" - -// Compile time check for interface adherence -var _ interfaces.ManagedZonesService = &ManagedZonesService{} - -type ManagedZonesService struct { - Impl map[string]map[string]interfaces.ManagedZone -} - -func (m *ManagedZonesService) Create(project string, managedzone interfaces.ManagedZone) interfaces.ManagedZonesCreateCall { - return &ManagedZonesCreateCall{nil, m, project, managedzone.(*ManagedZone)} -} - -func (m *ManagedZonesService) Delete(project string, managedZone string) interfaces.ManagedZonesDeleteCall { - return &ManagedZonesDeleteCall{m, project, managedZone, nil} -} - -func (m *ManagedZonesService) Get(project string, managedZone string) interfaces.ManagedZonesGetCall { - return &ManagedZonesGetCall{m, project, managedZone, nil, nil, ""} -} - -func (m *ManagedZonesService) List(project string) interfaces.ManagedZonesListCall { - return &ManagedZonesListCall{m, project, nil, nil, ""} -} - -func (m *ManagedZonesService) NewManagedZone(dnsName string) interfaces.ManagedZone { - return &ManagedZone{Service: m, Name_: dnsName} -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrset.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrset.go deleted file mode 100644 index 3412775c17..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrset.go +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2016 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 stubs - -import "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" - -// Compile time check for interface adherence -var _ interfaces.ResourceRecordSet = ResourceRecordSet{} - -type ResourceRecordSet struct { - Name_ string - Rrdatas_ []string - Ttl_ int64 - Type_ string -} - -func (r ResourceRecordSet) Name() string { return r.Name_ } -func (r ResourceRecordSet) Rrdatas() []string { return r.Rrdatas_ } -func (r ResourceRecordSet) Ttl() int64 { return r.Ttl_ } -func (r ResourceRecordSet) Type() string { return r.Type_ } diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrsets_list_call.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrsets_list_call.go deleted file mode 100644 index 8695142bff..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrsets_list_call.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2016 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 stubs - -import ( - "context" - - "google.golang.org/api/googleapi" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ interfaces.ResourceRecordSetsListCall = &ResourceRecordSetsListCall{} - -type ResourceRecordSetsListCall struct { - Response_ *ResourceRecordSetsListResponse - Err_ error - Name_ string - Type_ string -} - -func (call *ResourceRecordSetsListCall) Do(opts ...googleapi.CallOption) (interfaces.ResourceRecordSetsListResponse, error) { - return call.Response_, call.Err_ -} - -func (call *ResourceRecordSetsListCall) Pages(ctx context.Context, f func(interfaces.ResourceRecordSetsListResponse) error) error { - return f(call.Response_) -} - -func (call *ResourceRecordSetsListCall) Name(name string) interfaces.ResourceRecordSetsListCall { - call.Name_ = name - return call -} - -func (call *ResourceRecordSetsListCall) Type(type_ string) interfaces.ResourceRecordSetsListCall { - call.Type_ = type_ - return call -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrsets_list_response.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrsets_list_response.go deleted file mode 100644 index a60d8dceff..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrsets_list_response.go +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2016 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 stubs - -import "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" - -// Compile time check for interface adherence -var _ interfaces.ResourceRecordSetsListResponse = &ResourceRecordSetsListResponse{} - -type ResourceRecordSetsListResponse struct { - impl []interfaces.ResourceRecordSet -} - -func (response *ResourceRecordSetsListResponse) Rrsets() []interfaces.ResourceRecordSet { - return response.impl -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrsets_service.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrsets_service.go deleted file mode 100644 index 13e50d8b03..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/rrsets_service.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright 2016 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 stubs - -import ( - "fmt" - - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" -) - -// Compile time check for interface adherence -var _ interfaces.ResourceRecordSetsService = &ResourceRecordSetsService{} - -type ResourceRecordSetsService struct { - Service *Service - ListCall interfaces.ResourceRecordSetsListCall // Use to override response if required for testing -} - -func (s ResourceRecordSetsService) managedZone(project, managedZone string) (*ManagedZone, error) { - p := s.Service.ManagedZones_.Impl[project] - if p == nil { - return nil, fmt.Errorf("Project not found: %s", project) - } - z := s.Service.ManagedZones_.Impl[project][managedZone] - if z == nil { - return nil, fmt.Errorf("Zone %s not found in project %s", managedZone, project) - } - return z.(*ManagedZone), nil -} - -func (s ResourceRecordSetsService) List(project string, managedZone string) interfaces.ResourceRecordSetsListCall { - if s.ListCall != nil { - return s.ListCall - } - zone, err := s.managedZone(project, managedZone) - if err != nil { - return &ResourceRecordSetsListCall{Err_: err} - } - - response := &ResourceRecordSetsListResponse{} - for _, set := range zone.Rrsets { - response.impl = append(response.impl, set) - } - return &ResourceRecordSetsListCall{Response_: response} -} - -func (s ResourceRecordSetsService) Get(project, managedZone, name string) interfaces.ResourceRecordSetsListCall { - if s.ListCall != nil { - return s.ListCall - } - zone, err := s.managedZone(project, managedZone) - if err != nil { - return &ResourceRecordSetsListCall{Err_: err} - } - - response := &ResourceRecordSetsListResponse{} - for _, set := range zone.Rrsets { - if set.Name_ == name { - response.impl = append(response.impl, set) - } - } - return &ResourceRecordSetsListCall{Response_: response} -} - -func (service ResourceRecordSetsService) NewResourceRecordSet(name string, rrdatas []string, ttl int64, type_ rrstype.RrsType) interfaces.ResourceRecordSet { - rrset := ResourceRecordSet{Name_: name, Rrdatas_: rrdatas, Ttl_: ttl, Type_: string(type_)} - return rrset -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/service.go b/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/service.go deleted file mode 100644 index 561678cf93..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/internal/stubs/service.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2016 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 stubs - -import "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" - -// Compile time check for interface adherence -var _ interfaces.Service = &Service{} - -type Service struct { - Changes_ *ChangesService - ManagedZones_ *ManagedZonesService - Projects_ *ProjectsService - Rrsets_ *ResourceRecordSetsService -} - -func NewService() *Service { - s := &Service{} - s.Changes_ = &ChangesService{s} - s.ManagedZones_ = &ManagedZonesService{} - s.Projects_ = &ProjectsService{} - s.Rrsets_ = &ResourceRecordSetsService{s, nil} - return s -} - -func (s *Service) Changes() interfaces.ChangesService { - return s.Changes_ -} - -func (s *Service) ManagedZones() interfaces.ManagedZonesService { - return s.ManagedZones_ -} - -func (s *Service) Projects() interfaces.ProjectsService { - return s.Projects_ -} - -func (s *Service) ResourceRecordSets() interfaces.ResourceRecordSetsService { - return s.Rrsets_ -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/rrchangeset.go b/federation/pkg/dnsprovider/providers/google/clouddns/rrchangeset.go deleted file mode 100644 index c81d03dd23..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/rrchangeset.go +++ /dev/null @@ -1,124 +0,0 @@ -/* -Copyright 2016 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 clouddns - -import ( - "fmt" - - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ dnsprovider.ResourceRecordChangeset = &ResourceRecordChangeset{} - -type ResourceRecordChangeset struct { - rrsets *ResourceRecordSets - - additions []dnsprovider.ResourceRecordSet - removals []dnsprovider.ResourceRecordSet - upserts []dnsprovider.ResourceRecordSet -} - -func (c *ResourceRecordChangeset) Add(rrset dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordChangeset { - c.additions = append(c.additions, rrset) - return c -} - -func (c *ResourceRecordChangeset) Remove(rrset dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordChangeset { - c.removals = append(c.removals, rrset) - return c -} - -func (c *ResourceRecordChangeset) Upsert(rrset dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordChangeset { - c.upserts = append(c.upserts, rrset) - return c -} - -func (c *ResourceRecordChangeset) Apply() error { - rrsets := c.rrsets - - service := rrsets.zone.zones.interface_.service.Changes() - - var additions []interfaces.ResourceRecordSet - for _, r := range c.additions { - additions = append(additions, r.(ResourceRecordSet).impl) - } - var deletions []interfaces.ResourceRecordSet - for _, r := range c.removals { - deletions = append(deletions, r.(ResourceRecordSet).impl) - } - - if len(c.upserts) != 0 { - // TODO: We could maybe tweak this to fetch just the records we care about - // although not clear when this would be a win. N=1 obviously so though... - before, err := c.rrsets.List() - if err != nil { - return fmt.Errorf("error fetching recordset images for upsert operation: %v", err) - } - - upsertMap := make(map[string]dnsprovider.ResourceRecordSet) - for _, upsert := range c.upserts { - key := string(upsert.Type()) + "::" + upsert.Name() - upsertMap[key] = upsert - } - - for _, b := range before { - key := string(b.Type()) + "::" + b.Name() - upsert := upsertMap[key] - if upsert == nil { - continue - } - - deletions = append(deletions, b.(ResourceRecordSet).impl) - additions = append(additions, upsert.(ResourceRecordSet).impl) - - // Mark as seen - delete(upsertMap, key) - } - - // Anything left in the map must be an addition - for _, upsert := range upsertMap { - additions = append(additions, upsert.(ResourceRecordSet).impl) - } - } - - change := service.NewChange(additions, deletions) - newChange, err := service.Create(rrsets.project(), rrsets.zone.impl.Name(), change).Do() - if err != nil { - return err - } - newAdditions := newChange.Additions() - if len(newAdditions) != len(additions) { - return fmt.Errorf("Internal error when adding resource record set. Call succeeded but number of records returned is incorrect. Records sent=%d, records returned=%d, additions:%v", len(additions), len(newAdditions), c.additions) - } - newDeletions := newChange.Deletions() - if len(newDeletions) != len(deletions) { - return fmt.Errorf("Internal error when deleting resource record set. Call succeeded but number of records returned is incorrect. Records sent=%d, records returned=%d, deletions:%v", len(deletions), len(newDeletions), c.removals) - } - - return nil -} - -func (c *ResourceRecordChangeset) IsEmpty() bool { - return len(c.additions) == 0 && len(c.removals) == 0 -} - -// ResourceRecordSets returns the parent ResourceRecordSets -func (c *ResourceRecordChangeset) ResourceRecordSets() dnsprovider.ResourceRecordSets { - return c.rrsets -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/rrset.go b/federation/pkg/dnsprovider/providers/google/clouddns/rrset.go deleted file mode 100644 index f357e1c9e7..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/rrset.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2016 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 clouddns - -import ( - "fmt" - - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" -) - -// Compile time check for interface adherence -var _ dnsprovider.ResourceRecordSet = ResourceRecordSet{} - -type ResourceRecordSet struct { - impl interfaces.ResourceRecordSet - rrsets *ResourceRecordSets -} - -func (rrset ResourceRecordSet) String() string { - return fmt.Sprintf("<(clouddns) %q type=%s rrdatas=%q ttl=%v>", rrset.Name(), rrset.Type(), rrset.Rrdatas(), rrset.Ttl()) -} - -func (rrset ResourceRecordSet) Name() string { - return rrset.impl.Name() -} - -func (rrset ResourceRecordSet) Rrdatas() []string { - return rrset.impl.Rrdatas() -} - -func (rrset ResourceRecordSet) Ttl() int64 { - return rrset.impl.Ttl() -} - -func (rrset ResourceRecordSet) Type() rrstype.RrsType { - return rrstype.RrsType(rrset.impl.Type()) -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/rrsets.go b/federation/pkg/dnsprovider/providers/google/clouddns/rrsets.go deleted file mode 100644 index db9411c766..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/rrsets.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright 2016 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 clouddns - -import ( - "context" - - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" -) - -// Compile time check for interface adherence -var _ dnsprovider.ResourceRecordSets = ResourceRecordSets{} - -type ResourceRecordSets struct { - zone *Zone - impl interfaces.ResourceRecordSetsService -} - -// List returns a list of resource records in the given project and -// managed zone. -// !!CAUTION!! Your memory might explode if you have a huge number of -// records in your managed zone. -func (rrsets ResourceRecordSets) List() ([]dnsprovider.ResourceRecordSet, error) { - var list []dnsprovider.ResourceRecordSet - - ctx := context.Background() - - call := rrsets.impl.List(rrsets.project(), rrsets.zone.impl.Name()) - err := call.Pages(ctx, func(page interfaces.ResourceRecordSetsListResponse) error { - for _, rrset := range page.Rrsets() { - list = append(list, ResourceRecordSet{rrset, &rrsets}) - } - return nil - }) - if err != nil { - return nil, err - } - - return list, nil -} - -func (rrsets ResourceRecordSets) Get(name string) ([]dnsprovider.ResourceRecordSet, error) { - var list []dnsprovider.ResourceRecordSet - - ctx := context.Background() - - call := rrsets.impl.Get(rrsets.project(), rrsets.zone.impl.Name(), name) - err := call.Pages(ctx, func(page interfaces.ResourceRecordSetsListResponse) error { - for _, rrset := range page.Rrsets() { - list = append(list, ResourceRecordSet{rrset, &rrsets}) - } - return nil - }) - if err != nil { - return nil, err - } - - return list, nil -} - -func (r ResourceRecordSets) StartChangeset() dnsprovider.ResourceRecordChangeset { - return &ResourceRecordChangeset{ - rrsets: &r, - } -} - -func (r ResourceRecordSets) New(name string, rrdatas []string, ttl int64, rrstype rrstype.RrsType) dnsprovider.ResourceRecordSet { - return ResourceRecordSet{r.impl.NewResourceRecordSet(name, rrdatas, ttl, rrstype), &r} -} - -func (rrsets ResourceRecordSets) project() string { - return rrsets.zone.project() -} - -// Zone returns the parent zone -func (rrset ResourceRecordSets) Zone() dnsprovider.Zone { - return rrset.zone -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/zone.go b/federation/pkg/dnsprovider/providers/google/clouddns/zone.go deleted file mode 100644 index 97e775f90f..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/zone.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2016 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 clouddns - -import ( - "strconv" - - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ dnsprovider.Zone = &Zone{} - -type Zone struct { - impl interfaces.ManagedZone - zones *Zones -} - -func (zone *Zone) Name() string { - return zone.impl.DnsName() -} - -func (zone *Zone) ID() string { - return strconv.FormatUint(zone.impl.Id(), 10) -} - -func (zone *Zone) ResourceRecordSets() (dnsprovider.ResourceRecordSets, bool) { - return &ResourceRecordSets{zone, zone.zones.interface_.service.ResourceRecordSets()}, true -} - -func (zone Zone) project() string { - return zone.zones.project() -} diff --git a/federation/pkg/dnsprovider/providers/google/clouddns/zones.go b/federation/pkg/dnsprovider/providers/google/clouddns/zones.go deleted file mode 100644 index 9678083348..0000000000 --- a/federation/pkg/dnsprovider/providers/google/clouddns/zones.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2016 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 clouddns - -import ( - "google.golang.org/api/googleapi" - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns/internal/interfaces" -) - -// Compile time check for interface adherence -var _ dnsprovider.Zones = Zones{} - -type Zones struct { - impl interfaces.ManagedZonesService - interface_ *Interface -} - -func (zones Zones) List() ([]dnsprovider.Zone, error) { - var zoneList []dnsprovider.Zone - response, err := zones.impl.List(zones.project()).Do() - if err != nil { - if apiErr, ok := err.(*googleapi.Error); ok && apiErr.Code == 404 { - return zoneList, nil - } - return nil, err - } - managedZones := response.ManagedZones() - zoneList = make([]dnsprovider.Zone, len(managedZones)) - for i, zone := range managedZones { - zoneList[i] = &Zone{zone, &zones} - } - return zoneList, nil -} - -func (zones Zones) Add(zone dnsprovider.Zone) (dnsprovider.Zone, error) { - managedZone := zones.impl.NewManagedZone(zone.Name()) - response, err := zones.impl.Create(zones.project(), managedZone).Do() - if err != nil { - return nil, err - } - return &Zone{response, &zones}, nil -} - -func (zones Zones) Remove(zone dnsprovider.Zone) error { - if err := zones.impl.Delete(zones.project(), zone.(*Zone).impl.Name()).Do(); err != nil { - return err - } - return nil -} - -func (zones Zones) New(name string) (dnsprovider.Zone, error) { - managedZone := zones.impl.NewManagedZone(name) - return &Zone{managedZone, &zones}, nil -} - -func (zones Zones) project() string { - return zones.interface_.project() -} diff --git a/federation/pkg/dnsprovider/rrstype/BUILD b/federation/pkg/dnsprovider/rrstype/BUILD deleted file mode 100644 index 1df8d0c2d4..0000000000 --- a/federation/pkg/dnsprovider/rrstype/BUILD +++ /dev/null @@ -1,25 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["rrstype.go"], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype", -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/dnsprovider/rrstype/rrstype.go b/federation/pkg/dnsprovider/rrstype/rrstype.go deleted file mode 100644 index acf9e90b31..0000000000 --- a/federation/pkg/dnsprovider/rrstype/rrstype.go +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright 2016 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 rrstype - -type ( - RrsType string -) - -const ( - A = RrsType("A") - AAAA = RrsType("AAAA") - CNAME = RrsType("CNAME") - // TODO: Add other types as required -) diff --git a/federation/pkg/dnsprovider/tests/BUILD b/federation/pkg/dnsprovider/tests/BUILD deleted file mode 100644 index 193e4e5a0a..0000000000 --- a/federation/pkg/dnsprovider/tests/BUILD +++ /dev/null @@ -1,29 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["commontests.go"], - importpath = "k8s.io/kubernetes/federation/pkg/dnsprovider/tests", - deps = [ - "//federation/pkg/dnsprovider:go_default_library", - "//federation/pkg/dnsprovider/rrstype:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/dnsprovider/tests/commontests.go b/federation/pkg/dnsprovider/tests/commontests.go deleted file mode 100644 index 6e1584ad86..0000000000 --- a/federation/pkg/dnsprovider/tests/commontests.go +++ /dev/null @@ -1,194 +0,0 @@ -/* -Copyright 2016 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 tests - -import ( - "reflect" - "testing" - - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" -) - -/* CommonTestResourceRecordSetsReplace verifies that replacing an RRS works */ -func CommonTestResourceRecordSetsReplace(t *testing.T, zone dnsprovider.Zone) { - rrsets, _ := zone.ResourceRecordSets() - - sets := rrs(t, zone) - rrset := rrsets.New("alpha.test.com", []string{"8.8.4.4"}, 40, rrstype.A) - addRrsetOrFail(t, sets, rrset) - defer sets.StartChangeset().Remove(rrset).Apply() - - // Replace the record (change ttl and rrdatas) - newRrset := rrsets.New("alpha.test.com", []string{"8.8.8.8"}, 80, rrstype.A) - err := sets.StartChangeset().Add(newRrset).Remove(rrset).Apply() - if err != nil { - t.Errorf("Failed to replace resource record set %v -> %v: %v", rrset, newRrset, err) - } else { - defer sets.StartChangeset().Remove(newRrset).Apply() - t.Logf("Correctly replaced resource record %v -> %v", rrset, newRrset) - } - - // Check that the record was updated - assertHasRecord(t, sets, newRrset) -} - -/* CommonTestResourceRecordSetsReplaceAll verifies that we can remove an RRS and create one with a different name*/ -func CommonTestResourceRecordSetsReplaceAll(t *testing.T, zone dnsprovider.Zone) { - rrsets, _ := zone.ResourceRecordSets() - - sets := rrs(t, zone) - rrset := rrsets.New("alpha.test.com", []string{"8.8.4.4"}, 40, rrstype.A) - addRrsetOrFail(t, sets, rrset) - defer sets.StartChangeset().Remove(rrset).Apply() - - newRrset := rrsets.New("beta.test.com", []string{"8.8.8.8"}, 80, rrstype.A) - - // Try to add it again, and verify that the call fails. - err := sets.StartChangeset().Add(newRrset).Remove(rrset).Apply() - if err != nil { - t.Errorf("Failed to replace resource record set %v -> %v: %v", rrset, newRrset, err) - } else { - defer sets.StartChangeset().Remove(newRrset).Apply() - t.Logf("Correctly replaced resource record %v -> %v", rrset, newRrset) - } - - // Check that it was updated - assertHasRecord(t, sets, newRrset) - assertNotHasRecord(t, sets, rrset.Name(), rrset.Type()) -} - -/* CommonTestResourceRecordSetsDifferentType verifies that we can add records of the same name but different types */ -func CommonTestResourceRecordSetsDifferentTypes(t *testing.T, zone dnsprovider.Zone) { - rrsets, _ := zone.ResourceRecordSets() - - sets := rrs(t, zone) - rrset := rrsets.New("alpha.test.com", []string{"8.8.4.4"}, 40, rrstype.A) - addRrsetOrFail(t, sets, rrset) - defer sets.StartChangeset().Remove(rrset).Apply() - - aaaaRrset := rrsets.New("alpha.test.com", []string{"2001:4860:4860::8888"}, 80, rrstype.AAAA) - - // Add the resource with the same name but different type - err := sets.StartChangeset().Add(aaaaRrset).Apply() - if err != nil { - t.Errorf("Failed to add resource record set %v: %v", aaaaRrset, err) - } - defer sets.StartChangeset().Remove(aaaaRrset).Apply() - - // Check that both records exist - assertHasRecord(t, sets, aaaaRrset) - assertHasRecord(t, sets, rrset) -} - -/* rrs returns the ResourceRecordSets interface for a given zone */ -func rrs(t *testing.T, zone dnsprovider.Zone) (r dnsprovider.ResourceRecordSets) { - rrsets, supported := zone.ResourceRecordSets() - if !supported { - t.Fatalf("ResourceRecordSets interface not supported by zone %v", zone) - return r - } - return rrsets -} - -func getRrOrFail(t *testing.T, rrsets dnsprovider.ResourceRecordSets, name string) []dnsprovider.ResourceRecordSet { - rrsetList, err := rrsets.Get(name) - if err != nil { - t.Fatalf("Failed to get recordset: %v", err) - } else if len(rrsetList) == 0 { - t.Logf("Did not Get recordset: %v", name) - } else { - t.Logf("Got recordset: %v", rrsetList[0].Name()) - } - return rrsetList -} - -// assertHasRecord tests that rrsets has a record equivalent to rrset -func assertHasRecord(t *testing.T, rrsets dnsprovider.ResourceRecordSets, rrset dnsprovider.ResourceRecordSet) { - var found dnsprovider.ResourceRecordSet - - rrs, err := rrsets.List() - if err != nil { - if err.Error() == "OperationNotSupported" { - foundList := getRrOrFail(t, rrsets, rrset.Name()) - for i, elem := range foundList { - if elem.Name() == rrset.Name() && elem.Type() == rrset.Type() { - found = foundList[i] - break - } - } - } else { - t.Fatalf("Failed to list recordsets: %v", err) - } - } else { - if len(rrs) < 0 { - t.Fatalf("Record set length=%d, expected >=0", len(rrs)) - } else { - t.Logf("Got %d recordsets: %v", len(rrs), rrs) - } - - for _, r := range rrs { - if r.Name() != rrset.Name() || r.Type() != rrset.Type() { - continue - } - - if found != nil { - t.Errorf("found duplicate resource record set: %q and %q", r, found) - } - found = r - } - } - - if found == nil { - t.Errorf("resource record set %v not found", rrset) - } else { - assertEquivalent(t, found, rrset) - } -} - -// assertNotHasRecord tests that rrsets does not have a record matching name and type -func assertNotHasRecord(t *testing.T, rrsets dnsprovider.ResourceRecordSets, name string, rrstype rrstype.RrsType) { - found := getRrOrFail(t, rrsets, name) - if found != nil { - t.Errorf("resource record set found unexpectedly: %v", found) - } -} - -// assertEquivalent tests that l is equal to r, for the methods in ResourceRecordSet -func assertEquivalent(t *testing.T, l, r dnsprovider.ResourceRecordSet) { - if l.Name() != r.Name() { - t.Errorf("resource record sets not equal %v vs %v", l, r) - } - if l.Type() != r.Type() { - t.Errorf("resource record sets not equal %v vs %v", l, r) - } - if l.Ttl() != r.Ttl() { - t.Errorf("resource record sets not equal %v vs %v", l, r) - } - if !reflect.DeepEqual(l.Rrdatas(), r.Rrdatas()) { - t.Errorf("resource record sets not equal %v vs %v", l, r) - } -} - -func addRrsetOrFail(t *testing.T, rrsets dnsprovider.ResourceRecordSets, rrset dnsprovider.ResourceRecordSet) { - err := rrsets.StartChangeset().Add(rrset).Apply() - if err != nil { - t.Fatalf("Failed to add recordset %v: %v", rrset, err) - } else { - t.Logf("Successfully added resource record set: %v", rrset) - } -} diff --git a/federation/pkg/federatedtypes/BUILD b/federation/pkg/federatedtypes/BUILD deleted file mode 100644 index 3b2ce333af..0000000000 --- a/federation/pkg/federatedtypes/BUILD +++ /dev/null @@ -1,88 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_test( - name = "go_default_test", - srcs = [ - "hpa_test.go", - "scheduling_test.go", - ], - importpath = "k8s.io/kubernetes/federation/pkg/federatedtypes", - library = ":go_default_library", - deps = [ - "//federation/pkg/federation-controller/util/test:go_default_library", - "//vendor/github.com/stretchr/testify/assert:go_default_library", - "//vendor/k8s.io/api/autoscaling/v1:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - ], -) - -go_library( - name = "go_default_library", - srcs = [ - "adapter.go", - "configmap.go", - "daemonset.go", - "deployment.go", - "hpa.go", - "namespace.go", - "qualifiedname.go", - "registry.go", - "replicaset.go", - "scheduling.go", - "secret.go", - ], - importpath = "k8s.io/kubernetes/federation/pkg/federatedtypes", - deps = [ - "//federation/apis/federation:go_default_library", - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//federation/pkg/federation-controller/util:go_default_library", - "//federation/pkg/federation-controller/util/hpa:go_default_library", - "//federation/pkg/federation-controller/util/planner:go_default_library", - "//federation/pkg/federation-controller/util/podanalyzer:go_default_library", - "//federation/pkg/federation-controller/util/replicapreferences:go_default_library", - "//pkg/api:go_default_library", - "//pkg/apis/extensions:go_default_library", - "//pkg/controller/namespace/deletion:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/k8s.io/api/autoscaling/v1:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/meta: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/watch:go_default_library", - "//vendor/k8s.io/client-go/dynamic:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/k8s.io/client-go/tools/record:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/pkg/federatedtypes/crudtester:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/pkg/federatedtypes/adapter.go b/federation/pkg/federatedtypes/adapter.go deleted file mode 100644 index 1dbda2a498..0000000000 --- a/federation/pkg/federatedtypes/adapter.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federatedtypes - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - kubeclientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" -) - -// FederatedTypeAdapter defines operations for interacting with a -// federated type. Code written to this interface can then target any -// type for which an implementation of this interface exists. -type FederatedTypeAdapter interface { - Kind() string - ObjectType() pkgruntime.Object - IsExpectedType(obj interface{}) bool - Copy(obj pkgruntime.Object) pkgruntime.Object - Equivalent(obj1, obj2 pkgruntime.Object) bool - QualifiedName(obj pkgruntime.Object) QualifiedName - ObjectMeta(obj pkgruntime.Object) *metav1.ObjectMeta - - // Fed* operations target the federation control plane - FedCreate(obj pkgruntime.Object) (pkgruntime.Object, error) - FedDelete(qualifiedName QualifiedName, options *metav1.DeleteOptions) error - FedGet(qualifiedName QualifiedName) (pkgruntime.Object, error) - FedList(namespace string, options metav1.ListOptions) (pkgruntime.Object, error) - FedUpdate(obj pkgruntime.Object) (pkgruntime.Object, error) - FedWatch(namespace string, options metav1.ListOptions) (watch.Interface, error) - - // The following operations are intended to target a cluster that is a member of a federation - ClusterCreate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) - ClusterDelete(client kubeclientset.Interface, qualifiedName QualifiedName, options *metav1.DeleteOptions) error - ClusterGet(client kubeclientset.Interface, qualifiedName QualifiedName) (pkgruntime.Object, error) - ClusterList(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (pkgruntime.Object, error) - ClusterUpdate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) - ClusterWatch(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (watch.Interface, error) - - IsSchedulingAdapter() bool - - NewTestObject(namespace string) pkgruntime.Object -} - -// AdapterFactory defines the function signature for factory methods -// that create instances of FederatedTypeAdapter. Such methods should -// be registered with RegisterAdapterFactory to ensure the type -// adapter is discoverable. -type AdapterFactory func(client federationclientset.Interface, config *restclient.Config, adapterSpecificArgs map[string]interface{}) FederatedTypeAdapter - -// SetAnnotation sets the given key and value in the given object's ObjectMeta.Annotations map -func SetAnnotation(adapter FederatedTypeAdapter, obj pkgruntime.Object, key, value string) { - meta := adapter.ObjectMeta(obj) - if meta.Annotations == nil { - meta.Annotations = make(map[string]string) - } - meta.Annotations[key] = value -} - -// ObjectKey returns a cluster-unique key for the given object -func ObjectKey(adapter FederatedTypeAdapter, obj pkgruntime.Object) string { - return adapter.QualifiedName(obj).String() -} diff --git a/federation/pkg/federatedtypes/configmap.go b/federation/pkg/federatedtypes/configmap.go deleted file mode 100644 index 79fdea2caf..0000000000 --- a/federation/pkg/federatedtypes/configmap.go +++ /dev/null @@ -1,150 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federatedtypes - -import ( - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/watch" - kubeclientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/federation/pkg/federation-controller/util" -) - -const ( - ConfigMapKind = "configmap" - ConfigMapControllerName = "configmaps" -) - -func init() { - RegisterFederatedType(ConfigMapKind, ConfigMapControllerName, []schema.GroupVersionResource{apiv1.SchemeGroupVersion.WithResource(ConfigMapControllerName)}, NewConfigMapAdapter) -} - -type ConfigMapAdapter struct { - client federationclientset.Interface -} - -func NewConfigMapAdapter(client federationclientset.Interface, config *restclient.Config, adapterSpecificArgs map[string]interface{}) FederatedTypeAdapter { - return &ConfigMapAdapter{client: client} -} - -func (a *ConfigMapAdapter) Kind() string { - return ConfigMapKind -} - -func (a *ConfigMapAdapter) ObjectType() pkgruntime.Object { - return &apiv1.ConfigMap{} -} - -func (a *ConfigMapAdapter) IsExpectedType(obj interface{}) bool { - _, ok := obj.(*apiv1.ConfigMap) - return ok -} - -func (a *ConfigMapAdapter) Copy(obj pkgruntime.Object) pkgruntime.Object { - configmap := obj.(*apiv1.ConfigMap) - return &apiv1.ConfigMap{ - ObjectMeta: util.DeepCopyRelevantObjectMeta(configmap.ObjectMeta), - Data: configmap.Data, - } -} - -func (a *ConfigMapAdapter) Equivalent(obj1, obj2 pkgruntime.Object) bool { - configmap1 := obj1.(*apiv1.ConfigMap) - configmap2 := obj2.(*apiv1.ConfigMap) - return util.ConfigMapEquivalent(configmap1, configmap2) -} - -func (a *ConfigMapAdapter) QualifiedName(obj pkgruntime.Object) QualifiedName { - configmap := obj.(*apiv1.ConfigMap) - return QualifiedName{Namespace: configmap.Namespace, Name: configmap.Name} -} - -func (a *ConfigMapAdapter) ObjectMeta(obj pkgruntime.Object) *metav1.ObjectMeta { - return &obj.(*apiv1.ConfigMap).ObjectMeta -} - -func (a *ConfigMapAdapter) FedCreate(obj pkgruntime.Object) (pkgruntime.Object, error) { - configmap := obj.(*apiv1.ConfigMap) - return a.client.CoreV1().ConfigMaps(configmap.Namespace).Create(configmap) -} - -func (a *ConfigMapAdapter) FedDelete(qualifiedName QualifiedName, options *metav1.DeleteOptions) error { - return a.client.CoreV1().ConfigMaps(qualifiedName.Namespace).Delete(qualifiedName.Name, options) -} - -func (a *ConfigMapAdapter) FedGet(qualifiedName QualifiedName) (pkgruntime.Object, error) { - return a.client.CoreV1().ConfigMaps(qualifiedName.Namespace).Get(qualifiedName.Name, metav1.GetOptions{}) -} - -func (a *ConfigMapAdapter) FedList(namespace string, options metav1.ListOptions) (pkgruntime.Object, error) { - return a.client.CoreV1().ConfigMaps(namespace).List(options) -} - -func (a *ConfigMapAdapter) FedUpdate(obj pkgruntime.Object) (pkgruntime.Object, error) { - configmap := obj.(*apiv1.ConfigMap) - return a.client.CoreV1().ConfigMaps(configmap.Namespace).Update(configmap) -} - -func (a *ConfigMapAdapter) FedWatch(namespace string, options metav1.ListOptions) (watch.Interface, error) { - return a.client.CoreV1().ConfigMaps(namespace).Watch(options) -} - -func (a *ConfigMapAdapter) ClusterCreate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) { - configmap := obj.(*apiv1.ConfigMap) - return client.CoreV1().ConfigMaps(configmap.Namespace).Create(configmap) -} - -func (a *ConfigMapAdapter) ClusterDelete(client kubeclientset.Interface, qualifiedName QualifiedName, options *metav1.DeleteOptions) error { - return client.CoreV1().ConfigMaps(qualifiedName.Namespace).Delete(qualifiedName.Name, options) -} - -func (a *ConfigMapAdapter) ClusterGet(client kubeclientset.Interface, qualifiedName QualifiedName) (pkgruntime.Object, error) { - return client.CoreV1().ConfigMaps(qualifiedName.Namespace).Get(qualifiedName.Name, metav1.GetOptions{}) -} - -func (a *ConfigMapAdapter) ClusterList(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (pkgruntime.Object, error) { - return client.CoreV1().ConfigMaps(namespace).List(options) -} - -func (a *ConfigMapAdapter) ClusterUpdate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) { - configmap := obj.(*apiv1.ConfigMap) - return client.CoreV1().ConfigMaps(configmap.Namespace).Update(configmap) -} - -func (a *ConfigMapAdapter) ClusterWatch(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (watch.Interface, error) { - return client.CoreV1().ConfigMaps(namespace).Watch(options) -} - -func (a *ConfigMapAdapter) IsSchedulingAdapter() bool { - return false -} - -func (a *ConfigMapAdapter) NewTestObject(namespace string) pkgruntime.Object { - return &apiv1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "test-configmap-", - Namespace: namespace, - }, - Data: map[string]string{ - "A": "ala ma kota", - }, - } -} diff --git a/federation/pkg/federatedtypes/crudtester/BUILD b/federation/pkg/federatedtypes/crudtester/BUILD deleted file mode 100644 index 508bd3bad3..0000000000 --- a/federation/pkg/federatedtypes/crudtester/BUILD +++ /dev/null @@ -1,33 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["crudtester.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federatedtypes/crudtester", - deps = [ - "//federation/pkg/federatedtypes:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors: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/util/wait:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/federatedtypes/crudtester/crudtester.go b/federation/pkg/federatedtypes/crudtester/crudtester.go deleted file mode 100644 index e0da833cee..0000000000 --- a/federation/pkg/federatedtypes/crudtester/crudtester.go +++ /dev/null @@ -1,247 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package crudtester - -import ( - "fmt" - "time" - - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/wait" - clientset "k8s.io/client-go/kubernetes" - "k8s.io/kubernetes/federation/pkg/federatedtypes" -) - -const ( - AnnotationTestFederationCRUDUpdate string = "federation.kubernetes.io/test-federation-crud-update" -) - -// TestLogger defines operations common across different types of testing -type TestLogger interface { - Fatalf(format string, args ...interface{}) - Fatal(msg string) - Logf(format string, args ...interface{}) -} - -// FederatedTypeCRUDTester exercises Create/Read/Update/Delete operations for -// federated types via the Federation API and validates that the -// results of those operations are propagated to clusters that are -// members of a federation. -type FederatedTypeCRUDTester struct { - tl TestLogger - adapter federatedtypes.FederatedTypeAdapter - kind string - clusterClients []clientset.Interface - waitInterval time.Duration - // Federation operations will use wait.ForeverTestTimeout. Any - // operation that involves member clusters may take longer due to - // propagation latency. - clusterWaitTimeout time.Duration -} - -func NewFederatedTypeCRUDTester(testLogger TestLogger, adapter federatedtypes.FederatedTypeAdapter, clusterClients []clientset.Interface, waitInterval, clusterWaitTimeout time.Duration) *FederatedTypeCRUDTester { - return &FederatedTypeCRUDTester{ - tl: testLogger, - adapter: adapter, - kind: adapter.Kind(), - clusterClients: clusterClients, - waitInterval: waitInterval, - clusterWaitTimeout: clusterWaitTimeout, - } -} - -func (c *FederatedTypeCRUDTester) CheckLifecycle(desiredObject pkgruntime.Object) { - obj := c.CheckCreate(desiredObject) - c.CheckUpdate(obj) - - // Validate the golden path - removal of dependents - orphanDependents := false - c.CheckDelete(obj, &orphanDependents) -} - -func (c *FederatedTypeCRUDTester) Create(desiredObject pkgruntime.Object) pkgruntime.Object { - namespace := c.adapter.ObjectMeta(desiredObject).Namespace - resourceMsg := fmt.Sprintf("federated %s", c.kind) - if len(namespace) > 0 { - resourceMsg = fmt.Sprintf("%s in namespace %q", resourceMsg, namespace) - } - - c.tl.Logf("Creating new %s", resourceMsg) - - obj, err := c.adapter.FedCreate(desiredObject) - if err != nil { - c.tl.Fatalf("Error creating %s: %v", resourceMsg, err) - } - - qualifiedName := c.adapter.QualifiedName(obj) - c.tl.Logf("Created new federated %s %q", c.kind, qualifiedName) - - return obj -} - -func (c *FederatedTypeCRUDTester) CheckCreate(desiredObject pkgruntime.Object) pkgruntime.Object { - obj := c.Create(desiredObject) - - c.CheckPropagation(obj) - - return obj -} - -func (c *FederatedTypeCRUDTester) CheckUpdate(obj pkgruntime.Object) { - qualifiedName := c.adapter.QualifiedName(obj) - - var initialAnnotation string - meta := c.adapter.ObjectMeta(obj) - if meta.Annotations != nil { - initialAnnotation = meta.Annotations[AnnotationTestFederationCRUDUpdate] - } - - c.tl.Logf("Updating federated %s %q", c.kind, qualifiedName) - updatedObj, err := c.updateFedObject(obj) - if err != nil { - c.tl.Fatalf("Error updating federated %s %q: %v", c.kind, qualifiedName, err) - } - - // updateFedObject is expected to have changed the value of the annotation - meta = c.adapter.ObjectMeta(updatedObj) - updatedAnnotation := meta.Annotations[AnnotationTestFederationCRUDUpdate] - if updatedAnnotation == initialAnnotation { - c.tl.Fatalf("Federated %s %q not mutated", c.kind, qualifiedName) - } - - c.CheckPropagation(updatedObj) -} - -func (c *FederatedTypeCRUDTester) CheckDelete(obj pkgruntime.Object, orphanDependents *bool) { - qualifiedName := c.adapter.QualifiedName(obj) - - c.tl.Logf("Deleting federated %s %q", c.kind, qualifiedName) - err := c.adapter.FedDelete(qualifiedName, &metav1.DeleteOptions{OrphanDependents: orphanDependents}) - if err != nil { - c.tl.Fatalf("Error deleting federated %s %q: %v", c.kind, qualifiedName, err) - } - - deletingInCluster := (orphanDependents != nil && *orphanDependents == false) - - waitTimeout := wait.ForeverTestTimeout - if deletingInCluster { - // May need extra time to delete both federation and cluster resources - waitTimeout = c.clusterWaitTimeout - } - - // Wait for deletion. The federation resource will only be removed once orphan deletion has been - // completed or deemed unnecessary. - err = wait.PollImmediate(c.waitInterval, waitTimeout, func() (bool, error) { - _, err := c.adapter.FedGet(qualifiedName) - if errors.IsNotFound(err) { - return true, nil - } - return false, err - }) - if err != nil { - c.tl.Fatalf("Error deleting federated %s %q: %v", c.kind, qualifiedName, err) - } - - var stateMsg string = "present" - if deletingInCluster { - stateMsg = "not present" - } - for _, client := range c.clusterClients { - _, err := c.adapter.ClusterGet(client, qualifiedName) - switch { - case !deletingInCluster && errors.IsNotFound(err): - c.tl.Fatalf("Federated %s %q was unexpectedly deleted from a member cluster", c.kind, qualifiedName) - case deletingInCluster && err == nil: - c.tl.Fatalf("Federated %s %q was unexpectedly orphaned in a member cluster", c.kind, qualifiedName) - case err != nil && !errors.IsNotFound(err): - c.tl.Fatalf("Error while checking whether %s %q is %s in member clusters: %v", c.kind, qualifiedName, stateMsg, err) - } - } -} - -// CheckPropagation checks propagation for the crud tester's clients -func (c *FederatedTypeCRUDTester) CheckPropagation(obj pkgruntime.Object) { - c.CheckPropagationForClients(obj, c.clusterClients, true) -} - -// CheckPropagationForClients checks propagation for the provided clients -func (c *FederatedTypeCRUDTester) CheckPropagationForClients(obj pkgruntime.Object, clusterClients []clientset.Interface, objExpected bool) { - qualifiedName := c.adapter.QualifiedName(obj) - - c.tl.Logf("Waiting for %s %q in %d clusters", c.kind, qualifiedName, len(clusterClients)) - for _, client := range clusterClients { - err := c.waitForResource(client, obj) - switch { - case err == wait.ErrWaitTimeout: - if objExpected { - c.tl.Fatalf("Timeout verifying %s %q in a member cluster: %v", c.kind, qualifiedName, err) - } - case err != nil: - c.tl.Fatalf("Failed to verify %s %q in a member cluster: %v", c.kind, qualifiedName, err) - case err == nil && !objExpected: - c.tl.Fatalf("Found unexpected object %s %q in a member cluster: %v", c.kind, qualifiedName, err) - } - } -} - -func (c *FederatedTypeCRUDTester) waitForResource(client clientset.Interface, obj pkgruntime.Object) error { - qualifiedName := c.adapter.QualifiedName(obj) - err := wait.PollImmediate(c.waitInterval, c.clusterWaitTimeout, func() (bool, error) { - equivalenceFunc := c.adapter.Equivalent - if c.adapter.IsSchedulingAdapter() { - schedulingAdapter, ok := c.adapter.(federatedtypes.SchedulingAdapter) - if !ok { - c.tl.Fatalf("Adapter for kind %q does not properly implement SchedulingAdapter.", c.adapter.Kind()) - } - equivalenceFunc = schedulingAdapter.EquivalentIgnoringSchedule - } - - clusterObj, err := c.adapter.ClusterGet(client, qualifiedName) - if err == nil && equivalenceFunc(clusterObj, obj) { - return true, nil - } - if errors.IsNotFound(err) { - return false, nil - } - return false, err - }) - return err -} - -func (c *FederatedTypeCRUDTester) updateFedObject(obj pkgruntime.Object) (pkgruntime.Object, error) { - err := wait.PollImmediate(c.waitInterval, wait.ForeverTestTimeout, func() (bool, error) { - // Target the metadata for simplicity (it's type-agnostic) - federatedtypes.SetAnnotation(c.adapter, obj, AnnotationTestFederationCRUDUpdate, "updated") - - _, err := c.adapter.FedUpdate(obj) - if errors.IsConflict(err) { - // The resource was updated by the federation controller. - // Get the latest version and retry. - qualifiedName := c.adapter.QualifiedName(obj) - obj, err = c.adapter.FedGet(qualifiedName) - return false, err - } - // Be tolerant of a slow server - if errors.IsServerTimeout(err) { - return false, nil - } - return (err == nil), err - }) - return obj, err -} diff --git a/federation/pkg/federatedtypes/daemonset.go b/federation/pkg/federatedtypes/daemonset.go deleted file mode 100644 index 156cdb420b..0000000000 --- a/federation/pkg/federatedtypes/daemonset.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federatedtypes - -import ( - "reflect" - - "k8s.io/api/core/v1" - extensionsv1 "k8s.io/api/extensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/watch" - kubeclientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/federation/pkg/federation-controller/util" -) - -const ( - DaemonSetKind = "daemonset" - DaemonSetControllerName = "daemonsets" -) - -func init() { - RegisterFederatedType(DaemonSetKind, DaemonSetControllerName, []schema.GroupVersionResource{extensionsv1.SchemeGroupVersion.WithResource(DaemonSetControllerName)}, NewDaemonSetAdapter) -} - -type DaemonSetAdapter struct { - client federationclientset.Interface -} - -func NewDaemonSetAdapter(client federationclientset.Interface, config *restclient.Config, adapterSpecificArgs map[string]interface{}) FederatedTypeAdapter { - return &DaemonSetAdapter{client: client} -} - -func (a *DaemonSetAdapter) Kind() string { - return DaemonSetKind -} - -func (a *DaemonSetAdapter) ObjectType() pkgruntime.Object { - return &extensionsv1.DaemonSet{} -} - -func (a *DaemonSetAdapter) IsExpectedType(obj interface{}) bool { - _, ok := obj.(*extensionsv1.DaemonSet) - return ok -} - -func (a *DaemonSetAdapter) Copy(obj pkgruntime.Object) pkgruntime.Object { - daemonset := obj.(*extensionsv1.DaemonSet) - return &extensionsv1.DaemonSet{ - ObjectMeta: util.DeepCopyRelevantObjectMeta(daemonset.ObjectMeta), - Spec: *daemonset.Spec.DeepCopy(), - } -} - -func (a *DaemonSetAdapter) Equivalent(obj1, obj2 pkgruntime.Object) bool { - daemonset1 := obj1.(*extensionsv1.DaemonSet) - daemonset2 := obj2.(*extensionsv1.DaemonSet) - return util.ObjectMetaEquivalent(daemonset1.ObjectMeta, daemonset2.ObjectMeta) && reflect.DeepEqual(daemonset1.Spec, daemonset2.Spec) -} - -func (a *DaemonSetAdapter) QualifiedName(obj pkgruntime.Object) QualifiedName { - daemonset := obj.(*extensionsv1.DaemonSet) - return QualifiedName{Namespace: daemonset.Namespace, Name: daemonset.Name} -} - -func (a *DaemonSetAdapter) ObjectMeta(obj pkgruntime.Object) *metav1.ObjectMeta { - return &obj.(*extensionsv1.DaemonSet).ObjectMeta -} - -func (a *DaemonSetAdapter) FedCreate(obj pkgruntime.Object) (pkgruntime.Object, error) { - daemonset := obj.(*extensionsv1.DaemonSet) - return a.client.Extensions().DaemonSets(daemonset.Namespace).Create(daemonset) -} - -func (a *DaemonSetAdapter) FedDelete(qualifiedName QualifiedName, options *metav1.DeleteOptions) error { - return a.client.Extensions().DaemonSets(qualifiedName.Namespace).Delete(qualifiedName.Name, options) -} - -func (a *DaemonSetAdapter) FedGet(qualifiedName QualifiedName) (pkgruntime.Object, error) { - return a.client.Extensions().DaemonSets(qualifiedName.Namespace).Get(qualifiedName.Name, metav1.GetOptions{}) -} - -func (a *DaemonSetAdapter) FedList(namespace string, options metav1.ListOptions) (pkgruntime.Object, error) { - return a.client.Extensions().DaemonSets(namespace).List(options) -} - -func (a *DaemonSetAdapter) FedUpdate(obj pkgruntime.Object) (pkgruntime.Object, error) { - daemonset := obj.(*extensionsv1.DaemonSet) - return a.client.Extensions().DaemonSets(daemonset.Namespace).Update(daemonset) -} - -func (a *DaemonSetAdapter) FedWatch(namespace string, options metav1.ListOptions) (watch.Interface, error) { - return a.client.Extensions().DaemonSets(namespace).Watch(options) -} - -func (a *DaemonSetAdapter) ClusterCreate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) { - daemonset := obj.(*extensionsv1.DaemonSet) - return client.Extensions().DaemonSets(daemonset.Namespace).Create(daemonset) -} - -func (a *DaemonSetAdapter) ClusterDelete(client kubeclientset.Interface, qualifiedName QualifiedName, options *metav1.DeleteOptions) error { - return client.Extensions().DaemonSets(qualifiedName.Namespace).Delete(qualifiedName.Name, options) -} - -func (a *DaemonSetAdapter) ClusterGet(client kubeclientset.Interface, qualifiedName QualifiedName) (pkgruntime.Object, error) { - return client.Extensions().DaemonSets(qualifiedName.Namespace).Get(qualifiedName.Name, metav1.GetOptions{}) -} - -func (a *DaemonSetAdapter) ClusterList(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (pkgruntime.Object, error) { - return client.Extensions().DaemonSets(namespace).List(options) -} - -func (a *DaemonSetAdapter) ClusterUpdate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) { - daemonset := obj.(*extensionsv1.DaemonSet) - return client.Extensions().DaemonSets(daemonset.Namespace).Update(daemonset) -} - -func (a *DaemonSetAdapter) ClusterWatch(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (watch.Interface, error) { - return client.Extensions().DaemonSets(namespace).Watch(options) -} - -func (a *DaemonSetAdapter) IsSchedulingAdapter() bool { - return false -} - -func (a *DaemonSetAdapter) NewTestObject(namespace string) pkgruntime.Object { - return &extensionsv1.DaemonSet{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "test-daemonset-", - Namespace: namespace, - Labels: map[string]string{"app": "test-daemonset"}, - }, - Spec: extensionsv1.DaemonSetSpec{ - Template: v1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{"name": "test-pod"}, - }, - Spec: v1.PodSpec{ - Containers: []v1.Container{ - { - Name: "test-daemonset", - Image: "images/test-daemonset", - Ports: []v1.ContainerPort{{ContainerPort: 9376}}, - }, - }, - }, - }, - }, - } -} diff --git a/federation/pkg/federatedtypes/deployment.go b/federation/pkg/federatedtypes/deployment.go deleted file mode 100644 index cc6eccbd70..0000000000 --- a/federation/pkg/federatedtypes/deployment.go +++ /dev/null @@ -1,189 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federatedtypes - -import ( - apiv1 "k8s.io/api/core/v1" - extensionsv1 "k8s.io/api/extensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/watch" - kubeclientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - fedutil "k8s.io/kubernetes/federation/pkg/federation-controller/util" -) - -const ( - DeploymentKind = "deployment" - DeploymentControllerName = "deployments" - FedDeploymentPreferencesAnnotation = "federation.kubernetes.io/deployment-preferences" -) - -func init() { - RegisterFederatedType(DeploymentKind, DeploymentControllerName, []schema.GroupVersionResource{extensionsv1.SchemeGroupVersion.WithResource(DeploymentControllerName)}, NewDeploymentAdapter) -} - -type DeploymentAdapter struct { - *replicaSchedulingAdapter - client federationclientset.Interface -} - -func NewDeploymentAdapter(client federationclientset.Interface, config *restclient.Config, adapterSpecificArgs map[string]interface{}) FederatedTypeAdapter { - schedulingAdapter := replicaSchedulingAdapter{ - preferencesAnnotationName: FedDeploymentPreferencesAnnotation, - updateStatusFunc: func(obj pkgruntime.Object, schedulingInfo interface{}) error { - deployment := obj.(*extensionsv1.Deployment) - typedStatus := schedulingInfo.(*ReplicaSchedulingInfo).Status - if typedStatus.Replicas != deployment.Status.Replicas || typedStatus.UpdatedReplicas != deployment.Status.UpdatedReplicas || - typedStatus.ReadyReplicas != deployment.Status.ReadyReplicas || typedStatus.AvailableReplicas != deployment.Status.AvailableReplicas { - deployment.Status = extensionsv1.DeploymentStatus{ - Replicas: typedStatus.Replicas, - UpdatedReplicas: typedStatus.UpdatedReplicas, - ReadyReplicas: typedStatus.ReadyReplicas, - AvailableReplicas: typedStatus.AvailableReplicas, - } - _, err := client.Extensions().Deployments(deployment.Namespace).UpdateStatus(deployment) - return err - } - return nil - }, - } - - return &DeploymentAdapter{&schedulingAdapter, client} -} - -func (a *DeploymentAdapter) Kind() string { - return DeploymentKind -} - -func (a *DeploymentAdapter) ObjectType() pkgruntime.Object { - return &extensionsv1.Deployment{} -} - -func (a *DeploymentAdapter) IsExpectedType(obj interface{}) bool { - _, ok := obj.(*extensionsv1.Deployment) - return ok -} - -func (a *DeploymentAdapter) Copy(obj pkgruntime.Object) pkgruntime.Object { - deployment := obj.(*extensionsv1.Deployment) - return fedutil.DeepCopyDeployment(deployment) -} - -func (a *DeploymentAdapter) Equivalent(obj1, obj2 pkgruntime.Object) bool { - deployment1 := obj1.(*extensionsv1.Deployment) - deployment2 := obj2.(*extensionsv1.Deployment) - return fedutil.DeploymentEquivalent(deployment1, deployment2) -} - -func (a *DeploymentAdapter) QualifiedName(obj pkgruntime.Object) QualifiedName { - deployment := obj.(*extensionsv1.Deployment) - return QualifiedName{Namespace: deployment.Namespace, Name: deployment.Name} -} - -func (a *DeploymentAdapter) ObjectMeta(obj pkgruntime.Object) *metav1.ObjectMeta { - return &obj.(*extensionsv1.Deployment).ObjectMeta -} - -func (a *DeploymentAdapter) FedCreate(obj pkgruntime.Object) (pkgruntime.Object, error) { - deployment := obj.(*extensionsv1.Deployment) - return a.client.Extensions().Deployments(deployment.Namespace).Create(deployment) -} - -func (a *DeploymentAdapter) FedDelete(qualifiedName QualifiedName, options *metav1.DeleteOptions) error { - return a.client.Extensions().Deployments(qualifiedName.Namespace).Delete(qualifiedName.Name, options) -} - -func (a *DeploymentAdapter) FedGet(qualifiedName QualifiedName) (pkgruntime.Object, error) { - return a.client.Extensions().Deployments(qualifiedName.Namespace).Get(qualifiedName.Name, metav1.GetOptions{}) -} - -func (a *DeploymentAdapter) FedList(namespace string, options metav1.ListOptions) (pkgruntime.Object, error) { - return a.client.Extensions().Deployments(namespace).List(options) -} - -func (a *DeploymentAdapter) FedUpdate(obj pkgruntime.Object) (pkgruntime.Object, error) { - deployment := obj.(*extensionsv1.Deployment) - return a.client.Extensions().Deployments(deployment.Namespace).Update(deployment) -} - -func (a *DeploymentAdapter) FedWatch(namespace string, options metav1.ListOptions) (watch.Interface, error) { - return a.client.Extensions().Deployments(namespace).Watch(options) -} - -func (a *DeploymentAdapter) ClusterCreate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) { - deployment := obj.(*extensionsv1.Deployment) - return client.Extensions().Deployments(deployment.Namespace).Create(deployment) -} - -func (a *DeploymentAdapter) ClusterDelete(client kubeclientset.Interface, qualifiedName QualifiedName, options *metav1.DeleteOptions) error { - return client.Extensions().Deployments(qualifiedName.Namespace).Delete(qualifiedName.Name, options) -} - -func (a *DeploymentAdapter) ClusterGet(client kubeclientset.Interface, qualifiedName QualifiedName) (pkgruntime.Object, error) { - return client.Extensions().Deployments(qualifiedName.Namespace).Get(qualifiedName.Name, metav1.GetOptions{}) -} - -func (a *DeploymentAdapter) ClusterList(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (pkgruntime.Object, error) { - return client.Extensions().Deployments(namespace).List(options) -} - -func (a *DeploymentAdapter) ClusterUpdate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) { - deployment := obj.(*extensionsv1.Deployment) - return client.Extensions().Deployments(deployment.Namespace).Update(deployment) -} - -func (a *DeploymentAdapter) ClusterWatch(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (watch.Interface, error) { - return client.Extensions().Deployments(namespace).Watch(options) -} - -func (a *DeploymentAdapter) EquivalentIgnoringSchedule(obj1, obj2 pkgruntime.Object) bool { - deployment1 := obj1.(*extensionsv1.Deployment) - deployment2 := a.Copy(obj2).(*extensionsv1.Deployment) - deployment2.Spec.Replicas = deployment1.Spec.Replicas - return fedutil.DeploymentEquivalent(deployment1, deployment2) -} - -func (a *DeploymentAdapter) NewTestObject(namespace string) pkgruntime.Object { - replicas := int32(3) - zero := int64(0) - return &extensionsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "test-deployment-", - Namespace: namespace, - }, - Spec: extensionsv1.DeploymentSpec{ - Replicas: &replicas, - Template: apiv1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{"foo": "bar"}, - }, - Spec: apiv1.PodSpec{ - TerminationGracePeriodSeconds: &zero, - Containers: []apiv1.Container{ - { - Name: "nginx", - Image: "nginx", - }, - }, - }, - }, - }, - } -} diff --git a/federation/pkg/federatedtypes/hpa.go b/federation/pkg/federatedtypes/hpa.go deleted file mode 100644 index dbba7b5b0a..0000000000 --- a/federation/pkg/federatedtypes/hpa.go +++ /dev/null @@ -1,1015 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federatedtypes - -import ( - "fmt" - "time" - - autoscalingv1 "k8s.io/api/autoscaling/v1" - "k8s.io/api/extensions/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/watch" - kubeclientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - fedutil "k8s.io/kubernetes/federation/pkg/federation-controller/util" - hpautil "k8s.io/kubernetes/federation/pkg/federation-controller/util/hpa" - extensionsinternal "k8s.io/kubernetes/pkg/apis/extensions" - - "github.com/golang/glog" -) - -const ( - HpaKind = "horizontalpodautoscaler" - HpaControllerName = "horizontalpodautoscalers" - // This is used as the default min for hpa object submitted - // to federation, in a situation where the default is for - // some reason not present (Spec.MinReplicas == nil) - hpaMinReplicaDefault = int32(1) - // This is a tunable which does not change replica nums - // on an existing local hpa, before this timeout, if it - // did scale already (avoids thrashing of replicas around). - ScaleForbiddenWindow = 2 * time.Minute -) - -func init() { - RegisterFederatedType(HpaKind, HpaControllerName, []schema.GroupVersionResource{autoscalingv1.SchemeGroupVersion.WithResource(HpaControllerName)}, NewHpaAdapter) -} - -type HpaAdapter struct { - client federationclientset.Interface - scaleForbiddenWindow time.Duration -} - -func NewHpaAdapter(client federationclientset.Interface, config *restclient.Config, adapterSpecificArgs map[string]interface{}) FederatedTypeAdapter { - var scaleForbiddenWindow time.Duration - if adapterSpecificArgs != nil && adapterSpecificArgs[HpaKind] != nil { - scaleForbiddenWindow = adapterSpecificArgs[HpaKind].(*metav1.Duration).Duration - } else { - scaleForbiddenWindow = ScaleForbiddenWindow - } - - return &HpaAdapter{ - client: client, - scaleForbiddenWindow: scaleForbiddenWindow, - } -} - -func (a *HpaAdapter) Kind() string { - return HpaKind -} - -func (a *HpaAdapter) ObjectType() pkgruntime.Object { - return &autoscalingv1.HorizontalPodAutoscaler{} -} - -func (a *HpaAdapter) IsExpectedType(obj interface{}) bool { - _, ok := obj.(*autoscalingv1.HorizontalPodAutoscaler) - return ok -} - -func (a *HpaAdapter) Copy(obj pkgruntime.Object) pkgruntime.Object { - hpa := obj.(*autoscalingv1.HorizontalPodAutoscaler) - return &autoscalingv1.HorizontalPodAutoscaler{ - ObjectMeta: fedutil.DeepCopyRelevantObjectMeta(hpa.ObjectMeta), - Spec: *hpa.Spec.DeepCopy(), - } -} - -func (a *HpaAdapter) Equivalent(obj1, obj2 pkgruntime.Object) bool { - return fedutil.ObjectMetaAndSpecEquivalent(obj1, obj2) -} - -func (a *HpaAdapter) QualifiedName(obj pkgruntime.Object) QualifiedName { - hpa := obj.(*autoscalingv1.HorizontalPodAutoscaler) - return QualifiedName{Namespace: hpa.Namespace, Name: hpa.Name} -} - -func (a *HpaAdapter) ObjectMeta(obj pkgruntime.Object) *metav1.ObjectMeta { - return &obj.(*autoscalingv1.HorizontalPodAutoscaler).ObjectMeta -} - -func (a *HpaAdapter) FedCreate(obj pkgruntime.Object) (pkgruntime.Object, error) { - hpa := obj.(*autoscalingv1.HorizontalPodAutoscaler) - return a.client.AutoscalingV1().HorizontalPodAutoscalers(hpa.Namespace).Create(hpa) -} - -func (a *HpaAdapter) FedDelete(qualifiedName QualifiedName, options *metav1.DeleteOptions) error { - return a.client.AutoscalingV1().HorizontalPodAutoscalers(qualifiedName.Namespace).Delete(qualifiedName.Name, options) -} - -func (a *HpaAdapter) FedGet(qualifiedName QualifiedName) (pkgruntime.Object, error) { - return a.client.AutoscalingV1().HorizontalPodAutoscalers(qualifiedName.Namespace).Get(qualifiedName.Name, metav1.GetOptions{}) -} - -func (a *HpaAdapter) FedList(namespace string, options metav1.ListOptions) (pkgruntime.Object, error) { - return a.client.AutoscalingV1().HorizontalPodAutoscalers(namespace).List(options) -} - -func (a *HpaAdapter) FedUpdate(obj pkgruntime.Object) (pkgruntime.Object, error) { - hpa := obj.(*autoscalingv1.HorizontalPodAutoscaler) - return a.client.AutoscalingV1().HorizontalPodAutoscalers(hpa.Namespace).Update(hpa) -} - -func (a *HpaAdapter) FedWatch(namespace string, options metav1.ListOptions) (watch.Interface, error) { - return a.client.AutoscalingV1().HorizontalPodAutoscalers(namespace).Watch(options) -} - -func (a *HpaAdapter) ClusterCreate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) { - hpa := obj.(*autoscalingv1.HorizontalPodAutoscaler) - return client.AutoscalingV1().HorizontalPodAutoscalers(hpa.Namespace).Create(hpa) -} - -func (a *HpaAdapter) ClusterDelete(client kubeclientset.Interface, qualifiedName QualifiedName, options *metav1.DeleteOptions) error { - return client.AutoscalingV1().HorizontalPodAutoscalers(qualifiedName.Namespace).Delete(qualifiedName.Name, options) -} - -func (a *HpaAdapter) ClusterGet(client kubeclientset.Interface, qualifiedName QualifiedName) (pkgruntime.Object, error) { - return client.AutoscalingV1().HorizontalPodAutoscalers(qualifiedName.Namespace).Get(qualifiedName.Name, metav1.GetOptions{}) -} - -func (a *HpaAdapter) ClusterList(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (pkgruntime.Object, error) { - return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).List(options) -} - -func (a *HpaAdapter) ClusterUpdate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) { - hpa := obj.(*autoscalingv1.HorizontalPodAutoscaler) - return client.AutoscalingV1().HorizontalPodAutoscalers(hpa.Namespace).Update(hpa) -} - -func (a *HpaAdapter) ClusterWatch(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (watch.Interface, error) { - return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).Watch(options) -} - -func (a *HpaAdapter) NewTestObject(namespace string) pkgruntime.Object { - var min int32 = 4 - var targetCPU int32 = 70 - return &autoscalingv1.HorizontalPodAutoscaler{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "test-hpa-", - Namespace: namespace, - }, - Spec: autoscalingv1.HorizontalPodAutoscalerSpec{ - ScaleTargetRef: autoscalingv1.CrossVersionObjectReference{ - Kind: "ReplicaSet", - Name: "myrs", - }, - MinReplicas: &min, - MaxReplicas: int32(10), - TargetCPUUtilizationPercentage: &targetCPU, - }, - } -} - -func (a *HpaAdapter) IsSchedulingAdapter() bool { - return true -} - -func (a *HpaAdapter) EquivalentIgnoringSchedule(obj1, obj2 pkgruntime.Object) bool { - hpa1 := obj1.(*autoscalingv1.HorizontalPodAutoscaler) - hpa2 := a.Copy(obj2).(*autoscalingv1.HorizontalPodAutoscaler) - if hpa1.Spec.MinReplicas == nil { - hpa2.Spec.MinReplicas = nil - } else if hpa2.Spec.MinReplicas == nil { - var r int32 = *hpa1.Spec.MinReplicas - hpa2.Spec.MinReplicas = &r - } else { - *hpa2.Spec.MinReplicas = *hpa1.Spec.MinReplicas - } - hpa2.Spec.MaxReplicas = hpa1.Spec.MaxReplicas - return fedutil.ObjectMetaAndSpecEquivalent(hpa1, hpa2) -} - -type replicaNums struct { - min int32 - max int32 -} - -type hpaFederatedStatus struct { - lastScaleTime *metav1.Time - // Indicates how many clusters have hpa/replicas. - // Used to average the cpu utilization which is - // reflected to the federation user. - count int32 - aggregateCPUUtilizationPercentage *int32 - currentReplicas int32 - desiredReplicas int32 -} - -type hpaSchedulingInfo struct { - scheduleState map[string]*replicaNums - fedStatus hpaFederatedStatus -} - -// List of cluster names. -type hpaLists struct { - // Stores names of those clusters which can offer min. - availableMin sets.String - // Stores names of those clusters which can offer max. - availableMax sets.String - // Stores names of those clusters which do not have hpa yet. - noHpa sets.String -} - -func (a *HpaAdapter) GetSchedule(obj pkgruntime.Object, key string, clusters []*federationapi.Cluster, informer fedutil.FederatedInformer) (interface{}, error) { - currentClusterObjs, err := getCurrentClusterObjs(informer, key, clusters) - if err != nil { - return nil, err - } - - // Initialise averaged cpu utilisation for this reconcile. - var ccup int32 = 0 - fedStatus := hpaFederatedStatus{ - aggregateCPUUtilizationPercentage: &ccup, - count: int32(0), - desiredReplicas: int32(0), - currentReplicas: int32(0), - } - fedHpa := obj.(*autoscalingv1.HorizontalPodAutoscaler) - // We assign the last known scale time here, which we update with - // the latest time from among all clusters in ScheduleObject() - if fedHpa.Status.LastScaleTime != nil { - t := metav1.NewTime(fedHpa.Status.LastScaleTime.Time) - fedStatus.lastScaleTime = &t - } - - return &hpaSchedulingInfo{ - scheduleState: a.getHpaScheduleState(obj, currentClusterObjs), - fedStatus: fedStatus, - }, nil -} - -func getCurrentClusterObjs(informer fedutil.FederatedInformer, key string, clusters []*federationapi.Cluster) (map[string]pkgruntime.Object, error) { - currentClusterObjs := make(map[string]pkgruntime.Object) - for _, cluster := range clusters { - clusterName := cluster.Name - clusterObj, found, err := informer.GetTargetStore().GetByKey(clusterName, key) - if err != nil { - return nil, err - } - currentClusterObjs[clusterName] = nil - if found { - currentClusterObjs[clusterName] = clusterObj.(pkgruntime.Object) - } - } - return currentClusterObjs, nil -} - -// The algorithm used for scheduling is briefed as below: -// -// 1. Find clusters which can offer max and min, if any (lists.availableMax and -// lists.availableMin) in one pass on all clusters. -// -// 2. Reduce the replicas (both min and max) if needed (situation when fedHpa -// has lesser replicas then all cluster local hpa replicas totalled together). -// In this step reduce first from those hpas which already have max (and min) -// reducible. Once such clusters are over and reduction still needed, reduce -// one at a time from all clusters, randomly. This step will ensure that the -// exceeding replicas in local hpas are reduced to match the fedHpa. -// This step would ideally be a noop in most cases because its rare that fedHpa -// would have lesser replicas then the cluster local total (probably when user -// forces update if fedHpa). -// -// 3. Distribute the replicas. In this step we have replicas to distribute (which -// are fed replicas exceeding the sum total of local cluster replicas). If clusters -// already have replicas, one replica from each cluster which can offer replicas -// (both for max and min) are also added to this replicas to distribute numbers (min -// and max). -// 3a. We first do a sub-pass to distribute to clusters which need replicas, considering -// those as clusters in crucial need of replicas. -// 3b. After previous sub-pass, if we still have replicas remaining, in the sub-pass -// we distribute to those clusters which do not yet have any hpa. -// 3c. After previous if we still have more to distribute, then we distribute to all -// clusters randomly, giving replica distribution count (rdc=total-fed-replicas/no-of-clusters) -// to each at a time. -// -// The above algorithm is run to first distribute max and then distribute min to those clusters -// which get max. -func (a *HpaAdapter) getHpaScheduleState(fedObj pkgruntime.Object, currentObjs map[string]pkgruntime.Object) map[string]*replicaNums { - fedHpa := fedObj.(*autoscalingv1.HorizontalPodAutoscaler) - requestedMin := hpaMinReplicaDefault - if fedHpa.Spec.MinReplicas != nil { - requestedMin = *fedHpa.Spec.MinReplicas - } - requestedReplicas := replicaNums{ - min: requestedMin, - max: fedHpa.Spec.MaxReplicas, - } - // replica distribution count, per cluster - rdc := replicaNums{ - min: requestedReplicas.min / int32(len(currentObjs)), - max: requestedReplicas.max / int32(len(currentObjs)), - } - if rdc.min < 1 { - rdc.min = 1 - } - // TODO: Is there a better way? - // We need to cap the lowest limit of Max to 2, because in a - // situation like both min and max become 1 (same) for all clusters, - // no rebalancing would happen. - if rdc.max < 2 { - rdc.max = 2 - } - - // Pass 1: Analyse existing local hpa's if any. - // clusterLists holds the list of those clusters which can offer - // min and max replicas, to those which want them. - // For example new clusters joining the federation and/or - // those clusters which need to increase or reduce replicas - // beyond min/max limits. - // schedStatus currently have status of existing hpas. - // It will eventually have desired status for this reconcile. - clusterLists, currentReplicas, scheduleState := a.prepareForScheduling(currentObjs) - - remainingReplicas := replicaNums{ - min: requestedReplicas.min - currentReplicas.min, - max: requestedReplicas.max - currentReplicas.max, - } - - // Pass 2: reduction of replicas if needed ( situation that fedHpa updated replicas - // to lesser then existing). - // In this pass, we remain pessimistic and reduce one replica per cluster at a time. - if remainingReplicas.min < 0 { - excessMin := (remainingReplicas.min * int32(-1)) - remainingReplicas.min = reduceMinReplicas(excessMin, clusterLists.availableMin, scheduleState) - } - if remainingReplicas.max < 0 { - excessMax := (remainingReplicas.max * int32(-1)) - remainingReplicas.max = reduceMaxReplicas(excessMax, clusterLists.availableMax, scheduleState) - } - - toDistribute := replicaNums{ - min: remainingReplicas.min + int32(clusterLists.availableMin.Len()), - max: remainingReplicas.max + int32(clusterLists.availableMax.Len()), - } - - // Pass 3: Distribute Max and then Min. - // Here we first distribute max and then (in the next loop) - // distribute min into those clusters which already get the - // max fixed. - // In this process we might not meet the min limit and total of - // min limits might remain more then the requested federated min. - // This is partially because a min per cluster cannot be lesser - // then 1, but min could be requested as 1 at federation. - // Additionally we first increase replicas into those clusters - // which already have hpa's and are in a condition to increase. - // This will save cluster related resources for the user, such that - // if an already existing cluster can satisfy users request why send - // the workload to another. - // We then go ahead to give the replicas to those which do not - // have any hpa. In this pass however we try to ensure that all - // our Max are consumed in this reconcile. - a.distributeMaxReplicas(toDistribute.max, clusterLists, rdc, currentObjs, scheduleState) - - // We distribute min to those clusters which: - // 1 - can adjust min (our increase step would be only 1) - // 2 - which do not have this hpa and got max(increase step rdcMin) - // We might exhaust all min replicas here, with - // some clusters still needing them. We adjust this in finalise by - // assigning min replicas to 1 into those clusters which got max - // but min remains 0. - a.distributeMinReplicas(toDistribute.min, clusterLists, rdc, currentObjs, scheduleState) - - return finaliseScheduleState(scheduleState) -} - -func (a *HpaAdapter) ScheduleObject(cluster *federationapi.Cluster, clusterObj pkgruntime.Object, federationObjCopy pkgruntime.Object, schedulingInfo interface{}) (pkgruntime.Object, ScheduleAction, error) { - // Update federated status info - typedInfo := schedulingInfo.(*hpaSchedulingInfo) - if clusterObj != nil { - clusterHpa := clusterObj.(*autoscalingv1.HorizontalPodAutoscaler) - if clusterHpa.Status.CurrentCPUUtilizationPercentage != nil { - *typedInfo.fedStatus.aggregateCPUUtilizationPercentage += - (*clusterHpa.Status.CurrentCPUUtilizationPercentage * clusterHpa.Status.CurrentReplicas) - typedInfo.fedStatus.count += clusterHpa.Status.CurrentReplicas - } - if clusterHpa.Status.LastScaleTime != nil { - t := metav1.NewTime(clusterHpa.Status.LastScaleTime.Time) - if typedInfo.fedStatus.lastScaleTime != nil && - t.After(typedInfo.fedStatus.lastScaleTime.Time) { - typedInfo.fedStatus.lastScaleTime = &t - } - } - - typedInfo.fedStatus.currentReplicas += clusterHpa.Status.CurrentReplicas - typedInfo.fedStatus.desiredReplicas += clusterHpa.Status.DesiredReplicas - } - - // Update the cluster obj and the needed action on the cluster - clusterHpaState := typedInfo.scheduleState[cluster.Name] - desiredHpa := federationObjCopy.(*autoscalingv1.HorizontalPodAutoscaler) - if clusterHpaState != nil { - desiredHpa.Spec.MaxReplicas = clusterHpaState.max - if desiredHpa.Spec.MinReplicas == nil { - min := int32(0) - desiredHpa.Spec.MinReplicas = &min - } - *desiredHpa.Spec.MinReplicas = clusterHpaState.min - } - - var defaultAction ScheduleAction = "" - switch { - case clusterHpaState != nil && clusterObj != nil: - return desiredHpa, defaultAction, nil - case clusterHpaState != nil && clusterObj == nil: - return desiredHpa, ActionAdd, nil - case clusterHpaState == nil && clusterObj != nil: - return nil, ActionDelete, nil - } - return nil, defaultAction, nil -} - -func (a *HpaAdapter) UpdateFederatedStatus(obj pkgruntime.Object, schedulingInfo interface{}) error { - fedHpa := obj.(*autoscalingv1.HorizontalPodAutoscaler) - needUpdate, newFedHpaStatus := updateStatus(fedHpa, schedulingInfo.(*hpaSchedulingInfo).fedStatus) - if needUpdate { - fedHpa.Status = newFedHpaStatus - _, err := a.client.AutoscalingV1().HorizontalPodAutoscalers(fedHpa.Namespace).UpdateStatus(fedHpa) - if err != nil { - return fmt.Errorf("Error updating hpa: %s status in federation: %v", fedHpa.Name, err) - } - } - - if err := a.updateClusterListOnTargetObject(fedHpa, schedulingInfo.(*hpaSchedulingInfo).scheduleState); err != nil { - return fmt.Errorf("Error updating cluster list on object targetted by hpa: %s: %v", fedHpa.Name, err) - } - return nil -} - -func updateStatus(fedHpa *autoscalingv1.HorizontalPodAutoscaler, newStatus hpaFederatedStatus) (bool, autoscalingv1.HorizontalPodAutoscalerStatus) { - averageCPUUtilizationPercentage := int32(0) - // Average out the available current utilisation - if *newStatus.aggregateCPUUtilizationPercentage != 0 && newStatus.count != 0 { - averageCPUUtilizationPercentage = *newStatus.aggregateCPUUtilizationPercentage / newStatus.count - } - gen := fedHpa.Generation - newFedHpaStatus := autoscalingv1.HorizontalPodAutoscalerStatus{ObservedGeneration: &gen} - needUpdate := false - if (fedHpa.Status.CurrentCPUUtilizationPercentage == nil && - averageCPUUtilizationPercentage != 0) || - (fedHpa.Status.CurrentCPUUtilizationPercentage != nil && - averageCPUUtilizationPercentage != - *fedHpa.Status.CurrentCPUUtilizationPercentage) { - needUpdate = true - newFedHpaStatus.CurrentCPUUtilizationPercentage = &averageCPUUtilizationPercentage - } - if (fedHpa.Status.LastScaleTime == nil && newStatus.lastScaleTime != nil) || - (fedHpa.Status.LastScaleTime != nil && newStatus.lastScaleTime == nil) || - ((fedHpa.Status.LastScaleTime != nil && newStatus.lastScaleTime != nil) && - newStatus.lastScaleTime.After(fedHpa.Status.LastScaleTime.Time)) { - needUpdate = true - newFedHpaStatus.LastScaleTime = newStatus.lastScaleTime - } - if fedHpa.Status.DesiredReplicas != newStatus.desiredReplicas { - needUpdate = true - newFedHpaStatus.CurrentReplicas = newStatus.currentReplicas - } - if fedHpa.Status.CurrentReplicas != newStatus.currentReplicas { - needUpdate = true - newFedHpaStatus.DesiredReplicas = newStatus.desiredReplicas - } - return needUpdate, newFedHpaStatus -} - -// prepareForScheduling prepares the lists and totals from the -// existing objs. -// currentObjs has the list of all clusters, with obj as nil -// for those clusters which do not have hpa yet. -func (a *HpaAdapter) prepareForScheduling(currentObjs map[string]pkgruntime.Object) (hpaLists, replicaNums, map[string]*replicaNums) { - lists := hpaLists{ - availableMax: sets.NewString(), - availableMin: sets.NewString(), - noHpa: sets.NewString(), - } - existingTotal := replicaNums{ - min: int32(0), - max: int32(0), - } - - scheduleState := make(map[string]*replicaNums) - for cluster, obj := range currentObjs { - if obj == nil { - lists.noHpa.Insert(cluster) - scheduleState[cluster] = nil - continue - } - - if a.maxReplicasReducible(obj) { - lists.availableMax.Insert(cluster) - } - if a.minReplicasReducible(obj) { - lists.availableMin.Insert(cluster) - } - - replicas := replicaNums{min: 0, max: 0} - scheduleState[cluster] = &replicas - if obj.(*autoscalingv1.HorizontalPodAutoscaler).Spec.MinReplicas != nil { - existingTotal.min += *obj.(*autoscalingv1.HorizontalPodAutoscaler).Spec.MinReplicas - replicas.min = *obj.(*autoscalingv1.HorizontalPodAutoscaler).Spec.MinReplicas - } - existingTotal.max += obj.(*autoscalingv1.HorizontalPodAutoscaler).Spec.MaxReplicas - replicas.max = obj.(*autoscalingv1.HorizontalPodAutoscaler).Spec.MaxReplicas - } - - return lists, existingTotal, scheduleState -} - -// Note: reduceMinReplicas and reduceMaxReplicas, look quite similar in flow -// and code, however there are subtle differences. They together can be made -// into 1 function with an arg governing the functionality difference and -// additional args (superset of args in both) as needed. Doing so however -// makes the logical flow quite less readable. They are thus left as 2 for -// readability. - -// reduceMinReplicas reduces the min replicas from existing clusters. -// At the end of the function excessMin should be 0 and the MinList -// and the scheduledReplicas properly updated in place. -func reduceMinReplicas(excessMin int32, availableMinList sets.String, scheduled map[string]*replicaNums) int32 { - if excessMin > 0 { - // first we try reducing from those clusters which already offer min - if availableMinList.Len() > 0 { - for _, cluster := range availableMinList.List() { - replicas := scheduled[cluster] - if replicas.min > 1 { - replicas.min-- - availableMinList.Delete(cluster) - excessMin-- - if excessMin <= 0 { - break - } - } - } - } - } - - // If we could not get needed replicas from already offered min above - // we abruptly start removing replicas from some/all clusters. - // Here we might make some min to 0 signalling that this hpa might be a - // candidate to be removed from this cluster altogether. - for excessMin > 0 { - for _, replicas := range scheduled { - if replicas != nil && - replicas.min > 0 { - replicas.min-- - excessMin-- - if excessMin <= 0 { - break - } - } - } - } - - return excessMin -} - -// reduceMaxReplicas reduces the max replicas from existing clusters. -// At the end of the function excessMax should be 0 and the MaxList -// and the scheduledReplicas properly updated in place. -func reduceMaxReplicas(excessMax int32, availableMaxList sets.String, scheduled map[string]*replicaNums) int32 { - if excessMax > 0 { - // first we try reducing from those clusters which already offer max - if availableMaxList.Len() > 0 { - for _, cluster := range availableMaxList.List() { - replicas := scheduled[cluster] - if replicas != nil && !((replicas.max - replicas.min) < 0) { - replicas.max-- - availableMaxList.Delete(cluster) - excessMax-- - if excessMax <= 0 { - break - } - } - } - } - } - // If we could not get needed replicas to reduce from already offered - // max above we abruptly start removing replicas from some/all clusters. - // Here we might make some max and min to 0, signalling that this hpa be - // removed from this cluster altogether - for excessMax > 0 { - for _, replicas := range scheduled { - if replicas != nil && - !((replicas.max - replicas.min) < 0) { - replicas.max-- - excessMax-- - if excessMax <= 0 { - break - } - } - } - } - - return excessMax -} - -// distributeMaxReplicas -// Takes input: -// toDistributeMax: number of replicas to distribute. -// lists: cluster name lists, which have clusters with available max, -// available min and those with no hpas yet. -// rdc: replicadistributioncount for max and min. -// currentObjs: list of current cluster hpas. -// scheduled: schedule state which will be updated in place. -func (a *HpaAdapter) distributeMaxReplicas(toDistributeMax int32, lists hpaLists, rdc replicaNums, - currentObjs map[string]pkgruntime.Object, scheduled map[string]*replicaNums) int32 { - for cluster, replicas := range scheduled { - if toDistributeMax == 0 { - break - } - if replicas == nil { - continue - } - if a.maxReplicasNeeded(currentObjs[cluster]) { - replicas.max++ - if lists.availableMax.Len() > 0 { - popped, notEmpty := lists.availableMax.PopAny() - if notEmpty { - // Boundary checks have happened earlier in - // minReplicasReducible(). - scheduled[popped].max-- - } - } - // Any which ways utilise available map replicas - toDistributeMax-- - } - } - - // If we have new clusters where we can give our replicas, - // then give away all our replicas to the new clusters first. - if lists.noHpa.Len() > 0 { - for toDistributeMax > 0 { - for _, cluster := range lists.noHpa.UnsortedList() { - if scheduled[cluster] == nil { - scheduled[cluster] = &replicaNums{min: 0, max: 0} - } - replicas := scheduled[cluster] - // first give away max from clusters offering them - // this case especially helps getting hpa into newly joining - // clusters. - if lists.availableMax.Len() > 0 { - popped, notEmpty := lists.availableMax.PopAny() - if notEmpty { - // Boundary checks to reduce max have happened earlier in - // minReplicasReducible(). - replicas.max++ - scheduled[popped].max-- - toDistributeMax-- - continue - } - } - if toDistributeMax < rdc.max { - replicas.max += toDistributeMax - toDistributeMax = 0 - break - } - replicas.max += rdc.max - toDistributeMax -= rdc.max - } - } - } else { // we have no new clusters but if still have max replicas to distribute; - // just distribute all in current clusters. - for toDistributeMax > 0 { - for cluster, replicas := range scheduled { - if replicas == nil { - replicas = &replicaNums{min: 0, max: 0} - scheduled[cluster] = replicas - } - // First give away max from clusters offering them. - // This case especially helps getting hpa into newly joining - // clusters. - if lists.availableMax.Len() > 0 { - popped, notEmpty := lists.availableMax.PopAny() - if notEmpty { - // Boundary checks have happened earlier in - // minReplicasReducible(). - replicas.max++ - scheduled[popped].max-- - toDistributeMax-- - continue - } - } - if toDistributeMax < rdc.max { - replicas.max += toDistributeMax - toDistributeMax = 0 - break - } - replicas.max += rdc.max - toDistributeMax -= rdc.max - } - } - } - return toDistributeMax -} - -// distributeMinReplicas -// Takes input: -// toDistributeMin: number of replicas to distribute. -// lists: cluster name lists, which have clusters with available max, -// available min and those with no hpas yet. -// rdc: replicadistributioncount for max and min. -// currentObjs: list of current cluster hpas. -// scheduled: schedule state which will be updated in place. -func (a *HpaAdapter) distributeMinReplicas(toDistributeMin int32, lists hpaLists, rdc replicaNums, - currentObjs map[string]pkgruntime.Object, scheduled map[string]*replicaNums) int32 { - for cluster, replicas := range scheduled { - if toDistributeMin == 0 { - break - } - // We have distriubted Max and thus scheduled might not be nil - // but probably current (what we got originally) is nil(no hpa) - if replicas == nil || currentObjs[cluster] == nil { - continue - } - if a.minReplicasIncreasable(currentObjs[cluster]) { - if lists.availableMin.Len() > 0 { - popped, notEmpty := lists.availableMin.PopAny() - if notEmpty { - // Boundary checks have happened earlier. - scheduled[popped].min-- - replicas.min++ - toDistributeMin-- - } - } - } - } - - if lists.noHpa.Len() > 0 { - // TODO: can this become an infinite loop? - for toDistributeMin > 0 { - for _, cluster := range lists.noHpa.UnsortedList() { - replicas := scheduled[cluster] - if replicas == nil { - // We did not get max here so this cluster - // remains without hpa - continue - } - var replicaNum int32 = 0 - if toDistributeMin < rdc.min { - replicaNum = toDistributeMin - } else { - replicaNum = rdc.min - } - if (replicas.max - replicaNum) < replicas.min { - // Cannot increase the min in this cluster - // as it will go beyond max - continue - } - if lists.availableMin.Len() > 0 { - popped, notEmpty := lists.availableMin.PopAny() - if notEmpty { - // Boundary checks have happened earlier. - scheduled[popped].min-- - replicas.min++ - toDistributeMin-- - continue - } - } - replicas.min += replicaNum - toDistributeMin -= replicaNum - } - } - } else { // we have no new clusters but if still have min replicas to distribute; - // just distribute all in current clusters. - for toDistributeMin > 0 { - for _, replicas := range scheduled { - if replicas == nil { - // We did not get max here so this cluster - // remains without hpa - continue - } - var replicaNum int32 = 0 - if toDistributeMin < rdc.min { - replicaNum = toDistributeMin - } else { - replicaNum = rdc.min - } - if (replicas.max - replicaNum) < replicas.min { - // Cannot increase the min in this cluster - // as it will go beyond max - continue - } - if lists.availableMin.Len() > 0 { - popped, notEmpty := lists.availableMin.PopAny() - if notEmpty { - // Boundary checks have happened earlier. - scheduled[popped].min-- - replicas.min++ - toDistributeMin-- - continue - } - } - replicas.min += replicaNum - toDistributeMin -= replicaNum - } - } - } - return toDistributeMin -} - -// finaliseScheduleState ensures that the minReplica count is made to 1 -// for those clusters which got max, but did not get min. This is because -// k8s hpa does not accept hpas with 0 min replicas. -// The replica num distribution can thus have more mins then fedHpa requested -// but its better then having all replicas go into one cluster (if fedHpa -// requested min=1 (which is the most usual case). -func finaliseScheduleState(scheduled map[string]*replicaNums) map[string]*replicaNums { - for _, replicas := range scheduled { - if (replicas != nil) && (replicas.min <= 0) && (replicas.max > 0) { - // Min total does not necessarily meet the federated min limit. - replicas.min = 1 - } - } - return scheduled -} - -// isPristine is used to determine if so far local controller has been -// able to really determine, what should be the desired replica number for -// this cluster. -// This is used to get hpas into those clusters which might join fresh, -// and so far other cluster hpas haven't really reached anywhere. -// TODO: There is a flaw here, that a just born object would also offer its -// replicas which can also lead to fast thrashing. -// The only better way is to either ensure that object creation time stamp is set -// and can be used authoritatively; or have another field on the local object -// which is mandatorily set on creation and can be used authoritatively. -// Should we abuse annotations again for this, or this can be a proper requirement? -func isPristine(hpa *autoscalingv1.HorizontalPodAutoscaler) bool { - if hpa.Status.LastScaleTime == nil && - hpa.Status.DesiredReplicas == 0 { - return true - } - return false -} - -// isScaleable tells if it already has been a reasonable amount of -// time since this hpa scaled. Its used to avoid fast thrashing. -func (a *HpaAdapter) isScaleable(hpa *autoscalingv1.HorizontalPodAutoscaler) bool { - if hpa.Status.LastScaleTime == nil { - return false - } - t := hpa.Status.LastScaleTime.Add(a.scaleForbiddenWindow) - if t.After(time.Now()) { - return false - } - return true -} - -func (a *HpaAdapter) maxReplicasReducible(obj pkgruntime.Object) bool { - hpa := obj.(*autoscalingv1.HorizontalPodAutoscaler) - if (hpa.Spec.MinReplicas != nil) && - (((hpa.Spec.MaxReplicas - 1) - *hpa.Spec.MinReplicas) < 0) { - return false - } - if isPristine(hpa) { - return true - } - if !a.isScaleable(hpa) { - return false - } - if (hpa.Status.DesiredReplicas < hpa.Status.CurrentReplicas) || - ((hpa.Status.DesiredReplicas == hpa.Status.CurrentReplicas) && - (hpa.Status.DesiredReplicas < hpa.Spec.MaxReplicas)) { - return true - } - return false -} - -// minReplicasReducible checks if this cluster (hpa) can offer replicas which are -// stuck here because of min limit. -// Its noteworthy, that min and max are adjusted separately, but if the replicas -// are not being used here, the max adjustment will lead it to become equal to min, -// but will not be able to scale down further and offer max to some other cluster -// which needs replicas. -func (a *HpaAdapter) minReplicasReducible(obj pkgruntime.Object) bool { - hpa := obj.(*autoscalingv1.HorizontalPodAutoscaler) - if isPristine(hpa) && (hpa.Spec.MinReplicas != nil) && - (*hpa.Spec.MinReplicas > 1) && - (*hpa.Spec.MinReplicas <= hpa.Spec.MaxReplicas) { - return true - } - if !a.isScaleable(hpa) { - return false - } - if (hpa.Spec.MinReplicas != nil) && - (*hpa.Spec.MinReplicas > 1) && - (hpa.Status.DesiredReplicas == hpa.Status.CurrentReplicas) && - (hpa.Status.CurrentReplicas == *hpa.Spec.MinReplicas) { - return true - } - return false -} - -func (a *HpaAdapter) maxReplicasNeeded(obj pkgruntime.Object) bool { - hpa := obj.(*autoscalingv1.HorizontalPodAutoscaler) - if !a.isScaleable(hpa) { - return false - } - - if (hpa.Status.CurrentReplicas == hpa.Status.DesiredReplicas) && - (hpa.Status.CurrentReplicas == hpa.Spec.MaxReplicas) { - return true - } - return false -} - -func (a *HpaAdapter) minReplicasIncreasable(obj pkgruntime.Object) bool { - hpa := obj.(*autoscalingv1.HorizontalPodAutoscaler) - if !a.isScaleable(hpa) || - ((hpa.Spec.MinReplicas != nil) && - (*hpa.Spec.MinReplicas) >= hpa.Spec.MaxReplicas) { - return false - } - - if (hpa.Spec.MinReplicas != nil) && - (hpa.Status.DesiredReplicas > *hpa.Spec.MinReplicas) { - return true - } - return false -} - -// updateClusterListOnTargetObject passes the necessary info to the target object, -// so that the corresponding controller can act on that. -// This is used because if an hpa is active on a federated object it is supposed -// to control the replicas and presence/absence of target object from federated clusters. -func (a *HpaAdapter) updateClusterListOnTargetObject(fedHpa *autoscalingv1.HorizontalPodAutoscaler, scheduleStatus map[string]*replicaNums) error { - if len(fedHpa.Spec.ScaleTargetRef.Kind) <= 0 || len(fedHpa.Spec.ScaleTargetRef.Name) <= 0 { - // nothing to do - glog.Infof("Fed HPA: cluster list update on target object skipped for target obj: %s, kind: %s", fedHpa.Spec.ScaleTargetRef.Name, fedHpa.Spec.ScaleTargetRef.Kind) - return nil - } - - names := []string{} - for clusterName, replicas := range scheduleStatus { - if replicas != nil { - names = append(names, clusterName) - } - } - clusterNames := hpautil.ClusterNames{Names: names} - qualifiedKind := extensionsinternal.Kind(fedHpa.Spec.ScaleTargetRef.Kind) - targetObj, err := getRuntimeObjectForKind(a.client, qualifiedKind, fedHpa.Namespace, fedHpa.Spec.ScaleTargetRef.Name) - if errors.IsNotFound(err) { - // Nothing to do; the target object does not exist in federation. - glog.Infof("Fed HPA: cluster list update on target object skipped for target obj: %s, kind: %s. Target object missing in federation", fedHpa.Spec.ScaleTargetRef.Name, fedHpa.Spec.ScaleTargetRef.Kind) - return nil - } - if err != nil { - return err - } - - updatedObj := hpautil.SetHpaTargetClusterList(targetObj, clusterNames) - _, err = updateRuntimeObjectForKind(a.client, qualifiedKind, fedHpa.Namespace, updatedObj) - if err != nil { - return err - } - return nil -} - -// getRuntimeObjectForKind gets the hpa targetted object from the federation control plane. -// As of now, federation only supports "ReplicaSets" and "Deployments", which is the reason -// this function only lists these two types. -// TODO: update a similar info in federated hpa documentation. -func getRuntimeObjectForKind(c federationclientset.Interface, kind schema.GroupKind, ns, name string) (pkgruntime.Object, error) { - switch kind { - case extensionsinternal.Kind("ReplicaSet"): - return c.ExtensionsV1beta1().ReplicaSets(ns).Get(name, metav1.GetOptions{}) - case extensionsinternal.Kind("Deployment"): - return c.ExtensionsV1beta1().Deployments(ns).Get(name, metav1.GetOptions{}) - default: - return nil, fmt.Errorf("Unsupported federated kind targeted by hpa: %v", kind) - } -} - -// updateRuntimeObjectForKind updates the hpa targetted object in the federation control plane. -// As of now, federation only supports "ReplicaSets" and "Deployments", which is the reason -// this function only lists these two types. -// TODO: update a similar info in federated hpa documentation. -func updateRuntimeObjectForKind(c federationclientset.Interface, kind schema.GroupKind, ns string, obj pkgruntime.Object) (pkgruntime.Object, error) { - switch kind { - case extensionsinternal.Kind("ReplicaSet"): - return c.ExtensionsV1beta1().ReplicaSets(ns).Update(obj.(*v1beta1.ReplicaSet)) - case extensionsinternal.Kind("Deployment"): - return c.ExtensionsV1beta1().Deployments(ns).Update(obj.(*v1beta1.Deployment)) - default: - return nil, fmt.Errorf("Unsupported federated kind targeted by hpa: %v", kind) - } -} diff --git a/federation/pkg/federatedtypes/hpa_test.go b/federation/pkg/federatedtypes/hpa_test.go deleted file mode 100644 index 95447b18d5..0000000000 --- a/federation/pkg/federatedtypes/hpa_test.go +++ /dev/null @@ -1,264 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federatedtypes - -import ( - "testing" - - autoscalingv1 "k8s.io/api/autoscaling/v1" - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - . "k8s.io/kubernetes/federation/pkg/federation-controller/util/test" - - "github.com/stretchr/testify/assert" -) - -type replicas struct { - min int32 - max int32 -} - -func TestGetHpaScheduleState(t *testing.T) { - defaultFedHpa := newHpaWithReplicas(NewInt32(1), NewInt32(70), 10) - testCases := map[string]struct { - fedHpa *autoscalingv1.HorizontalPodAutoscaler - localHpas map[string]pkgruntime.Object - expectedReplicas map[string]*replicas - }{ - "Distribiutes replicas randomly if no existing hpa in any local cluster": { - localHpas: func() map[string]pkgruntime.Object { - hpas := make(map[string]pkgruntime.Object) - hpas["c1"] = nil - hpas["c2"] = nil - return hpas - }(), - }, - "Cluster with no hpa gets replicas if other clusters have replicas": { - localHpas: func() map[string]pkgruntime.Object { - hpas := make(map[string]pkgruntime.Object) - hpas["c1"] = newHpaWithReplicas(NewInt32(1), NewInt32(70), 10) - hpas["c2"] = nil - return hpas - }(), - expectedReplicas: map[string]*replicas{ - "c1": { - min: int32(1), - max: int32(9), - }, - "c2": { - min: int32(1), - max: int32(1), - }, - }, - }, - "Cluster needing max replicas gets it if there is another cluster to offer max": { - localHpas: func() map[string]pkgruntime.Object { - hpa1 := newHpaWithReplicas(NewInt32(1), NewInt32(70), 7) - hpa1 = updateHpaStatus(hpa1, NewInt32(50), 5, 5, true) - hpa2 := newHpaWithReplicas(NewInt32(1), NewInt32(70), 1) - hpa2 = updateHpaStatus(hpa2, NewInt32(70), 1, 1, true) - // include third object to ensure, it does not break the test - hpa3 := newHpaWithReplicas(NewInt32(1), NewInt32(70), 2) - hpa3 = updateHpaStatus(hpa3, NewInt32(70), 1, 1, false) - hpas := make(map[string]pkgruntime.Object) - hpas["c1"] = hpa1 - hpas["c2"] = hpa2 - hpas["c3"] = hpa3 - return hpas - }(), - expectedReplicas: map[string]*replicas{ - "c1": { - min: int32(1), - max: int32(6), - }, - "c2": { - min: int32(1), - max: int32(2), - }, - "c3": { - min: int32(1), - max: int32(2), - }, - }, - }, - "Cluster needing max replicas does not get it if there is no cluster offerring max": { - localHpas: func() map[string]pkgruntime.Object { - hpa1 := newHpaWithReplicas(NewInt32(1), NewInt32(70), 9) - hpa1 = updateHpaStatus(hpa1, NewInt32(70), 9, 9, false) - hpa2 := newHpaWithReplicas(NewInt32(1), NewInt32(70), 1) - hpa2 = updateHpaStatus(hpa2, NewInt32(70), 1, 1, true) - hpas := make(map[string]pkgruntime.Object) - hpas["c1"] = hpa1 - hpas["c2"] = hpa2 - return hpas - }(), - expectedReplicas: map[string]*replicas{ - "c1": { - min: int32(1), - max: int32(9), - }, - "c2": { - min: int32(1), - max: int32(1), - }, - }, - }, - "Cluster which can increase min replicas gets to increase min if there is a cluster offering min": { - fedHpa: newHpaWithReplicas(NewInt32(4), NewInt32(70), 10), - localHpas: func() map[string]pkgruntime.Object { - hpa1 := newHpaWithReplicas(NewInt32(3), NewInt32(70), 6) - hpa1 = updateHpaStatus(hpa1, NewInt32(50), 3, 3, true) - hpa2 := newHpaWithReplicas(NewInt32(1), NewInt32(70), 4) - hpa2 = updateHpaStatus(hpa2, NewInt32(50), 3, 3, true) - hpas := make(map[string]pkgruntime.Object) - hpas["c1"] = hpa1 - hpas["c2"] = hpa2 - return hpas - }(), - expectedReplicas: map[string]*replicas{ - "c1": { - min: int32(2), - max: int32(6), - }, - "c2": { - min: int32(2), - max: int32(4), - }, - }, - }, - "Cluster which can increase min replicas does not increase if there are no clusters offering min": { - fedHpa: newHpaWithReplicas(NewInt32(4), NewInt32(70), 10), - localHpas: func() map[string]pkgruntime.Object { - hpa1 := newHpaWithReplicas(NewInt32(3), NewInt32(70), 6) - hpa1 = updateHpaStatus(hpa1, NewInt32(50), 4, 4, true) - hpa2 := newHpaWithReplicas(NewInt32(1), NewInt32(70), 4) - hpa2 = updateHpaStatus(hpa2, NewInt32(50), 3, 3, true) - hpas := make(map[string]pkgruntime.Object) - hpas["c1"] = hpa1 - hpas["c2"] = hpa2 - return hpas - }(), - expectedReplicas: map[string]*replicas{ - "c1": { - min: int32(3), - max: int32(6), - }, - "c2": { - min: int32(1), - max: int32(4), - }, - }, - }, - "Increasing replicas on fed object increases the same on clusters": { - // Existing total of local min, max = 1+1, 5+5 decreasing to below - fedHpa: newHpaWithReplicas(NewInt32(4), NewInt32(70), 14), - localHpas: func() map[string]pkgruntime.Object { - // does not matter if scaleability is true - hpas := make(map[string]pkgruntime.Object) - hpas["c1"] = newHpaWithReplicas(NewInt32(1), NewInt32(70), 5) - hpas["c2"] = newHpaWithReplicas(NewInt32(1), NewInt32(70), 5) - return hpas - }(), - // We dont know which cluster gets how many, but the resultant total should match - }, - "Decreasing replicas on fed object decreases the same on clusters": { - // Existing total of local min, max = 2+2, 8+8 decreasing to below - fedHpa: newHpaWithReplicas(NewInt32(3), NewInt32(70), 8), - localHpas: func() map[string]pkgruntime.Object { - // does not matter if scaleability is true - hpas := make(map[string]pkgruntime.Object) - hpas["c1"] = newHpaWithReplicas(NewInt32(2), NewInt32(70), 8) - hpas["c2"] = newHpaWithReplicas(NewInt32(2), NewInt32(70), 8) - return hpas - }(), - // We dont know which cluster gets how many, but the resultant total should match - }, - } - - adapter := &HpaAdapter{ - scaleForbiddenWindow: ScaleForbiddenWindow, - } - for testName, testCase := range testCases { - t.Run(testName, func(t *testing.T) { - if testCase.fedHpa == nil { - testCase.fedHpa = defaultFedHpa - } - scheduledState := adapter.getHpaScheduleState(testCase.fedHpa, testCase.localHpas) - checkClusterConditions(t, testCase.fedHpa, scheduledState) - if testCase.expectedReplicas != nil { - for cluster, replicas := range testCase.expectedReplicas { - scheduledReplicas := scheduledState[cluster] - assert.Equal(t, replicas.min, scheduledReplicas.min) - assert.Equal(t, replicas.max, scheduledReplicas.max) - } - } - }) - } -} - -func updateHpaStatus(hpa *autoscalingv1.HorizontalPodAutoscaler, currentUtilisation *int32, current, desired int32, scaleable bool) *autoscalingv1.HorizontalPodAutoscaler { - hpa.Status.CurrentReplicas = current - hpa.Status.DesiredReplicas = desired - hpa.Status.CurrentCPUUtilizationPercentage = currentUtilisation - now := metav1.Now() - scaledTime := now - if scaleable { - // definitely more then ScaleForbiddenWindow time ago - scaledTime = metav1.NewTime(now.Time.Add(-2 * ScaleForbiddenWindow)) - } - hpa.Status.LastScaleTime = &scaledTime - return hpa -} - -func checkClusterConditions(t *testing.T, fedHpa *autoscalingv1.HorizontalPodAutoscaler, scheduled map[string]*replicaNums) { - minTotal := int32(0) - maxTotal := int32(0) - for _, replicas := range scheduled { - minTotal += replicas.min - maxTotal += replicas.max - } - - // - Total of max matches the fed max - assert.Equal(t, fedHpa.Spec.MaxReplicas, maxTotal) - // - Total of min is not less then fed min - assert.Condition(t, func() bool { - if *fedHpa.Spec.MinReplicas <= minTotal { - return true - } - return false - }) -} - -func newHpaWithReplicas(min, targetUtilisation *int32, max int32) *autoscalingv1.HorizontalPodAutoscaler { - return &autoscalingv1.HorizontalPodAutoscaler{ - ObjectMeta: metav1.ObjectMeta{ - Name: "myhpa", - Namespace: apiv1.NamespaceDefault, - SelfLink: "/api/mylink", - }, - Spec: autoscalingv1.HorizontalPodAutoscalerSpec{ - ScaleTargetRef: autoscalingv1.CrossVersionObjectReference{ - Kind: "HorizontalPodAutoscaler", - Name: "target-", - }, - MinReplicas: min, - MaxReplicas: max, - TargetCPUUtilizationPercentage: targetUtilisation, - }, - } -} diff --git a/federation/pkg/federatedtypes/namespace.go b/federation/pkg/federatedtypes/namespace.go deleted file mode 100644 index ae4892c6bc..0000000000 --- a/federation/pkg/federatedtypes/namespace.go +++ /dev/null @@ -1,215 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federatedtypes - -import ( - "fmt" - - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/dynamic" - kubeclientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/record" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/federation/pkg/federation-controller/util" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/controller/namespace/deletion" - - "github.com/golang/glog" -) - -const ( - NamespaceKind = "namespace" - NamespaceControllerName = "namespaces" -) - -func init() { - RegisterFederatedType(NamespaceKind, NamespaceControllerName, []schema.GroupVersionResource{apiv1.SchemeGroupVersion.WithResource(NamespaceControllerName)}, NewNamespaceAdapter) -} - -type NamespaceAdapter struct { - client federationclientset.Interface - deleter deletion.NamespacedResourcesDeleterInterface -} - -func NewNamespaceAdapter(client federationclientset.Interface, config *restclient.Config, adapterSpecificArgs map[string]interface{}) FederatedTypeAdapter { - dynamicClientPool := dynamic.NewDynamicClientPool(config) - discoverResourcesFunc := client.Discovery().ServerPreferredNamespacedResources - deleter := deletion.NewNamespacedResourcesDeleter( - client.Core().Namespaces(), - dynamicClientPool, - nil, - discoverResourcesFunc, - apiv1.FinalizerKubernetes, - false) - return &NamespaceAdapter{client: client, deleter: deleter} -} - -func (a *NamespaceAdapter) Kind() string { - return NamespaceKind -} - -func (a *NamespaceAdapter) ObjectType() pkgruntime.Object { - return &apiv1.Namespace{} -} - -func (a *NamespaceAdapter) IsExpectedType(obj interface{}) bool { - _, ok := obj.(*apiv1.Namespace) - return ok -} - -func (a *NamespaceAdapter) Copy(obj pkgruntime.Object) pkgruntime.Object { - namespace := obj.(*apiv1.Namespace) - return &apiv1.Namespace{ - ObjectMeta: util.DeepCopyRelevantObjectMeta(namespace.ObjectMeta), - Spec: *namespace.Spec.DeepCopy(), - } -} - -func (a *NamespaceAdapter) Equivalent(obj1, obj2 pkgruntime.Object) bool { - return util.ObjectMetaAndSpecEquivalent(obj1, obj2) -} - -func (a *NamespaceAdapter) QualifiedName(obj pkgruntime.Object) QualifiedName { - namespace := obj.(*apiv1.Namespace) - return QualifiedName{Name: namespace.Name} -} - -func (a *NamespaceAdapter) ObjectMeta(obj pkgruntime.Object) *metav1.ObjectMeta { - return &obj.(*apiv1.Namespace).ObjectMeta -} - -func (a *NamespaceAdapter) FedCreate(obj pkgruntime.Object) (pkgruntime.Object, error) { - namespace := obj.(*apiv1.Namespace) - return a.client.CoreV1().Namespaces().Create(namespace) -} - -func (a *NamespaceAdapter) FedDelete(qualifiedName QualifiedName, options *metav1.DeleteOptions) error { - return a.client.CoreV1().Namespaces().Delete(qualifiedName.Name, options) -} - -func (a *NamespaceAdapter) FedGet(qualifiedName QualifiedName) (pkgruntime.Object, error) { - return a.client.CoreV1().Namespaces().Get(qualifiedName.Name, metav1.GetOptions{}) -} - -func (a *NamespaceAdapter) FedList(namespace string, options metav1.ListOptions) (pkgruntime.Object, error) { - return a.client.CoreV1().Namespaces().List(options) -} - -func (a *NamespaceAdapter) FedUpdate(obj pkgruntime.Object) (pkgruntime.Object, error) { - namespace := obj.(*apiv1.Namespace) - return a.client.CoreV1().Namespaces().Update(namespace) -} - -func (a *NamespaceAdapter) FedWatch(namespace string, options metav1.ListOptions) (watch.Interface, error) { - return a.client.CoreV1().Namespaces().Watch(options) -} - -func (a *NamespaceAdapter) ClusterCreate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) { - namespace := obj.(*apiv1.Namespace) - return client.CoreV1().Namespaces().Create(namespace) -} - -func (a *NamespaceAdapter) ClusterDelete(client kubeclientset.Interface, qualifiedName QualifiedName, options *metav1.DeleteOptions) error { - return client.CoreV1().Namespaces().Delete(qualifiedName.Name, options) -} - -func (a *NamespaceAdapter) ClusterGet(client kubeclientset.Interface, qualifiedName QualifiedName) (pkgruntime.Object, error) { - return client.CoreV1().Namespaces().Get(qualifiedName.Name, metav1.GetOptions{}) -} - -func (a *NamespaceAdapter) ClusterList(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (pkgruntime.Object, error) { - return client.CoreV1().Namespaces().List(options) -} - -func (a *NamespaceAdapter) ClusterUpdate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) { - namespace := obj.(*apiv1.Namespace) - return client.CoreV1().Namespaces().Update(namespace) -} - -func (a *NamespaceAdapter) ClusterWatch(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (watch.Interface, error) { - return client.CoreV1().Namespaces().Watch(options) -} - -func (a *NamespaceAdapter) IsSchedulingAdapter() bool { - return false -} - -func (a *NamespaceAdapter) NewTestObject(namespace string) pkgruntime.Object { - return &apiv1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "test-namespace-", - }, - Spec: apiv1.NamespaceSpec{ - Finalizers: []apiv1.FinalizerName{apiv1.FinalizerKubernetes}, - }, - } -} - -// CleanUpNamespace deletes all resources in a given namespace. -func (a *NamespaceAdapter) CleanUpNamespace(obj pkgruntime.Object, eventRecorder record.EventRecorder) (pkgruntime.Object, error) { - namespace := obj.(*apiv1.Namespace) - name := namespace.Name - - // Set Terminating status. - updatedNamespace := &apiv1.Namespace{ - ObjectMeta: namespace.ObjectMeta, - Spec: namespace.Spec, - Status: apiv1.NamespaceStatus{ - Phase: apiv1.NamespaceTerminating, - }, - } - var err error - if namespace.Status.Phase != apiv1.NamespaceTerminating { - glog.V(2).Infof("Marking ns %s as terminating", name) - eventRecorder.Event(namespace, api.EventTypeNormal, "DeleteNamespace", fmt.Sprintf("Marking for deletion")) - _, err = a.FedUpdate(updatedNamespace) - if err != nil { - return nil, fmt.Errorf("failed to update namespace: %v", err) - } - } - - if hasFinalizerInSpec(updatedNamespace, apiv1.FinalizerKubernetes) { - // Delete resources in this namespace. - err = a.deleter.Delete(name) - if err != nil { - return nil, fmt.Errorf("error in deleting resources in namespace %s: %v", name, err) - } - glog.V(2).Infof("Removed kubernetes finalizer from ns %s", name) - // Fetch the updated Namespace. - obj, err = a.FedGet(QualifiedName{Name: name}) - updatedNamespace = obj.(*apiv1.Namespace) - if err != nil { - return nil, fmt.Errorf("error in fetching updated namespace %s: %s", name, err) - } - } - - return updatedNamespace, nil -} - -func hasFinalizerInSpec(namespace *apiv1.Namespace, finalizer apiv1.FinalizerName) bool { - for i := range namespace.Spec.Finalizers { - if namespace.Spec.Finalizers[i] == finalizer { - return true - } - } - return false -} diff --git a/federation/pkg/federatedtypes/qualifiedname.go b/federation/pkg/federatedtypes/qualifiedname.go deleted file mode 100644 index 95f0df1104..0000000000 --- a/federation/pkg/federatedtypes/qualifiedname.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federatedtypes - -import ( - "fmt" -) - -// QualifiedName comprises a resource name with an optional namespace. -// If namespace is provided, a QualifiedName will be rendered as -// "/". If not, it will be rendered as "name". This -// is intended to allow the FederatedTypeAdapter interface and its -// consumers to operate on both namespaces and namespace-qualified -// resources. - -type QualifiedName struct { - Namespace string - Name string -} - -// String returns the general purpose string representation -func (n QualifiedName) String() string { - if len(n.Namespace) == 0 { - return n.Name - } - return fmt.Sprintf("%s/%s", n.Namespace, n.Name) -} diff --git a/federation/pkg/federatedtypes/registry.go b/federation/pkg/federatedtypes/registry.go deleted file mode 100644 index 720b32a854..0000000000 --- a/federation/pkg/federatedtypes/registry.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federatedtypes - -import ( - "fmt" - - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// FederatedType configures federation for a kubernetes type -type FederatedType struct { - Kind string - ControllerName string - RequiredResources []schema.GroupVersionResource - AdapterFactory AdapterFactory -} - -var typeRegistry = make(map[string]FederatedType) - -// RegisterFederatedType ensures that configuration for the given kind will be returned by the FederatedTypes method. -func RegisterFederatedType(kind, controllerName string, requiredResources []schema.GroupVersionResource, factory AdapterFactory) { - _, ok := typeRegistry[kind] - if ok { - // TODO Is panicking ok given that this is part of a type-registration mechanism - panic(fmt.Sprintf("Federated type %q has already been registered", kind)) - } - typeRegistry[kind] = FederatedType{ - Kind: kind, - ControllerName: controllerName, - RequiredResources: requiredResources, - AdapterFactory: factory, - } -} - -// FederatedTypes returns a mapping of kind (e.g. "secret") to the -// type information required to configure its federation. -func FederatedTypes() map[string]FederatedType { - // TODO copy RequiredResources to avoid accidental mutation - result := make(map[string]FederatedType) - for key, value := range typeRegistry { - result[key] = value - } - return result -} diff --git a/federation/pkg/federatedtypes/replicaset.go b/federation/pkg/federatedtypes/replicaset.go deleted file mode 100644 index 0477c78731..0000000000 --- a/federation/pkg/federatedtypes/replicaset.go +++ /dev/null @@ -1,189 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federatedtypes - -import ( - apiv1 "k8s.io/api/core/v1" - extensionsv1 "k8s.io/api/extensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/watch" - kubeclientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - fedutil "k8s.io/kubernetes/federation/pkg/federation-controller/util" -) - -const ( - ReplicaSetKind = "replicaset" - ReplicaSetControllerName = "replicasets" - FedReplicaSetPreferencesAnnotation = "federation.kubernetes.io/replica-set-preferences" -) - -func init() { - RegisterFederatedType(ReplicaSetKind, ReplicaSetControllerName, []schema.GroupVersionResource{extensionsv1.SchemeGroupVersion.WithResource(ReplicaSetControllerName)}, NewReplicaSetAdapter) -} - -type ReplicaSetAdapter struct { - *replicaSchedulingAdapter - client federationclientset.Interface -} - -func NewReplicaSetAdapter(client federationclientset.Interface, config *restclient.Config, adapterSpecificArgs map[string]interface{}) FederatedTypeAdapter { - replicaSchedulingAdapter := replicaSchedulingAdapter{ - preferencesAnnotationName: FedReplicaSetPreferencesAnnotation, - updateStatusFunc: func(obj pkgruntime.Object, schedulingInfo interface{}) error { - rs := obj.(*extensionsv1.ReplicaSet) - typedStatus := schedulingInfo.(*ReplicaSchedulingInfo).Status - if typedStatus.Replicas != rs.Status.Replicas || typedStatus.FullyLabeledReplicas != rs.Status.FullyLabeledReplicas || - typedStatus.ReadyReplicas != rs.Status.ReadyReplicas || typedStatus.AvailableReplicas != rs.Status.AvailableReplicas { - rs.Status = extensionsv1.ReplicaSetStatus{ - Replicas: typedStatus.Replicas, - FullyLabeledReplicas: typedStatus.Replicas, - ReadyReplicas: typedStatus.ReadyReplicas, - AvailableReplicas: typedStatus.AvailableReplicas, - } - _, err := client.Extensions().ReplicaSets(rs.Namespace).UpdateStatus(rs) - return err - } - return nil - }, - } - return &ReplicaSetAdapter{&replicaSchedulingAdapter, client} -} - -func (a *ReplicaSetAdapter) Kind() string { - return ReplicaSetKind -} - -func (a *ReplicaSetAdapter) ObjectType() pkgruntime.Object { - return &extensionsv1.ReplicaSet{} -} - -func (a *ReplicaSetAdapter) IsExpectedType(obj interface{}) bool { - _, ok := obj.(*extensionsv1.ReplicaSet) - return ok -} - -func (a *ReplicaSetAdapter) Copy(obj pkgruntime.Object) pkgruntime.Object { - rs := obj.(*extensionsv1.ReplicaSet) - return &extensionsv1.ReplicaSet{ - ObjectMeta: fedutil.DeepCopyRelevantObjectMeta(rs.ObjectMeta), - Spec: *rs.Spec.DeepCopy(), - } -} - -func (a *ReplicaSetAdapter) Equivalent(obj1, obj2 pkgruntime.Object) bool { - return fedutil.ObjectMetaAndSpecEquivalent(obj1, obj2) -} - -func (a *ReplicaSetAdapter) QualifiedName(obj pkgruntime.Object) QualifiedName { - replicaset := obj.(*extensionsv1.ReplicaSet) - return QualifiedName{Namespace: replicaset.Namespace, Name: replicaset.Name} -} - -func (a *ReplicaSetAdapter) ObjectMeta(obj pkgruntime.Object) *metav1.ObjectMeta { - return &obj.(*extensionsv1.ReplicaSet).ObjectMeta -} - -func (a *ReplicaSetAdapter) FedCreate(obj pkgruntime.Object) (pkgruntime.Object, error) { - replicaset := obj.(*extensionsv1.ReplicaSet) - return a.client.Extensions().ReplicaSets(replicaset.Namespace).Create(replicaset) -} - -func (a *ReplicaSetAdapter) FedDelete(qualifiedName QualifiedName, options *metav1.DeleteOptions) error { - return a.client.Extensions().ReplicaSets(qualifiedName.Namespace).Delete(qualifiedName.Name, options) -} - -func (a *ReplicaSetAdapter) FedGet(qualifiedName QualifiedName) (pkgruntime.Object, error) { - return a.client.Extensions().ReplicaSets(qualifiedName.Namespace).Get(qualifiedName.Name, metav1.GetOptions{}) -} - -func (a *ReplicaSetAdapter) FedList(namespace string, options metav1.ListOptions) (pkgruntime.Object, error) { - return a.client.Extensions().ReplicaSets(namespace).List(options) -} - -func (a *ReplicaSetAdapter) FedUpdate(obj pkgruntime.Object) (pkgruntime.Object, error) { - replicaset := obj.(*extensionsv1.ReplicaSet) - return a.client.Extensions().ReplicaSets(replicaset.Namespace).Update(replicaset) -} - -func (a *ReplicaSetAdapter) FedWatch(namespace string, options metav1.ListOptions) (watch.Interface, error) { - return a.client.Extensions().ReplicaSets(namespace).Watch(options) -} - -func (a *ReplicaSetAdapter) ClusterCreate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) { - replicaset := obj.(*extensionsv1.ReplicaSet) - return client.Extensions().ReplicaSets(replicaset.Namespace).Create(replicaset) -} - -func (a *ReplicaSetAdapter) ClusterDelete(client kubeclientset.Interface, qualifiedName QualifiedName, options *metav1.DeleteOptions) error { - return client.Extensions().ReplicaSets(qualifiedName.Namespace).Delete(qualifiedName.Name, options) -} - -func (a *ReplicaSetAdapter) ClusterGet(client kubeclientset.Interface, qualifiedName QualifiedName) (pkgruntime.Object, error) { - return client.Extensions().ReplicaSets(qualifiedName.Namespace).Get(qualifiedName.Name, metav1.GetOptions{}) -} - -func (a *ReplicaSetAdapter) ClusterList(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (pkgruntime.Object, error) { - return client.Extensions().ReplicaSets(namespace).List(options) -} - -func (a *ReplicaSetAdapter) ClusterUpdate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) { - replicaset := obj.(*extensionsv1.ReplicaSet) - return client.Extensions().ReplicaSets(replicaset.Namespace).Update(replicaset) -} - -func (a *ReplicaSetAdapter) ClusterWatch(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (watch.Interface, error) { - return client.Extensions().ReplicaSets(namespace).Watch(options) -} - -func (a *ReplicaSetAdapter) EquivalentIgnoringSchedule(obj1, obj2 pkgruntime.Object) bool { - replicaset1 := obj1.(*extensionsv1.ReplicaSet) - replicaset2 := a.Copy(obj2).(*extensionsv1.ReplicaSet) - replicaset2.Spec.Replicas = replicaset1.Spec.Replicas - return fedutil.ObjectMetaAndSpecEquivalent(replicaset1, replicaset2) -} - -func (a *ReplicaSetAdapter) NewTestObject(namespace string) pkgruntime.Object { - replicas := int32(3) - zero := int64(0) - return &extensionsv1.ReplicaSet{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "test-replicaset-", - Namespace: namespace, - }, - Spec: extensionsv1.ReplicaSetSpec{ - Replicas: &replicas, - Template: apiv1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{"foo": "bar"}, - }, - Spec: apiv1.PodSpec{ - TerminationGracePeriodSeconds: &zero, - Containers: []apiv1.Container{ - { - Name: "nginx", - Image: "nginx", - }, - }, - }, - }, - }, - } -} diff --git a/federation/pkg/federatedtypes/scheduling.go b/federation/pkg/federatedtypes/scheduling.go deleted file mode 100644 index cdbd397034..0000000000 --- a/federation/pkg/federatedtypes/scheduling.go +++ /dev/null @@ -1,356 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federatedtypes - -import ( - "bytes" - "fmt" - "reflect" - "sort" - "time" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - fedapi "k8s.io/kubernetes/federation/apis/federation" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - fedutil "k8s.io/kubernetes/federation/pkg/federation-controller/util" - hpautil "k8s.io/kubernetes/federation/pkg/federation-controller/util/hpa" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/planner" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/podanalyzer" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/replicapreferences" - - "github.com/golang/glog" -) - -// ScheduleAction is used by the interface ScheduleObject of SchedulingAdapter -// to sync controller reconcile to convey the action type needed for the -// particular cluster local object in ScheduleObject -type ScheduleAction string - -const ( - ActionAdd = "add" - ActionDelete = "delete" -) - -// ReplicaStatus contains the details of status fields from the cluster objects, -// which need accumulation to update the status of the federated object. -type ReplicaStatus struct { - Replicas int32 - UpdatedReplicas int32 - FullyLabeledReplicas int32 - ReadyReplicas int32 - AvailableReplicas int32 -} - -// ReplicaScheduleState is the result of adapter specific schedule() function, -// which is then used to update objects into clusters. -type ReplicaScheduleState struct { - isSelected bool - replicas int64 -} - -// ReplicaSchedulingInfo wraps the information that a replica type (rs or deployment) -// SchedulingAdapter needs to update objects per a schedule. -type ReplicaSchedulingInfo struct { - ScheduleState map[string]*ReplicaScheduleState - Status ReplicaStatus -} - -// SchedulingAdapter defines operations for interacting with a -// federated type that requires more complex synchronization logic. -type SchedulingAdapter interface { - GetSchedule(obj pkgruntime.Object, key string, clusters []*federationapi.Cluster, informer fedutil.FederatedInformer) (interface{}, error) - ScheduleObject(cluster *federationapi.Cluster, clusterObj pkgruntime.Object, federationObjCopy pkgruntime.Object, schedulingInfo interface{}) (pkgruntime.Object, ScheduleAction, error) - UpdateFederatedStatus(obj pkgruntime.Object, schedulingInfo interface{}) error - - // EquivalentIgnoringSchedule returns whether obj1 and obj2 are - // equivalent ignoring differences due to scheduling. - EquivalentIgnoringSchedule(obj1, obj2 pkgruntime.Object) bool -} - -// replicaSchedulingAdapter is meant to be embedded in other type adapters that require -// workload scheduling with actual pod replicas. -type replicaSchedulingAdapter struct { - preferencesAnnotationName string - updateStatusFunc func(pkgruntime.Object, interface{}) error -} - -func (a *replicaSchedulingAdapter) IsSchedulingAdapter() bool { - return true -} - -func isSelected(names []string, name string) bool { - for _, val := range names { - if val == name { - return true - } - } - return false -} - -func isObjHpaControlled(fedObj pkgruntime.Object) (bool, error) { - hpaSelectedClusters, error := hpautil.GetHpaTargetClusterList(fedObj) - if error != nil { - return false, error - } - - if hpaSelectedClusters == nil { - return false, nil - } - return true, nil -} - -// initializeScheduleState initializes the schedule state for consumption by schedule -// functions (schedule or simple schedule). After this initialization the state would -// already have information, if only a subset of clusters targetted by hpa, or all clusters -// need to be considered by the actual scheduling functions. -// The return bool named hpaControlled tells if this object is controlled by hpa or not. -func initializeScheduleState(fedObj pkgruntime.Object, clusterNames []string) (map[string]*ReplicaScheduleState, bool, error) { - initialState := make(map[string]*ReplicaScheduleState) - hpaControlled := false - hpaSelectedClusters, error := hpautil.GetHpaTargetClusterList(fedObj) - if error != nil { - return nil, hpaControlled, error - } - - if hpaSelectedClusters != nil { - hpaControlled = true - } - for _, clusterName := range clusterNames { - replicaState := ReplicaScheduleState{ - isSelected: false, - replicas: 0, - } - if hpaControlled { - if isSelected(hpaSelectedClusters.Names, clusterName) { - replicaState.isSelected = true - } - } - initialState[clusterName] = &replicaState - } - return initialState, hpaControlled, nil -} - -func (a *replicaSchedulingAdapter) GetSchedule(obj pkgruntime.Object, key string, clusters []*federationapi.Cluster, informer fedutil.FederatedInformer) (interface{}, error) { - var clusterNames []string - for _, cluster := range clusters { - clusterNames = append(clusterNames, cluster.Name) - } - - // Schedule the pods across the existing clusters. - objectGetter := func(clusterName, key string) (interface{}, bool, error) { - return informer.GetTargetStore().GetByKey(clusterName, key) - } - podsGetter := func(clusterName string, obj pkgruntime.Object) (*apiv1.PodList, error) { - clientset, err := informer.GetClientsetForCluster(clusterName) - if err != nil { - return nil, err - } - selectorObj := reflect.ValueOf(obj).Elem().FieldByName("Spec").FieldByName("Selector").Interface().(*metav1.LabelSelector) - selector, err := metav1.LabelSelectorAsSelector(selectorObj) - if err != nil { - return nil, fmt.Errorf("invalid selector: %v", err) - } - metadata, err := meta.Accessor(obj) - if err != nil { - return nil, err - } - return clientset.Core().Pods(metadata.GetNamespace()).List(metav1.ListOptions{LabelSelector: selector.String()}) - } - - initializedState, hpaControlled, err := initializeScheduleState(obj, clusterNames) - if err != nil { - return nil, err - } - - if hpaControlled { - state, err := simpleSchedule(initializedState, key, objectGetter) - if err != nil { - return nil, err - } - return &ReplicaSchedulingInfo{ - ScheduleState: state, - Status: ReplicaStatus{}, - }, nil - } - - currentReplicasPerCluster, estimatedCapacity, err := clustersReplicaState(clusterNames, key, objectGetter, podsGetter) - if err != nil { - return nil, err - } - - fedPref, err := replicapreferences.GetAllocationPreferences(obj, a.preferencesAnnotationName) - if err != nil { - glog.Infof("Invalid workload-type specific preference, using default. object: %v, err: %v", obj, err) - } - if fedPref == nil { - fedPref = &fedapi.ReplicaAllocationPreferences{ - Clusters: map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}, - }, - } - } - - plnr := planner.NewPlanner(fedPref) - - return &ReplicaSchedulingInfo{ - ScheduleState: schedule(plnr, obj, key, clusterNames, currentReplicasPerCluster, estimatedCapacity, initializedState), - Status: ReplicaStatus{}, - }, nil -} - -func (a *replicaSchedulingAdapter) ScheduleObject(cluster *federationapi.Cluster, clusterObj pkgruntime.Object, federationObjCopy pkgruntime.Object, schedulingInfo interface{}) (pkgruntime.Object, ScheduleAction, error) { - typedSchedulingInfo := schedulingInfo.(*ReplicaSchedulingInfo) - clusterScheduleState := typedSchedulingInfo.ScheduleState[cluster.Name] - - if clusterObj != nil { - schedulingStatusVal := reflect.ValueOf(typedSchedulingInfo).Elem().FieldByName("Status") - objStatusVal := reflect.ValueOf(clusterObj).Elem().FieldByName("Status") - for i := 0; i < schedulingStatusVal.NumField(); i++ { - schedulingStatusField := schedulingStatusVal.Field(i) - schedulingStatusFieldName := schedulingStatusVal.Type().Field(i).Name - objStatusField := objStatusVal.FieldByName(schedulingStatusFieldName) - if objStatusField.IsValid() { - current := schedulingStatusField.Int() - additional := objStatusField.Int() - schedulingStatusField.SetInt(current + additional) - } - } - } - - var action ScheduleAction = "" - specReplicas := int32(0) - // If the cluster has been selected (isSelected = true; for example by hpa) - // and the obj does not get any replicas, then it should create one with - // 0 replicas (which can then be scaled by hpa in that cluster). - // On the other hand we keep the action as "unassigned" if this cluster was - // not selected, and let the sync controller decide what to do. - if clusterScheduleState.isSelected { - specReplicas = int32(clusterScheduleState.replicas) - action = ActionAdd - } - reflect.ValueOf(federationObjCopy).Elem().FieldByName("Spec").FieldByName("Replicas").Set(reflect.ValueOf(&specReplicas)) - return federationObjCopy, action, nil -} - -func (a *replicaSchedulingAdapter) UpdateFederatedStatus(obj pkgruntime.Object, schedulingInfo interface{}) error { - return a.updateStatusFunc(obj, schedulingInfo) -} - -// simpleSchedule get replicas from only those clusters which are selected (by hpa scheduler). -// This aim of this is to ensure that this controller does not update objects, which are -// targetted by hpa. -func simpleSchedule(scheduleState map[string]*ReplicaScheduleState, key string, objectGetter func(clusterName string, key string) (interface{}, bool, error)) (map[string]*ReplicaScheduleState, error) { - for clusterName, state := range scheduleState { - // Get and consider replicas only for those clusters which are selected by hpa. - if state.isSelected { - obj, exists, err := objectGetter(clusterName, key) - if err != nil { - return nil, err - } - if !exists { - continue - } - state.replicas = reflect.ValueOf(obj).Elem().FieldByName("Spec").FieldByName("Replicas").Elem().Int() - } - } - - return scheduleState, nil -} - -func schedule(planner *planner.Planner, obj pkgruntime.Object, key string, clusterNames []string, currentReplicasPerCluster map[string]int64, estimatedCapacity map[string]int64, initialState map[string]*ReplicaScheduleState) map[string]*ReplicaScheduleState { - // TODO: integrate real scheduler - replicas := reflect.ValueOf(obj).Elem().FieldByName("Spec").FieldByName("Replicas").Elem().Int() - scheduleResult, overflow := planner.Plan(replicas, clusterNames, currentReplicasPerCluster, estimatedCapacity, key) - - // Ensure that all current clusters end up in the scheduling result. - // initialState, is preinitialized with all isSelected to false. - result := initialState - for clusterName := range currentReplicasPerCluster { - // We consider 0 replicas equaling to no need of creating a new object. - // isSchedule remains false in such case. - result[clusterName].replicas = 0 - } - - for clusterName, replicas := range scheduleResult { - result[clusterName].isSelected = true - result[clusterName].replicas = replicas - } - for clusterName, replicas := range overflow { - result[clusterName].isSelected = true - result[clusterName].replicas += replicas - } - - if glog.V(4) { - buf := bytes.NewBufferString(fmt.Sprintf("Schedule - %q\n", key)) - sort.Strings(clusterNames) - for _, clusterName := range clusterNames { - cur := currentReplicasPerCluster[clusterName] - target := scheduleResult[clusterName] - fmt.Fprintf(buf, "%s: current: %d target: %d", clusterName, cur, target) - if over, found := overflow[clusterName]; found { - fmt.Fprintf(buf, " overflow: %d", over) - } - if capacity, found := estimatedCapacity[clusterName]; found { - fmt.Fprintf(buf, " capacity: %d", capacity) - } - fmt.Fprintf(buf, "\n") - } - glog.V(4).Infof(buf.String()) - } - return result -} - -// clusterReplicaState returns information about the scheduling state of the pods running in the federated clusters. -func clustersReplicaState( - clusterNames []string, - key string, - objectGetter func(clusterName string, key string) (interface{}, bool, error), - podsGetter func(clusterName string, obj pkgruntime.Object) (*apiv1.PodList, error)) (currentReplicasPerCluster map[string]int64, estimatedCapacity map[string]int64, err error) { - - currentReplicasPerCluster = make(map[string]int64) - estimatedCapacity = make(map[string]int64) - - for _, clusterName := range clusterNames { - obj, exists, err := objectGetter(clusterName, key) - if err != nil { - return nil, nil, err - } - if !exists { - continue - } - replicas := reflect.ValueOf(obj).Elem().FieldByName("Spec").FieldByName("Replicas").Elem().Int() - readyReplicas := reflect.ValueOf(obj).Elem().FieldByName("Status").FieldByName("ReadyReplicas").Int() - if replicas == readyReplicas { - currentReplicasPerCluster[clusterName] = readyReplicas - } else { - pods, err := podsGetter(clusterName, obj.(pkgruntime.Object)) - if err != nil { - return nil, nil, err - } - podStatus := podanalyzer.AnalyzePods(pods, time.Now()) - currentReplicasPerCluster[clusterName] = int64(podStatus.RunningAndReady) // include pending as well? - unschedulable := int64(podStatus.Unschedulable) - if unschedulable > 0 { - estimatedCapacity[clusterName] = replicas - unschedulable - } - } - } - return currentReplicasPerCluster, estimatedCapacity, nil -} diff --git a/federation/pkg/federatedtypes/scheduling_test.go b/federation/pkg/federatedtypes/scheduling_test.go deleted file mode 100644 index d938e525a5..0000000000 --- a/federation/pkg/federatedtypes/scheduling_test.go +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federatedtypes - -import ( - "fmt" - "testing" - "time" - - apiv1 "k8s.io/api/core/v1" - extensionsv1 "k8s.io/api/extensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - - "github.com/stretchr/testify/assert" -) - -func TestClusterReplicaState(t *testing.T) { - uncalledPodsGetter := func(clusterName string, obj pkgruntime.Object) (*apiv1.PodList, error) { - t.Fatal("podsGetter should not be called when workload objects are all ready.") - return nil, nil - } - - podsByReplicaSet := make(map[pkgruntime.Object][]*apiv1.Pod) - podsGetter := func(clusterName string, obj pkgruntime.Object) (*apiv1.PodList, error) { - pods, ok := podsByReplicaSet[obj] - if !ok { - t.Fatalf("No pods found in test data for replica set %v", obj) - return nil, fmt.Errorf("Not found") - } - var podListPods []apiv1.Pod - for _, pod := range pods { - podListPods = append(podListPods, *pod) - } - return &apiv1.PodList{Items: podListPods}, nil - } - - readyCondition := apiv1.PodCondition{Type: apiv1.PodReady} - unschedulableCondition := apiv1.PodCondition{ - Type: apiv1.PodScheduled, - Status: apiv1.ConditionFalse, - Reason: apiv1.PodReasonUnschedulable, - LastTransitionTime: metav1.NewTime(time.Now().Add(-1 * time.Hour)), - } - - one := int64(1) - two := int64(2) - - tests := map[string]struct { - rs1Replicas int32 - rs2Replicas int32 - rs1ReadyReplicas int32 - rs2ReadyReplicas int32 - podsGetter func(clusterName string, obj pkgruntime.Object) (*apiv1.PodList, error) - pod1Phase apiv1.PodPhase - pod1Condition apiv1.PodCondition - pod2Phase apiv1.PodPhase - pod2Condition apiv1.PodCondition - cluster1Replicas *int64 - cluster2Replicas *int64 - cluster1UnschedulableReplicas *int64 - cluster2UnschedulableReplicas *int64 - }{ - "All replica sets have an equal number of requested and ready replicas.": {rs1Replicas: 2, rs2Replicas: 2, rs1ReadyReplicas: 2, rs2ReadyReplicas: 2, podsGetter: uncalledPodsGetter, cluster1Replicas: &two, cluster2Replicas: &two}, - "One replica set has a pending schedulable pod": {rs1Replicas: 2, rs2Replicas: 2, rs1ReadyReplicas: 1, rs2ReadyReplicas: 2, podsGetter: podsGetter, pod1Phase: apiv1.PodRunning, pod1Condition: readyCondition, pod2Phase: apiv1.PodPending, cluster1Replicas: &one, cluster2Replicas: &two}, - "One replica set has an unschedulable pod": {rs1Replicas: 2, rs2Replicas: 2, rs1ReadyReplicas: 1, rs2ReadyReplicas: 2, podsGetter: podsGetter, pod1Phase: apiv1.PodRunning, pod1Condition: readyCondition, pod2Phase: apiv1.PodPending, pod2Condition: unschedulableCondition, cluster1Replicas: &one, cluster2Replicas: &two, cluster1UnschedulableReplicas: &one}, - } - - for name, tt := range tests { - t.Run(name, func(t *testing.T) { - clusters := []string{"one", "two"} - replicaSetsByCluster := make(map[string]*extensionsv1.ReplicaSet) - replicaSetGetter := func(clusterName string, key string) (interface{}, bool, error) { - rs, ok := replicaSetsByCluster[clusterName] - if !ok { - t.Fatalf("No replica set found in test data for %v", clusterName) - return nil, false, fmt.Errorf("Not found") - } - return rs, true, nil - } - rs1 := newReplicaSetWithReplicas("one", tt.rs1Replicas) - rs2 := newReplicaSetWithReplicas("two", tt.rs2Replicas) - rs1.Spec.Replicas = &tt.rs1Replicas - rs2.Spec.Replicas = &tt.rs2Replicas - rs1.Status.ReadyReplicas = tt.rs1ReadyReplicas - rs2.Status.ReadyReplicas = tt.rs2ReadyReplicas - - replicaSetsByCluster["one"] = rs1 - replicaSetsByCluster["two"] = rs2 - - pod1 := newPod("one") - pod2 := newPod("two") - podThree := newPod("three") - podFour := newPod("four") - - pod1.Status.Phase = tt.pod1Phase - pod2.Status.Phase = tt.pod2Phase - pod1.Status.Conditions = []apiv1.PodCondition{tt.pod1Condition} - pod2.Status.Conditions = []apiv1.PodCondition{tt.pod2Condition} - - podsByReplicaSet[rs1] = []*apiv1.Pod{pod1, pod2} - podsByReplicaSet[rs2] = []*apiv1.Pod{podThree, podFour} - - current, estimatedCapacity, err := clustersReplicaState(clusters, "", replicaSetGetter, tt.podsGetter) - - assert.Nil(t, err) - - wantedCurrent := make(map[string]int64) - if tt.cluster1Replicas != nil { - wantedCurrent["one"] = *tt.cluster1Replicas - } - if tt.cluster2Replicas != nil { - wantedCurrent["two"] = *tt.cluster2Replicas - } - assert.Equal(t, wantedCurrent, current) - - wantedEstimatedCapacity := make(map[string]int64) - if tt.cluster1UnschedulableReplicas != nil { - wantedEstimatedCapacity["one"] = *tt.cluster1UnschedulableReplicas - } - if tt.cluster2UnschedulableReplicas != nil { - wantedEstimatedCapacity["two"] = *tt.cluster2UnschedulableReplicas - } - assert.Equal(t, wantedEstimatedCapacity, estimatedCapacity) - }) - } -} - -func newReplicaSetWithReplicas(name string, replicas int32) *extensionsv1.ReplicaSet { - return &extensionsv1.ReplicaSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: metav1.NamespaceDefault, - SelfLink: "/api/v1/namespaces/default/replicasets/name", - }, - Spec: extensionsv1.ReplicaSetSpec{ - Replicas: &replicas, - }, - } -} - -func newPod(name string) *apiv1.Pod { - return &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: metav1.NamespaceDefault, - }, - } -} diff --git a/federation/pkg/federatedtypes/secret.go b/federation/pkg/federatedtypes/secret.go deleted file mode 100644 index 09548ca62a..0000000000 --- a/federation/pkg/federatedtypes/secret.go +++ /dev/null @@ -1,152 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package federatedtypes - -import ( - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/watch" - kubeclientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/federation/pkg/federation-controller/util" -) - -const ( - SecretKind = "secret" - SecretControllerName = "secrets" -) - -func init() { - RegisterFederatedType(SecretKind, SecretControllerName, []schema.GroupVersionResource{apiv1.SchemeGroupVersion.WithResource(SecretControllerName)}, NewSecretAdapter) -} - -type SecretAdapter struct { - client federationclientset.Interface -} - -func NewSecretAdapter(client federationclientset.Interface, config *restclient.Config, adapterSpecificArgs map[string]interface{}) FederatedTypeAdapter { - return &SecretAdapter{client: client} -} - -func (a *SecretAdapter) Kind() string { - return SecretKind -} - -func (a *SecretAdapter) ObjectType() pkgruntime.Object { - return &apiv1.Secret{} -} - -func (a *SecretAdapter) IsExpectedType(obj interface{}) bool { - _, ok := obj.(*apiv1.Secret) - return ok -} - -func (a *SecretAdapter) Copy(obj pkgruntime.Object) pkgruntime.Object { - secret := obj.(*apiv1.Secret) - return &apiv1.Secret{ - ObjectMeta: util.DeepCopyRelevantObjectMeta(secret.ObjectMeta), - Data: secret.Data, - Type: secret.Type, - } -} - -func (a *SecretAdapter) Equivalent(obj1, obj2 pkgruntime.Object) bool { - secret1 := obj1.(*apiv1.Secret) - secret2 := obj2.(*apiv1.Secret) - return util.SecretEquivalent(*secret1, *secret2) -} - -func (a *SecretAdapter) QualifiedName(obj pkgruntime.Object) QualifiedName { - secret := obj.(*apiv1.Secret) - return QualifiedName{Namespace: secret.Namespace, Name: secret.Name} -} - -func (a *SecretAdapter) ObjectMeta(obj pkgruntime.Object) *metav1.ObjectMeta { - return &obj.(*apiv1.Secret).ObjectMeta -} - -func (a *SecretAdapter) FedCreate(obj pkgruntime.Object) (pkgruntime.Object, error) { - secret := obj.(*apiv1.Secret) - return a.client.CoreV1().Secrets(secret.Namespace).Create(secret) -} - -func (a *SecretAdapter) FedDelete(qualifiedName QualifiedName, options *metav1.DeleteOptions) error { - return a.client.CoreV1().Secrets(qualifiedName.Namespace).Delete(qualifiedName.Name, options) -} - -func (a *SecretAdapter) FedGet(qualifiedName QualifiedName) (pkgruntime.Object, error) { - return a.client.CoreV1().Secrets(qualifiedName.Namespace).Get(qualifiedName.Name, metav1.GetOptions{}) -} - -func (a *SecretAdapter) FedList(namespace string, options metav1.ListOptions) (pkgruntime.Object, error) { - return a.client.CoreV1().Secrets(namespace).List(options) -} - -func (a *SecretAdapter) FedUpdate(obj pkgruntime.Object) (pkgruntime.Object, error) { - secret := obj.(*apiv1.Secret) - return a.client.CoreV1().Secrets(secret.Namespace).Update(secret) -} - -func (a *SecretAdapter) FedWatch(namespace string, options metav1.ListOptions) (watch.Interface, error) { - return a.client.CoreV1().Secrets(namespace).Watch(options) -} - -func (a *SecretAdapter) ClusterCreate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) { - secret := obj.(*apiv1.Secret) - return client.CoreV1().Secrets(secret.Namespace).Create(secret) -} - -func (a *SecretAdapter) ClusterDelete(client kubeclientset.Interface, qualifiedName QualifiedName, options *metav1.DeleteOptions) error { - return client.CoreV1().Secrets(qualifiedName.Namespace).Delete(qualifiedName.Name, options) -} - -func (a *SecretAdapter) ClusterGet(client kubeclientset.Interface, qualifiedName QualifiedName) (pkgruntime.Object, error) { - return client.CoreV1().Secrets(qualifiedName.Namespace).Get(qualifiedName.Name, metav1.GetOptions{}) -} - -func (a *SecretAdapter) ClusterList(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (pkgruntime.Object, error) { - return client.CoreV1().Secrets(namespace).List(options) -} - -func (a *SecretAdapter) ClusterUpdate(client kubeclientset.Interface, obj pkgruntime.Object) (pkgruntime.Object, error) { - secret := obj.(*apiv1.Secret) - return client.CoreV1().Secrets(secret.Namespace).Update(secret) -} - -func (a *SecretAdapter) ClusterWatch(client kubeclientset.Interface, namespace string, options metav1.ListOptions) (watch.Interface, error) { - return client.CoreV1().Secrets(namespace).Watch(options) -} - -func (a *SecretAdapter) IsSchedulingAdapter() bool { - return false -} - -func (a *SecretAdapter) NewTestObject(namespace string) pkgruntime.Object { - return &apiv1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "test-secret-", - Namespace: namespace, - }, - Data: map[string][]byte{ - "A": []byte("ala ma kota"), - }, - Type: apiv1.SecretTypeOpaque, - } -} diff --git a/federation/pkg/federation-controller/BUILD b/federation/pkg/federation-controller/BUILD deleted file mode 100644 index 0a1dc2f977..0000000000 --- a/federation/pkg/federation-controller/BUILD +++ /dev/null @@ -1,33 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["doc.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller", -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/pkg/federation-controller/cluster:all-srcs", - "//federation/pkg/federation-controller/ingress:all-srcs", - "//federation/pkg/federation-controller/job:all-srcs", - "//federation/pkg/federation-controller/service:all-srcs", - "//federation/pkg/federation-controller/sync:all-srcs", - "//federation/pkg/federation-controller/util:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/OWNERS b/federation/pkg/federation-controller/OWNERS deleted file mode 100644 index 571c01c052..0000000000 --- a/federation/pkg/federation-controller/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -approvers: -- quinton-hoole -- nikhiljindal -- madhusudancs -reviewers: -- quinton-hoole -- nikhiljindal -- madhusudancs diff --git a/federation/pkg/federation-controller/cluster/BUILD b/federation/pkg/federation-controller/cluster/BUILD deleted file mode 100644 index 9c50487b2f..0000000000 --- a/federation/pkg/federation-controller/cluster/BUILD +++ /dev/null @@ -1,67 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_test( - name = "go_default_test", - srcs = ["clustercontroller_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/cluster", - library = ":go_default_library", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//pkg/api/testapi:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/uuid:go_default_library", - "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - ], -) - -go_library( - name = "go_default_library", - srcs = [ - "cluster_client.go", - "clustercontroller.go", - "doc.go", - ], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/cluster", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/cache:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//federation/pkg/federation-controller/util:go_default_library", - "//pkg/api:go_default_library", - "//pkg/client/clientset_generated/internalclientset:go_default_library", - "//pkg/controller:go_default_library", - "//pkg/kubelet/apis:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/k8s.io/api/core/v1: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/util/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait: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/tools/cache:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/cluster/cluster_client.go b/federation/pkg/federation-controller/cluster/cluster_client.go deleted file mode 100644 index c9f963588c..0000000000 --- a/federation/pkg/federation-controller/cluster/cluster_client.go +++ /dev/null @@ -1,170 +0,0 @@ -/* -Copyright 2016 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 cluster - -import ( - "fmt" - "strings" - - "github.com/golang/glog" - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/sets" - restclient "k8s.io/client-go/rest" - federation_v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" - "k8s.io/kubernetes/federation/pkg/federation-controller/util" - "k8s.io/kubernetes/pkg/api" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" - kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis" -) - -const ( - UserAgentName = "Cluster-Controller" -) - -type ClusterClient struct { - kubeClient *clientset.Clientset -} - -func NewClusterClientSet(c *federation_v1beta1.Cluster) (*ClusterClient, error) { - clusterConfig, err := util.BuildClusterConfig(c) - if err != nil { - return nil, err - } - var clusterClientSet = ClusterClient{} - if clusterConfig != nil { - clusterClientSet.kubeClient = clientset.NewForConfigOrDie((restclient.AddUserAgent(clusterConfig, UserAgentName))) - if clusterClientSet.kubeClient == nil { - return nil, nil - } - } - return &clusterClientSet, nil -} - -// GetClusterHealthStatus gets the kubernetes cluster health status by requesting "/healthz" -func (self *ClusterClient) GetClusterHealthStatus() *federation_v1beta1.ClusterStatus { - clusterStatus := federation_v1beta1.ClusterStatus{} - currentTime := metav1.Now() - newClusterReadyCondition := federation_v1beta1.ClusterCondition{ - Type: federation_v1beta1.ClusterReady, - Status: v1.ConditionTrue, - Reason: "ClusterReady", - Message: "/healthz responded with ok", - LastProbeTime: currentTime, - LastTransitionTime: currentTime, - } - newClusterNotReadyCondition := federation_v1beta1.ClusterCondition{ - Type: federation_v1beta1.ClusterReady, - Status: v1.ConditionFalse, - Reason: "ClusterNotReady", - Message: "/healthz responded without ok", - LastProbeTime: currentTime, - LastTransitionTime: currentTime, - } - newNodeOfflineCondition := federation_v1beta1.ClusterCondition{ - Type: federation_v1beta1.ClusterOffline, - Status: v1.ConditionTrue, - Reason: "ClusterNotReachable", - Message: "cluster is not reachable", - LastProbeTime: currentTime, - LastTransitionTime: currentTime, - } - newNodeNotOfflineCondition := federation_v1beta1.ClusterCondition{ - Type: federation_v1beta1.ClusterOffline, - Status: v1.ConditionFalse, - Reason: "ClusterReachable", - Message: "cluster is reachable", - LastProbeTime: currentTime, - LastTransitionTime: currentTime, - } - body, err := self.kubeClient.DiscoveryClient.RESTClient().Get().AbsPath("/healthz").Do().Raw() - if err != nil { - clusterStatus.Conditions = append(clusterStatus.Conditions, newNodeOfflineCondition) - } else { - if !strings.EqualFold(string(body), "ok") { - clusterStatus.Conditions = append(clusterStatus.Conditions, newClusterNotReadyCondition, newNodeNotOfflineCondition) - } else { - clusterStatus.Conditions = append(clusterStatus.Conditions, newClusterReadyCondition) - } - } - - zones, region, err := self.GetClusterZones() - if err != nil { - glog.Warningf("Failed to get zones and region for cluster with client %v: %v", self, err) - } else { - clusterStatus.Zones = zones - clusterStatus.Region = region - } - - return &clusterStatus -} - -// GetClusterZones gets the kubernetes cluster zones and region by inspecting labels on nodes in the cluster. -func (self *ClusterClient) GetClusterZones() (zones []string, region string, err error) { - return getZoneNames(self.kubeClient) -} - -// Find the name of the zone in which a Node is running -func getZoneNameForNode(node api.Node) (string, error) { - for key, value := range node.Labels { - if key == kubeletapis.LabelZoneFailureDomain { - return value, nil - } - } - return "", fmt.Errorf("Zone name for node %s not found. No label with key %s", - node.Name, kubeletapis.LabelZoneFailureDomain) -} - -// Find the name of the region in which a Node is running -func getRegionNameForNode(node api.Node) (string, error) { - for key, value := range node.Labels { - if key == kubeletapis.LabelZoneRegion { - return value, nil - } - } - return "", fmt.Errorf("Region name for node %s not found. No label with key %s", - node.Name, kubeletapis.LabelZoneRegion) -} - -// Find the names of all zones and the region in which we have nodes in this cluster. -func getZoneNames(client *clientset.Clientset) (zones []string, region string, err error) { - zoneNames := sets.NewString() - nodes, err := client.Core().Nodes().List(metav1.ListOptions{}) - if err != nil { - glog.Errorf("Failed to list nodes while getting zone names: %v", err) - return nil, "", err - } - for i, node := range nodes.Items { - // TODO: quinton-hoole make this more efficient. - // For non-multi-zone clusters the zone will - // be identical for all nodes, so we only need to look at one node - // For multi-zone clusters we know at build time - // which zones are included. Rather get this info from there, because it's cheaper. - zoneName, err := getZoneNameForNode(node) - if err != nil { - return nil, "", err - } - zoneNames.Insert(zoneName) - if i == 0 { - region, err = getRegionNameForNode(node) - if err != nil { - return nil, "", err - } - } - } - return zoneNames.List(), region, nil -} diff --git a/federation/pkg/federation-controller/cluster/clustercontroller.go b/federation/pkg/federation-controller/cluster/clustercontroller.go deleted file mode 100644 index 6820a71e76..0000000000 --- a/federation/pkg/federation-controller/cluster/clustercontroller.go +++ /dev/null @@ -1,209 +0,0 @@ -/* -Copyright 2016 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 cluster - -import ( - "strings" - "sync" - "time" - - "github.com/golang/glog" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/cache" - federationv1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" - clustercache "k8s.io/kubernetes/federation/client/cache" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/pkg/controller" -) - -type ClusterController struct { - // federationClient used to operate cluster - federationClient federationclientset.Interface - - // clusterMonitorPeriod is the period for updating status of cluster - clusterMonitorPeriod time.Duration - - mu sync.RWMutex - knownClusterSet sets.String - // clusterClusterStatusMap is a mapping of clusterName and cluster status of last sampling - clusterClusterStatusMap map[string]federationv1beta1.ClusterStatus - // clusterKubeClientMap is a mapping of clusterName and restclient - clusterKubeClientMap map[string]ClusterClient - - // cluster framework and store - clusterController cache.Controller - clusterStore clustercache.StoreToClusterLister -} - -// StartClusterController starts a new cluster controller -func StartClusterController(config *restclient.Config, stopChan <-chan struct{}, clusterMonitorPeriod time.Duration) { - restclient.AddUserAgent(config, "cluster-controller") - client := federationclientset.NewForConfigOrDie(config) - controller := newClusterController(client, clusterMonitorPeriod) - glog.Infof("Starting cluster controller") - controller.Run(stopChan) -} - -// newClusterController returns a new cluster controller -func newClusterController(federationClient federationclientset.Interface, clusterMonitorPeriod time.Duration) *ClusterController { - cc := &ClusterController{ - knownClusterSet: make(sets.String), - federationClient: federationClient, - clusterMonitorPeriod: clusterMonitorPeriod, - clusterClusterStatusMap: make(map[string]federationv1beta1.ClusterStatus), - clusterKubeClientMap: make(map[string]ClusterClient), - } - cc.clusterStore.Store, cc.clusterController = cache.NewInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - return cc.federationClient.Federation().Clusters().List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - return cc.federationClient.Federation().Clusters().Watch(options) - }, - }, - &federationv1beta1.Cluster{}, - controller.NoResyncPeriodFunc(), - cache.ResourceEventHandlerFuncs{ - DeleteFunc: cc.delFromClusterSet, - AddFunc: cc.addToClusterSet, - }, - ) - return cc -} - -// delFromClusterSet delete a cluster from clusterSet and -// delete the corresponding restclient from the map clusterKubeClientMap -func (cc *ClusterController) delFromClusterSet(obj interface{}) { - cc.mu.Lock() - defer cc.mu.Unlock() - cluster := obj.(*federationv1beta1.Cluster) - cc.delFromClusterSetByName(cluster.Name) -} - -// delFromClusterSetByName delete a cluster from clusterSet by name and -// delete the corresponding restclient from the map clusterKubeClientMap. -// Caller must make sure that they hold the mutex -func (cc *ClusterController) delFromClusterSetByName(clusterName string) { - glog.V(1).Infof("ClusterController observed a cluster deletion: %v", clusterName) - cc.knownClusterSet.Delete(clusterName) - delete(cc.clusterKubeClientMap, clusterName) - delete(cc.clusterClusterStatusMap, clusterName) -} - -func (cc *ClusterController) addToClusterSet(obj interface{}) { - cc.mu.Lock() - defer cc.mu.Unlock() - cluster := obj.(*federationv1beta1.Cluster) - cc.addToClusterSetWithoutLock(cluster) -} - -// addToClusterSetWithoutLock inserts the new cluster to clusterSet and create -// a corresponding restclient to map clusterKubeClientMap if the cluster is not -// known. Caller must make sure that they hold the mutex. -func (cc *ClusterController) addToClusterSetWithoutLock(cluster *federationv1beta1.Cluster) { - if cc.knownClusterSet.Has(cluster.Name) { - return - } - glog.V(1).Infof("ClusterController observed a new cluster: %v", cluster.Name) - cc.knownClusterSet.Insert(cluster.Name) - // create the restclient of cluster - restClient, err := NewClusterClientSet(cluster) - if err != nil || restClient == nil { - glog.Errorf("Failed to create corresponding restclient of kubernetes cluster: %v", err) - return - } - cc.clusterKubeClientMap[cluster.Name] = *restClient -} - -// Run begins watching and syncing. -func (cc *ClusterController) Run(stopChan <-chan struct{}) { - defer utilruntime.HandleCrash() - go cc.clusterController.Run(stopChan) - // monitor cluster status periodically, in phase 1 we just get the health state from "/healthz" - go wait.Until(func() { - if err := cc.updateClusterStatus(); err != nil { - glog.Errorf("Error monitoring cluster status: %v", err) - } - }, cc.clusterMonitorPeriod, stopChan) -} - -// updateClusterStatus checks cluster status and get the metrics from cluster's restapi -func (cc *ClusterController) updateClusterStatus() error { - clusters, err := cc.federationClient.Federation().Clusters().List(metav1.ListOptions{}) - if err != nil { - return err - } - - for _, cluster := range clusters.Items { - cc.mu.RLock() - // skip updating status of the cluster which is not yet added to knownClusterSet. - if !cc.knownClusterSet.Has(cluster.Name) { - cc.mu.RUnlock() - continue - } - clusterClient, clientFound := cc.clusterKubeClientMap[cluster.Name] - clusterStatusOld, statusFound := cc.clusterClusterStatusMap[cluster.Name] - cc.mu.RUnlock() - - if !clientFound { - glog.Warningf("Failed to get client for cluster %s", cluster.Name) - continue - } - clusterStatusNew := clusterClient.GetClusterHealthStatus() - if !statusFound { - glog.Infof("There is no status stored for cluster: %v before", cluster.Name) - } else { - hasTransition := false - if len(clusterStatusNew.Conditions) != len(clusterStatusOld.Conditions) { - hasTransition = true - } else { - for i := 0; i < len(clusterStatusNew.Conditions); i++ { - if !(strings.EqualFold(string(clusterStatusNew.Conditions[i].Type), string(clusterStatusOld.Conditions[i].Type)) && - strings.EqualFold(string(clusterStatusNew.Conditions[i].Status), string(clusterStatusOld.Conditions[i].Status))) { - hasTransition = true - break - } - } - } - - if !hasTransition { - for j := 0; j < len(clusterStatusNew.Conditions); j++ { - clusterStatusNew.Conditions[j].LastTransitionTime = clusterStatusOld.Conditions[j].LastTransitionTime - } - } - } - - cc.mu.Lock() - cc.clusterClusterStatusMap[cluster.Name] = *clusterStatusNew - cc.mu.Unlock() - cluster.Status = *clusterStatusNew - cluster, err := cc.federationClient.Federation().Clusters().UpdateStatus(&cluster) - if err != nil { - glog.Warningf("Failed to update the status of cluster: %v ,error is : %v", cluster.Name, err) - // Don't return err here, as we want to continue processing remaining clusters. - continue - } - } - return nil -} diff --git a/federation/pkg/federation-controller/cluster/clustercontroller_test.go b/federation/pkg/federation-controller/cluster/clustercontroller_test.go deleted file mode 100644 index 8ae0acc029..0000000000 --- a/federation/pkg/federation-controller/cluster/clustercontroller_test.go +++ /dev/null @@ -1,173 +0,0 @@ -/* -Copyright 2016 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 cluster - -import ( - "encoding/json" - "fmt" - "net/http" - "net/http/httptest" - "testing" - "time" - - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/uuid" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - federationv1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/pkg/api/testapi" -) - -func newCluster(clusterName string, serverUrl string) *federationv1beta1.Cluster { - cluster := federationv1beta1.Cluster{ - TypeMeta: metav1.TypeMeta{APIVersion: testapi.Federation.GroupVersion().String()}, - ObjectMeta: metav1.ObjectMeta{ - UID: uuid.NewUUID(), - Name: clusterName, - }, - Spec: federationv1beta1.ClusterSpec{ - ServerAddressByClientCIDRs: []federationv1beta1.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: serverUrl, - }, - }, - }, - } - return &cluster -} - -func newClusterList(cluster *federationv1beta1.Cluster) *federationv1beta1.ClusterList { - clusterList := federationv1beta1.ClusterList{ - TypeMeta: metav1.TypeMeta{APIVersion: testapi.Federation.GroupVersion().String()}, - ListMeta: metav1.ListMeta{ - SelfLink: "foobar", - }, - Items: []federationv1beta1.Cluster{}, - } - clusterList.Items = append(clusterList.Items, *cluster) - return &clusterList -} - -// init a fake http handler, simulate a federation apiserver, response the "DELETE" "PUT" "GET" "UPDATE" -// when "canBeGotten" is false, means that user can not get the cluster cluster from apiserver -func createHttptestFakeHandlerForFederation(clusterList *federationv1beta1.ClusterList, canBeGotten bool) *http.HandlerFunc { - fakeHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - clusterListString, _ := json.Marshal(*clusterList) - w.Header().Set("Content-Type", "application/json") - switch r.Method { - case "PUT": - fmt.Fprintln(w, string(clusterListString)) - case "GET": - if canBeGotten { - fmt.Fprintln(w, string(clusterListString)) - } else { - fmt.Fprintln(w, "") - } - default: - fmt.Fprintln(w, "") - } - }) - return &fakeHandler -} - -// init a fake http handler, simulate a cluster apiserver, response the "/healthz" -// when "canBeGotten" is false, means that user can not get response from apiserver -func createHttptestFakeHandlerForCluster(canBeGotten bool) *http.HandlerFunc { - fakeHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - switch r.Method { - case "GET": - if canBeGotten { - fmt.Fprintln(w, "ok") - } else { - w.WriteHeader(http.StatusNotFound) - } - default: - fmt.Fprintln(w, "") - } - }) - return &fakeHandler -} - -func TestUpdateClusterStatusOK(t *testing.T) { - clusterName := "foobarCluster" - // create dummy httpserver - testClusterServer := httptest.NewServer(createHttptestFakeHandlerForCluster(true)) - defer testClusterServer.Close() - federationCluster := newCluster(clusterName, testClusterServer.URL) - federationClusterList := newClusterList(federationCluster) - - testFederationServer := httptest.NewServer(createHttptestFakeHandlerForFederation(federationClusterList, true)) - defer testFederationServer.Close() - - restClientCfg, err := clientcmd.BuildConfigFromFlags(testFederationServer.URL, "") - if err != nil { - t.Errorf("Failed to build client config") - } - federationClientSet := federationclientset.NewForConfigOrDie(restclient.AddUserAgent(restClientCfg, "cluster-controller")) - - manager := newClusterController(federationClientSet, 5) - manager.addToClusterSet(federationCluster) - err = manager.updateClusterStatus() - if err != nil { - t.Errorf("Failed to Update Cluster Status: %v", err) - } - clusterStatus, found := manager.clusterClusterStatusMap[clusterName] - if !found { - t.Errorf("Failed to Update Cluster Status") - } else { - if (clusterStatus.Conditions[1].Status != v1.ConditionFalse) || (clusterStatus.Conditions[1].Type != federationv1beta1.ClusterOffline) { - t.Errorf("Failed to Update Cluster Status") - } - } -} - -// Test races between informer's updates and routine updates of cluster status -// Issue https://github.com/kubernetes/kubernetes/issues/49958 -func TestUpdateClusterRace(t *testing.T) { - clusterName := "foobarCluster" - // create dummy httpserver - testClusterServer := httptest.NewServer(createHttptestFakeHandlerForCluster(true)) - defer testClusterServer.Close() - federationCluster := newCluster(clusterName, testClusterServer.URL) - federationClusterList := newClusterList(federationCluster) - - testFederationServer := httptest.NewServer(createHttptestFakeHandlerForFederation(federationClusterList, true)) - defer testFederationServer.Close() - - restClientCfg, err := clientcmd.BuildConfigFromFlags(testFederationServer.URL, "") - if err != nil { - t.Errorf("Failed to build client config") - } - federationClientSet := federationclientset.NewForConfigOrDie(restclient.AddUserAgent(restClientCfg, "cluster-controller")) - - manager := newClusterController(federationClientSet, 1*time.Millisecond) - - stop := make(chan struct{}) - manager.Run(stop) - - // try to trigger the race in UpdateClusterStatus - for i := 0; i < 10; i++ { - manager.addToClusterSet(federationCluster) - manager.delFromClusterSet(federationCluster) - } - - close(stop) -} diff --git a/federation/pkg/federation-controller/cluster/doc.go b/federation/pkg/federation-controller/cluster/doc.go deleted file mode 100644 index d311db0945..0000000000 --- a/federation/pkg/federation-controller/cluster/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2016 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 cluster contains code for syncing cluster -package cluster // import "k8s.io/kubernetes/federation/pkg/federation-controller/cluster" diff --git a/federation/pkg/federation-controller/doc.go b/federation/pkg/federation-controller/doc.go deleted file mode 100644 index 657ce63c1e..0000000000 --- a/federation/pkg/federation-controller/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2015 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 federation_controller contains code for controllers (like the cluster -// controller). -package federation_controller // import "k8s.io/kubernetes/federation/pkg/federation-controller" diff --git a/federation/pkg/federation-controller/ingress/BUILD b/federation/pkg/federation-controller/ingress/BUILD deleted file mode 100644 index ad56da1d81..0000000000 --- a/federation/pkg/federation-controller/ingress/BUILD +++ /dev/null @@ -1,77 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = ["ingress_controller.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/ingress", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//federation/pkg/federation-controller/util:go_default_library", - "//federation/pkg/federation-controller/util/clusterselector:go_default_library", - "//federation/pkg/federation-controller/util/deletionhelper:go_default_library", - "//federation/pkg/federation-controller/util/eventsink:go_default_library", - "//pkg/api:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//pkg/controller:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors: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/types:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/k8s.io/client-go/tools/record:go_default_library", - "//vendor/k8s.io/client-go/util/flowcontrol:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["ingress_controller_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/ingress", - library = ":go_default_library", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/fake:go_default_library", - "//federation/pkg/federation-controller/util:go_default_library", - "//federation/pkg/federation-controller/util/deletionhelper:go_default_library", - "//federation/pkg/federation-controller/util/finalizers:go_default_library", - "//federation/pkg/federation-controller/util/test:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/github.com/stretchr/testify/assert:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors: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/types:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library", - "//vendor/k8s.io/client-go/tools/cache:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/ingress/ingress_controller.go b/federation/pkg/federation-controller/ingress/ingress_controller.go deleted file mode 100644 index 3e95d678f1..0000000000 --- a/federation/pkg/federation-controller/ingress/ingress_controller.go +++ /dev/null @@ -1,890 +0,0 @@ -/* -Copyright 2016 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 ingress - -import ( - "crypto/md5" - "fmt" - "sync" - "time" - - "k8s.io/api/core/v1" - extensionsv1beta1 "k8s.io/api/extensions/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/watch" - kubeclientset "k8s.io/client-go/kubernetes" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/tools/record" - "k8s.io/client-go/util/flowcontrol" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/federation/pkg/federation-controller/util" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/clusterselector" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/deletionhelper" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/eventsink" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/controller" - - "github.com/golang/glog" -) - -const ( - // Special cluster name which denotes all clusters - only used internally. It's not a valid cluster name, so effectively reserved. - allClustersKey = ".ALL_CLUSTERS" - // TODO: Get the constants below directly from the Kubernetes Ingress Controller constants - but thats in a separate repo - staticIPNameKeyWritable = "kubernetes.io/ingress.global-static-ip-name" // The writable annotation on Ingress to tell the controller to use a specific, named, static IP - staticIPNameKeyReadonly = "ingress.kubernetes.io/static-ip" // The readonly key via which the cluster's Ingress Controller communicates which static IP it used. If staticIPNameKeyWritable above is specified, it is used. - uidAnnotationKey = "kubernetes.io/ingress.uid" // The annotation on federation clusters, where we store the ingress UID - uidConfigMapName = "ingress-uid" // Name of the config-map and key the ingress controller stores its uid in. - uidConfigMapNamespace = "kube-system" - uidKey = "uid" - providerUidKey = "provider-uid" - // Annotation on the ingress in federation control plane that is used to keep - // track of the first cluster in which we create ingress. - // We wait for ingress to be created in this cluster before creating it any - // other cluster. - firstClusterAnnotation = "ingress.federation.kubernetes.io/first-cluster" - ControllerName = "ingresses" - UserAgentName = "federation-ingresses-controller" -) - -var ( - RequiredResources = []schema.GroupVersionResource{extensionsv1beta1.SchemeGroupVersion.WithResource("ingresses")} -) - -type IngressController struct { - sync.Mutex // Lock used for leader election - // For triggering single ingress reconciliation. This is used when there is an - // add/update/delete operation on an ingress in either federated API server or - // in some member of the federation. - ingressDeliverer *util.DelayingDeliverer - - // For triggering reconciliation of cluster ingress controller configmap and - // all ingresses. This is used when a new cluster becomes available. - clusterDeliverer *util.DelayingDeliverer - - // For triggering reconciliation of cluster ingress controller configmap. - // This is used when a configmap is updated in the cluster. - configMapDeliverer *util.DelayingDeliverer - - // Contains ingresses present in members of federation. - ingressFederatedInformer util.FederatedInformer - // Contains ingress controller configmaps present in members of federation. - configMapFederatedInformer util.FederatedInformer - // For updating ingresses in members of federation. - federatedIngressUpdater util.FederatedUpdater - // For updating configmaps in members of federation. - federatedConfigMapUpdater util.FederatedUpdater - // Definitions of ingresses that should be federated. - ingressInformerStore cache.Store - // Informer controller for ingresses that should be federated. - ingressInformerController cache.Controller - - // Client to federated api server. - federatedApiClient federationclientset.Interface - - // Backoff manager for ingresses - ingressBackoff *flowcontrol.Backoff - // Backoff manager for configmaps - configMapBackoff *flowcontrol.Backoff - - // For events - eventRecorder record.EventRecorder - - deletionHelper *deletionhelper.DeletionHelper - - ingressReviewDelay time.Duration - configMapReviewDelay time.Duration - clusterAvailableDelay time.Duration - smallDelay time.Duration - updateTimeout time.Duration -} - -// NewIngressController returns a new ingress controller -func NewIngressController(client federationclientset.Interface) *IngressController { - glog.V(4).Infof("->NewIngressController V(4)") - broadcaster := record.NewBroadcaster() - broadcaster.StartRecordingToSink(eventsink.NewFederatedEventSink(client)) - recorder := broadcaster.NewRecorder(legacyscheme.Scheme, v1.EventSource{Component: UserAgentName}) - ic := &IngressController{ - federatedApiClient: client, - ingressReviewDelay: time.Second * 10, - configMapReviewDelay: time.Second * 10, - clusterAvailableDelay: time.Second * 20, - smallDelay: time.Second * 3, - updateTimeout: time.Second * 30, - ingressBackoff: flowcontrol.NewBackOff(5*time.Second, time.Minute), - eventRecorder: recorder, - configMapBackoff: flowcontrol.NewBackOff(5*time.Second, time.Minute), - } - - // Build deliverers for triggering reconciliations. - ic.ingressDeliverer = util.NewDelayingDeliverer() - ic.clusterDeliverer = util.NewDelayingDeliverer() - ic.configMapDeliverer = util.NewDelayingDeliverer() - - // Start informer in federated API servers on ingresses that should be federated. - ic.ingressInformerStore, ic.ingressInformerController = cache.NewInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (pkgruntime.Object, error) { - return client.Extensions().Ingresses(metav1.NamespaceAll).List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - return client.Extensions().Ingresses(metav1.NamespaceAll).Watch(options) - }, - }, - &extensionsv1beta1.Ingress{}, - controller.NoResyncPeriodFunc(), - util.NewTriggerOnAllChanges( - func(obj pkgruntime.Object) { - ic.deliverIngressObj(obj, 0, false) - }, - )) - - // Federated informer on ingresses in members of federation. - ic.ingressFederatedInformer = util.NewFederatedInformer( - client, - func(cluster *federationapi.Cluster, targetClient kubeclientset.Interface) (cache.Store, cache.Controller) { - return cache.NewInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (pkgruntime.Object, error) { - return targetClient.Extensions().Ingresses(metav1.NamespaceAll).List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - return targetClient.Extensions().Ingresses(metav1.NamespaceAll).Watch(options) - }, - }, - &extensionsv1beta1.Ingress{}, - controller.NoResyncPeriodFunc(), - // Trigger reconciliation whenever something in federated cluster is changed. In most cases it - // would be just confirmation that some ingress operation succeeded. - util.NewTriggerOnAllChanges( - func(obj pkgruntime.Object) { - ic.deliverIngressObj(obj, ic.ingressReviewDelay, false) - }, - )) - }, - - &util.ClusterLifecycleHandlerFuncs{ - ClusterAvailable: func(cluster *federationapi.Cluster) { - // When new cluster becomes available process all the ingresses again, and configure it's ingress controller's configmap with the correct UID - ic.clusterDeliverer.DeliverAfter(cluster.Name, cluster, ic.clusterAvailableDelay) - }, - }, - ) - - // Federated informer on configmaps for ingress controllers in members of the federation. - ic.configMapFederatedInformer = util.NewFederatedInformer( - client, - func(cluster *federationapi.Cluster, targetClient kubeclientset.Interface) (cache.Store, cache.Controller) { - glog.V(4).Infof("Returning new informer for cluster %q", cluster.Name) - return cache.NewInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (pkgruntime.Object, error) { - if targetClient == nil { - glog.Errorf("Internal error: targetClient is nil") - } - return targetClient.Core().ConfigMaps(uidConfigMapNamespace).List(options) // we only want to list one by name - unfortunately Kubernetes don't have a selector for that. - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if targetClient == nil { - glog.Errorf("Internal error: targetClient is nil") - } - return targetClient.Core().ConfigMaps(uidConfigMapNamespace).Watch(options) // as above - }, - }, - &v1.ConfigMap{}, - controller.NoResyncPeriodFunc(), - // Trigger reconciliation whenever the ingress controller's configmap in a federated cluster is changed. In most cases it - // would be just confirmation that the configmap for the ingress controller is correct. - util.NewTriggerOnAllChanges( - func(obj pkgruntime.Object) { - ic.deliverConfigMapObj(cluster.Name, obj, ic.configMapReviewDelay, false) - }, - )) - }, - - &util.ClusterLifecycleHandlerFuncs{ - ClusterAvailable: func(cluster *federationapi.Cluster) { - ic.clusterDeliverer.DeliverAfter(cluster.Name, cluster, ic.clusterAvailableDelay) - }, - }, - ) - - // Federated ingress updater along with Create/Update/Delete operations. - ic.federatedIngressUpdater = util.NewFederatedUpdater(ic.ingressFederatedInformer, "ingress", ic.updateTimeout, ic.eventRecorder, - func(client kubeclientset.Interface, obj pkgruntime.Object) error { - ingress := obj.(*extensionsv1beta1.Ingress) - glog.V(4).Infof("Attempting to create Ingress: %v", ingress) - _, err := client.Extensions().Ingresses(ingress.Namespace).Create(ingress) - if err != nil { - glog.Errorf("Error creating ingress %q: %v", types.NamespacedName{Name: ingress.Name, Namespace: ingress.Namespace}, err) - } else { - glog.V(4).Infof("Successfully created ingress %q", types.NamespacedName{Name: ingress.Name, Namespace: ingress.Namespace}) - } - return err - }, - func(client kubeclientset.Interface, obj pkgruntime.Object) error { - ingress := obj.(*extensionsv1beta1.Ingress) - glog.V(4).Infof("Attempting to update Ingress: %v", ingress) - _, err := client.Extensions().Ingresses(ingress.Namespace).Update(ingress) - if err != nil { - glog.V(4).Infof("Failed to update Ingress: %v", err) - } else { - glog.V(4).Infof("Successfully updated Ingress: %q", types.NamespacedName{Name: ingress.Name, Namespace: ingress.Namespace}) - } - return err - }, - func(client kubeclientset.Interface, obj pkgruntime.Object) error { - ingress := obj.(*extensionsv1beta1.Ingress) - glog.V(4).Infof("Attempting to delete Ingress: %v", ingress) - orphanDependents := false - err := client.Extensions().Ingresses(ingress.Namespace).Delete(ingress.Name, &metav1.DeleteOptions{OrphanDependents: &orphanDependents}) - return err - }) - - // Federated configmap updater along with Create/Update/Delete operations. Only Update should ever be called. - ic.federatedConfigMapUpdater = util.NewFederatedUpdater(ic.configMapFederatedInformer, "configmap", ic.updateTimeout, ic.eventRecorder, - func(client kubeclientset.Interface, obj pkgruntime.Object) error { - configMap := obj.(*v1.ConfigMap) - configMapName := types.NamespacedName{Name: configMap.Name, Namespace: configMap.Namespace} - glog.Errorf("Internal error: Incorrectly attempting to create ConfigMap: %q", configMapName) - _, err := client.Core().ConfigMaps(configMap.Namespace).Create(configMap) - return err - }, - func(client kubeclientset.Interface, obj pkgruntime.Object) error { - configMap := obj.(*v1.ConfigMap) - configMapName := types.NamespacedName{Name: configMap.Name, Namespace: configMap.Namespace} - glog.V(4).Infof("Attempting to update ConfigMap: %v", configMap) - _, err := client.Core().ConfigMaps(configMap.Namespace).Update(configMap) - if err == nil { - glog.V(4).Infof("Successfully updated ConfigMap %q %v", configMapName, configMap) - } else { - glog.V(4).Infof("Failed to update ConfigMap %q: %v", configMapName, err) - } - return err - }, - func(client kubeclientset.Interface, obj pkgruntime.Object) error { - configMap := obj.(*v1.ConfigMap) - configMapName := types.NamespacedName{Name: configMap.Name, Namespace: configMap.Namespace} - glog.Errorf("Internal error: Incorrectly attempting to delete ConfigMap: %q", configMapName) - err := client.Core().ConfigMaps(configMap.Namespace).Delete(configMap.Name, &metav1.DeleteOptions{}) - return err - }) - - ic.deletionHelper = deletionhelper.NewDeletionHelper( - ic.updateIngress, - // objNameFunc - func(obj pkgruntime.Object) string { - ingress := obj.(*extensionsv1beta1.Ingress) - return fmt.Sprintf("%s/%s", ingress.Namespace, ingress.Name) - }, - ic.ingressFederatedInformer, - ic.federatedIngressUpdater, - ) - return ic -} - -// Sends the given updated object to apiserver. -// Assumes that the given object is an ingress. -func (ic *IngressController) updateIngress(obj pkgruntime.Object) (pkgruntime.Object, error) { - ingress := obj.(*extensionsv1beta1.Ingress) - return ic.federatedApiClient.Extensions().Ingresses(ingress.Namespace).Update(ingress) -} - -func (ic *IngressController) Run(stopChan <-chan struct{}) { - glog.Infof("Starting Ingress Controller") - go ic.ingressInformerController.Run(stopChan) - glog.Infof("... Starting Ingress Federated Informer") - ic.ingressFederatedInformer.Start() - glog.Infof("... Starting ConfigMap Federated Informer") - ic.configMapFederatedInformer.Start() - go func() { - <-stopChan - glog.Infof("Stopping Ingress Federated Informer") - ic.ingressFederatedInformer.Stop() - glog.Infof("Stopping ConfigMap Federated Informer") - ic.configMapFederatedInformer.Stop() - glog.Infof("Stopping ingress deliverer") - ic.ingressDeliverer.Stop() - glog.Infof("Stopping configmap deliverer") - ic.configMapDeliverer.Stop() - glog.Infof("Stopping cluster deliverer") - ic.clusterDeliverer.Stop() - }() - ic.ingressDeliverer.StartWithHandler(func(item *util.DelayingDelivererItem) { - ingress := item.Value.(types.NamespacedName) - glog.V(4).Infof("Ingress change delivered, reconciling: %v", ingress) - ic.reconcileIngress(ingress) - }) - ic.clusterDeliverer.StartWithHandler(func(item *util.DelayingDelivererItem) { - clusterName := item.Key - if clusterName != allClustersKey { - glog.V(4).Infof("Cluster change delivered for cluster %q, reconciling configmap and ingress for that cluster", clusterName) - } else { - glog.V(4).Infof("Cluster change delivered for all clusters, reconciling configmaps and ingresses for all clusters") - } - ic.reconcileIngressesOnClusterChange(clusterName) - ic.reconcileConfigMapForCluster(clusterName) - }) - ic.configMapDeliverer.StartWithHandler(func(item *util.DelayingDelivererItem) { - clusterName := item.Key - if clusterName != allClustersKey { - glog.V(4).Infof("ConfigMap change delivered for cluster %q, reconciling configmap for that cluster", clusterName) - } else { - glog.V(4).Infof("ConfigMap change delivered for all clusters, reconciling configmaps for all clusters") - } - ic.reconcileConfigMapForCluster(clusterName) - }) - - util.StartBackoffGC(ic.ingressBackoff, stopChan) - util.StartBackoffGC(ic.configMapBackoff, stopChan) -} - -func (ic *IngressController) deliverIngressObj(obj interface{}, delay time.Duration, failed bool) { - ingress := obj.(*extensionsv1beta1.Ingress) - ic.deliverIngress(types.NamespacedName{Namespace: ingress.Namespace, Name: ingress.Name}, delay, failed) -} - -func (ic *IngressController) deliverIngress(ingress types.NamespacedName, delay time.Duration, failed bool) { - glog.V(4).Infof("Delivering ingress: %s with delay: %v error: %v", ingress, delay, failed) - key := ingress.String() - if failed { - ic.ingressBackoff.Next(key, time.Now()) - delay = delay + ic.ingressBackoff.Get(key) - } else { - ic.ingressBackoff.Reset(key) - } - ic.ingressDeliverer.DeliverAfter(key, ingress, delay) -} - -func (ic *IngressController) deliverConfigMapObj(clusterName string, obj interface{}, delay time.Duration, failed bool) { - configMap := obj.(*v1.ConfigMap) - ic.deliverConfigMap(clusterName, types.NamespacedName{Namespace: configMap.Namespace, Name: configMap.Name}, delay, failed) -} - -func (ic *IngressController) deliverConfigMap(cluster string, configMap types.NamespacedName, delay time.Duration, failed bool) { - key := cluster - if failed { - ic.configMapBackoff.Next(key, time.Now()) - delay = delay + ic.configMapBackoff.Get(key) - } else { - ic.configMapBackoff.Reset(key) - } - glog.V(4).Infof("Delivering ConfigMap for cluster %q (delay %q): %s", cluster, delay, configMap) - ic.configMapDeliverer.DeliverAfter(key, configMap, delay) -} - -// Check whether all data stores are in sync. False is returned if any of the informer/stores is not yet -// synced with the corresponding api server. -func (ic *IngressController) isSynced() bool { - if !ic.ingressFederatedInformer.ClustersSynced() { - glog.V(2).Infof("Cluster list not synced for ingress federated informer") - return false - } - clusters, err := ic.ingressFederatedInformer.GetReadyClusters() - if err != nil { - glog.Errorf("Failed to get ready clusters for ingress federated informer: %v", err) - return false - } - if !ic.ingressFederatedInformer.GetTargetStore().ClustersSynced(clusters) { - glog.V(2).Infof("Target store not synced for ingress federated informer") - return false - } - if !ic.configMapFederatedInformer.ClustersSynced() { - glog.V(2).Infof("Cluster list not synced for config map federated informer") - return false - } - clusters, err = ic.configMapFederatedInformer.GetReadyClusters() - if err != nil { - glog.Errorf("Failed to get ready clusters for configmap federated informer: %v", err) - return false - } - if !ic.configMapFederatedInformer.GetTargetStore().ClustersSynced(clusters) { - glog.V(2).Infof("Target store not synced for configmap federated informer") - return false - } - glog.V(4).Infof("Cluster list is synced") - return true -} - -// The function triggers reconciliation of all federated ingresses. clusterName is the name of the cluster that changed -// but all ingresses in all clusters are reconciled -func (ic *IngressController) reconcileIngressesOnClusterChange(clusterName string) { - glog.V(4).Infof("Reconciling ingresses on cluster change for cluster %q", clusterName) - if !ic.isSynced() { - glog.V(4).Infof("Not synced, will try again later to reconcile ingresses.") - ic.clusterDeliverer.DeliverAfter(clusterName, nil, ic.clusterAvailableDelay) - } - ingressList := ic.ingressInformerStore.List() - if len(ingressList) <= 0 { - glog.V(4).Infof("No federated ingresses to reconcile.") - } - - for _, obj := range ingressList { - ingress := obj.(*extensionsv1beta1.Ingress) - nsName := types.NamespacedName{Name: ingress.Name, Namespace: ingress.Namespace} - glog.V(4).Infof("Delivering federated ingress %q for cluster %q", nsName, clusterName) - ic.deliverIngress(nsName, ic.smallDelay, false) - } -} - -/* - reconcileConfigMapForCluster ensures that the configmap for the ingress controller in the cluster has objectmeta.data.UID - consistent with all the other clusters in the federation. If clusterName == allClustersKey, then all available clusters - configmaps are reconciled. -*/ -func (ic *IngressController) reconcileConfigMapForCluster(clusterName string) { - glog.V(4).Infof("Reconciling ConfigMap for cluster(s) %q", clusterName) - - if !ic.isSynced() { - ic.configMapDeliverer.DeliverAfter(clusterName, nil, ic.clusterAvailableDelay) - return - } - - if clusterName == allClustersKey { - clusters, err := ic.configMapFederatedInformer.GetReadyClusters() - if err != nil { - glog.Errorf("Failed to get ready clusters. redelivering %q: %v", clusterName, err) - ic.configMapDeliverer.DeliverAfter(clusterName, nil, ic.clusterAvailableDelay) - return - } - for _, cluster := range clusters { - glog.V(4).Infof("Delivering ConfigMap for cluster(s) %q", clusterName) - ic.configMapDeliverer.DeliverAt(cluster.Name, nil, time.Now()) - } - return - } else { - cluster, found, err := ic.configMapFederatedInformer.GetReadyCluster(clusterName) - if err != nil || !found { - glog.Errorf("Internal error: Cluster %q queued for configmap reconciliation, but not found. Will try again later: error = %v", clusterName, err) - ic.configMapDeliverer.DeliverAfter(clusterName, nil, ic.clusterAvailableDelay) - return - } - uidConfigMapNamespacedName := types.NamespacedName{Name: uidConfigMapName, Namespace: uidConfigMapNamespace} - configMapObj, found, err := ic.configMapFederatedInformer.GetTargetStore().GetByKey(cluster.Name, uidConfigMapNamespacedName.String()) - if !found || err != nil { - logmsg := fmt.Sprintf("Failed to get ConfigMap %q for cluster %q. Will try again later", uidConfigMapNamespacedName, cluster.Name) - if err != nil { - logmsg = fmt.Sprintf("%v: %v", logmsg, err) - } - if len(ic.ingressInformerStore.List()) > 0 { // Error-level if ingresses are active, Info-level otherwise. - glog.Errorf(logmsg) - } else { - glog.V(4).Infof(logmsg) - } - ic.configMapDeliverer.DeliverAfter(clusterName, nil, ic.configMapReviewDelay) - return - } - glog.V(4).Infof("Successfully got ConfigMap %q for cluster %q.", uidConfigMapNamespacedName, clusterName) - configMap, ok := configMapObj.(*v1.ConfigMap) - if !ok { - glog.Errorf("Internal error: The object in the ConfigMap cache for cluster %q configmap %q is not a *ConfigMap", cluster.Name, uidConfigMapNamespacedName) - return - } - ic.reconcileConfigMap(cluster, configMap) - return - } -} - -// getProviderUid returns a provider ID based on the provided clusterName. -func getProviderUid(clusterName string) string { - hashedName := md5.Sum([]byte(clusterName)) - return fmt.Sprintf("%x", hashedName[:8]) -} - -/* - reconcileConfigMap ensures that the configmap in the cluster has a UID - consistent with the federation cluster's associated annotation. - - 1. If the UID in the configmap differs from the UID stored in the cluster's annotation, the configmap is updated. - 2. If the UID annotation is missing from the cluster, the cluster's UID annotation is updated to be consistent - with the master cluster. - 3. If there is no elected master cluster, this cluster attempts to elect itself as the master cluster. - - In cases 2 and 3, the configmaps will be updated in the next cycle, triggered by the federation cluster update(s) - -*/ -func (ic *IngressController) reconcileConfigMap(cluster *federationapi.Cluster, configMap *v1.ConfigMap) { - ic.Lock() // TODO: Reduce the scope of this master election lock. - defer ic.Unlock() - - configMapNsName := types.NamespacedName{Name: configMap.Name, Namespace: configMap.Namespace} - glog.V(4).Infof("Reconciling ConfigMap %q in cluster %q", configMapNsName, cluster.Name) - - clusterIngressUID, clusterIngressUIDExists := cluster.ObjectMeta.Annotations[uidAnnotationKey] - configMapUID, ok := configMap.Data[uidKey] - - if !ok { - glog.Errorf("Warning: ConfigMap %q in cluster %q does not contain data key %q. Therefore it cannot become the master.", configMapNsName, cluster.Name, uidKey) - } - - if !clusterIngressUIDExists || clusterIngressUID == "" { - glog.V(4).Infof("Cluster %q is the only master", cluster.Name) - // Second argument is the fallback, in case this is the only cluster, in which case it becomes the master - var err error - if clusterIngressUID, err = ic.updateClusterIngressUIDToMasters(cluster, configMapUID); err != nil { - return - } - // If we successfully update the Cluster Object, fallthrough and update the configMap. - } - - // Figure out providerUid. - providerUid := getProviderUid(cluster.Name) - configMapProviderUid := configMap.Data[providerUidKey] - - if configMapUID == clusterIngressUID && configMapProviderUid == providerUid { - glog.V(4).Infof("Ingress configMap update is not required: UID %q and ProviderUid %q are equal", configMapUID, providerUid) - } else { - if configMapUID != clusterIngressUID { - glog.V(4).Infof("Ingress configMap update is required for UID: configMapUID %q not equal to clusterIngressUID %q", configMapUID, clusterIngressUID) - } else if configMapProviderUid != providerUid { - glog.V(4).Infof("Ingress configMap update is required: configMapProviderUid %q not equal to providerUid %q", configMapProviderUid, providerUid) - } - configMap.Data[uidKey] = clusterIngressUID - configMap.Data[providerUidKey] = providerUid - operations := []util.FederatedOperation{{ - Type: util.OperationTypeUpdate, - Obj: configMap, - ClusterName: cluster.Name, - Key: configMapNsName.String(), - }} - glog.V(4).Infof("Calling federatedConfigMapUpdater.Update() - operations: %v", operations) - err := ic.federatedConfigMapUpdater.Update(operations) - if err != nil { - glog.Errorf("Failed to execute update of ConfigMap %q on cluster %q: %v", configMapNsName, cluster.Name, err) - ic.configMapDeliverer.DeliverAfter(cluster.Name, nil, ic.configMapReviewDelay) - } - } -} - -/* - getMasterCluster returns the cluster which is the elected master w.r.t. ingress UID, and it's ingress UID. - If there is no elected master cluster, an error is returned. - All other clusters must use the ingress UID of the elected master. -*/ -func (ic *IngressController) getMasterCluster() (master *federationapi.Cluster, ingressUID string, err error) { - clusters, err := ic.configMapFederatedInformer.GetReadyClusters() - if err != nil { - glog.Errorf("Failed to get cluster list: %v", err) - return nil, "", err - } - - for _, c := range clusters { - UID, exists := c.ObjectMeta.Annotations[uidAnnotationKey] - if exists && UID != "" { // Found the master cluster - glog.V(4).Infof("Found master cluster %q with annotation %q=%q", c.Name, uidAnnotationKey, UID) - return c, UID, nil - } - } - return nil, "", fmt.Errorf("Failed to find master cluster with annotation %q", uidAnnotationKey) -} - -/* - updateClusterIngressUIDToMasters takes the ingress UID annotation on the master cluster and applies it to cluster. - If there is no master cluster, then fallbackUID is used (and hence this cluster becomes the master). -*/ -func (ic *IngressController) updateClusterIngressUIDToMasters(cluster *federationapi.Cluster, fallbackUID string) (string, error) { - masterCluster, masterUID, err := ic.getMasterCluster() - cluster = cluster.DeepCopy() // Make a clone so that we don't clobber our input param - if err == nil { - if masterCluster.Name != cluster.Name { // We're not the master, need to get in sync - if cluster.ObjectMeta.Annotations == nil { - cluster.ObjectMeta.Annotations = map[string]string{} - } - cluster.ObjectMeta.Annotations[uidAnnotationKey] = masterUID - if _, err = ic.federatedApiClient.Federation().Clusters().Update(cluster); err != nil { - glog.Errorf("Failed to add master ingress UID annotation (%q = %q) from master cluster %q to cluster %q, will try again later: %v", uidAnnotationKey, masterUID, masterCluster.Name, cluster.Name, err) - return "", err - } else { - glog.V(4).Infof("Successfully added master ingress UID annotation (%q = %q) from master cluster %q to cluster %q.", uidAnnotationKey, masterUID, masterCluster.Name, cluster.Name) - return masterUID, nil - } - } else { - glog.V(4).Infof("Cluster %q with ingress UID is already the master with annotation (%q = %q), no need to update.", cluster.Name, uidAnnotationKey, cluster.ObjectMeta.Annotations[uidAnnotationKey]) - return cluster.ObjectMeta.Annotations[uidAnnotationKey], nil - } - } else { - glog.V(2).Infof("No master cluster found to source an ingress UID from for cluster %q.", cluster.Name) - if fallbackUID != "" { - glog.V(2).Infof("Attempting to elect new master cluster %q with ingress UID %q = %q", cluster.Name, uidAnnotationKey, fallbackUID) - if cluster.ObjectMeta.Annotations == nil { - cluster.ObjectMeta.Annotations = map[string]string{} - } - cluster.ObjectMeta.Annotations[uidAnnotationKey] = fallbackUID - if _, err = ic.federatedApiClient.Federation().Clusters().Update(cluster); err != nil { - glog.Errorf("Failed to add ingress UID annotation (%q = %q) to cluster %q. No master elected. Will try again later: %v", uidAnnotationKey, fallbackUID, cluster.Name, err) - return "", err - } else { - glog.V(4).Infof("Successfully added ingress UID annotation (%q = %q) to cluster %q.", uidAnnotationKey, fallbackUID, cluster.Name) - return fallbackUID, nil - } - } else { - glog.Errorf("No master cluster exists, and fallbackUID for cluster %q is nil. This probably means that no clusters have an ingress controller configmap with key %q. Federated Ingress currently supports clusters running Google Loadbalancer Controller (\"GLBC\")", cluster.Name, uidKey) - return "", err - } - } -} - -func (ic *IngressController) isClusterReady(clusterName string) bool { - cluster, isReady, err := ic.ingressFederatedInformer.GetReadyCluster(clusterName) - return isReady && err == nil && cluster != nil -} - -// updateAnnotationOnIngress updates the annotation with the given key on the given federated ingress. -// Queues the ingress for resync when done. -func (ic *IngressController) updateAnnotationOnIngress(ingress *extensionsv1beta1.Ingress, key, value string) { - if ingress.ObjectMeta.Annotations == nil { - ingress.ObjectMeta.Annotations = make(map[string]string) - } - ingress.ObjectMeta.Annotations[key] = value - ingressName := types.NamespacedName{Name: ingress.Name, Namespace: ingress.Namespace} - glog.V(4).Infof("Attempting to update annotation %s:%s on base federated ingress: %v", key, value, ingressName) - if updatedFedIngress, err := ic.federatedApiClient.Extensions().Ingresses(ingress.Namespace).Update(ingress); err != nil { - glog.Errorf("Failed to update annotation %s:%s on federated ingress %q, will try again later: %v", key, value, ingressName, err) - ic.deliverIngress(ingressName, ic.ingressReviewDelay, true) - return - } else { - glog.V(4).Infof("Successfully updated annotation %s:%s on federated ingress %q, after update: %q", key, value, ingress, updatedFedIngress) - ic.deliverIngress(ingressName, ic.smallDelay, false) - return - } -} - -func (ic *IngressController) reconcileIngress(ingress types.NamespacedName) { - glog.V(4).Infof("Reconciling ingress %q for all clusters", ingress) - if !ic.isSynced() { - ic.deliverIngress(ingress, ic.clusterAvailableDelay, false) - return - } - - key := ingress.String() - baseIngressObjFromStore, exist, err := ic.ingressInformerStore.GetByKey(key) - if err != nil { - glog.Errorf("Failed to query main ingress store for %v: %v", ingress, err) - ic.deliverIngress(ingress, 0, true) - return - } - if !exist { - // Not federated ingress, ignoring. - glog.V(4).Infof("Ingress %q is not federated. Ignoring.", ingress) - return - } - baseIngress := baseIngressObjFromStore.(*extensionsv1beta1.Ingress).DeepCopy() - glog.V(4).Infof("Base (federated) ingress: %v", baseIngress) - - if baseIngress.DeletionTimestamp != nil { - if err := ic.delete(baseIngress); err != nil { - glog.Errorf("Failed to delete %s: %v", ingress, err) - ic.eventRecorder.Eventf(baseIngress, api.EventTypeWarning, "DeleteFailed", - "Ingress delete failed: %v", err) - ic.deliverIngress(ingress, 0, true) - } - return - } - - glog.V(3).Infof("Ensuring delete object from underlying clusters finalizer for ingress: %s", - baseIngress.Name) - // Add the required finalizers before creating a ingress in underlying clusters. - updatedIngressObj, err := ic.deletionHelper.EnsureFinalizers(baseIngress) - if err != nil { - glog.Errorf("Failed to ensure delete object from underlying clusters finalizer in ingress %s: %v", - baseIngress.Name, err) - ic.deliverIngress(ingress, 0, true) - return - } - baseIngress = updatedIngressObj.(*extensionsv1beta1.Ingress) - - glog.V(3).Infof("Syncing ingress %s in underlying clusters", baseIngress.Name) - - clusters, err := ic.ingressFederatedInformer.GetReadyClusters() - if err != nil { - glog.Errorf("Failed to get cluster list: %v", err) - ic.deliverIngress(ingress, ic.clusterAvailableDelay, false) - return - } else { - glog.V(4).Infof("Found %d ready clusters across which to reconcile ingress %q", len(clusters), ingress) - } - - operations := make([]util.FederatedOperation, 0) - - for _, cluster := range clusters { - baseIPName, baseIPAnnotationExists := baseIngress.ObjectMeta.Annotations[staticIPNameKeyWritable] - firstClusterName, firstClusterExists := baseIngress.ObjectMeta.Annotations[firstClusterAnnotation] - clusterIngressObj, clusterIngressFound, err := ic.ingressFederatedInformer.GetTargetStore().GetByKey(cluster.Name, key) - if err != nil { - glog.Errorf("Failed to get cached ingress %s for cluster %s, will retry: %v", ingress, cluster.Name, err) - ic.deliverIngress(ingress, 0, true) - return - } - desiredIngress := &extensionsv1beta1.Ingress{} - desiredIngress.ObjectMeta = *baseIngress.ObjectMeta.DeepCopy() - desiredIngress.Spec = *desiredIngress.Spec.DeepCopy() - - glog.V(4).Infof("Desired Ingress: %v", desiredIngress) - - send, err := clusterselector.SendToCluster(cluster.Labels, desiredIngress.ObjectMeta.Annotations) - if err != nil { - glog.Errorf("Error processing ClusterSelector cluster: %s for Ingress map: %s error: %s", cluster.Name, key, err.Error()) - return - } - - switch { - case !clusterIngressFound && send: - glog.V(4).Infof("No existing Ingress %s in cluster %s - checking if appropriate to queue a create operation", ingress, cluster.Name) - // We can't supply server-created fields when creating a new object. - desiredIngress.ObjectMeta = util.DeepCopyRelevantObjectMeta(baseIngress.ObjectMeta) - - // We always first create an ingress in the first available cluster. Once that ingress - // has been created and allocated a global IP (visible via an annotation), - // we record that annotation on the federated ingress, and create all other cluster - // ingresses with that same global IP. - // Note: If the first cluster becomes (e.g. temporarily) unavailable, the - // second cluster will become the first cluster, but eventually all ingresses - // will share the single global IP recorded in the annotation of the - // federated ingress. - haveFirstCluster := firstClusterExists && firstClusterName != "" && ic.isClusterReady(firstClusterName) - if !haveFirstCluster { - glog.V(4).Infof("No cluster has been chosen as the first cluster. Electing cluster %s as the first cluster to create ingress in", cluster.Name) - ic.updateAnnotationOnIngress(baseIngress, firstClusterAnnotation, cluster.Name) - return - } - if baseIPAnnotationExists || firstClusterName == cluster.Name { - if baseIPAnnotationExists { - glog.V(4).Infof("No existing Ingress %s in cluster %s and static IP annotation (%q) exists on base ingress - queuing a create operation", ingress, cluster.Name, staticIPNameKeyWritable) - } else { - glog.V(4).Infof("No existing Ingress %s in cluster %s and no static IP annotation (%q) on base ingress - queuing a create operation in first cluster", ingress, cluster.Name, staticIPNameKeyWritable) - } - operations = append(operations, util.FederatedOperation{ - Type: util.OperationTypeAdd, - Obj: desiredIngress, - ClusterName: cluster.Name, - Key: key, - }) - } else { - glog.V(4).Infof("No annotation %q exists on ingress %q in federation and waiting for ingress in cluster %s. Not queueing create operation for ingress until annotation exists", staticIPNameKeyWritable, ingress, firstClusterName) - } - case clusterIngressFound && !send: - glog.V(5).Infof("Removing Ingress: %s from cluster: %s reason: cluster selectors do not match: %-v %-v", key, cluster.Name, cluster.ObjectMeta.Labels, desiredIngress.ObjectMeta.Annotations[federationapi.FederationClusterSelectorAnnotation]) - operations = append(operations, util.FederatedOperation{ - Type: util.OperationTypeDelete, - Obj: desiredIngress, - ClusterName: cluster.Name, - Key: key, - }) - case clusterIngressFound && send: - clusterIngress := clusterIngressObj.(*extensionsv1beta1.Ingress) - glog.V(4).Infof("Found existing Ingress %s in cluster %s - checking if update is required (in either direction)", ingress, cluster.Name) - clusterIPName, clusterIPNameExists := clusterIngress.ObjectMeta.Annotations[staticIPNameKeyReadonly] - baseLBStatusExists := len(baseIngress.Status.LoadBalancer.Ingress) > 0 - clusterLBStatusExists := len(clusterIngress.Status.LoadBalancer.Ingress) > 0 - logStr := fmt.Sprintf("Cluster ingress %q has annotation %q=%q, loadbalancer status exists? [%v], federated ingress has annotation %q=%q, loadbalancer status exists? [%v]. %%s annotation and/or loadbalancer status from cluster ingress to federated ingress.", ingress, staticIPNameKeyReadonly, clusterIPName, clusterLBStatusExists, staticIPNameKeyWritable, baseIPName, baseLBStatusExists) - if (!baseIPAnnotationExists && clusterIPNameExists) || (!baseLBStatusExists && clusterLBStatusExists) { // copy the IP name from the readonly annotation on the cluster ingress, to the writable annotation on the federated ingress - glog.V(4).Infof(logStr, "Transferring") - if !baseIPAnnotationExists && clusterIPNameExists { - ic.updateAnnotationOnIngress(baseIngress, staticIPNameKeyWritable, clusterIPName) - return - } - if !baseLBStatusExists && clusterLBStatusExists { - baseIngress.Status.LoadBalancer = *clusterIngress.Status.LoadBalancer.DeepCopy() - glog.V(4).Infof("Attempting to update base federated ingress status: %v", baseIngress) - if updatedFedIngress, err := ic.federatedApiClient.Extensions().Ingresses(baseIngress.Namespace).UpdateStatus(baseIngress); err != nil { - glog.Errorf("Failed to update federated ingress status of %q (loadbalancer status), will try again later: %v", ingress, err) - ic.deliverIngress(ingress, ic.ingressReviewDelay, true) - return - } else { - glog.V(4).Infof("Successfully updated federated ingress status of %q (added loadbalancer status), after update: %q", ingress, updatedFedIngress) - ic.deliverIngress(ingress, ic.smallDelay, false) - return - } - } - } else { - glog.V(4).Infof(logStr, "Not transferring") - } - // Update existing cluster ingress, if needed. - if util.ObjectMetaAndSpecEquivalent(baseIngress, clusterIngress) { - glog.V(4).Infof("Ingress %q in cluster %q does not need an update: cluster ingress is equivalent to federated ingress", ingress, cluster.Name) - } else { - glog.V(4).Infof("Ingress %s in cluster %s needs an update: cluster ingress %v is not equivalent to federated ingress %v", ingress, cluster.Name, clusterIngress, desiredIngress) - clusterIngress.ObjectMeta.DeepCopyInto(&desiredIngress.ObjectMeta) - // Merge any annotations and labels on the federated ingress onto the underlying cluster ingress, - // overwriting duplicates. - if desiredIngress.ObjectMeta.Annotations == nil { - desiredIngress.ObjectMeta.Annotations = make(map[string]string) - } - for key, val := range baseIngress.ObjectMeta.Annotations { - desiredIngress.ObjectMeta.Annotations[key] = val - } - if desiredIngress.ObjectMeta.Labels == nil { - desiredIngress.ObjectMeta.Labels = make(map[string]string) - } - for key, val := range baseIngress.ObjectMeta.Labels { - desiredIngress.ObjectMeta.Labels[key] = val - } - - operations = append(operations, util.FederatedOperation{ - Type: util.OperationTypeUpdate, - Obj: desiredIngress, - ClusterName: cluster.Name, - Key: key, - }) - // TODO: Transfer any readonly (target-proxy, url-map etc) annotations from the master cluster to the federation, if this is the master cluster. - // This is only for consistency, so that the federation ingress metadata matches the underlying clusters. It's not actually required } - } - } - } - - if len(operations) == 0 { - // Everything is in order - glog.V(4).Infof("Ingress %q is up-to-date in all clusters - no propagation to clusters required.", ingress) - return - } - glog.V(4).Infof("Calling federatedUpdater.Update() - operations: %v", operations) - err = ic.federatedIngressUpdater.Update(operations) - if err != nil { - glog.Errorf("Failed to execute updates for %s: %v", ingress, err) - ic.deliverIngress(ingress, ic.ingressReviewDelay, true) - return - } - // Schedule another periodic reconciliation, only to account for possible bugs in watch processing. - ic.deliverIngress(ingress, ic.ingressReviewDelay, false) -} - -// delete deletes the given ingress or returns error if the deletion was not complete. -func (ic *IngressController) delete(ingress *extensionsv1beta1.Ingress) error { - glog.V(3).Infof("Handling deletion of ingress: %v", *ingress) - _, err := ic.deletionHelper.HandleObjectInUnderlyingClusters(ingress) - if err != nil { - return err - } - - err = ic.federatedApiClient.Extensions().Ingresses(ingress.Namespace).Delete(ingress.Name, nil) - if err != nil { - // Its all good if the error is not found error. That means it is deleted already and we do not have to do anything. - // This is expected when we are processing an update as a result of ingress finalizer deletion. - // The process that deleted the last finalizer is also going to delete the ingress and we do not have to do anything. - if !errors.IsNotFound(err) { - return fmt.Errorf("failed to delete ingress: %v", err) - } - } - return nil -} diff --git a/federation/pkg/federation-controller/ingress/ingress_controller_test.go b/federation/pkg/federation-controller/ingress/ingress_controller_test.go deleted file mode 100644 index 429c8f4b1b..0000000000 --- a/federation/pkg/federation-controller/ingress/ingress_controller_test.go +++ /dev/null @@ -1,397 +0,0 @@ -/* -Copyright 2016 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 ingress - -import ( - "fmt" - "reflect" - "testing" - "time" - - apiv1 "k8s.io/api/core/v1" - extensionsv1beta1 "k8s.io/api/extensions/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/wait" - kubeclientset "k8s.io/client-go/kubernetes" - fakekubeclientset "k8s.io/client-go/kubernetes/fake" - "k8s.io/client-go/tools/cache" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - fakefedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/fake" - "k8s.io/kubernetes/federation/pkg/federation-controller/util" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/deletionhelper" - finalizersutil "k8s.io/kubernetes/federation/pkg/federation-controller/util/finalizers" - . "k8s.io/kubernetes/federation/pkg/federation-controller/util/test" - - "github.com/golang/glog" - "github.com/stretchr/testify/assert" -) - -const ( - maxTrials = 20 - clusters string = "clusters" - ingresses string = "ingresses" - configmaps string = "configmaps" -) - -func TestIngressController(t *testing.T) { - fakeClusterList := federationapi.ClusterList{Items: []federationapi.Cluster{}} - fakeConfigMapList1 := apiv1.ConfigMapList{Items: []apiv1.ConfigMap{}} - fakeConfigMapList2 := apiv1.ConfigMapList{Items: []apiv1.ConfigMap{}} - cluster1 := NewCluster("cluster1", apiv1.ConditionTrue) - cluster2 := NewCluster("cluster2", apiv1.ConditionTrue) - cfg1 := NewConfigMap("foo") - cfg2 := NewConfigMap("bar") // Different UID from cfg1, so that we can check that they get reconciled. - assert.NotEqual(t, cfg1.Data[uidKey], cfg2.Data[uidKey], fmt.Sprintf("ConfigMap in cluster 2 must initially not equal that in cluster 1 for this test - please fix test")) - - t.Log("Creating fake infrastructure") - fedClient := &fakefedclientset.Clientset{} - RegisterFakeList(clusters, &fedClient.Fake, &fakeClusterList) - RegisterFakeList(ingresses, &fedClient.Fake, &extensionsv1beta1.IngressList{Items: []extensionsv1beta1.Ingress{}}) - fedIngressWatch := RegisterFakeWatch(ingresses, &fedClient.Fake) - clusterWatch := RegisterFakeWatch(clusters, &fedClient.Fake) - fedClusterUpdateChan := RegisterFakeCopyOnUpdate(clusters, &fedClient.Fake, clusterWatch) - fedIngressUpdateChan := RegisterFakeCopyOnUpdate(ingresses, &fedClient.Fake, fedIngressWatch) - - cluster1Client := &fakekubeclientset.Clientset{} - RegisterFakeList(ingresses, &cluster1Client.Fake, &extensionsv1beta1.IngressList{Items: []extensionsv1beta1.Ingress{}}) - RegisterFakeList(configmaps, &cluster1Client.Fake, &fakeConfigMapList1) - cluster1IngressWatch := RegisterFakeWatch(ingresses, &cluster1Client.Fake) - cluster1ConfigMapWatch := RegisterFakeWatch(configmaps, &cluster1Client.Fake) - cluster1IngressCreateChan := RegisterFakeCopyOnCreate(ingresses, &cluster1Client.Fake, cluster1IngressWatch) - cluster1IngressUpdateChan := RegisterFakeCopyOnUpdate(ingresses, &cluster1Client.Fake, cluster1IngressWatch) - cluster1ConfigMapUpdateChan := RegisterFakeCopyOnUpdate(configmaps, &cluster1Client.Fake, cluster1ConfigMapWatch) - - cluster2Client := &fakekubeclientset.Clientset{} - RegisterFakeList(ingresses, &cluster2Client.Fake, &extensionsv1beta1.IngressList{Items: []extensionsv1beta1.Ingress{}}) - RegisterFakeList(configmaps, &cluster2Client.Fake, &fakeConfigMapList2) - cluster2IngressWatch := RegisterFakeWatch(ingresses, &cluster2Client.Fake) - cluster2ConfigMapWatch := RegisterFakeWatch(configmaps, &cluster2Client.Fake) - cluster2IngressCreateChan := RegisterFakeCopyOnCreate(ingresses, &cluster2Client.Fake, cluster2IngressWatch) - cluster2ConfigMapUpdateChan := RegisterFakeCopyOnUpdate(configmaps, &cluster2Client.Fake, cluster2ConfigMapWatch) - - clientFactoryFunc := func(cluster *federationapi.Cluster) (kubeclientset.Interface, error) { - switch cluster.Name { - case cluster1.Name: - return cluster1Client, nil - case cluster2.Name: - return cluster2Client, nil - default: - return nil, fmt.Errorf("Unknown cluster") - } - } - ingressController := NewIngressController(fedClient) - ingressInformer := ToFederatedInformerForTestOnly(ingressController.ingressFederatedInformer) - ingressInformer.SetClientFactory(clientFactoryFunc) - configMapInformer := ToFederatedInformerForTestOnly(ingressController.configMapFederatedInformer) - configMapInformer.SetClientFactory(clientFactoryFunc) - ingressController.clusterAvailableDelay = time.Second - ingressController.ingressReviewDelay = 100 * time.Millisecond - ingressController.configMapReviewDelay = 100 * time.Millisecond - ingressController.smallDelay = 100 * time.Millisecond - ingressController.updateTimeout = 5 * time.Second - - stop := make(chan struct{}) - t.Log("Running Ingress Controller") - ingressController.Run(stop) - - // TODO: Here we are creating the ingress with first cluster annotation. - // Add another test without that annotation when - // https://github.com/kubernetes/kubernetes/issues/36540 is fixed. - fedIngress := extensionsv1beta1.Ingress{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-ingress", - Namespace: "mynamespace", - SelfLink: "/api/v1/namespaces/mynamespace/ingress/test-ingress", - Annotations: map[string]string{ - firstClusterAnnotation: cluster1.Name, - }, - }, - Status: extensionsv1beta1.IngressStatus{ - LoadBalancer: apiv1.LoadBalancerStatus{ - Ingress: make([]apiv1.LoadBalancerIngress, 0, 0), - }, - }, - } - - t.Log("Adding cluster 1") - clusterWatch.Add(cluster1) - - t.Log("Adding Ingress UID ConfigMap to cluster 1") - cluster1ConfigMapWatch.Add(cfg1) - - t.Log("Checking that UID annotation on Cluster 1 annotation was correctly updated prior to adding Federated Ingress") - cluster := GetClusterFromChan(fedClusterUpdateChan) - assert.NotNil(t, cluster) - assert.Equal(t, cluster.ObjectMeta.Annotations[uidAnnotationKey], cfg1.Data[uidKey]) - - t.Log("Adding cluster 2") - clusterWatch.Add(cluster2) - cluster2ConfigMapWatch.Add(cfg2) - - t.Log("Checking that a configmap updates are propagated prior to Federated Ingress") - referenceUid := cfg1.Data[uidKey] - uid1, providerId1 := GetConfigMapUidAndProviderId(t, cluster1ConfigMapUpdateChan) - uid2, providerId2 := GetConfigMapUidAndProviderId(t, cluster2ConfigMapUpdateChan) - t.Logf("uid2 = %v and ref = %v", uid2, referenceUid) - assert.True(t, referenceUid == uid1, "Expected cluster1 configmap uid %q to be equal to referenceUid %q", uid1, referenceUid) - assert.True(t, referenceUid == uid2, "Expected cluster2 configmap uid %q to be equal to referenceUid %q", uid2, referenceUid) - assert.True(t, providerId1 != providerId2, "Expected cluster1 providerUid %q to be unique and different from cluster2 providerUid %q", providerId1, providerId2) - - // Test add federated ingress. - t.Log("Adding Federated Ingress") - fedIngressWatch.Add(&fedIngress) - - t.Log("Checking that appropriate finalizers are added") - // There should be an update to add both the finalizers. - updatedIngress := GetIngressFromChan(t, fedIngressUpdateChan) - AssertHasFinalizer(t, updatedIngress, deletionhelper.FinalizerDeleteFromUnderlyingClusters) - AssertHasFinalizer(t, updatedIngress, metav1.FinalizerOrphanDependents) - fedIngress = *updatedIngress - - t.Log("Checking that Ingress was correctly created in cluster 1") - createdIngress := GetIngressFromChan(t, cluster1IngressCreateChan) - assert.NotNil(t, createdIngress) - cluster1Ingress := *createdIngress - assert.True(t, reflect.DeepEqual(fedIngress.Spec, cluster1Ingress.Spec), "Spec of created ingress is not equal") - assert.True(t, util.ObjectMetaEquivalent(fedIngress.ObjectMeta, cluster1Ingress.ObjectMeta), - "Metadata of created object is not equivalent") - - // Wait for finalizers to appear in federation store. - assert.NoError(t, WaitForFinalizersInFederationStore(ingressController, ingressController.ingressInformerStore, - types.NamespacedName{Namespace: fedIngress.Namespace, Name: fedIngress.Name}.String()), "finalizers not found in federated ingress") - - // Wait for the cluster ingress to appear in cluster store. - assert.NoError(t, WaitForIngressInClusterStore(ingressController.ingressFederatedInformer.GetTargetStore(), cluster1.Name, - types.NamespacedName{Namespace: createdIngress.Namespace, Name: createdIngress.Name}.String()), - "Created ingress not found in underlying cluster store") - - // Test that IP address gets transferred from cluster ingress to federated ingress. - t.Log("Checking that IP address gets transferred from cluster ingress to federated ingress") - cluster1Ingress.Status.LoadBalancer.Ingress = append(cluster1Ingress.Status.LoadBalancer.Ingress, - apiv1.LoadBalancerIngress{IP: "1.2.3.4"}) - glog.Infof("Setting artificial IP address for cluster1 ingress") - - for trial := 0; trial < maxTrials; trial++ { - cluster1IngressWatch.Modify(&cluster1Ingress) - // Wait for store to see the updated cluster ingress. - key := types.NamespacedName{Namespace: createdIngress.Namespace, Name: createdIngress.Name}.String() - if err := WaitForStatusUpdate(t, ingressController.ingressFederatedInformer.GetTargetStore(), - cluster1.Name, key, cluster1Ingress.Status.LoadBalancer, time.Second); err != nil { - continue - } - if err := WaitForFedStatusUpdate(t, ingressController.ingressInformerStore, - key, cluster1Ingress.Status.LoadBalancer, time.Second); err != nil { - continue - } - } - - for trial := 0; trial < maxTrials; trial++ { - updatedIngress = GetIngressFromChan(t, fedIngressUpdateChan) - assert.NotNil(t, updatedIngress, "Cluster's ingress load balancer status was not correctly transferred to the federated ingress") - if updatedIngress == nil { - return - } - if reflect.DeepEqual(cluster1Ingress.Status.LoadBalancer.Ingress, updatedIngress.Status.LoadBalancer.Ingress) { - fedIngress.Status.LoadBalancer = updatedIngress.Status.LoadBalancer - break - } else { - glog.Infof("Status check failed: expected: %v actual: %v", cluster1Ingress.Status, updatedIngress.Status) - } - } - glog.Infof("Status check: expected: %v actual: %v", cluster1Ingress.Status, updatedIngress.Status) - assert.True(t, reflect.DeepEqual(cluster1Ingress.Status.LoadBalancer.Ingress, updatedIngress.Status.LoadBalancer.Ingress), - fmt.Sprintf("Ingress IP was not transferred from cluster ingress to federated ingress. %v is not equal to %v", - cluster1Ingress.Status.LoadBalancer.Ingress, updatedIngress.Status.LoadBalancer.Ingress)) - - assert.NoError(t, WaitForStatusUpdate(t, ingressController.ingressFederatedInformer.GetTargetStore(), - cluster1.Name, types.NamespacedName{Namespace: createdIngress.Namespace, Name: createdIngress.Name}.String(), - cluster1Ingress.Status.LoadBalancer, time.Second)) - assert.NoError(t, WaitForFedStatusUpdate(t, ingressController.ingressInformerStore, - types.NamespacedName{Namespace: createdIngress.Namespace, Name: createdIngress.Name}.String(), - cluster1Ingress.Status.LoadBalancer, time.Second)) - t.Logf("expected: %v, actual: %v", createdIngress, updatedIngress) - - // Test update federated ingress. - if fedIngress.ObjectMeta.Annotations == nil { - fedIngress.ObjectMeta.Annotations = make(map[string]string) - } - fedIngress.ObjectMeta.Annotations["A"] = "B" - fedIngress.ObjectMeta.Annotations[federationapi.FederationClusterSelectorAnnotation] = `[{"key": "cluster", "operator": "in", "values": ["cluster1","cluster2"]}]` - t.Log("Modifying Federated Ingress") - fedIngressWatch.Modify(&fedIngress) - t.Log("Checking that Ingress was correctly updated in cluster 1") - var updatedIngress2 *extensionsv1beta1.Ingress - - for trial := 0; trial < maxTrials; trial++ { - updatedIngress2 = GetIngressFromChan(t, cluster1IngressUpdateChan) - assert.NotNil(t, updatedIngress2) - if updatedIngress2 == nil { - return - } - if reflect.DeepEqual(fedIngress.Spec, updatedIngress.Spec) && - updatedIngress2.ObjectMeta.Annotations["A"] == fedIngress.ObjectMeta.Annotations["A"] { - break - } - } - - assert.True(t, reflect.DeepEqual(updatedIngress2.Spec, fedIngress.Spec), "Spec of updated ingress is not equal") - assert.Equal(t, updatedIngress2.ObjectMeta.Annotations["A"], fedIngress.ObjectMeta.Annotations["A"], "Updated annotation not transferred from federated to cluster ingress.") - - fedIngress.Annotations[staticIPNameKeyWritable] = "foo" // Make sure that the base object has a static IP name first. - fedIngressWatch.Modify(&fedIngress) - - t.Log("Checking that the ingress got created in cluster 2 after a global ip was assigned") - createdIngress2 := GetIngressFromChan(t, cluster2IngressCreateChan) - assert.NotNil(t, createdIngress2) - assert.True(t, reflect.DeepEqual(fedIngress.Spec, createdIngress2.Spec), "Spec of created ingress is not equal") - t.Logf("created meta: %v fed meta: %v", createdIngress2.ObjectMeta, fedIngress.ObjectMeta) - assert.True(t, util.ObjectMetaEquivalent(fedIngress.ObjectMeta, createdIngress2.ObjectMeta), "Metadata of created object is not equivalent") - - close(stop) -} - -func GetConfigMapUidAndProviderId(t *testing.T, c chan runtime.Object) (string, string) { - updatedConfigMap := GetConfigMapFromChan(c) - assert.NotNil(t, updatedConfigMap, "ConfigMap should have received an update") - assert.NotNil(t, updatedConfigMap.Data, "ConfigMap data is empty") - - for _, key := range []string{uidKey, providerUidKey} { - val, ok := updatedConfigMap.Data[key] - assert.True(t, ok, fmt.Sprintf("Didn't receive an update for key %v: %v", key, updatedConfigMap.Data)) - assert.True(t, len(val) > 0, fmt.Sprintf("Received an empty update for key %v", key)) - } - return updatedConfigMap.Data[uidKey], updatedConfigMap.Data[providerUidKey] -} - -func GetIngressFromChan(t *testing.T, c chan runtime.Object) *extensionsv1beta1.Ingress { - obj := GetObjectFromChan(c) - - if obj == nil { - return nil - } - - ingress, ok := obj.(*extensionsv1beta1.Ingress) - if !ok { - t.Logf("Object on channel was not of type *extensionsv1beta1.Ingress: %v", obj) - } - return ingress -} - -func GetConfigMapFromChan(c chan runtime.Object) *apiv1.ConfigMap { - if configMap := GetObjectFromChan(c); configMap == nil { - return nil - } else { - return configMap.(*apiv1.ConfigMap) - } - -} - -func GetClusterFromChan(c chan runtime.Object) *federationapi.Cluster { - if cluster := GetObjectFromChan(c); cluster == nil { - return nil - } else { - return cluster.(*federationapi.Cluster) - } -} - -func NewConfigMap(uid string) *apiv1.ConfigMap { - return &apiv1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: uidConfigMapName, - Namespace: uidConfigMapNamespace, - SelfLink: "/api/v1/namespaces/" + uidConfigMapNamespace + "/configmap/" + uidConfigMapName, - // TODO: Remove: Annotations: map[string]string{}, - }, - Data: map[string]string{ - uidKey: uid, - }, - } -} - -// Wait for finalizers to appear in federation store. -func WaitForFinalizersInFederationStore(ingressController *IngressController, store cache.Store, key string) error { - retryInterval := 100 * time.Millisecond - timeout := wait.ForeverTestTimeout - err := wait.PollImmediate(retryInterval, timeout, func() (bool, error) { - obj, found, err := store.GetByKey(key) - if !found || err != nil { - return false, err - } - ingress := obj.(*extensionsv1beta1.Ingress) - hasOrphanFinalizer, err := finalizersutil.HasFinalizer(ingress, metav1.FinalizerOrphanDependents) - if err != nil { - return false, err - } - hasDeleteFinalizer, err := finalizersutil.HasFinalizer(ingress, deletionhelper.FinalizerDeleteFromUnderlyingClusters) - if err != nil { - return false, err - } - if hasOrphanFinalizer && hasDeleteFinalizer { - return true, nil - } - return false, nil - }) - return err -} - -// Wait for the cluster ingress to appear in cluster store. -func WaitForIngressInClusterStore(store util.FederatedReadOnlyStore, clusterName, key string) error { - retryInterval := 100 * time.Millisecond - timeout := wait.ForeverTestTimeout - err := wait.PollImmediate(retryInterval, timeout, func() (bool, error) { - _, found, err := store.GetByKey(clusterName, key) - if found && err == nil { - return true, nil - } - if errors.IsNotFound(err) { - return false, nil - } - return false, err - }) - return err -} - -// Wait for ingress status to be updated to match the desiredStatus. -func WaitForStatusUpdate(t *testing.T, store util.FederatedReadOnlyStore, clusterName, key string, desiredStatus apiv1.LoadBalancerStatus, timeout time.Duration) error { - retryInterval := 100 * time.Millisecond - err := wait.PollImmediate(retryInterval, timeout, func() (bool, error) { - obj, found, err := store.GetByKey(clusterName, key) - if !found || err != nil { - return false, err - } - ingress := obj.(*extensionsv1beta1.Ingress) - return reflect.DeepEqual(ingress.Status.LoadBalancer, desiredStatus), nil - }) - return err -} - -// Wait for ingress status to be updated to match the desiredStatus. -func WaitForFedStatusUpdate(t *testing.T, store cache.Store, key string, desiredStatus apiv1.LoadBalancerStatus, timeout time.Duration) error { - retryInterval := 100 * time.Millisecond - err := wait.PollImmediate(retryInterval, timeout, func() (bool, error) { - obj, found, err := store.GetByKey(key) - if !found || err != nil { - return false, err - } - ingress := obj.(*extensionsv1beta1.Ingress) - return reflect.DeepEqual(ingress.Status.LoadBalancer, desiredStatus), nil - }) - return err -} diff --git a/federation/pkg/federation-controller/job/BUILD b/federation/pkg/federation-controller/job/BUILD deleted file mode 100644 index 0b5dd30902..0000000000 --- a/federation/pkg/federation-controller/job/BUILD +++ /dev/null @@ -1,79 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = ["jobcontroller.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/job", - deps = [ - "//federation/apis/federation:go_default_library", - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//federation/pkg/federation-controller/util:go_default_library", - "//federation/pkg/federation-controller/util/deletionhelper:go_default_library", - "//federation/pkg/federation-controller/util/eventsink:go_default_library", - "//federation/pkg/federation-controller/util/planner:go_default_library", - "//federation/pkg/federation-controller/util/replicapreferences:go_default_library", - "//pkg/api:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//pkg/controller:go_default_library", - "//vendor/github.com/davecgh/go-spew/spew:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/k8s.io/api/batch/v1:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors: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/wait:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/k8s.io/client-go/tools/record:go_default_library", - "//vendor/k8s.io/client-go/util/flowcontrol:go_default_library", - "//vendor/k8s.io/client-go/util/workqueue:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["jobcontroller_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/job", - library = ":go_default_library", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/fake:go_default_library", - "//federation/pkg/federation-controller/util:go_default_library", - "//federation/pkg/federation-controller/util/finalizers:go_default_library", - "//federation/pkg/federation-controller/util/test:go_default_library", - "//pkg/apis/batch/v1:go_default_library", - "//vendor/github.com/stretchr/testify/assert:go_default_library", - "//vendor/k8s.io/api/batch/v1:go_default_library", - "//vendor/k8s.io/api/core/v1: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/util/sets:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library", - "//vendor/k8s.io/client-go/testing:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/job/jobcontroller.go b/federation/pkg/federation-controller/job/jobcontroller.go deleted file mode 100644 index 0ca450382d..0000000000 --- a/federation/pkg/federation-controller/job/jobcontroller.go +++ /dev/null @@ -1,562 +0,0 @@ -/* -Copyright 2016 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 job - -import ( - "fmt" - "reflect" - "time" - - "github.com/davecgh/go-spew/spew" - "github.com/golang/glog" - - batchv1 "k8s.io/api/batch/v1" - clientv1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" - kubeclientset "k8s.io/client-go/kubernetes" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/tools/record" - "k8s.io/client-go/util/flowcontrol" - "k8s.io/client-go/util/workqueue" - fed "k8s.io/kubernetes/federation/apis/federation" - fedv1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" - fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - fedutil "k8s.io/kubernetes/federation/pkg/federation-controller/util" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/deletionhelper" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/eventsink" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/planner" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/replicapreferences" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/controller" -) - -const ( - fedJobPreferencesAnnotation = "federation.kubernetes.io/job-preferences" - allClustersKey = "THE_ALL_CLUSTER_KEY" - // UserAgentName is the user agent used in the federation client - UserAgentName = "Federation-Job-Controller" - // ControllerName is name of this controller - ControllerName = "jobs" -) - -var ( - // RequiredResources is the resource group version of the type this controller manages - RequiredResources = []schema.GroupVersionResource{batchv1.SchemeGroupVersion.WithResource("jobs")} - jobReviewDelay = 10 * time.Second - clusterAvailableDelay = 20 * time.Second - clusterUnavailableDelay = 60 * time.Second - updateTimeout = 30 * time.Second - backoffInitial = 5 * time.Second - backoffMax = 1 * time.Minute -) - -// FederationJobController synchronizes the state of a federated job object -// to clusters that are members of the federation. -type FederationJobController struct { - fedClient fedclientset.Interface - - jobController cache.Controller - jobStore cache.Store - - fedJobInformer fedutil.FederatedInformer - - jobDeliverer *fedutil.DelayingDeliverer - clusterDeliverer *fedutil.DelayingDeliverer - jobWorkQueue workqueue.Interface - // For updating members of federation. - fedUpdater fedutil.FederatedUpdater - - jobBackoff *flowcontrol.Backoff - // For events - eventRecorder record.EventRecorder - - defaultPlanner *planner.Planner - deletionHelper *deletionhelper.DeletionHelper -} - -// NewJobController creates a new federation job controller -func NewJobController(fedClient fedclientset.Interface) *FederationJobController { - broadcaster := record.NewBroadcaster() - broadcaster.StartRecordingToSink(eventsink.NewFederatedEventSink(fedClient)) - recorder := broadcaster.NewRecorder(legacyscheme.Scheme, clientv1.EventSource{Component: "federated-job-controller"}) - fjc := &FederationJobController{ - fedClient: fedClient, - jobDeliverer: fedutil.NewDelayingDeliverer(), - clusterDeliverer: fedutil.NewDelayingDeliverer(), - jobWorkQueue: workqueue.New(), - jobBackoff: flowcontrol.NewBackOff(backoffInitial, backoffMax), - defaultPlanner: planner.NewPlanner(&fed.ReplicaAllocationPreferences{ - Clusters: map[string]fed.ClusterPreferences{ - "*": {Weight: 1}, - }, - }), - eventRecorder: recorder, - } - - jobFedInformerFactory := func(cluster *fedv1.Cluster, clientset kubeclientset.Interface) (cache.Store, cache.Controller) { - return cache.NewInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - return clientset.BatchV1().Jobs(metav1.NamespaceAll).List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - return clientset.BatchV1().Jobs(metav1.NamespaceAll).Watch(options) - }, - }, - &batchv1.Job{}, - controller.NoResyncPeriodFunc(), - fedutil.NewTriggerOnAllChanges( - func(obj runtime.Object) { fjc.deliverLocalJob(obj, jobReviewDelay) }, - ), - ) - } - clusterLifecycle := fedutil.ClusterLifecycleHandlerFuncs{ - ClusterAvailable: func(cluster *fedv1.Cluster) { - fjc.clusterDeliverer.DeliverAfter(allClustersKey, nil, clusterAvailableDelay) - }, - ClusterUnavailable: func(cluster *fedv1.Cluster, _ []interface{}) { - fjc.clusterDeliverer.DeliverAfter(allClustersKey, nil, clusterUnavailableDelay) - }, - } - fjc.fedJobInformer = fedutil.NewFederatedInformer(fedClient, jobFedInformerFactory, &clusterLifecycle) - - fjc.jobStore, fjc.jobController = cache.NewInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - return fjc.fedClient.BatchV1().Jobs(metav1.NamespaceAll).List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - return fjc.fedClient.BatchV1().Jobs(metav1.NamespaceAll).Watch(options) - }, - }, - &batchv1.Job{}, - controller.NoResyncPeriodFunc(), - fedutil.NewTriggerOnMetaAndSpecChanges( - func(obj runtime.Object) { fjc.deliverFedJobObj(obj, 0) }, - ), - ) - - fjc.fedUpdater = fedutil.NewFederatedUpdater(fjc.fedJobInformer, "job", updateTimeout, fjc.eventRecorder, - func(client kubeclientset.Interface, obj runtime.Object) error { - rs := obj.(*batchv1.Job) - _, err := client.BatchV1().Jobs(rs.Namespace).Create(rs) - return err - }, - func(client kubeclientset.Interface, obj runtime.Object) error { - rs := obj.(*batchv1.Job) - _, err := client.BatchV1().Jobs(rs.Namespace).Update(rs) - return err - }, - func(client kubeclientset.Interface, obj runtime.Object) error { - rs := obj.(*batchv1.Job) - err := client.BatchV1().Jobs(rs.Namespace).Delete(rs.Name, &metav1.DeleteOptions{}) - return err - }) - - fjc.deletionHelper = deletionhelper.NewDeletionHelper( - fjc.updateJob, - // objNameFunc - func(obj runtime.Object) string { - job := obj.(*batchv1.Job) - return job.Name - }, - fjc.fedJobInformer, - fjc.fedUpdater, - ) - - return fjc -} - -// Sends the given updated object to apiserver. -// Assumes that the given object is a job. -func (fjc *FederationJobController) updateJob(obj runtime.Object) (runtime.Object, error) { - job := obj.(*batchv1.Job) - return fjc.fedClient.BatchV1().Jobs(job.Namespace).Update(job) -} - -// Run starts the syncing of federation jobs to the clusters. -func (fjc *FederationJobController) Run(workers int, stopCh <-chan struct{}) { - go fjc.jobController.Run(stopCh) - fjc.fedJobInformer.Start() - - fjc.jobDeliverer.StartWithHandler(func(item *fedutil.DelayingDelivererItem) { - fjc.jobWorkQueue.Add(item.Key) - }) - fjc.clusterDeliverer.StartWithHandler(func(_ *fedutil.DelayingDelivererItem) { - fjc.reconcileJobsOnClusterChange() - }) - - for !fjc.isSynced() { - time.Sleep(5 * time.Millisecond) - } - - for i := 0; i < workers; i++ { - go wait.Until(fjc.worker, time.Second, stopCh) - } - - fedutil.StartBackoffGC(fjc.jobBackoff, stopCh) - - <-stopCh - glog.Infof("Shutting down FederationJobController") - fjc.jobDeliverer.Stop() - fjc.clusterDeliverer.Stop() - fjc.jobWorkQueue.ShutDown() - fjc.fedJobInformer.Stop() -} - -func (fjc *FederationJobController) isSynced() bool { - if !fjc.fedJobInformer.ClustersSynced() { - glog.V(3).Infof("Cluster list not synced") - return false - } - clusters, err := fjc.fedJobInformer.GetReadyClusters() - if err != nil { - glog.Errorf("Failed to get ready clusters: %v", err) - return false - } - if !fjc.fedJobInformer.GetTargetStore().ClustersSynced(clusters) { - glog.V(2).Infof("cluster job list not synced") - return false - } - - if !fjc.jobController.HasSynced() { - glog.V(2).Infof("federation job list not synced") - return false - } - return true -} - -func (fjc *FederationJobController) deliverLocalJob(obj interface{}, duration time.Duration) { - key, err := controller.KeyFunc(obj) - if err != nil { - glog.Errorf("Couldn't get key for object %v: %v", obj, err) - return - } - _, exists, err := fjc.jobStore.GetByKey(key) - if err != nil { - glog.Errorf("Couldn't get federated job %v: %v", key, err) - return - } - if exists { // ignore jobs exists only in local k8s - fjc.deliverJobByKey(key, duration, false) - } -} - -func (fjc *FederationJobController) deliverFedJobObj(obj interface{}, delay time.Duration) { - key, err := controller.KeyFunc(obj) - if err != nil { - glog.Errorf("Couldn't get key for object %+v: %v", obj, err) - return - } - fjc.deliverJobByKey(key, delay, false) -} - -func (fjc *FederationJobController) deliverJobByKey(key string, delay time.Duration, failed bool) { - if failed { - fjc.jobBackoff.Next(key, time.Now()) - delay = delay + fjc.jobBackoff.Get(key) - } else { - fjc.jobBackoff.Reset(key) - } - fjc.jobDeliverer.DeliverAfter(key, nil, delay) -} - -type reconciliationStatus string - -const ( - statusAllOk = reconciliationStatus("ALL_OK") - statusNeedRecheck = reconciliationStatus("RECHECK") - statusError = reconciliationStatus("ERROR") - statusNotSynced = reconciliationStatus("NOSYNC") -) - -func (fjc *FederationJobController) worker() { - for { - item, quit := fjc.jobWorkQueue.Get() - if quit { - return - } - key := item.(string) - status, err := fjc.reconcileJob(key) - fjc.jobWorkQueue.Done(item) - if err != nil { - glog.Errorf("Error syncing job controller: %v", err) - fjc.deliverJobByKey(key, 0, true) - } else { - switch status { - case statusAllOk: - break - case statusError: - fjc.deliverJobByKey(key, 0, true) - case statusNeedRecheck: - fjc.deliverJobByKey(key, jobReviewDelay, false) - case statusNotSynced: - fjc.deliverJobByKey(key, clusterAvailableDelay, false) - default: - glog.Errorf("Unhandled reconciliation status: %s", status) - fjc.deliverJobByKey(key, jobReviewDelay, false) - } - } - } -} - -type scheduleResult struct { - Parallelism *int32 - Completions *int32 -} - -func (fjc *FederationJobController) schedule(fjob *batchv1.Job, clusters []*fedv1.Cluster) map[string]scheduleResult { - plnr := fjc.defaultPlanner - frsPref, err := replicapreferences.GetAllocationPreferences(fjob, fedJobPreferencesAnnotation) - if err != nil { - glog.Warningf("Invalid job specific preference, use default. rs: %v, err: %v", fjob, err) - } - if frsPref != nil { // create a new planner if user specified a preference - plnr = planner.NewPlanner(frsPref) - } - - parallelism := int64(*fjob.Spec.Parallelism) - var clusterNames []string - for _, cluster := range clusters { - clusterNames = append(clusterNames, cluster.Name) - } - parallelismResult, _ := plnr.Plan(parallelism, clusterNames, nil, nil, fjob.Namespace+"/"+fjob.Name) - - if frsPref != nil { - for _, clusterPref := range frsPref.Clusters { - clusterPref.MinReplicas = 0 - clusterPref.MaxReplicas = nil - } - plnr = planner.NewPlanner(frsPref) - } - clusterNames = nil - for clusterName := range parallelismResult { - clusterNames = append(clusterNames, clusterName) - } - completionsResult := make(map[string]int64) - if fjob.Spec.Completions != nil { - completionsResult, _ = plnr.Plan(int64(*fjob.Spec.Completions), clusterNames, nil, nil, fjob.Namespace+"/"+fjob.Name) - } - - results := make(map[string]scheduleResult) - for _, clusterName := range clusterNames { - paralle := int32(parallelismResult[clusterName]) - complet := int32(completionsResult[clusterName]) - result := scheduleResult{ - Parallelism: ¶lle, - } - if fjob.Spec.Completions != nil { - result.Completions = &complet - } - results[clusterName] = result - } - - return results -} - -func (fjc *FederationJobController) reconcileJob(key string) (reconciliationStatus, error) { - if !fjc.isSynced() { - return statusNotSynced, nil - } - - glog.V(4).Infof("Start reconcile job %q", key) - startTime := time.Now() - defer glog.V(4).Infof("Finished reconcile job %q (%v)", key, time.Now().Sub(startTime)) - - objFromStore, exists, err := fjc.jobStore.GetByKey(key) - if err != nil { - return statusError, err - } - if !exists { - // deleted federated job, nothing need to do - return statusAllOk, nil - } - - // Create a copy before modifying the obj to prevent race condition with other readers of obj from store. - fjob, ok := objFromStore.(*batchv1.Job) - if !ok { - return statusError, err - } - fjob = fjob.DeepCopy() - - // delete job - if fjob.DeletionTimestamp != nil { - if err := fjc.delete(fjob); err != nil { - fjc.eventRecorder.Eventf(fjob, api.EventTypeNormal, "DeleteFailed", "Job delete failed: %v", err) - return statusError, err - } - return statusAllOk, nil - } - - glog.V(3).Infof("Ensuring delete object from underlying clusters finalizer for job: %s\n", key) - // Add the required finalizers before creating a job in underlying clusters. - updatedJobObj, err := fjc.deletionHelper.EnsureFinalizers(fjob) - if err != nil { - return statusError, err - } - fjob = updatedJobObj.(*batchv1.Job) - - clusters, err := fjc.fedJobInformer.GetReadyClusters() - if err != nil { - return statusError, err - } - - scheduleResult := fjc.schedule(fjob, clusters) - glog.V(3).Infof("Start syncing local job %s: %s\n", key, spew.Sprintf("%v", scheduleResult)) - - fedStatus := batchv1.JobStatus{} - var fedStatusFailedCondition *batchv1.JobCondition - var fedStatusCompleteCondition *batchv1.JobCondition - var operations []fedutil.FederatedOperation - for clusterName, result := range scheduleResult { - ljobObj, exists, err := fjc.fedJobInformer.GetTargetStore().GetByKey(clusterName, key) - if err != nil { - return statusError, err - } - ljob := &batchv1.Job{ - ObjectMeta: fedutil.DeepCopyRelevantObjectMeta(fjob.ObjectMeta), - Spec: *fjob.Spec.DeepCopy(), - } - // use selector generated at federation level, or user specified value - manualSelector := true - ljob.Spec.ManualSelector = &manualSelector - ljob.Spec.Parallelism = result.Parallelism - ljob.Spec.Completions = result.Completions - - if !exists { - if *ljob.Spec.Parallelism > 0 { - fjc.eventRecorder.Eventf(fjob, api.EventTypeNormal, "CreateInCluster", "Creating job in cluster %s", clusterName) - operations = append(operations, fedutil.FederatedOperation{ - Type: fedutil.OperationTypeAdd, - Obj: ljob, - ClusterName: clusterName, - }) - } - } else { - currentLjob := ljobObj.(*batchv1.Job) - - // Update existing job, if needed. - if !fedutil.ObjectMetaAndSpecEquivalent(ljob, currentLjob) { - fjc.eventRecorder.Eventf(fjob, api.EventTypeNormal, "UpdateInCluster", "Updating job in cluster %s", clusterName) - operations = append(operations, fedutil.FederatedOperation{ - Type: fedutil.OperationTypeUpdate, - Obj: ljob, - ClusterName: clusterName, - }) - } - - // collect local job status - for _, condition := range currentLjob.Status.Conditions { - if condition.Type == batchv1.JobComplete { - if fedStatusCompleteCondition == nil || - fedStatusCompleteCondition.LastTransitionTime.Before(&condition.LastTransitionTime) { - fedStatusCompleteCondition = &condition - } - } else if condition.Type == batchv1.JobFailed { - if fedStatusFailedCondition == nil || - fedStatusFailedCondition.LastTransitionTime.Before(&condition.LastTransitionTime) { - fedStatusFailedCondition = &condition - } - } - } - if currentLjob.Status.StartTime != nil { - if fedStatus.StartTime == nil || fedStatus.StartTime.After(currentLjob.Status.StartTime.Time) { - fedStatus.StartTime = currentLjob.Status.StartTime - } - } - if currentLjob.Status.CompletionTime != nil { - if fedStatus.CompletionTime == nil || fedStatus.CompletionTime.Before(currentLjob.Status.CompletionTime) { - fedStatus.CompletionTime = currentLjob.Status.CompletionTime - } - } - fedStatus.Active += currentLjob.Status.Active - fedStatus.Succeeded += currentLjob.Status.Succeeded - fedStatus.Failed += currentLjob.Status.Failed - } - } - - // federated job fails if any local job failes - if fedStatusFailedCondition != nil { - fedStatus.Conditions = append(fedStatus.Conditions, *fedStatusFailedCondition) - } else if fedStatusCompleteCondition != nil { - fedStatus.Conditions = append(fedStatus.Conditions, *fedStatusCompleteCondition) - } - if !reflect.DeepEqual(fedStatus, fjob.Status) { - fjob.Status = fedStatus - _, err = fjc.fedClient.BatchV1().Jobs(fjob.Namespace).UpdateStatus(fjob) - if err != nil { - return statusError, err - } - } - - if len(operations) == 0 { - // Everything is in order - return statusAllOk, nil - } - - if glog.V(4) { - for i, op := range operations { - job := op.Obj.(*batchv1.Job) - glog.V(4).Infof("operation[%d]: %s, %s/%s/%s, %d", i, op.Type, op.ClusterName, job.Namespace, job.Name, *job.Spec.Parallelism) - } - } - err = fjc.fedUpdater.Update(operations) - if err != nil { - return statusError, err - } - - // Some operations were made, reconcile after a while. - return statusNeedRecheck, nil - -} - -func (fjc *FederationJobController) reconcileJobsOnClusterChange() { - if !fjc.isSynced() { - fjc.clusterDeliverer.DeliverAfter(allClustersKey, nil, clusterAvailableDelay) - } - jobs := fjc.jobStore.List() - for _, job := range jobs { - key, _ := controller.KeyFunc(job) - fjc.deliverJobByKey(key, 0, false) - } -} - -// delete deletes the given job or returns error if the deletion was not complete. -func (fjc *FederationJobController) delete(job *batchv1.Job) error { - glog.V(3).Infof("Handling deletion of job: %s/%s\n", job.Namespace, job.Name) - _, err := fjc.deletionHelper.HandleObjectInUnderlyingClusters(job) - if err != nil { - return err - } - - err = fjc.fedClient.BatchV1().Jobs(job.Namespace).Delete(job.Name, nil) - if err != nil { - // Its all good if the error is not found error. That means it is deleted already and we do not have to do anything. - // This is expected when we are processing an update as a result of job finalizer deletion. - // The process that deleted the last finalizer is also going to delete the job and we do not have to do anything. - if !errors.IsNotFound(err) { - return fmt.Errorf("failed to delete job: %s/%s, %v", job.Namespace, job.Name, err) - } - } - return nil -} diff --git a/federation/pkg/federation-controller/job/jobcontroller_test.go b/federation/pkg/federation-controller/job/jobcontroller_test.go deleted file mode 100644 index 65a869baa4..0000000000 --- a/federation/pkg/federation-controller/job/jobcontroller_test.go +++ /dev/null @@ -1,282 +0,0 @@ -/* -Copyright 2016 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 job - -import ( - "flag" - "fmt" - "testing" - "time" - - batchv1 "k8s.io/api/batch/v1" - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - kubeclientset "k8s.io/client-go/kubernetes" - kubeclientfake "k8s.io/client-go/kubernetes/fake" - core "k8s.io/client-go/testing" - fedv1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" - fedclientfake "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/fake" - fedutil "k8s.io/kubernetes/federation/pkg/federation-controller/util" - finalizersutil "k8s.io/kubernetes/federation/pkg/federation-controller/util/finalizers" - testutil "k8s.io/kubernetes/federation/pkg/federation-controller/util/test" - batchv1internal "k8s.io/kubernetes/pkg/apis/batch/v1" - - "github.com/stretchr/testify/assert" - "k8s.io/apimachinery/pkg/util/sets" - "reflect" - "strings" -) - -func installWatchReactor(fakeClien *core.Fake, resource string) chan runtime.Object { - objChan := make(chan runtime.Object, 100) - - fakeWatch := watch.NewRaceFreeFake() - fakeClien.PrependWatchReactor(resource, core.DefaultWatchReactor(fakeWatch, nil)) - fakeClien.PrependReactor("create", resource, func(action core.Action) (handled bool, ret runtime.Object, err error) { - obj := action.(core.CreateAction).GetObject() - batchv1internal.SetDefaults_Job(obj.(*batchv1.Job)) - fakeWatch.Add(obj) - objChan <- obj - return false, nil, nil - }) - fakeClien.PrependReactor("update", resource, func(action core.Action) (handled bool, ret runtime.Object, err error) { - obj := action.(core.UpdateAction).GetObject() - fakeWatch.Modify(obj) - objChan <- obj - return false, nil, nil - }) - fakeClien.PrependReactor("delete", resource, func(action core.Action) (handled bool, ret runtime.Object, err error) { - obj := &batchv1.Job{ - ObjectMeta: metav1.ObjectMeta{ - Name: action.(core.DeleteAction).GetName(), - Namespace: action.GetNamespace(), - }, - } - fakeWatch.Delete(obj) - objChan <- obj - return false, nil, nil - }) - - return objChan -} - -func TestJobController(t *testing.T) { - flag.Set("logtostderr", "true") - flag.Set("v", "5") - flag.Parse() - - jobReviewDelay = 50 * time.Millisecond - clusterAvailableDelay = 200 * time.Millisecond - clusterUnavailableDelay = 200 * time.Millisecond - - fedclientset := fedclientfake.NewSimpleClientset() - fedChan := installWatchReactor(&fedclientset.Fake, "jobs") - - fedclientset.Federation().Clusters().Create(testutil.NewCluster("k8s-1", apiv1.ConditionTrue)) - fedclientset.Federation().Clusters().Create(testutil.NewCluster("k8s-2", apiv1.ConditionTrue)) - - kube1clientset := kubeclientfake.NewSimpleClientset() - kube1Chan := installWatchReactor(&kube1clientset.Fake, "jobs") - kube2clientset := kubeclientfake.NewSimpleClientset() - kube2Chan := installWatchReactor(&kube2clientset.Fake, "jobs") - - fedInformerClientFactory := func(cluster *fedv1.Cluster) (kubeclientset.Interface, error) { - switch cluster.Name { - case "k8s-1": - return kube1clientset, nil - case "k8s-2": - return kube2clientset, nil - default: - return nil, fmt.Errorf("Unknown cluster: %v", cluster.Name) - } - } - jobController := NewJobController(fedclientset) - fedjobinformer := testutil.ToFederatedInformerForTestOnly(jobController.fedJobInformer) - fedjobinformer.SetClientFactory(fedInformerClientFactory) - - stopChan := make(chan struct{}) - defer close(stopChan) - go jobController.Run(5, stopChan) - - test := func(job *batchv1.Job, parallelism1, parallelism2, completions1, completions2 int32) { - job, _ = fedclientset.Batch().Jobs(metav1.NamespaceDefault).Create(job) - - joinErrors := func(errors []error) error { - if len(errors) == 0 { - return nil - } - errorStrings := []string{} - for _, err := range errors { - errorStrings = append(errorStrings, err.Error()) - } - return fmt.Errorf("%s", strings.Join(errorStrings, "\n")) - } - - // check local jobs are created with correct spec - checkLocalJob := func(parallelism, completions int32) testutil.CheckingFunction { - return func(obj runtime.Object) error { - errors := []error{} - ljob := obj.(*batchv1.Job) - if !fedutil.ObjectMetaEquivalent(job.ObjectMeta, ljob.ObjectMeta) { - errors = append(errors, fmt.Errorf("Job meta un-equivalent: %#v (expected) != %#v (actual)", job.ObjectMeta, ljob.ObjectMeta)) - } - if err := checkEqual(t, *ljob.Spec.Parallelism, parallelism, "Spec.Parallelism"); err != nil { - errors = append(errors, err) - } - if ljob.Spec.Completions != nil { - if err := checkEqual(t, *ljob.Spec.Completions, completions, "Spec.Completions"); err != nil { - errors = append(errors, err) - } - } - return joinErrors(errors) - } - } - checkFedJob := func(obj runtime.Object) error { - errors := []error{} - return joinErrors(errors) - } - assert.NoError(t, testutil.CheckObjectFromChan(kube1Chan, checkLocalJob(parallelism1, completions1))) - assert.NoError(t, testutil.CheckObjectFromChan(kube2Chan, checkLocalJob(parallelism2, completions2))) - assert.NoError(t, testutil.CheckObjectFromChan(fedChan, checkFedJob)) - - // finish local jobs - job1, _ := kube1clientset.Batch().Jobs(metav1.NamespaceDefault).Get(job.Name, metav1.GetOptions{}) - finishJob(job1, 100*time.Millisecond) - job1, _ = kube1clientset.Batch().Jobs(metav1.NamespaceDefault).UpdateStatus(job1) - job2, _ := kube2clientset.Batch().Jobs(metav1.NamespaceDefault).Get(job.Name, metav1.GetOptions{}) - finishJob(job2, 100*time.Millisecond) - job2, _ = kube2clientset.Batch().Jobs(metav1.NamespaceDefault).UpdateStatus(job2) - - // check fed job status updated - assert.NoError(t, testutil.CheckObjectFromChan(fedChan, func(obj runtime.Object) error { - errors := []error{} - job := obj.(*batchv1.Job) - if err := checkEqual(t, *job.Spec.Parallelism, *job1.Spec.Parallelism+*job2.Spec.Parallelism, "Spec.Parallelism"); err != nil { - errors = append(errors, err) - } - if job.Spec.Completions != nil { - if err := checkEqual(t, *job.Spec.Completions, *job1.Spec.Completions+*job2.Spec.Completions, "Spec.Completions"); err != nil { - errors = append(errors, err) - } - } - if err := checkEqual(t, job.Status.Succeeded, job1.Status.Succeeded+job2.Status.Succeeded, "Status.Succeeded"); err != nil { - errors = append(errors, err) - } - return joinErrors(errors) - })) - - // delete fed job by set deletion time, and remove orphan finalizer - job, _ = fedclientset.Batch().Jobs(metav1.NamespaceDefault).Get(job.Name, metav1.GetOptions{}) - deletionTimestamp := metav1.Now() - job.DeletionTimestamp = &deletionTimestamp - finalizersutil.RemoveFinalizers(job, sets.NewString(metav1.FinalizerOrphanDependents)) - fedclientset.Batch().Jobs(metav1.NamespaceDefault).Update(job) - - // check jobs are deleted - checkDeleted := func(obj runtime.Object) error { - djob := obj.(*batchv1.Job) - deletedJob := &batchv1.Job{ - ObjectMeta: metav1.ObjectMeta{ - Name: djob.Name, - Namespace: djob.Namespace, - }, - } - if !reflect.DeepEqual(djob, deletedJob) { - return fmt.Errorf("%s/%s should be deleted", djob.Namespace, djob.Name) - } - return nil - } - assert.NoError(t, testutil.CheckObjectFromChan(kube1Chan, checkDeleted)) - assert.NoError(t, testutil.CheckObjectFromChan(kube2Chan, checkDeleted)) - assert.NoError(t, testutil.CheckObjectFromChan(fedChan, checkDeleted)) - } - - test(newJob("job1", 2, 7), 1, 1, 4, 3) - test(newJob("job2", 2, -1), 1, 1, -1, -1) - test(newJob("job3", 7, 2), 4, 3, 1, 1) - test(newJob("job4", 7, 1), 4, 3, 1, 0) -} - -func checkEqual(_ *testing.T, expected, actual interface{}, msg string) error { - if !assert.ObjectsAreEqual(expected, actual) { - return fmt.Errorf("%s not equal: %#v (expected) != %#v (actual)", msg, expected, actual) - } - return nil -} - -func newJob(name string, parallelism int32, completions int32) *batchv1.Job { - job := batchv1.Job{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: metav1.NamespaceDefault, - SelfLink: "/api/v1/namespaces/default/jobs/name", - }, - Spec: batchv1.JobSpec{ - Parallelism: ¶llelism, - Completions: &completions, - Template: apiv1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{ - "foo": name, - }, - }, - Spec: apiv1.PodSpec{ - Containers: []apiv1.Container{ - {Image: "foo/bar"}, - }, - RestartPolicy: apiv1.RestartPolicyNever, - }, - }, - }, - } - if parallelism < 0 { - job.Spec.Parallelism = nil - } - if completions < 0 { - job.Spec.Completions = nil - } - - batchv1internal.SetDefaults_Job(&job) - return &job -} - -func newCondition(conditionType batchv1.JobConditionType, reason, message string) batchv1.JobCondition { - return batchv1.JobCondition{ - Type: conditionType, - Status: apiv1.ConditionTrue, - LastProbeTime: metav1.Now(), - LastTransitionTime: metav1.Now(), - Reason: reason, - Message: message, - } -} - -func finishJob(job *batchv1.Job, duration time.Duration) { - job.Status.Conditions = append(job.Status.Conditions, newCondition(batchv1.JobComplete, "", "")) - if job.Spec.Completions == nil { - job.Status.Succeeded = 1 - } else { - job.Status.Succeeded = *job.Spec.Completions - } - now := metav1.Now() - job.Status.StartTime = &now - time.Sleep(duration) - now = metav1.Now() - job.Status.CompletionTime = &now -} diff --git a/federation/pkg/federation-controller/service/BUILD b/federation/pkg/federation-controller/service/BUILD deleted file mode 100644 index a7db00ad44..0000000000 --- a/federation/pkg/federation-controller/service/BUILD +++ /dev/null @@ -1,87 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = ["servicecontroller.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/service", - deps = [ - "//federation/apis/federation:go_default_library", - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//federation/pkg/federation-controller/service/ingress:go_default_library", - "//federation/pkg/federation-controller/util:go_default_library", - "//federation/pkg/federation-controller/util/clusterselector:go_default_library", - "//federation/pkg/federation-controller/util/deletionhelper:go_default_library", - "//federation/pkg/federation-controller/util/eventsink:go_default_library", - "//pkg/api:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//pkg/controller:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors: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: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/util/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/listers/core/v1:go_default_library", - "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/k8s.io/client-go/tools/record:go_default_library", - "//vendor/k8s.io/client-go/util/flowcontrol:go_default_library", - "//vendor/k8s.io/client-go/util/workqueue:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["servicecontroller_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/service", - library = ":go_default_library", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/fake:go_default_library", - "//federation/pkg/federation-controller/service/ingress:go_default_library", - "//federation/pkg/federation-controller/util:go_default_library", - "//federation/pkg/federation-controller/util/deletionhelper:go_default_library", - "//federation/pkg/federation-controller/util/test:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/github.com/stretchr/testify/require:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors: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/types:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library", - "//vendor/k8s.io/client-go/listers/core/v1:go_default_library", - "//vendor/k8s.io/client-go/tools/cache:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/pkg/federation-controller/service/dns:all-srcs", - "//federation/pkg/federation-controller/service/ingress:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/service/dns/BUILD b/federation/pkg/federation-controller/service/dns/BUILD deleted file mode 100644 index 7c1a2c8b12..0000000000 --- a/federation/pkg/federation-controller/service/dns/BUILD +++ /dev/null @@ -1,62 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_test( - name = "go_default_test", - srcs = ["dns_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/service/dns", - library = ":go_default_library", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/fake:go_default_library", - "//federation/pkg/dnsprovider/providers/google/clouddns:go_default_library", - "//federation/pkg/federation-controller/service/ingress:go_default_library", - "//federation/pkg/federation-controller/util/test:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", - ], -) - -go_library( - name = "go_default_library", - srcs = ["dns.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/service/dns", - deps = [ - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//federation/pkg/dnsprovider:go_default_library", - "//federation/pkg/dnsprovider/rrstype:go_default_library", - "//federation/pkg/federation-controller/service/ingress:go_default_library", - "//federation/pkg/federation-controller/util:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/k8s.io/api/core/v1: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/util/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", - "//vendor/k8s.io/client-go/listers/core/v1:go_default_library", - "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/k8s.io/client-go/util/flowcontrol:go_default_library", - "//vendor/k8s.io/client-go/util/workqueue:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/service/dns/dns.go b/federation/pkg/federation-controller/service/dns/dns.go deleted file mode 100644 index e478d76e6b..0000000000 --- a/federation/pkg/federation-controller/service/dns/dns.go +++ /dev/null @@ -1,549 +0,0 @@ -/* -Copyright 2016 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 dns - -import ( - "fmt" - "net" - "strings" - "time" - - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" - corelisters "k8s.io/client-go/listers/core/v1" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/util/flowcontrol" - "k8s.io/client-go/util/workqueue" - fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/federation/pkg/dnsprovider" - "k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" - "k8s.io/kubernetes/federation/pkg/federation-controller/service/ingress" - "k8s.io/kubernetes/federation/pkg/federation-controller/util" - - "github.com/golang/glog" -) - -const ( - ControllerName = "service-dns" - - UserAgentName = "federation-service-dns-controller" - - // minDNSTTL is the minimum safe DNS TTL value to use (in seconds). We use this as the TTL for all DNS records. - minDNSTTL = 180 - - serviceSyncPeriod = 30 * time.Second -) - -type ServiceDNSController struct { - // Client to federation api server - federationClient fedclientset.Interface - dns dnsprovider.Interface - federationName string - // serviceDNSSuffix is the DNS suffix we use when publishing service DNS names - serviceDNSSuffix string - // zoneName and zoneID are used to identify the zone in which to put records - zoneName string - zoneID string - dnsZones dnsprovider.Zones - // each federation should be configured with a single zone (e.g. "mycompany.com") - dnsZone dnsprovider.Zone - // Informer Store for federated services - serviceStore corelisters.ServiceLister - // Informer controller for federated services - serviceController cache.Controller - workQueue workqueue.Interface - objectDeliverer *util.DelayingDeliverer - flowcontrolBackoff *flowcontrol.Backoff -} - -// NewServiceDNSController returns a new service dns controller to manage DNS records for federated services -func NewServiceDNSController(client fedclientset.Interface, dnsProvider, dnsProviderConfig, federationName, - serviceDNSSuffix, zoneName, zoneID string) (*ServiceDNSController, error) { - dns, err := dnsprovider.InitDnsProvider(dnsProvider, dnsProviderConfig) - if err != nil { - runtime.HandleError(fmt.Errorf("DNS provider could not be initialized: %v", err)) - return nil, err - } - d := &ServiceDNSController{ - federationClient: client, - dns: dns, - federationName: federationName, - serviceDNSSuffix: serviceDNSSuffix, - zoneName: zoneName, - zoneID: zoneID, - workQueue: workqueue.New(), - objectDeliverer: util.NewDelayingDeliverer(), - flowcontrolBackoff: flowcontrol.NewBackOff(5*time.Second, time.Minute), - } - if err := d.validateConfig(); err != nil { - runtime.HandleError(fmt.Errorf("Invalid configuration passed to DNS provider: %v", err)) - return nil, err - } - if err := d.retrieveOrCreateDNSZone(); err != nil { - runtime.HandleError(fmt.Errorf("Failed to retrieve DNS zone: %v", err)) - return nil, err - } - - // Start informer in federated API servers on federated services - var serviceIndexer cache.Indexer - serviceIndexer, d.serviceController = cache.NewIndexerInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (pkgruntime.Object, error) { - return client.Core().Services(metav1.NamespaceAll).List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - return client.Core().Services(metav1.NamespaceAll).Watch(options) - }, - }, - &v1.Service{}, - serviceSyncPeriod, - util.NewTriggerOnAllChanges(func(obj pkgruntime.Object) { d.workQueue.Add(obj) }), - cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, - ) - d.serviceStore = corelisters.NewServiceLister(serviceIndexer) - - return d, nil -} - -func (s *ServiceDNSController) DNSControllerRun(workers int, stopCh <-chan struct{}) { - defer runtime.HandleCrash() - defer s.workQueue.ShutDown() - - glog.Infof("Starting federation service dns controller") - - s.objectDeliverer.StartWithHandler(func(item *util.DelayingDelivererItem) { - s.workQueue.Add(item.Value.(*v1.Service)) - }) - defer s.objectDeliverer.Stop() - - util.StartBackoffGC(s.flowcontrolBackoff, stopCh) - go s.serviceController.Run(stopCh) - - for i := 0; i < workers; i++ { - go wait.Until(s.worker, time.Second, stopCh) - } - - <-stopCh - glog.Infof("Stopping federation service dns controller") -} - -// Adds backoff to delay if this delivery is related to some failure. Resets backoff if there was no failure. -func (s *ServiceDNSController) deliverService(service *v1.Service, delay time.Duration, failed bool) { - if failed { - s.flowcontrolBackoff.Next(service.String(), time.Now()) - delay = delay + s.flowcontrolBackoff.Get(service.String()) - } else { - s.flowcontrolBackoff.Reset(service.String()) - } - s.objectDeliverer.DeliverAfter(service.String(), service, delay) -} - -func wantsDNSRecords(service *v1.Service) bool { - return service.Spec.Type == v1.ServiceTypeLoadBalancer -} - -func (s *ServiceDNSController) workerFunction() bool { - item, quit := s.workQueue.Get() - if quit { - return true - } - defer s.workQueue.Done(item) - - service := item.(*v1.Service) - - if !wantsDNSRecords(service) { - return false - } - - ingress, err := ingress.ParseFederatedServiceIngress(service) - if err != nil { - runtime.HandleError(fmt.Errorf("Error in parsing lb ingress for service %s/%s: %v", service.Namespace, service.Name, err)) - return false - } - for _, clusterIngress := range ingress.Items { - err = s.ensureDNSRecords(clusterIngress.Cluster, service) - if err != nil { - runtime.HandleError(fmt.Errorf("Error when ensuring DNS records for service %s/%s: %v", service.Namespace, service.Name, err)) - s.deliverService(service, 0, true) - } - } - return false -} - -func (s *ServiceDNSController) worker() { - for { - if quit := s.workerFunction(); quit { - glog.Infof("service dns controller worker queue shutting down") - return - } - } -} - -func (s *ServiceDNSController) validateConfig() error { - if s.federationName == "" { - return fmt.Errorf("DNSController should not be run without federationName") - } - if s.zoneName == "" && s.zoneID == "" { - return fmt.Errorf("DNSController must be run with either zoneName or zoneID") - } - if s.serviceDNSSuffix == "" { - if s.zoneName == "" { - return fmt.Errorf("DNSController must be run with zoneName, if serviceDnsSuffix is not set") - } - s.serviceDNSSuffix = s.zoneName - } - if s.dns == nil { - return fmt.Errorf("DNSController should not be run without a dnsprovider") - } - zones, ok := s.dns.Zones() - if !ok { - return fmt.Errorf("the dns provider does not support zone enumeration, which is required for creating dns records") - } - s.dnsZones = zones - return nil -} - -func (s *ServiceDNSController) retrieveOrCreateDNSZone() error { - matchingZones, err := getDNSZones(s.zoneName, s.zoneID, s.dnsZones) - if err != nil { - return fmt.Errorf("error querying for DNS zones: %v", err) - } - switch len(matchingZones) { - case 0: // No matching zones for s.zoneName, so create one - if s.zoneName == "" { - return fmt.Errorf("DNSController must be run with zoneName to create zone automatically") - } - glog.Infof("DNS zone %q not found. Creating DNS zone %q.", s.zoneName, s.zoneName) - managedZone, err := s.dnsZones.New(s.zoneName) - if err != nil { - return err - } - zone, err := s.dnsZones.Add(managedZone) - if err != nil { - return err - } - glog.Infof("DNS zone %q successfully created. Note that DNS resolution will not work until you have registered this name with "+ - "a DNS registrar and they have changed the authoritative name servers for your domain to point to your DNS provider", zone.Name()) - case 1: // s.zoneName matches exactly one DNS zone - s.dnsZone = matchingZones[0] - default: // s.zoneName matches more than one DNS zone - return fmt.Errorf("Multiple matching DNS zones found for %q; please specify zoneID", s.zoneName) - } - return nil -} - -// getHealthyEndpoints returns the hostnames and/or IP addresses of healthy endpoints for the service, at a zone, region and global level (or an error) -func (s *ServiceDNSController) getHealthyEndpoints(clusterName string, service *v1.Service) (zoneEndpoints, regionEndpoints, globalEndpoints []string, err error) { - var ( - zoneNames []string - regionName string - ) - if zoneNames, regionName, err = s.getClusterZoneNames(clusterName); err != nil { - return nil, nil, nil, err - } - - // If federated service is deleted, return empty endpoints, so that DNS records are removed - if service.DeletionTimestamp != nil { - return zoneEndpoints, regionEndpoints, globalEndpoints, nil - } - - serviceIngress, err := ingress.ParseFederatedServiceIngress(service) - if err != nil { - return nil, nil, nil, err - } - - for _, lbClusterIngress := range serviceIngress.Items { - lbClusterName := lbClusterIngress.Cluster - lbZoneNames, lbRegionName, err := s.getClusterZoneNames(lbClusterName) - if err != nil { - return nil, nil, nil, err - } - for _, ingress := range lbClusterIngress.Items { - var address string - // We should get either an IP address or a hostname - use whichever one we get - if ingress.IP != "" { - address = ingress.IP - } else if ingress.Hostname != "" { - address = ingress.Hostname - } - if len(address) <= 0 { - return nil, nil, nil, fmt.Errorf("Service %s/%s in cluster %s has neither LoadBalancerStatus.ingress.ip nor LoadBalancerStatus.ingress.hostname. Cannot use it as endpoint for federated service", - service.Name, service.Namespace, clusterName) - } - for _, lbZoneName := range lbZoneNames { - for _, zoneName := range zoneNames { - if lbZoneName == zoneName { - zoneEndpoints = append(zoneEndpoints, address) - } - } - } - if lbRegionName == regionName { - regionEndpoints = append(regionEndpoints, address) - } - globalEndpoints = append(globalEndpoints, address) - } - } - return zoneEndpoints, regionEndpoints, globalEndpoints, nil -} - -// getClusterZoneNames returns the name of the zones (and the region) where the specified cluster exists (e.g. zones "us-east1-c" on GCE, or "us-east-1b" on AWS) -func (s *ServiceDNSController) getClusterZoneNames(clusterName string) ([]string, string, error) { - cluster, err := s.federationClient.Federation().Clusters().Get(clusterName, metav1.GetOptions{}) - if err != nil { - return nil, "", err - } - return cluster.Status.Zones, cluster.Status.Region, nil -} - -// getDNSZones returns the DNS zones matching dnsZoneName and dnsZoneID (if specified) -func getDNSZones(dnsZoneName string, dnsZoneID string, dnsZonesInterface dnsprovider.Zones) ([]dnsprovider.Zone, error) { - // TODO: We need query-by-name and query-by-id functions - dnsZones, err := dnsZonesInterface.List() - if err != nil { - return nil, err - } - - var matches []dnsprovider.Zone - findName := strings.TrimSuffix(dnsZoneName, ".") - for _, dnsZone := range dnsZones { - if dnsZoneID != "" { - if dnsZoneID != dnsZone.ID() { - continue - } - } - if findName != "" { - if strings.TrimSuffix(dnsZone.Name(), ".") != findName { - continue - } - } - matches = append(matches, dnsZone) - } - - return matches, nil -} - -// NOTE: that if the named resource record set does not exist, but no -// error occurred, the returned list will be empty, and the error will -// be nil -func getRrset(dnsName string, rrsetsInterface dnsprovider.ResourceRecordSets) ([]dnsprovider.ResourceRecordSet, error) { - return rrsetsInterface.Get(dnsName) -} - -func findRrset(list []dnsprovider.ResourceRecordSet, rrset dnsprovider.ResourceRecordSet) dnsprovider.ResourceRecordSet { - for i, elem := range list { - if dnsprovider.ResourceRecordSetsEquivalent(rrset, elem) { - return list[i] - } - } - return nil -} - -/* getResolvedEndpoints performs DNS resolution on the provided slice of endpoints (which might be DNS names or IPv4 addresses) - and returns a list of IPv4 addresses. If any of the endpoints are neither valid IPv4 addresses nor resolvable DNS names, - non-nil error is also returned (possibly along with a partially complete list of resolved endpoints. -*/ -func getResolvedEndpoints(endpoints []string) ([]string, error) { - resolvedEndpoints := sets.String{} - for _, endpoint := range endpoints { - if net.ParseIP(endpoint) == nil { - // It's not a valid IP address, so assume it's a DNS name, and try to resolve it, - // replacing its DNS name with its IP addresses in expandedEndpoints - ipAddrs, err := net.LookupHost(endpoint) - if err != nil { - return resolvedEndpoints.List(), err - } - for _, ip := range ipAddrs { - resolvedEndpoints = resolvedEndpoints.Union(sets.NewString(ip)) - } - } else { - resolvedEndpoints = resolvedEndpoints.Union(sets.NewString(endpoint)) - } - } - return resolvedEndpoints.List(), nil -} - -/* ensureDNSRrsets ensures (idempotently, and with minimum mutations) that all of the DNS resource record sets for dnsName are consistent with endpoints. - if endpoints is nil or empty, a CNAME record to uplevelCname is ensured. -*/ -func (s *ServiceDNSController) ensureDNSRrsets(dnsZone dnsprovider.Zone, dnsName string, endpoints []string, uplevelCname string) error { - rrsets, supported := dnsZone.ResourceRecordSets() - if !supported { - return fmt.Errorf("Failed to ensure DNS records for %s. DNS provider does not support the ResourceRecordSets interface", dnsName) - } - rrsetList, err := getRrset(dnsName, rrsets) // TODO: rrsets.Get(dnsName) - if err != nil { - return err - } - if len(rrsetList) == 0 { - glog.V(4).Infof("No recordsets found for DNS name %q. Need to add either A records (if we have healthy endpoints), or a CNAME record to %q", dnsName, uplevelCname) - if len(endpoints) < 1 { - glog.V(4).Infof("There are no healthy endpoint addresses at level %q, so CNAME to %q, if provided", dnsName, uplevelCname) - if uplevelCname != "" { - glog.V(4).Infof("Creating CNAME to %q for %q", uplevelCname, dnsName) - newRrset := rrsets.New(dnsName, []string{uplevelCname}, minDNSTTL, rrstype.CNAME) - glog.V(4).Infof("Adding recordset %v", newRrset) - err = rrsets.StartChangeset().Add(newRrset).Apply() - if err != nil { - return err - } - glog.V(4).Infof("Successfully created CNAME to %q for %q", uplevelCname, dnsName) - } else { - glog.V(4).Infof("We want no record for %q, and we have no record, so we're all good.", dnsName) - } - } else { - // We have valid endpoint addresses, so just add them as A records. - // But first resolve DNS names, as some cloud providers (like AWS) expose - // load balancers behind DNS names, not IP addresses. - glog.V(4).Infof("We have valid endpoint addresses %v at level %q, so add them as A records, after resolving DNS names", endpoints, dnsName) - resolvedEndpoints, err := getResolvedEndpoints(endpoints) - if err != nil { - return err // TODO: We could potentially add the ones we did get back, even if some of them failed to resolve. - } - newRrset := rrsets.New(dnsName, resolvedEndpoints, minDNSTTL, rrstype.A) - glog.V(4).Infof("Adding recordset %v", newRrset) - err = rrsets.StartChangeset().Add(newRrset).Apply() - if err != nil { - return err - } - glog.V(4).Infof("Successfully added recordset %v", newRrset) - } - } else { - // the rrsets already exists, so make it right. - glog.V(4).Infof("Recordset %v already exists. Ensuring that it is correct.", rrsetList) - if len(endpoints) < 1 { - // Need an appropriate CNAME record. Check that we have it. - newRrset := rrsets.New(dnsName, []string{uplevelCname}, minDNSTTL, rrstype.CNAME) - glog.V(4).Infof("No healthy endpoints for %s. Have recordsets %v. Need recordset %v", dnsName, rrsetList, newRrset) - found := findRrset(rrsetList, newRrset) - if found != nil { - // The existing rrset is equivalent to the required one - our work is done here - glog.V(4).Infof("Existing recordset %v is equivalent to needed recordset %v, our work is done here.", rrsetList, newRrset) - return nil - } else { - // Need to replace the existing one with a better one (or just remove it if we have no healthy endpoints). - glog.V(4).Infof("Existing recordset %v not equivalent to needed recordset %v removing existing and adding needed.", rrsetList, newRrset) - changeSet := rrsets.StartChangeset() - for i := range rrsetList { - changeSet = changeSet.Remove(rrsetList[i]) - } - if uplevelCname != "" { - changeSet = changeSet.Add(newRrset) - if err := changeSet.Apply(); err != nil { - return err - } - glog.V(4).Infof("Successfully replaced needed recordset %v -> %v", found, newRrset) - } else { - if err := changeSet.Apply(); err != nil { - return err - } - glog.V(4).Infof("Successfully removed existing recordset %v", found) - glog.V(4).Infof("Uplevel CNAME is empty string. Not adding recordset %v", newRrset) - } - } - } else { - // We have an rrset in DNS, possibly with some missing addresses and some unwanted addresses. - // And we have healthy endpoints. Just replace what's there with the healthy endpoints, if it's not already correct. - glog.V(4).Infof("%s: Healthy endpoints %v exist. Recordset %v exists. Reconciling.", dnsName, endpoints, rrsetList) - resolvedEndpoints, err := getResolvedEndpoints(endpoints) - if err != nil { // Some invalid addresses or otherwise unresolvable DNS names. - return err // TODO: We could potentially add the ones we did get back, even if some of them failed to resolve. - } - newRrset := rrsets.New(dnsName, resolvedEndpoints, minDNSTTL, rrstype.A) - glog.V(4).Infof("Have recordset %v. Need recordset %v", rrsetList, newRrset) - found := findRrset(rrsetList, newRrset) - if found != nil { - glog.V(4).Infof("Existing recordset %v is equivalent to needed recordset %v, our work is done here.", found, newRrset) - // TODO: We could be more thorough about checking for equivalence to avoid unnecessary updates, but in the - // worst case we'll just replace what's there with an equivalent, if not exactly identical record set. - return nil - } else { - // Need to replace the existing one with a better one - glog.V(4).Infof("Existing recordset %v is not equivalent to needed recordset %v, removing existing and adding needed.", found, newRrset) - changeSet := rrsets.StartChangeset() - for i := range rrsetList { - changeSet = changeSet.Remove(rrsetList[i]) - } - changeSet = changeSet.Add(newRrset) - if err = changeSet.Apply(); err != nil { - return err - } - glog.V(4).Infof("Successfully replaced recordset %v -> %v", found, newRrset) - } - } - } - return nil -} - -/* ensureDNSRecords ensures (idempotently, and with minimum mutations) that all of the DNS records for a service in a given cluster are correct, -given the current state of that service in that cluster. This should be called every time the state of a service might have changed -(either w.r.t. its loadbalancer address, or if the number of healthy backend endpoints for that service transitioned from zero to non-zero -(or vice versa). Only shards of the service which have both a loadbalancer ingress IP address or hostname AND at least one healthy backend endpoint -are included in DNS records for that service (at all of zone, region and global levels). All other addresses are removed. Also, if no shards exist -in the zone or region of the cluster, a CNAME reference to the next higher level is ensured to exist. */ -func (s *ServiceDNSController) ensureDNSRecords(clusterName string, service *v1.Service) error { - // Quinton: Pseudocode.... - // See https://github.com/kubernetes/kubernetes/pull/25107#issuecomment-218026648 - // For each service we need the following DNS names: - // mysvc.myns.myfed.svc.z1.r1.mydomain.com (for zone z1 in region r1) - // - an A record to IP address of specific shard in that zone (if that shard exists and has healthy endpoints) - // - OR a CNAME record to the next level up, i.e. mysvc.myns.myfed.svc.r1.mydomain.com (if a healthy shard does not exist in zone z1) - // mysvc.myns.myfed.svc.r1.mydomain.com - // - a set of A records to IP addresses of all healthy shards in region r1, if one or more of these exist - // - OR a CNAME record to the next level up, i.e. mysvc.myns.myfed.svc.mydomain.com (if no healthy shards exist in region r1) - // mysvc.myns.myfed.svc.mydomain.com - // - a set of A records to IP addresses of all healthy shards in all regions, if one or more of these exist. - // - no record (NXRECORD response) if no healthy shards exist in any regions - // - // Each service has the current known state of loadbalancer ingress for the federated cluster stored in annotations. - // So generate the DNS records based on the current state and ensure those desired DNS records match the - // actual DNS records (add new records, remove deleted records, and update changed records). - // - serviceName := service.Name - namespaceName := service.Namespace - zoneNames, regionName, err := s.getClusterZoneNames(clusterName) - if err != nil { - return err - } - if zoneNames == nil { - return fmt.Errorf("failed to get cluster zone names") - } - commonPrefix := serviceName + "." + namespaceName + "." + s.federationName + ".svc" - // dnsNames is the path up the DNS search tree, starting at the leaf - dnsNames := []string{ - strings.Join([]string{commonPrefix, zoneNames[0], regionName, s.serviceDNSSuffix}, "."), // zone level - TODO might need other zone names for multi-zone clusters - strings.Join([]string{commonPrefix, regionName, s.serviceDNSSuffix}, "."), // region level, one up from zone level - strings.Join([]string{commonPrefix, s.serviceDNSSuffix}, "."), // global level, one up from region level - "", // nowhere to go up from global level - } - - zoneEndpoints, regionEndpoints, globalEndpoints, err := s.getHealthyEndpoints(clusterName, service) - if err != nil { - return err - } - endpoints := [][]string{zoneEndpoints, regionEndpoints, globalEndpoints} - for i, endpoint := range endpoints { - if err = s.ensureDNSRrsets(s.dnsZone, dnsNames[i], endpoint, dnsNames[i+1]); err != nil { - return err - } - } - return nil -} diff --git a/federation/pkg/federation-controller/service/dns/dns_test.go b/federation/pkg/federation-controller/service/dns/dns_test.go deleted file mode 100644 index b30c23c7ef..0000000000 --- a/federation/pkg/federation-controller/service/dns/dns_test.go +++ /dev/null @@ -1,251 +0,0 @@ -/* -Copyright 2016 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 dns - -import ( - "fmt" - "sort" - "testing" - "time" - - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/kubernetes/federation/apis/federation/v1beta1" - fakefedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/fake" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns" // Only for unit testing purposes. - "k8s.io/kubernetes/federation/pkg/federation-controller/service/ingress" - . "k8s.io/kubernetes/federation/pkg/federation-controller/util/test" -) - -// NewClusterWithRegionZone builds a new cluster object with given region and zone attributes. -func NewClusterWithRegionZone(name string, readyStatus v1.ConditionStatus, region, zone string) *v1beta1.Cluster { - cluster := NewCluster(name, readyStatus) - cluster.Status.Zones = []string{zone} - cluster.Status.Region = region - return cluster -} - -func TestServiceController_ensureDnsRecords(t *testing.T) { - cluster1Name := "c1" - cluster2Name := "c2" - cluster1 := NewClusterWithRegionZone(cluster1Name, v1.ConditionTrue, "fooregion", "foozone") - cluster2 := NewClusterWithRegionZone(cluster2Name, v1.ConditionTrue, "barregion", "barzone") - globalDNSName := "servicename.servicenamespace.myfederation.svc.federation.example.com" - fooRegionDNSName := "servicename.servicenamespace.myfederation.svc.fooregion.federation.example.com" - fooZoneDNSName := "servicename.servicenamespace.myfederation.svc.foozone.fooregion.federation.example.com" - barRegionDNSName := "servicename.servicenamespace.myfederation.svc.barregion.federation.example.com" - barZoneDNSName := "servicename.servicenamespace.myfederation.svc.barzone.barregion.federation.example.com" - - tests := []struct { - name string - service v1.Service - expected sets.String - }{ - { - name: "ServiceWithSingleLBIngress", - service: v1.Service{ - ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{ - ingress.FederatedServiceIngressAnnotation: ingress.NewFederatedServiceIngress(). - AddEndpoints(cluster1Name, []string{"198.51.100.1"}). - AddEndpoints(cluster2Name, []string{}). - String()}, - }, - }, - expected: sets.NewString( - "example.com:"+globalDNSName+":A:180:[198.51.100.1]", - "example.com:"+fooRegionDNSName+":A:180:[198.51.100.1]", - "example.com:"+fooZoneDNSName+":A:180:[198.51.100.1]", - "example.com:"+barRegionDNSName+":CNAME:180:["+globalDNSName+"]", - "example.com:"+barZoneDNSName+":CNAME:180:["+barRegionDNSName+"]", - ), - }, - /* - TODO: getResolvedEndpoints preforms DNS lookup. - Mock and maybe look at error handling when some endpoints resolve, but also caching? - { - name: "withname", - service: v1.Service{ - ObjectMeta: metav1.ObjectMeta{}, - }, - expected: []string{ - "example.com:"+globalDNSName+":A:180:[198.51.100.1]", - "example.com:"+fooRegionDNSName+":A:180:[198.51.100.1]", - "example.com:"+fooZoneDNSName+":A:180:[198.51.100.1]", - }, - }, - */ - { - name: "ServiceWithNoLBIngress", - service: v1.Service{ - ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{ - ingress.FederatedServiceIngressAnnotation: ingress.NewFederatedServiceIngress(). - AddEndpoints(cluster1Name, []string{}). - AddEndpoints(cluster2Name, []string{}). - String()}, - }, - }, - expected: sets.NewString( - "example.com:"+fooRegionDNSName+":CNAME:180:["+globalDNSName+"]", - "example.com:"+fooZoneDNSName+":CNAME:180:["+fooRegionDNSName+"]", - "example.com:"+barRegionDNSName+":CNAME:180:["+globalDNSName+"]", - "example.com:"+barZoneDNSName+":CNAME:180:["+barRegionDNSName+"]", - ), - }, - { - name: "ServiceWithMultipleLBIngress", - service: v1.Service{ - ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{ - ingress.FederatedServiceIngressAnnotation: ingress.NewFederatedServiceIngress(). - AddEndpoints(cluster1Name, []string{"198.51.100.1"}). - AddEndpoints(cluster2Name, []string{"198.51.200.1"}). - String()}, - }, - }, - expected: sets.NewString( - "example.com:"+globalDNSName+":A:180:[198.51.100.1 198.51.200.1]", - "example.com:"+fooRegionDNSName+":A:180:[198.51.100.1]", - "example.com:"+fooZoneDNSName+":A:180:[198.51.100.1]", - "example.com:"+barRegionDNSName+":A:180:[198.51.200.1]", - "example.com:"+barZoneDNSName+":A:180:[198.51.200.1]", - ), - }, - { - name: "ServiceWithLBIngressAndServiceDeleted", - service: v1.Service{ - ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{ - ingress.FederatedServiceIngressAnnotation: ingress.NewFederatedServiceIngress(). - AddEndpoints(cluster1Name, []string{"198.51.100.1"}). - AddEndpoints(cluster2Name, []string{"198.51.200.1"}). - String()}, - DeletionTimestamp: &metav1.Time{Time: time.Now()}, - }, - }, - expected: sets.NewString( - // TODO: Ideally we should expect that there are no DNS records when federated service is deleted. Need to remove these leaks in future - "example.com:"+fooRegionDNSName+":CNAME:180:["+globalDNSName+"]", - "example.com:"+fooZoneDNSName+":CNAME:180:["+fooRegionDNSName+"]", - "example.com:"+barRegionDNSName+":CNAME:180:["+globalDNSName+"]", - "example.com:"+barZoneDNSName+":CNAME:180:["+barRegionDNSName+"]", - ), - }, - { - name: "ServiceWithMultipleLBIngressAndOneLBIngressGettingRemoved", - service: v1.Service{ - ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{ - ingress.FederatedServiceIngressAnnotation: ingress.NewFederatedServiceIngress(). - AddEndpoints(cluster1Name, []string{"198.51.100.1"}). - AddEndpoints(cluster2Name, []string{"198.51.200.1"}). - RemoveEndpoint(cluster2Name, "198.51.200.1"). - String()}, - }, - }, - expected: sets.NewString( - "example.com:"+globalDNSName+":A:180:[198.51.100.1]", - "example.com:"+fooRegionDNSName+":A:180:[198.51.100.1]", - "example.com:"+fooZoneDNSName+":A:180:[198.51.100.1]", - "example.com:"+barRegionDNSName+":CNAME:180:["+globalDNSName+"]", - "example.com:"+barZoneDNSName+":CNAME:180:["+barRegionDNSName+"]", - ), - }, - { - name: "ServiceWithMultipleLBIngressAndAllLBIngressGettingRemoved", - service: v1.Service{ - ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{ - ingress.FederatedServiceIngressAnnotation: ingress.NewFederatedServiceIngress(). - AddEndpoints(cluster1Name, []string{"198.51.100.1"}). - AddEndpoints(cluster2Name, []string{"198.51.200.1"}). - RemoveEndpoint(cluster1Name, "198.51.100.1"). - RemoveEndpoint(cluster2Name, "198.51.200.1"). - String()}, - }, - }, - expected: sets.NewString( - "example.com:"+fooRegionDNSName+":CNAME:180:["+globalDNSName+"]", - "example.com:"+fooZoneDNSName+":CNAME:180:["+fooRegionDNSName+"]", - "example.com:"+barRegionDNSName+":CNAME:180:["+globalDNSName+"]", - "example.com:"+barZoneDNSName+":CNAME:180:["+barRegionDNSName+"]", - ), - }, - } - for _, test := range tests { - fakedns, _ := clouddns.NewFakeInterface() - fakednsZones, ok := fakedns.Zones() - if !ok { - t.Error("Unable to fetch zones") - } - fakeClient := &fakefedclientset.Clientset{} - RegisterFakeClusterGet(&fakeClient.Fake, &v1beta1.ClusterList{Items: []v1beta1.Cluster{*cluster1, *cluster2}}) - d := ServiceDNSController{ - federationClient: fakeClient, - dns: fakedns, - dnsZones: fakednsZones, - serviceDNSSuffix: "federation.example.com", - zoneName: "example.com", - federationName: "myfederation", - } - - dnsZones, err := getDNSZones(d.zoneName, d.zoneID, d.dnsZones) - if err != nil { - t.Errorf("Test failed for %s, Get DNS Zones failed: %v", test.name, err) - } - d.dnsZone = dnsZones[0] - test.service.Name = "servicename" - test.service.Namespace = "servicenamespace" - - ingress, err := ingress.ParseFederatedServiceIngress(&test.service) - if err != nil { - t.Errorf("Error in parsing lb ingress for service %s/%s: %v", test.service.Namespace, test.service.Name, err) - return - } - for _, clusterIngress := range ingress.Items { - d.ensureDNSRecords(clusterIngress.Cluster, &test.service) - } - - zones, err := fakednsZones.List() - if err != nil { - t.Errorf("error querying zones: %v", err) - } - - // Dump every record to a testable-by-string-comparison form - records := sets.NewString() - for _, z := range zones { - zoneName := z.Name() - - rrs, ok := z.ResourceRecordSets() - if !ok { - t.Errorf("cannot get rrs for zone %q", zoneName) - } - - rrList, err := rrs.List() - if err != nil { - t.Errorf("error querying rr for zone %q: %v", zoneName, err) - } - for _, rr := range rrList { - rrdatas := rr.Rrdatas() - - // Put in consistent (testable-by-string-comparison) order - sort.Strings(rrdatas) - records.Insert(fmt.Sprintf("%s:%s:%s:%d:%s", zoneName, rr.Name(), rr.Type(), rr.Ttl(), rrdatas)) - } - } - - if !records.Equal(test.expected) { - t.Errorf("Test %q failed. Actual=%v, Expected=%v", test.name, records, test.expected) - } - } -} diff --git a/federation/pkg/federation-controller/service/ingress/BUILD b/federation/pkg/federation-controller/service/ingress/BUILD deleted file mode 100644 index a849819ed5..0000000000 --- a/federation/pkg/federation-controller/service/ingress/BUILD +++ /dev/null @@ -1,29 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["ingress.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/service/ingress", - deps = [ - "//federation/apis/federation:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/service/ingress/ingress.go b/federation/pkg/federation-controller/service/ingress/ingress.go deleted file mode 100644 index 776ccf78fe..0000000000 --- a/federation/pkg/federation-controller/service/ingress/ingress.go +++ /dev/null @@ -1,136 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package ingress - -import ( - "encoding/json" - "sort" - "strings" - - "k8s.io/api/core/v1" - fedapi "k8s.io/kubernetes/federation/apis/federation" -) - -// Compile time check for interface adherence -var _ sort.Interface = &FederatedServiceIngress{} - -const ( - FederatedServiceIngressAnnotation = "federation.kubernetes.io/service-ingresses" -) - -// FederatedServiceIngress implements sort.Interface. -type FederatedServiceIngress struct { - fedapi.FederatedServiceIngress -} - -func NewFederatedServiceIngress() *FederatedServiceIngress { - return &FederatedServiceIngress{} -} - -func (ingress *FederatedServiceIngress) String() string { - annotationBytes, _ := json.Marshal(ingress) - return string(annotationBytes[:]) -} - -// Len is to satisfy of sort.Interface. -func (ingress *FederatedServiceIngress) Len() int { - return len(ingress.Items) -} - -// Less is to satisfy of sort.Interface. -func (ingress *FederatedServiceIngress) Less(i, j int) bool { - return (strings.Compare(ingress.Items[i].Cluster, ingress.Items[j].Cluster) < 0) -} - -// Swap is to satisfy of sort.Interface. -func (ingress *FederatedServiceIngress) Swap(i, j int) { - ingress.Items[i].Cluster, ingress.Items[j].Cluster = ingress.Items[j].Cluster, ingress.Items[i].Cluster - ingress.Items[i].Items, ingress.Items[j].Items = ingress.Items[j].Items, ingress.Items[i].Items -} - -// GetClusterLoadBalancerIngresses returns loadbalancer ingresses for given cluster if exist otherwise returns an empty slice -func (ingress *FederatedServiceIngress) GetClusterLoadBalancerIngresses(cluster string) []v1.LoadBalancerIngress { - for _, clusterIngress := range ingress.Items { - if cluster == clusterIngress.Cluster { - return clusterIngress.Items - } - } - return []v1.LoadBalancerIngress{} -} - -// AddClusterLoadBalancerIngresses adds the ladbalancer ingresses for a given cluster to federated service ingress -func (ingress *FederatedServiceIngress) AddClusterLoadBalancerIngresses(cluster string, loadbalancerIngresses []v1.LoadBalancerIngress) { - for i, clusterIngress := range ingress.Items { - if cluster == clusterIngress.Cluster { - ingress.Items[i].Items = append(ingress.Items[i].Items, loadbalancerIngresses...) - return - } - } - clusterNewIngress := fedapi.ClusterServiceIngress{Cluster: cluster, Items: loadbalancerIngresses} - ingress.Items = append(ingress.Items, clusterNewIngress) - sort.Sort(ingress) -} - -// AddEndpoints add one or more endpoints to federated service ingress. -// endpoints are federated cluster's loadbalancer ip/hostname for the service -func (ingress *FederatedServiceIngress) AddEndpoints(cluster string, endpoints []string) *FederatedServiceIngress { - lbIngress := []v1.LoadBalancerIngress{} - for _, endpoint := range endpoints { - lbIngress = append(lbIngress, v1.LoadBalancerIngress{IP: endpoint}) - } - ingress.AddClusterLoadBalancerIngresses(cluster, lbIngress) - return ingress -} - -// RemoveEndpoint removes a single endpoint (ip/hostname) from the federated service ingress -func (ingress *FederatedServiceIngress) RemoveEndpoint(cluster string, endpoint string) *FederatedServiceIngress { - for i, clusterIngress := range ingress.Items { - if cluster == clusterIngress.Cluster { - for j, lbIngress := range clusterIngress.Items { - if lbIngress.IP == endpoint { - ingress.Items[i].Items = append(ingress.Items[i].Items[:j], ingress.Items[i].Items[j+1:]...) - } - } - } - } - return ingress -} - -// ParseFederatedServiceIngress extracts federated service ingresses from a federated service -func ParseFederatedServiceIngress(service *v1.Service) (*FederatedServiceIngress, error) { - ingress := FederatedServiceIngress{} - if service.Annotations == nil { - return &ingress, nil - } - federatedServiceIngressString, found := service.Annotations[FederatedServiceIngressAnnotation] - if !found { - return &ingress, nil - } - if err := json.Unmarshal([]byte(federatedServiceIngressString), &ingress); err != nil { - return &ingress, err - } - return &ingress, nil -} - -// UpdateIngressAnnotation updates the federated service with service ingress annotation -func UpdateIngressAnnotation(service *v1.Service, ingress *FederatedServiceIngress) *v1.Service { - if service.Annotations == nil { - service.Annotations = make(map[string]string) - } - service.Annotations[FederatedServiceIngressAnnotation] = ingress.String() - return service -} diff --git a/federation/pkg/federation-controller/service/servicecontroller.go b/federation/pkg/federation-controller/service/servicecontroller.go deleted file mode 100644 index 281cbae9db..0000000000 --- a/federation/pkg/federation-controller/service/servicecontroller.go +++ /dev/null @@ -1,727 +0,0 @@ -/* -Copyright 2016 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 service - -import ( - "fmt" - "reflect" - "sort" - "strings" - "time" - - "github.com/golang/glog" - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" - kubeclientset "k8s.io/client-go/kubernetes" - corelisters "k8s.io/client-go/listers/core/v1" - cache "k8s.io/client-go/tools/cache" - "k8s.io/client-go/tools/record" - "k8s.io/client-go/util/flowcontrol" - "k8s.io/client-go/util/workqueue" - fedapi "k8s.io/kubernetes/federation/apis/federation" - v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" - fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/federation/pkg/federation-controller/service/ingress" - fedutil "k8s.io/kubernetes/federation/pkg/federation-controller/util" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/clusterselector" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/deletionhelper" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/eventsink" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/controller" -) - -const ( - serviceSyncPeriod = 30 * time.Second - - UserAgentName = "federation-service-controller" - - reviewDelay = 10 * time.Second - updateTimeout = 30 * time.Second - allClustersKey = "ALL_CLUSTERS" - clusterAvailableDelay = time.Second * 20 - ControllerName = "services" -) - -var ( - RequiredResources = []schema.GroupVersionResource{v1.SchemeGroupVersion.WithResource("services")} -) - -type ServiceController struct { - federationClient fedclientset.Interface - // A store of services, populated by the serviceController - serviceStore corelisters.ServiceLister - // Watches changes to all services - serviceController cache.Controller - federatedInformer fedutil.FederatedInformer - eventBroadcaster record.EventBroadcaster - eventRecorder record.EventRecorder - // services that need to be synced - queue *workqueue.Type - - // For triggering all services reconciliation. This is used when - // a new cluster becomes available. - clusterDeliverer *fedutil.DelayingDeliverer - - deletionHelper *deletionhelper.DeletionHelper - - reviewDelay time.Duration - clusterAvailableDelay time.Duration - updateTimeout time.Duration - - endpointFederatedInformer fedutil.FederatedInformer - federatedUpdater fedutil.FederatedUpdater - objectDeliverer *fedutil.DelayingDeliverer - flowcontrolBackoff *flowcontrol.Backoff -} - -// New returns a new service controller to keep service objects between -// the federation and member clusters in sync. -func New(federationClient fedclientset.Interface) *ServiceController { - broadcaster := record.NewBroadcaster() - broadcaster.StartRecordingToSink(eventsink.NewFederatedEventSink(federationClient)) - recorder := broadcaster.NewRecorder(legacyscheme.Scheme, v1.EventSource{Component: UserAgentName}) - - s := &ServiceController{ - federationClient: federationClient, - eventBroadcaster: broadcaster, - eventRecorder: recorder, - queue: workqueue.New(), - reviewDelay: reviewDelay, - clusterAvailableDelay: clusterAvailableDelay, - updateTimeout: updateTimeout, - flowcontrolBackoff: flowcontrol.NewBackOff(5*time.Second, time.Minute), - } - s.objectDeliverer = fedutil.NewDelayingDeliverer() - s.clusterDeliverer = fedutil.NewDelayingDeliverer() - var serviceIndexer cache.Indexer - serviceIndexer, s.serviceController = cache.NewIndexerInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (pkgruntime.Object, error) { - return s.federationClient.Core().Services(metav1.NamespaceAll).List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - return s.federationClient.Core().Services(metav1.NamespaceAll).Watch(options) - }, - }, - &v1.Service{}, - serviceSyncPeriod, - fedutil.NewTriggerOnAllChanges(func(obj pkgruntime.Object) { - glog.V(5).Infof("Delivering notification from federation: %v", obj) - s.deliverObject(obj, 0, false) - }), - cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, - ) - s.serviceStore = corelisters.NewServiceLister(serviceIndexer) - - clusterLifecycle := fedutil.ClusterLifecycleHandlerFuncs{ - ClusterAvailable: func(cluster *v1beta1.Cluster) { - s.clusterDeliverer.DeliverAfter(allClustersKey, nil, clusterAvailableDelay) - }, - } - fedInformerFactory := func(cluster *v1beta1.Cluster, targetClient kubeclientset.Interface) (cache.Store, cache.Controller) { - return cache.NewInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (pkgruntime.Object, error) { - return targetClient.Core().Services(metav1.NamespaceAll).List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - return targetClient.Core().Services(metav1.NamespaceAll).Watch(options) - }, - }, - &v1.Service{}, - controller.NoResyncPeriodFunc(), - // Trigger reconciliation whenever something in federated cluster is changed. In most cases it - // would be just confirmation that some service operation succeeded. - fedutil.NewTriggerOnAllChanges( - func(obj pkgruntime.Object) { - glog.V(5).Infof("Delivering service notification from federated cluster %s: %v", cluster.Name, obj) - s.deliverObject(obj, s.reviewDelay, false) - }, - )) - } - - s.federatedInformer = fedutil.NewFederatedInformer(federationClient, fedInformerFactory, &clusterLifecycle) - - s.federatedUpdater = fedutil.NewFederatedUpdater(s.federatedInformer, "service", updateTimeout, s.eventRecorder, - func(client kubeclientset.Interface, obj pkgruntime.Object) error { - svc := obj.(*v1.Service) - _, err := client.Core().Services(svc.Namespace).Create(svc) - return err - }, - func(client kubeclientset.Interface, obj pkgruntime.Object) error { - svc := obj.(*v1.Service) - _, err := client.Core().Services(svc.Namespace).Update(svc) - return err - }, - func(client kubeclientset.Interface, obj pkgruntime.Object) error { - svc := obj.(*v1.Service) - orphanDependents := false - err := client.Core().Services(svc.Namespace).Delete(svc.Name, &metav1.DeleteOptions{OrphanDependents: &orphanDependents}) - return err - }) - - // Federated informers on endpoints in federated clusters. - // This will enable to check if service ingress endpoints in federated clusters are reachable - s.endpointFederatedInformer = fedutil.NewFederatedInformer( - federationClient, - func(cluster *v1beta1.Cluster, targetClient kubeclientset.Interface) ( - cache.Store, cache.Controller) { - return cache.NewInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (pkgruntime.Object, error) { - return targetClient.Core().Endpoints(metav1.NamespaceAll).List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - return targetClient.Core().Endpoints(metav1.NamespaceAll).Watch(options) - }, - }, - &v1.Endpoints{}, - controller.NoResyncPeriodFunc(), - fedutil.NewTriggerOnMetaAndFieldChanges( - "Subsets", - func(obj pkgruntime.Object) { - glog.V(5).Infof("Delivering endpoint notification from federated cluster %s :%v", cluster.Name, obj) - s.deliverObject(obj, s.reviewDelay, false) - }, - )) - }, - &fedutil.ClusterLifecycleHandlerFuncs{}, - ) - - s.deletionHelper = deletionhelper.NewDeletionHelper( - s.updateService, - // objNameFunc - func(obj pkgruntime.Object) string { - service := obj.(*v1.Service) - return fmt.Sprintf("%s/%s", service.Namespace, service.Name) - }, - s.federatedInformer, - s.federatedUpdater, - ) - - return s -} - -// Sends the given updated object to apiserver. -// Assumes that the given object is a service. -func (s *ServiceController) updateService(obj pkgruntime.Object) (pkgruntime.Object, error) { - service := obj.(*v1.Service) - return s.federationClient.Core().Services(service.Namespace).Update(service) -} - -// Run starts informers, delay deliverers and workers. Workers continuously watch for events which could -// be from federation or federated clusters and tries to reconcile the service objects from federation to -// federated clusters. -func (s *ServiceController) Run(workers int, stopCh <-chan struct{}) { - glog.Infof("Starting federation service controller") - - defer runtime.HandleCrash() - defer s.queue.ShutDown() - - s.federatedInformer.Start() - defer s.federatedInformer.Stop() - - s.endpointFederatedInformer.Start() - defer s.endpointFederatedInformer.Stop() - - s.objectDeliverer.StartWithHandler(func(item *fedutil.DelayingDelivererItem) { - s.queue.Add(item.Value.(string)) - }) - defer s.objectDeliverer.Stop() - - s.clusterDeliverer.StartWithHandler(func(_ *fedutil.DelayingDelivererItem) { - s.deliverServicesOnClusterChange() - }) - defer s.clusterDeliverer.Stop() - - fedutil.StartBackoffGC(s.flowcontrolBackoff, stopCh) - go s.serviceController.Run(stopCh) - - for i := 0; i < workers; i++ { - go wait.Until(s.fedServiceWorker, time.Second, stopCh) - } - - <-stopCh - glog.Infof("Shutting down federation service controller") -} - -type reconciliationStatus string - -const ( - statusAllOk = reconciliationStatus("ALL_OK") - statusRecoverableError = reconciliationStatus("RECOVERABLE_ERROR") - statusNonRecoverableError = reconciliationStatus("NON_RECOVERABLE_ERROR") - statusNotSynced = reconciliationStatus("NOSYNC") -) - -func (s *ServiceController) workerFunction() bool { - key, quit := s.queue.Get() - if quit { - return true - } - defer s.queue.Done(key) - - service := key.(string) - status := s.reconcileService(service) - switch status { - case statusAllOk: - // do nothing, reconcile is successful. - case statusNotSynced: - glog.V(5).Infof("Delivering notification for %q after clusterAvailableDelay", service) - s.deliverService(service, s.clusterAvailableDelay, false) - case statusRecoverableError: - s.deliverService(service, 0, true) - case statusNonRecoverableError: - // do nothing, error is already logged. - } - return false -} - -// fedServiceWorker runs a worker thread that just dequeues items, processes them, and marks them done. -func (s *ServiceController) fedServiceWorker() { - for { - if quit := s.workerFunction(); quit { - glog.Infof("service controller worker queue shutting down") - return - } - } -} - -// delete deletes the given service or returns error if the deletion was not complete. -func (s *ServiceController) delete(service *v1.Service) error { - glog.V(3).Infof("Handling deletion of service: %v", *service) - _, err := s.deletionHelper.HandleObjectInUnderlyingClusters(service) - if err != nil { - return err - } - - err = s.federationClient.Core().Services(service.Namespace).Delete(service.Name, nil) - if err != nil { - // Its all good if the error is not found error. That means it is deleted already and we do not have to do anything. - // This is expected when we are processing an update as a result of service finalizer deletion. - // The process that deleted the last finalizer is also going to delete the service and we do not have to do anything. - if !errors.IsNotFound(err) { - return fmt.Errorf("failed to delete service: %v", err) - } - } - return nil -} - -func (s *ServiceController) deliverServicesOnClusterChange() { - if !s.isSynced() { - s.clusterDeliverer.DeliverAfter(allClustersKey, nil, s.clusterAvailableDelay) - } - glog.V(5).Infof("Delivering all service as cluster status changed") - serviceList, err := s.serviceStore.List(labels.Everything()) - if err != nil { - runtime.HandleError(fmt.Errorf("error listing federated services: %v", err)) - s.clusterDeliverer.DeliverAfter(allClustersKey, nil, 0) - } - for _, service := range serviceList { - s.deliverObject(service, 0, false) - } -} - -func (s *ServiceController) deliverObject(object interface{}, delay time.Duration, failed bool) { - switch value := object.(type) { - case *v1.Service: - s.deliverService(types.NamespacedName{Namespace: value.Namespace, Name: value.Name}.String(), delay, failed) - case *v1.Endpoints: - s.deliverService(types.NamespacedName{Namespace: value.Namespace, Name: value.Name}.String(), delay, failed) - default: - glog.Warningf("Unknown object received: %v", object) - } -} - -// Adds backoff to delay if this delivery is related to some failure. Resets backoff if there was no failure. -func (s *ServiceController) deliverService(key string, delay time.Duration, failed bool) { - if failed { - s.flowcontrolBackoff.Next(key, time.Now()) - delay = delay + s.flowcontrolBackoff.Get(key) - } else { - s.flowcontrolBackoff.Reset(key) - } - s.objectDeliverer.DeliverAfter(key, key, delay) -} - -// Check whether all data stores are in sync. False is returned if any of the informer/stores is not yet synced with -// the corresponding api server. -func (s *ServiceController) isSynced() bool { - if !s.federatedInformer.ClustersSynced() { - glog.V(2).Infof("Cluster list not synced") - return false - } - serviceClusters, err := s.federatedInformer.GetReadyClusters() - if err != nil { - runtime.HandleError(fmt.Errorf("Failed to get ready clusters: %v", err)) - return false - } - if !s.federatedInformer.GetTargetStore().ClustersSynced(serviceClusters) { - return false - } - - if !s.endpointFederatedInformer.ClustersSynced() { - glog.V(2).Infof("Cluster list not synced") - return false - } - endpointClusters, err := s.endpointFederatedInformer.GetReadyClusters() - if err != nil { - runtime.HandleError(fmt.Errorf("Failed to get ready clusters: %v", err)) - return false - } - if !s.endpointFederatedInformer.GetTargetStore().ClustersSynced(endpointClusters) { - return false - } - - return true -} - -// reconcileService triggers reconciliation of a federated service with corresponding services in federated clusters. -// This function is called on service Addition/Deletion/Update either in federated cluster or in federation. -func (s *ServiceController) reconcileService(key string) reconciliationStatus { - if !s.isSynced() { - glog.V(4).Infof("Data store not synced, delaying reconcilation: %v", key) - return statusNotSynced - } - - namespace, name, err := cache.SplitMetaNamespaceKey(key) - if err != nil { - runtime.HandleError(fmt.Errorf("Invalid key %q received, unable to split key to namespace and name, err: %v", key, err)) - return statusNonRecoverableError - } - - service, err := s.serviceStore.Services(namespace).Get(name) - if errors.IsNotFound(err) { - // Not a federated service, ignoring. - return statusAllOk - } else if err != nil { - runtime.HandleError(fmt.Errorf("Failed to retrieve federated service %q from store: %v", key, err)) - return statusRecoverableError - } - - glog.V(3).Infof("Reconciling federated service: %s", key) - - // Create a copy before modifying the service to prevent race condition with other readers of service from store - fedService := service.DeepCopy() - - // Handle deletion of federated service - if fedService.DeletionTimestamp != nil { - if err := s.delete(fedService); err != nil { - runtime.HandleError(fmt.Errorf("Failed to delete %s: %v", key, err)) - s.eventRecorder.Eventf(fedService, api.EventTypeWarning, "DeleteFailed", "Deleting service failed: %v", err) - return statusRecoverableError - } - glog.V(3).Infof("Deleting federated service succeeded: %s", key) - s.eventRecorder.Eventf(fedService, api.EventTypeNormal, "DeleteSucceed", "Deleting service succeeded") - return statusAllOk - } - - // Add the required finalizers before creating a service in underlying clusters. This ensures that the - // dependent services in underlying clusters are deleted when the federated service is deleted. - updatedServiceObj, err := s.deletionHelper.EnsureFinalizers(fedService) - if err != nil { - runtime.HandleError(fmt.Errorf("Failed to ensure setting finalizer for service %s: %v", key, err)) - return statusRecoverableError - } - fedService = updatedServiceObj.(*v1.Service) - - // Synchronize the federated service in all underlying ready clusters. - clusters, err := s.federatedInformer.GetReadyClusters() - if err != nil { - runtime.HandleError(fmt.Errorf("Failed to get ready cluster list: %v", err)) - return statusRecoverableError - } - - newLBStatus := newLoadbalancerStatus() - newServiceIngress := ingress.NewFederatedServiceIngress() - operations := make([]fedutil.FederatedOperation, 0) - for _, cluster := range clusters { - // Aggregate all operations to perform on all federated clusters - operation, err := getOperationsToPerformOnCluster(s.federatedInformer, cluster, fedService, clusterselector.SendToCluster) - if err != nil { - return statusRecoverableError - } - if operation != nil { - operations = append(operations, *operation) - } - - // Aggregate LoadBalancerStatus from all services in federated clusters to update status in federated service - lbStatus, err := s.getServiceStatusInCluster(cluster, key) - if err != nil { - return statusRecoverableError - } - if len(lbStatus.Ingress) > 0 { - newLBStatus.Ingress = append(newLBStatus.Ingress, lbStatus.Ingress...) - - // Add/Update federated service ingress only if there are reachable endpoints backing the lb service - endpoints, err := s.getServiceEndpointsInCluster(cluster, key) - if err != nil { - return statusRecoverableError - } - // if there are no endpoints created for the service then the loadbalancer ingress - // is not reachable, so do not consider such loadbalancer ingresses for federated - // service ingresses - if len(endpoints) > 0 { - clusterIngress := fedapi.ClusterServiceIngress{ - Cluster: cluster.Name, - Items: lbStatus.Ingress, - } - newServiceIngress.Items = append(newServiceIngress.Items, clusterIngress) - } - } - } - - if len(operations) != 0 { - err = s.federatedUpdater.Update(operations) - if err != nil { - if !errors.IsAlreadyExists(err) { - runtime.HandleError(fmt.Errorf("Failed to execute updates for %s: %v", key, err)) - return statusRecoverableError - } - } - } - - // Update the federated service if there are any updates in clustered service (status/endpoints) - err = s.updateFederatedService(fedService, newLBStatus, newServiceIngress) - if err != nil { - return statusRecoverableError - } - - glog.V(5).Infof("Everything is in order in federated clusters for service %s", key) - return statusAllOk -} - -type clusterSelectorFunc func(map[string]string, map[string]string) (bool, error) - -// getOperationsToPerformOnCluster returns the operations to be performed so that clustered service is in sync with federated service -func getOperationsToPerformOnCluster(informer fedutil.FederatedInformer, cluster *v1beta1.Cluster, fedService *v1.Service, selector clusterSelectorFunc) (*fedutil.FederatedOperation, error) { - var operation *fedutil.FederatedOperation - var operationType fedutil.FederatedOperationType = "" - - key := types.NamespacedName{Namespace: fedService.Namespace, Name: fedService.Name}.String() - clusterServiceObj, found, err := informer.GetTargetStore().GetByKey(cluster.Name, key) - if err != nil { - runtime.HandleError(fmt.Errorf("Failed to get %s service from %s: %v", key, cluster.Name, err)) - return nil, err - } - - send, err := selector(cluster.Labels, fedService.ObjectMeta.Annotations) - if err != nil { - glog.Errorf("Error processing ClusterSelector cluster: %s for service map: %s error: %s", cluster.Name, key, err.Error()) - return nil, err - } else if !send { - glog.V(5).Infof("Skipping cluster: %s for service: %s reason: cluster selectors do not match: %-v %-v", cluster.Name, key, cluster.ObjectMeta.Labels, fedService.ObjectMeta.Annotations[v1beta1.FederationClusterSelectorAnnotation]) - } - - desiredService := &v1.Service{ - ObjectMeta: fedutil.DeepCopyRelevantObjectMeta(fedService.ObjectMeta), - Spec: *fedService.Spec.DeepCopy(), - } - switch { - case found && send: - clusterService, ok := clusterServiceObj.(*v1.Service) - if !ok { - runtime.HandleError(fmt.Errorf("Unexpected error for %q: %v", key, err)) - return nil, err - } - - // ClusterIP and NodePort are allocated to Service by cluster, so retain the same if any while updating - desiredService.Spec.ClusterIP = clusterService.Spec.ClusterIP - for _, cPort := range clusterService.Spec.Ports { - for i, fPort := range clusterService.Spec.Ports { - if fPort.Name == cPort.Name && fPort.Protocol == cPort.Protocol && fPort.Port == cPort.Port { - desiredService.Spec.Ports[i].NodePort = cPort.NodePort - } - } - } - - // Update existing service, if needed. - if !Equivalent(desiredService, clusterService) { - operationType = fedutil.OperationTypeUpdate - - glog.V(4).Infof("Service in underlying cluster %s does not match, Desired: %+v, Existing: %+v", cluster.Name, desiredService, clusterService) - - // ResourceVersion of cluster service can be different from federated service, - // so do not update ResourceVersion while updating cluster service - desiredService.ResourceVersion = clusterService.ResourceVersion - } else { - glog.V(5).Infof("Service in underlying cluster %s is up to date: %+v", cluster.Name, desiredService) - } - case found && !send: - operationType = fedutil.OperationTypeDelete - case !found && send: - operationType = fedutil.OperationTypeAdd - desiredService.ResourceVersion = "" - - glog.V(4).Infof("Creating service in underlying cluster %s: %+v", cluster.Name, desiredService) - } - - if len(operationType) > 0 { - operation = &fedutil.FederatedOperation{ - Type: operationType, - Obj: desiredService, - ClusterName: cluster.Name, - Key: key, - } - } - return operation, nil -} - -// getServiceStatusInCluster returns service status in federated cluster -func (s *ServiceController) getServiceStatusInCluster(cluster *v1beta1.Cluster, key string) (*v1.LoadBalancerStatus, error) { - lbStatus := &v1.LoadBalancerStatus{} - - clusterServiceObj, serviceFound, err := s.federatedInformer.GetTargetStore().GetByKey(cluster.Name, key) - if err != nil { - runtime.HandleError(fmt.Errorf("Failed to get %s service from %s: %v", key, cluster.Name, err)) - return lbStatus, err - } - if serviceFound { - clusterService, ok := clusterServiceObj.(*v1.Service) - if !ok { - err = fmt.Errorf("Unknown object received: %v", clusterServiceObj) - runtime.HandleError(err) - return lbStatus, err - } - lbStatus = &clusterService.Status.LoadBalancer - newLbStatus := &loadbalancerStatus{*lbStatus} - sort.Sort(newLbStatus) - } - return lbStatus, nil -} - -// getServiceEndpointsInCluster returns ready endpoints corresponding to service in federated cluster -func (s *ServiceController) getServiceEndpointsInCluster(cluster *v1beta1.Cluster, key string) ([]v1.EndpointAddress, error) { - addresses := []v1.EndpointAddress{} - - clusterEndpointsObj, endpointsFound, err := s.endpointFederatedInformer.GetTargetStore().GetByKey(cluster.Name, key) - if err != nil { - runtime.HandleError(fmt.Errorf("Failed to get %s endpoint from %s: %v", key, cluster.Name, err)) - return addresses, err - } - if endpointsFound { - clusterEndpoints, ok := clusterEndpointsObj.(*v1.Endpoints) - if !ok { - glog.Warningf("Unknown object received: %v", clusterEndpointsObj) - return addresses, fmt.Errorf("Unknown object received: %v", clusterEndpointsObj) - } - for _, subset := range clusterEndpoints.Subsets { - if len(subset.Addresses) > 0 { - addresses = append(addresses, subset.Addresses...) - } - } - } - return addresses, nil -} - -// updateFederatedService updates the federated service with aggregated lbStatus and serviceIngresses -// and also updates the dns records as needed -func (s *ServiceController) updateFederatedService(fedService *v1.Service, newLBStatus *loadbalancerStatus, newServiceIngress *ingress.FederatedServiceIngress) error { - key := types.NamespacedName{Namespace: fedService.Namespace, Name: fedService.Name}.String() - needUpdate := false - - // Sort the endpoints so that we can compare - sort.Sort(newLBStatus) - if !reflect.DeepEqual(fedService.Status.LoadBalancer.Ingress, newLBStatus.Ingress) { - fedService.Status.LoadBalancer.Ingress = newLBStatus.Ingress - glog.V(3).Infof("Federated service loadbalancer status updated for %s: %v", key, newLBStatus.Ingress) - needUpdate = true - } - - existingServiceIngress, err := ingress.ParseFederatedServiceIngress(fedService) - if err != nil { - runtime.HandleError(fmt.Errorf("Failed to parse endpoint annotations for service %s: %v", key, err)) - return err - } - - // TODO: We should have a reliable cluster health check(should consider quorum) to detect cluster is not - // reachable and remove dns records for them. Until a reliable cluster health check is available, below code is - // a workaround to not remove the existing dns records which were created before the cluster went offline. - unreadyClusters, err := s.federatedInformer.GetUnreadyClusters() - if err != nil { - runtime.HandleError(fmt.Errorf("Failed to get unready cluster list: %v", err)) - return err - } - for _, cluster := range unreadyClusters { - lbIngress := existingServiceIngress.GetClusterLoadBalancerIngresses(cluster.Name) - newServiceIngress.AddClusterLoadBalancerIngresses(cluster.Name, lbIngress) - glog.V(5).Infof("Cluster %s is Offline, Preserving previously available status for Service %s", cluster.Name, key) - } - - // Update federated service status and/or ingress annotations if changed - sort.Sort(newServiceIngress) - if !reflect.DeepEqual(existingServiceIngress.Items, newServiceIngress.Items) { - fedService = ingress.UpdateIngressAnnotation(fedService, newServiceIngress) - glog.V(3).Infof("Federated service loadbalancer ingress updated for %s: existing: %#v, desired: %#v", key, existingServiceIngress, newServiceIngress) - needUpdate = true - } - - if needUpdate { - var err error - fedService, err = s.federationClient.Core().Services(fedService.Namespace).UpdateStatus(fedService) - if err != nil { - runtime.HandleError(fmt.Errorf("Error updating the federation service object %s: %v", key, err)) - return err - } - } - - return nil -} - -// Equivalent Checks if cluster-independent, user provided data in two given services are equal. If in the future the -// services structure is expanded then any field that is not populated by the api server should be included here. -func Equivalent(s1, s2 *v1.Service) bool { - // TODO: should also check for all annotations except FederationServiceIngressAnnotation - return s1.Name == s2.Name && s1.Namespace == s2.Namespace && - (reflect.DeepEqual(s1.Labels, s2.Labels) || (len(s1.Labels) == 0 && len(s2.Labels) == 0)) && - reflect.DeepEqual(s1.Spec, s2.Spec) -} - -type loadbalancerStatus struct { - v1.LoadBalancerStatus -} - -func newLoadbalancerStatus() *loadbalancerStatus { - return &loadbalancerStatus{} -} - -func (lbs loadbalancerStatus) Len() int { - return len(lbs.Ingress) -} - -func (lbs loadbalancerStatus) Less(i, j int) bool { - ipComparison := strings.Compare(lbs.Ingress[i].IP, lbs.Ingress[j].IP) - hostnameComparison := strings.Compare(lbs.Ingress[i].Hostname, lbs.Ingress[j].Hostname) - if ipComparison < 0 || (ipComparison == 0 && hostnameComparison < 0) { - return true - } - return false -} - -func (lbs loadbalancerStatus) Swap(i, j int) { - lbs.Ingress[i].IP, lbs.Ingress[j].IP = lbs.Ingress[j].IP, lbs.Ingress[i].IP - lbs.Ingress[i].Hostname, lbs.Ingress[j].Hostname = lbs.Ingress[j].Hostname, lbs.Ingress[i].Hostname -} diff --git a/federation/pkg/federation-controller/service/servicecontroller_test.go b/federation/pkg/federation-controller/service/servicecontroller_test.go deleted file mode 100644 index a20a039469..0000000000 --- a/federation/pkg/federation-controller/service/servicecontroller_test.go +++ /dev/null @@ -1,383 +0,0 @@ -/* -Copyright 2016 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 service - -import ( - "fmt" - "reflect" - "strings" - "testing" - "time" - - "github.com/golang/glog" - "github.com/stretchr/testify/require" - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/wait" - kubeclientset "k8s.io/client-go/kubernetes" - fakekubeclientset "k8s.io/client-go/kubernetes/fake" - corelisters "k8s.io/client-go/listers/core/v1" - "k8s.io/client-go/tools/cache" - "k8s.io/kubernetes/federation/apis/federation/v1beta1" - fakefedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/fake" - "k8s.io/kubernetes/federation/pkg/federation-controller/service/ingress" - fedutil "k8s.io/kubernetes/federation/pkg/federation-controller/util" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/deletionhelper" - . "k8s.io/kubernetes/federation/pkg/federation-controller/util/test" -) - -const ( - retryInterval = 100 * time.Millisecond - - clusters string = "clusters" - services string = "services" - endpoints string = "endpoints" - - lbIngress1 = "10.20.30.40" - lbIngress2 = "10.20.30.50" - serviceEndpoint1 = "192.168.0.1" - serviceEndpoint2 = "192.168.1.1" -) - -var awfulError error = errors.NewGone("Something bad happened") - -func TestServiceController(t *testing.T) { - glog.Infof("Creating fake infrastructure") - fedClient := &fakefedclientset.Clientset{} - cluster1 := NewCluster("cluster1", v1.ConditionTrue) - cluster2 := NewCluster("cluster2", v1.ConditionTrue) - - RegisterFakeClusterGet(&fedClient.Fake, &v1beta1.ClusterList{Items: []v1beta1.Cluster{*cluster1, *cluster2}}) - RegisterFakeList(clusters, &fedClient.Fake, &v1beta1.ClusterList{Items: []v1beta1.Cluster{*cluster1, *cluster2}}) - fedclusterWatch := RegisterFakeWatch(clusters, &fedClient.Fake) - RegisterFakeList(services, &fedClient.Fake, &v1.ServiceList{Items: []v1.Service{}}) - fedServiceWatch := RegisterFakeWatch(services, &fedClient.Fake) - RegisterFakeOnCreate(clusters, &fedClient.Fake, fedclusterWatch) - RegisterFakeOnUpdate(clusters, &fedClient.Fake, fedclusterWatch) - RegisterFakeOnCreate(services, &fedClient.Fake, fedServiceWatch) - RegisterFakeOnUpdate(services, &fedClient.Fake, fedServiceWatch) - RegisterFakeOnDelete(services, &fedClient.Fake, fedServiceWatch, serviceObjectGetter) - - cluster1Client := &fakekubeclientset.Clientset{} - RegisterFakeList(services, &cluster1Client.Fake, &v1.ServiceList{Items: []v1.Service{}}) - c1ServiceWatch := RegisterFakeWatch(services, &cluster1Client.Fake) - RegisterFakeList(endpoints, &cluster1Client.Fake, &v1.EndpointsList{Items: []v1.Endpoints{}}) - c1EndpointWatch := RegisterFakeWatch(endpoints, &cluster1Client.Fake) - RegisterFakeOnCreate(services, &cluster1Client.Fake, c1ServiceWatch) - RegisterFakeOnUpdate(services, &cluster1Client.Fake, c1ServiceWatch) - RegisterFakeOnDelete(services, &cluster1Client.Fake, c1ServiceWatch, serviceObjectGetter) - RegisterFakeOnCreate(endpoints, &cluster1Client.Fake, c1EndpointWatch) - RegisterFakeOnUpdate(endpoints, &cluster1Client.Fake, c1EndpointWatch) - - cluster2Client := &fakekubeclientset.Clientset{} - RegisterFakeList(services, &cluster2Client.Fake, &v1.ServiceList{Items: []v1.Service{}}) - c2ServiceWatch := RegisterFakeWatch(services, &cluster2Client.Fake) - RegisterFakeList(endpoints, &cluster2Client.Fake, &v1.EndpointsList{Items: []v1.Endpoints{}}) - c2EndpointWatch := RegisterFakeWatch(endpoints, &cluster2Client.Fake) - RegisterFakeOnCreate(services, &cluster2Client.Fake, c2ServiceWatch) - RegisterFakeOnUpdate(services, &cluster2Client.Fake, c2ServiceWatch) - RegisterFakeOnDelete(services, &cluster2Client.Fake, c2ServiceWatch, serviceObjectGetter) - RegisterFakeOnCreate(endpoints, &cluster2Client.Fake, c2EndpointWatch) - RegisterFakeOnUpdate(endpoints, &cluster2Client.Fake, c2EndpointWatch) - - fedInformerClientFactory := func(cluster *v1beta1.Cluster) (kubeclientset.Interface, error) { - switch cluster.Name { - case cluster1.Name: - return cluster1Client, nil - case cluster2.Name: - return cluster2Client, nil - default: - return nil, fmt.Errorf("Unknown cluster: %v", cluster.Name) - } - } - - sc := New(fedClient) - ToFederatedInformerForTestOnly(sc.federatedInformer).SetClientFactory(fedInformerClientFactory) - ToFederatedInformerForTestOnly(sc.endpointFederatedInformer).SetClientFactory(fedInformerClientFactory) - sc.clusterAvailableDelay = 100 * time.Millisecond - sc.reviewDelay = 50 * time.Millisecond - sc.updateTimeout = 5 * time.Second - - stop := make(chan struct{}) - glog.Infof("Running Service Controller") - go sc.Run(5, stop) - - glog.Infof("Adding cluster 1") - fedclusterWatch.Add(cluster1) - - service := NewService("test-service-1", 80) - - glog.Infof("Adding federated service") - fedServiceWatch.Add(service) - key := types.NamespacedName{Namespace: service.Namespace, Name: service.Name}.String() - - glog.Infof("Test service was correctly created in cluster 1") - require.NoError(t, WaitForClusterService(t, sc.federatedInformer.GetTargetStore(), cluster1.Name, - key, service, wait.ForeverTestTimeout)) - - glog.Infof("Adding cluster 2") - fedclusterWatch.Add(cluster2) - - glog.Infof("Test service was correctly created in cluster 2") - require.NoError(t, WaitForClusterService(t, sc.federatedInformer.GetTargetStore(), cluster2.Name, - key, service, wait.ForeverTestTimeout)) - - glog.Infof("Test federation service is updated when cluster1 service status is updated") - service.Status = v1.ServiceStatus{ - LoadBalancer: v1.LoadBalancerStatus{ - Ingress: []v1.LoadBalancerIngress{ - {IP: lbIngress1}, - }}} - - desiredStatus := service.Status - desiredService := &v1.Service{Status: desiredStatus} - - c1ServiceWatch.Modify(service) - require.NoError(t, WaitForClusterService(t, sc.federatedInformer.GetTargetStore(), cluster1.Name, - key, service, wait.ForeverTestTimeout)) - require.NoError(t, WaitForFederatedServiceUpdate(t, sc.serviceStore, - key, desiredService, serviceStatusCompare, wait.ForeverTestTimeout)) - - glog.Infof("Test federation service is updated when cluster1 endpoint for the service is created") - desiredIngressAnnotation := ingress.NewFederatedServiceIngress(). - AddEndpoints("cluster1", []string{lbIngress1}). - String() - desiredService = &v1.Service{ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{ingress.FederatedServiceIngressAnnotation: desiredIngressAnnotation}}} - c1EndpointWatch.Add(NewEndpoint("test-service-1", serviceEndpoint1)) - require.NoError(t, WaitForFederatedServiceUpdate(t, sc.serviceStore, - key, desiredService, serviceIngressCompare, wait.ForeverTestTimeout)) - - glog.Infof("Test federation service is updated when cluster2 service status is updated") - service.Status = v1.ServiceStatus{ - LoadBalancer: v1.LoadBalancerStatus{ - Ingress: []v1.LoadBalancerIngress{ - {IP: lbIngress2}, - }}} - desiredStatus.LoadBalancer.Ingress = append(desiredStatus.LoadBalancer.Ingress, v1.LoadBalancerIngress{IP: lbIngress2}) - desiredService = &v1.Service{Status: desiredStatus} - - c2ServiceWatch.Modify(service) - require.NoError(t, WaitForClusterService(t, sc.federatedInformer.GetTargetStore(), cluster2.Name, - key, service, wait.ForeverTestTimeout)) - require.NoError(t, WaitForFederatedServiceUpdate(t, sc.serviceStore, - key, desiredService, serviceStatusCompare, wait.ForeverTestTimeout)) - - glog.Infof("Test federation service is updated when cluster2 endpoint for the service is created") - desiredIngressAnnotation = ingress.NewFederatedServiceIngress(). - AddEndpoints("cluster1", []string{lbIngress1}). - AddEndpoints("cluster2", []string{lbIngress2}). - String() - desiredService = &v1.Service{ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{ingress.FederatedServiceIngressAnnotation: desiredIngressAnnotation}}} - c2EndpointWatch.Add(NewEndpoint("test-service-1", serviceEndpoint2)) - require.NoError(t, WaitForFederatedServiceUpdate(t, sc.serviceStore, - key, desiredService, serviceIngressCompare, wait.ForeverTestTimeout)) - - glog.Infof("Test federation service is updated when cluster1 endpoint for the service is deleted") - desiredIngressAnnotation = ingress.NewFederatedServiceIngress(). - AddEndpoints("cluster2", []string{lbIngress2}). - String() - desiredService = &v1.Service{ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{ingress.FederatedServiceIngressAnnotation: desiredIngressAnnotation}}} - c1EndpointWatch.Delete(NewEndpoint("test-service-1", serviceEndpoint1)) - require.NoError(t, WaitForFederatedServiceUpdate(t, sc.serviceStore, - key, desiredService, serviceIngressCompare, wait.ForeverTestTimeout)) - - glog.Infof("Test modifying federated service by changing the port") - service.Spec.Ports[0].Port = 9090 - fedServiceWatch.Modify(service) - require.NoError(t, WaitForClusterService(t, sc.federatedInformer.GetTargetStore(), cluster1.Name, - key, service, wait.ForeverTestTimeout)) - - glog.Infof("Test cluster service is recreated when deleted") - c1Service := NewService("test-service-1", 80) - c1Service.DeletionTimestamp = &metav1.Time{Time: time.Now()} - c1ServiceWatch.Delete(c1Service) - require.NoError(t, WaitForClusterService(t, sc.federatedInformer.GetTargetStore(), cluster1.Name, - key, service, wait.ForeverTestTimeout)) - - glog.Infof("Test cluster services are deleted when federated service is deleted") - service.ObjectMeta.Finalizers = append(service.ObjectMeta.Finalizers, deletionhelper.FinalizerDeleteFromUnderlyingClusters) - service.DeletionTimestamp = &metav1.Time{Time: time.Now()} - fedServiceWatch.Modify(service) - require.NoError(t, WaitForClusterServiceDelete(t, sc.federatedInformer.GetTargetStore(), cluster1.Name, - key, wait.ForeverTestTimeout)) - require.NoError(t, WaitForClusterServiceDelete(t, sc.federatedInformer.GetTargetStore(), cluster2.Name, - key, wait.ForeverTestTimeout)) - - close(stop) -} - -func TestGetOperationsToPerformOnCluster(t *testing.T) { - obj := NewService("test-service-1", 80) - cluster1 := NewCluster("cluster1", v1.ConditionTrue) - fedClient := &fakefedclientset.Clientset{} - sc := New(fedClient) - - testCases := map[string]struct { - expectedSendErr bool - sendToCluster bool - operationType fedutil.FederatedOperationType - }{ - "sendToCluster error returned": { - expectedSendErr: true, - }, - "Missing object and not matching ClusterSelector should result in no operations": { - sendToCluster: false, - }, - "Missing object and matching ClusterSelector should result in add operation": { - operationType: fedutil.OperationTypeAdd, - sendToCluster: true, - }, - // Update and Delete scenarios are tested in TestServiceController - } - for testName, testCase := range testCases { - t.Run(testName, func(t *testing.T) { - - operations, err := getOperationsToPerformOnCluster(sc.federatedInformer, cluster1, obj, func(map[string]string, map[string]string) (bool, error) { - if testCase.expectedSendErr { - return false, awfulError - } - return testCase.sendToCluster, nil - }) - if testCase.expectedSendErr { - require.Error(t, err, "An error was expected") - } else { - require.NoError(t, err, "An error was not expected") - } - if len(testCase.operationType) == 0 { - require.Nil(t, operations, "An operation was not expected") - } else { - require.NotNil(t, operations, "A single operation was expected") - require.Equal(t, testCase.operationType, operations.Type, "Unexpected operation returned") - } - }) - } -} - -// serviceObjectGetter gives dummy service objects to use with RegisterFakeOnDelete -// This is just so that federated informer can be tested for delete scenarios. -func serviceObjectGetter(name, namespace string) runtime.Object { - service := new(v1.Service) - service.Namespace = namespace - service.Name = name - return service -} - -func NewService(name string, port int32) *v1.Service { - return &v1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: v1.NamespaceDefault, - SelfLink: "/api/v1/namespaces/default/services/" + name, - Labels: map[string]string{"app": name}, - }, - Spec: v1.ServiceSpec{ - Ports: []v1.ServicePort{{Port: port}}, - Type: v1.ServiceTypeLoadBalancer, - }, - } -} - -func NewEndpoint(name, ip string) *v1.Endpoints { - return &v1.Endpoints{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: v1.NamespaceDefault, - SelfLink: "/api/v1/namespaces/default/endpoints/" + name, - Labels: map[string]string{"app": name}, - }, - Subsets: []v1.EndpointSubset{{ - Addresses: []v1.EndpointAddress{{ - IP: ip, - }}}, - }, - } -} - -// WaitForClusterService waits for the cluster service to be created matching the desiredService. -func WaitForClusterService(t *testing.T, store fedutil.FederatedReadOnlyStore, clusterName, key string, desiredService *v1.Service, timeout time.Duration) error { - err := wait.PollImmediate(retryInterval, timeout, func() (bool, error) { - obj, found, err := store.GetByKey(clusterName, key) - if !found || err != nil { - return false, err - } - service := obj.(*v1.Service) - if !Equivalent(service, desiredService) { - glog.V(5).Infof("Waiting for clustered service, Desired: %v, Current: %v", desiredService, service) - return false, nil - } - glog.V(5).Infof("Clustered service is up to date: %v", service) - return true, nil - }) - return err -} - -// WaitForClusterServiceDelete waits for the cluster service to be deleted. -func WaitForClusterServiceDelete(t *testing.T, store fedutil.FederatedReadOnlyStore, clusterName, key string, timeout time.Duration) error { - err := wait.PollImmediate(retryInterval, timeout, func() (bool, error) { - _, found, _ := store.GetByKey(clusterName, key) - if !found { - return true, nil - } - return false, nil - }) - return err -} - -type serviceCompare func(current, desired *v1.Service) (match bool) - -func serviceStatusCompare(current, desired *v1.Service) bool { - if !reflect.DeepEqual(current.Status.LoadBalancer, desired.Status.LoadBalancer) { - glog.V(5).Infof("Waiting for loadbalancer status, Current: %v, Desired: %v", current.Status.LoadBalancer, desired.Status.LoadBalancer) - return false - } - glog.V(5).Infof("Loadbalancer status match: %v", current.Status.LoadBalancer) - return true -} - -func serviceIngressCompare(current, desired *v1.Service) bool { - if strings.Compare(current.Annotations[ingress.FederatedServiceIngressAnnotation], desired.Annotations[ingress.FederatedServiceIngressAnnotation]) != 0 { - glog.V(5).Infof("Waiting for loadbalancer ingress, Current: %v, Desired: %v", current.Annotations[ingress.FederatedServiceIngressAnnotation], desired.Annotations[ingress.FederatedServiceIngressAnnotation]) - return false - } - glog.V(5).Infof("Loadbalancer ingress match: %v", current.Annotations[ingress.FederatedServiceIngressAnnotation]) - return true -} - -// WaitForFederatedServiceUpdate waits for federated service updates to match the desiredService. -func WaitForFederatedServiceUpdate(t *testing.T, store corelisters.ServiceLister, key string, desiredService *v1.Service, match serviceCompare, timeout time.Duration) error { - err := wait.PollImmediate(retryInterval, timeout, func() (bool, error) { - namespace, name, err := cache.SplitMetaNamespaceKey(key) - if err != nil { - return false, err - } - service, err := store.Services(namespace).Get(name) - switch { - case errors.IsNotFound(err): - return false, nil - case err != nil: - return false, err - case !match(service, desiredService): - return false, nil - default: - return true, nil - } - }) - return err -} diff --git a/federation/pkg/federation-controller/sync/BUILD b/federation/pkg/federation-controller/sync/BUILD deleted file mode 100644 index f337860263..0000000000 --- a/federation/pkg/federation-controller/sync/BUILD +++ /dev/null @@ -1,69 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_test( - name = "go_default_test", - srcs = ["controller_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/sync", - library = ":go_default_library", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/pkg/federatedtypes:go_default_library", - "//federation/pkg/federation-controller/util:go_default_library", - "//federation/pkg/federation-controller/util/test:go_default_library", - "//vendor/github.com/stretchr/testify/require:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - ], -) - -go_library( - name = "go_default_library", - srcs = ["controller.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/sync", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//federation/pkg/federatedtypes:go_default_library", - "//federation/pkg/federation-controller/util:go_default_library", - "//federation/pkg/federation-controller/util/clusterselector:go_default_library", - "//federation/pkg/federation-controller/util/deletionhelper:go_default_library", - "//federation/pkg/federation-controller/util/eventsink:go_default_library", - "//pkg/api:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//pkg/controller:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors: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/util/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/k8s.io/client-go/tools/record:go_default_library", - "//vendor/k8s.io/client-go/util/flowcontrol:go_default_library", - "//vendor/k8s.io/client-go/util/workqueue:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/sync/controller.go b/federation/pkg/federation-controller/sync/controller.go deleted file mode 100644 index 00020f449e..0000000000 --- a/federation/pkg/federation-controller/sync/controller.go +++ /dev/null @@ -1,598 +0,0 @@ -/* -Copyright 2016 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 sync - -import ( - "fmt" - "time" - - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" - kubeclientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/tools/record" - "k8s.io/client-go/util/flowcontrol" - "k8s.io/client-go/util/workqueue" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/federation/pkg/federatedtypes" - "k8s.io/kubernetes/federation/pkg/federation-controller/util" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/clusterselector" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/deletionhelper" - "k8s.io/kubernetes/federation/pkg/federation-controller/util/eventsink" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/controller" - - "github.com/golang/glog" -) - -const ( - allClustersKey = "ALL_CLUSTERS" -) - -// FederationSyncController synchronizes the state of a federated type -// to clusters that are members of the federation. -type FederationSyncController struct { - // For triggering reconciliation of a single resource. This is - // used when there is an add/update/delete operation on a resource - // in either federated API server or in some member of the - // federation. - deliverer *util.DelayingDeliverer - - // For triggering reconciliation of all target resources. This is - // used when a new cluster becomes available. - clusterDeliverer *util.DelayingDeliverer - - // Contains resources present in members of federation. - informer util.FederatedInformer - // For updating members of federation. - updater util.FederatedUpdater - // Definitions of resources that should be federated. - store cache.Store - // Informer controller for resources that should be federated. - controller cache.Controller - - // Work queue allowing parallel processing of resources - workQueue workqueue.Interface - - // Backoff manager - backoff *flowcontrol.Backoff - - // For events - eventRecorder record.EventRecorder - - deletionHelper *deletionhelper.DeletionHelper - - reviewDelay time.Duration - clusterAvailableDelay time.Duration - clusterUnavailableDelay time.Duration - smallDelay time.Duration - updateTimeout time.Duration - - adapter federatedtypes.FederatedTypeAdapter -} - -// StartFederationSyncController starts a new sync controller for a type adapter -func StartFederationSyncController(kind string, adapterFactory federatedtypes.AdapterFactory, config *restclient.Config, stopChan <-chan struct{}, minimizeLatency bool, adapterSpecificArgs map[string]interface{}) { - restclient.AddUserAgent(config, fmt.Sprintf("federation-%s-controller", kind)) - client := federationclientset.NewForConfigOrDie(config) - adapter := adapterFactory(client, config, adapterSpecificArgs) - controller := newFederationSyncController(client, adapter) - if minimizeLatency { - controller.minimizeLatency() - } - glog.Infof(fmt.Sprintf("Starting federated sync controller for %s resources", kind)) - controller.Run(stopChan) -} - -// newFederationSyncController returns a new sync controller for the given client and type adapter -func newFederationSyncController(client federationclientset.Interface, adapter federatedtypes.FederatedTypeAdapter) *FederationSyncController { - broadcaster := record.NewBroadcaster() - broadcaster.StartRecordingToSink(eventsink.NewFederatedEventSink(client)) - recorder := broadcaster.NewRecorder(legacyscheme.Scheme, v1.EventSource{Component: fmt.Sprintf("federation-%v-controller", adapter.Kind())}) - - s := &FederationSyncController{ - reviewDelay: time.Second * 10, - clusterAvailableDelay: time.Second * 20, - clusterUnavailableDelay: time.Second * 60, - smallDelay: time.Second * 3, - updateTimeout: time.Second * 30, - workQueue: workqueue.New(), - backoff: flowcontrol.NewBackOff(5*time.Second, time.Minute), - eventRecorder: recorder, - adapter: adapter, - } - - // Build delivereres for triggering reconciliations. - s.deliverer = util.NewDelayingDeliverer() - s.clusterDeliverer = util.NewDelayingDeliverer() - - // Start informer in federated API servers on the resource type that should be federated. - s.store, s.controller = cache.NewInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (pkgruntime.Object, error) { - return adapter.FedList(metav1.NamespaceAll, options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - return adapter.FedWatch(metav1.NamespaceAll, options) - }, - }, - adapter.ObjectType(), - controller.NoResyncPeriodFunc(), - util.NewTriggerOnAllChanges(func(obj pkgruntime.Object) { s.deliverObj(obj, 0, false) })) - - // Federated informer on the resource type in members of federation. - s.informer = util.NewFederatedInformer( - client, - func(cluster *federationapi.Cluster, targetClient kubeclientset.Interface) (cache.Store, cache.Controller) { - return cache.NewInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (pkgruntime.Object, error) { - return adapter.ClusterList(targetClient, metav1.NamespaceAll, options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - return adapter.ClusterWatch(targetClient, metav1.NamespaceAll, options) - }, - }, - adapter.ObjectType(), - controller.NoResyncPeriodFunc(), - // Trigger reconciliation whenever something in federated cluster is changed. In most cases it - // would be just confirmation that some operation on the target resource type had succeeded. - util.NewTriggerOnAllChanges( - func(obj pkgruntime.Object) { - s.deliverObj(obj, s.reviewDelay, false) - }, - )) - }, - - &util.ClusterLifecycleHandlerFuncs{ - ClusterAvailable: func(cluster *federationapi.Cluster) { - // When new cluster becomes available process all the target resources again. - s.clusterDeliverer.DeliverAt(allClustersKey, nil, time.Now().Add(s.clusterAvailableDelay)) - }, - // When a cluster becomes unavailable process all the target resources again. - ClusterUnavailable: func(cluster *federationapi.Cluster, _ []interface{}) { - s.clusterDeliverer.DeliverAt(allClustersKey, nil, time.Now().Add(s.clusterUnavailableDelay)) - }, - }, - ) - - // Federated updeater along with Create/Update/Delete operations. - s.updater = util.NewFederatedUpdater(s.informer, adapter.Kind(), s.updateTimeout, s.eventRecorder, - func(client kubeclientset.Interface, obj pkgruntime.Object) error { - _, err := adapter.ClusterCreate(client, obj) - return err - }, - func(client kubeclientset.Interface, obj pkgruntime.Object) error { - _, err := adapter.ClusterUpdate(client, obj) - return err - }, - func(client kubeclientset.Interface, obj pkgruntime.Object) error { - qualifiedName := adapter.QualifiedName(obj) - orphanDependents := false - err := adapter.ClusterDelete(client, qualifiedName, &metav1.DeleteOptions{OrphanDependents: &orphanDependents}) - return err - }) - - s.deletionHelper = deletionhelper.NewDeletionHelper( - s.updateObject, - // objNameFunc - func(obj pkgruntime.Object) string { - return adapter.QualifiedName(obj).String() - }, - s.informer, - s.updater, - ) - - return s -} - -// minimizeLatency reduces delays and timeouts to make the controller more responsive (useful for testing). -func (s *FederationSyncController) minimizeLatency() { - s.clusterAvailableDelay = time.Second - s.clusterUnavailableDelay = time.Second - s.reviewDelay = 50 * time.Millisecond - s.smallDelay = 20 * time.Millisecond - s.updateTimeout = 5 * time.Second -} - -// Sends the given updated object to apiserver. -func (s *FederationSyncController) updateObject(obj pkgruntime.Object) (pkgruntime.Object, error) { - return s.adapter.FedUpdate(obj) -} - -func (s *FederationSyncController) Run(stopChan <-chan struct{}) { - go s.controller.Run(stopChan) - s.informer.Start() - s.deliverer.StartWithHandler(func(item *util.DelayingDelivererItem) { - s.workQueue.Add(item) - }) - s.clusterDeliverer.StartWithHandler(func(_ *util.DelayingDelivererItem) { - s.reconcileOnClusterChange() - }) - - // TODO: Allow multiple workers. - go wait.Until(s.worker, time.Second, stopChan) - - util.StartBackoffGC(s.backoff, stopChan) - - // Ensure all goroutines are cleaned up when the stop channel closes - go func() { - <-stopChan - s.informer.Stop() - s.workQueue.ShutDown() - s.deliverer.Stop() - s.clusterDeliverer.Stop() - }() -} - -type reconciliationStatus int - -const ( - statusAllOK reconciliationStatus = iota - statusNeedsRecheck - statusError - statusNotSynced -) - -func (s *FederationSyncController) worker() { - for { - obj, quit := s.workQueue.Get() - if quit { - return - } - - item := obj.(*util.DelayingDelivererItem) - qualifiedName := item.Value.(*federatedtypes.QualifiedName) - status := s.reconcile(*qualifiedName) - s.workQueue.Done(item) - - switch status { - case statusAllOK: - break - case statusError: - s.deliver(*qualifiedName, 0, true) - case statusNeedsRecheck: - s.deliver(*qualifiedName, s.reviewDelay, false) - case statusNotSynced: - s.deliver(*qualifiedName, s.clusterAvailableDelay, false) - } - } -} - -func (s *FederationSyncController) deliverObj(obj pkgruntime.Object, delay time.Duration, failed bool) { - qualifiedName := s.adapter.QualifiedName(obj) - s.deliver(qualifiedName, delay, failed) -} - -// Adds backoff to delay if this delivery is related to some failure. Resets backoff if there was no failure. -func (s *FederationSyncController) deliver(qualifiedName federatedtypes.QualifiedName, delay time.Duration, failed bool) { - key := qualifiedName.String() - if failed { - s.backoff.Next(key, time.Now()) - delay = delay + s.backoff.Get(key) - } else { - s.backoff.Reset(key) - } - s.deliverer.DeliverAfter(key, &qualifiedName, delay) -} - -// Check whether all data stores are in sync. False is returned if any of the informer/stores is not yet -// synced with the corresponding api server. -func (s *FederationSyncController) isSynced() bool { - if !s.informer.ClustersSynced() { - glog.V(2).Infof("Cluster list not synced") - return false - } - clusters, err := s.informer.GetReadyClusters() - if err != nil { - runtime.HandleError(fmt.Errorf("Failed to get ready clusters: %v", err)) - return false - } - if !s.informer.GetTargetStore().ClustersSynced(clusters) { - return false - } - return true -} - -// The function triggers reconciliation of all target federated resources. -func (s *FederationSyncController) reconcileOnClusterChange() { - if !s.isSynced() { - s.clusterDeliverer.DeliverAt(allClustersKey, nil, time.Now().Add(s.clusterAvailableDelay)) - } - for _, obj := range s.store.List() { - qualifiedName := s.adapter.QualifiedName(obj.(pkgruntime.Object)) - s.deliver(qualifiedName, s.smallDelay, false) - } -} - -func (s *FederationSyncController) reconcile(qualifiedName federatedtypes.QualifiedName) reconciliationStatus { - if !s.isSynced() { - return statusNotSynced - } - - kind := s.adapter.Kind() - key := qualifiedName.String() - - glog.V(4).Infof("Starting to reconcile %v %v", kind, key) - startTime := time.Now() - defer glog.V(4).Infof("Finished reconciling %v %v (duration: %v)", kind, key, time.Now().Sub(startTime)) - - obj, err := s.objFromCache(kind, key) - if err != nil { - return statusError - } - if obj == nil { - return statusAllOK - } - - meta := s.adapter.ObjectMeta(obj) - if meta.DeletionTimestamp != nil { - err := s.delete(obj, kind, qualifiedName) - if err != nil { - msg := "Failed to delete %s %q: %v" - args := []interface{}{kind, qualifiedName, err} - runtime.HandleError(fmt.Errorf(msg, args...)) - s.eventRecorder.Eventf(obj, api.EventTypeWarning, "DeleteFailed", msg, args...) - return statusError - } - return statusAllOK - } - - glog.V(3).Infof("Ensuring finalizers exist on %s %q", kind, key) - obj, err = s.deletionHelper.EnsureFinalizers(obj) - if err != nil { - runtime.HandleError(fmt.Errorf("Failed to ensure finalizers for %s %q: %v", kind, key, err)) - return statusError - } - - operationsAccessor := func(adapter federatedtypes.FederatedTypeAdapter, selectedClusters []*federationapi.Cluster, unselectedClusters []*federationapi.Cluster, obj pkgruntime.Object, schedulingInfo interface{}) ([]util.FederatedOperation, error) { - operations, err := clusterOperations(adapter, selectedClusters, unselectedClusters, obj, key, schedulingInfo, func(clusterName string) (interface{}, bool, error) { - return s.informer.GetTargetStore().GetByKey(clusterName, key) - }) - if err != nil { - s.eventRecorder.Eventf(obj, api.EventTypeWarning, "FedClusterOperationsError", "Error obtaining sync operations for %s: %s error: %s", kind, key, err.Error()) - } - return operations, err - } - - return syncToClusters( - s.informer.GetReadyClusters, - operationsAccessor, - selectedClusters, - s.updater.Update, - s.adapter, - s.informer, - obj, - ) -} - -func (s *FederationSyncController) objFromCache(kind, key string) (pkgruntime.Object, error) { - cachedObj, exist, err := s.store.GetByKey(key) - if err != nil { - wrappedErr := fmt.Errorf("Failed to query %s store for %q: %v", kind, key, err) - runtime.HandleError(wrappedErr) - return nil, err - } - if !exist { - return nil, nil - } - return cachedObj.(pkgruntime.Object).DeepCopyObject(), nil -} - -// delete deletes the given resource or returns error if the deletion was not complete. -func (s *FederationSyncController) delete(obj pkgruntime.Object, kind string, qualifiedName federatedtypes.QualifiedName) error { - glog.V(3).Infof("Handling deletion of %s %q", kind, qualifiedName) - - // Perform pre-deletion cleanup for the namespace adapter - namespaceAdapter, ok := s.adapter.(*federatedtypes.NamespaceAdapter) - if ok { - var err error - obj, err = namespaceAdapter.CleanUpNamespace(obj, s.eventRecorder) - if err != nil { - return err - } - } - - _, err := s.deletionHelper.HandleObjectInUnderlyingClusters(obj) - if err != nil { - return err - } - - err = s.adapter.FedDelete(qualifiedName, nil) - if err != nil { - // Its all good if the error is not found error. That means it is deleted already and we do not have to do anything. - // This is expected when we are processing an update as a result of finalizer deletion. - // The process that deleted the last finalizer is also going to delete the resource and we do not have to do anything. - if !errors.IsNotFound(err) { - return err - } - } - return nil -} - -type clustersAccessorFunc func() ([]*federationapi.Cluster, error) -type operationsFunc func(federatedtypes.FederatedTypeAdapter, []*federationapi.Cluster, []*federationapi.Cluster, pkgruntime.Object, interface{}) ([]util.FederatedOperation, error) -type clusterSelectorFunc func(*metav1.ObjectMeta, func(map[string]string, map[string]string) (bool, error), []*federationapi.Cluster) ([]*federationapi.Cluster, []*federationapi.Cluster, error) -type executionFunc func([]util.FederatedOperation) error - -// syncToClusters ensures that the state of the given object is synchronized to member clusters. -func syncToClusters(clustersAccessor clustersAccessorFunc, operationsAccessor operationsFunc, selector clusterSelectorFunc, execute executionFunc, adapter federatedtypes.FederatedTypeAdapter, informer util.FederatedInformer, obj pkgruntime.Object) reconciliationStatus { - kind := adapter.Kind() - key := federatedtypes.ObjectKey(adapter, obj) - - glog.V(3).Infof("Syncing %s %q in underlying clusters", kind, key) - - clusters, err := clustersAccessor() - if err != nil { - runtime.HandleError(fmt.Errorf("Failed to get cluster list: %v", err)) - return statusNotSynced - } - - selectedClusters, unselectedClusters, err := selector(adapter.ObjectMeta(obj), clusterselector.SendToCluster, clusters) - if err != nil { - return statusError - } - - var schedulingInfo interface{} - if adapter.IsSchedulingAdapter() { - schedulingAdapter, ok := adapter.(federatedtypes.SchedulingAdapter) - if !ok { - glog.Fatalf("Adapter for kind %q does not properly implement SchedulingAdapter.", kind) - } - schedulingInfo, err = schedulingAdapter.GetSchedule(obj, key, selectedClusters, informer) - if err != nil { - runtime.HandleError(fmt.Errorf("adapter.GetSchedule() failed on adapter for %s %q: %v", kind, key, err)) - return statusError - } - } - - operations, err := operationsAccessor(adapter, selectedClusters, unselectedClusters, obj, schedulingInfo) - if err != nil { - return statusError - } - - if adapter.IsSchedulingAdapter() { - schedulingAdapter, ok := adapter.(federatedtypes.SchedulingAdapter) - if !ok { - glog.Fatalf("Adapter for kind %q does not properly implement SchedulingAdapter.", kind) - } - err = schedulingAdapter.UpdateFederatedStatus(obj, schedulingInfo) - if err != nil { - runtime.HandleError(fmt.Errorf("adapter.UpdateFinished() failed on adapter for %s %q: %v", kind, key, err)) - return statusError - } - } - - if len(operations) == 0 { - return statusAllOK - } - - err = execute(operations) - if err != nil { - runtime.HandleError(fmt.Errorf("Failed to execute updates for %s %q: %v", kind, key, err)) - return statusError - } - - // Everything is in order but let's be double sure - return statusNeedsRecheck -} - -// selectedClusters filters the provided clusters into two slices, one containing the clusters selected by selector and the other containing the rest of the provided clusters. -func selectedClusters(objMeta *metav1.ObjectMeta, selector func(map[string]string, map[string]string) (bool, error), clusters []*federationapi.Cluster) ([]*federationapi.Cluster, []*federationapi.Cluster, error) { - selectedClusters := []*federationapi.Cluster{} - unselectedClusters := []*federationapi.Cluster{} - - for _, cluster := range clusters { - send, err := selector(cluster.Labels, objMeta.Annotations) - if err != nil { - return nil, nil, err - } else if !send { - unselectedClusters = append(unselectedClusters, cluster) - } else { - selectedClusters = append(selectedClusters, cluster) - } - } - return selectedClusters, unselectedClusters, nil -} - -type clusterObjectAccessorFunc func(clusterName string) (interface{}, bool, error) - -// clusterOperations returns the list of operations needed to synchronize the state of the given object to the provided clusters -func clusterOperations(adapter federatedtypes.FederatedTypeAdapter, selectedClusters []*federationapi.Cluster, unselectedClusters []*federationapi.Cluster, obj pkgruntime.Object, key string, schedulingInfo interface{}, accessor clusterObjectAccessorFunc) ([]util.FederatedOperation, error) { - operations := make([]util.FederatedOperation, 0) - - kind := adapter.Kind() - for _, cluster := range selectedClusters { - // The data should not be modified. - desiredObj := adapter.Copy(obj) - - clusterObj, found, err := accessor(cluster.Name) - if err != nil { - wrappedErr := fmt.Errorf("Failed to get %s %q from cluster %q: %v", kind, key, cluster.Name, err) - runtime.HandleError(wrappedErr) - return nil, wrappedErr - } - - var scheduleAction federatedtypes.ScheduleAction = federatedtypes.ActionAdd - if adapter.IsSchedulingAdapter() { - schedulingAdapter, ok := adapter.(federatedtypes.SchedulingAdapter) - if !ok { - err = fmt.Errorf("adapter for kind %s does not properly implement SchedulingAdapter.", kind) - glog.Fatalf("Error: %v", err) - } - var clusterTypedObj pkgruntime.Object = nil - if clusterObj != nil { - clusterTypedObj = clusterObj.(pkgruntime.Object) - } - desiredObj, scheduleAction, err = schedulingAdapter.ScheduleObject(cluster, clusterTypedObj, desiredObj, schedulingInfo) - if err != nil { - runtime.HandleError(err) - return nil, err - } - } - - var operationType util.FederatedOperationType = "" - if found { - if scheduleAction == federatedtypes.ActionDelete { - operationType = util.OperationTypeDelete - } else { - clusterObj := clusterObj.(pkgruntime.Object) - if !adapter.Equivalent(desiredObj, clusterObj) { - operationType = util.OperationTypeUpdate - } - } - } else if scheduleAction == federatedtypes.ActionAdd { - operationType = util.OperationTypeAdd - } - - if len(operationType) > 0 { - operations = append(operations, util.FederatedOperation{ - Type: operationType, - Obj: desiredObj, - ClusterName: cluster.Name, - Key: key, - }) - } - } - - for _, cluster := range unselectedClusters { - clusterObj, found, err := accessor(cluster.Name) - if err != nil { - wrappedErr := fmt.Errorf("Failed to get %s %q from cluster %q: %v", kind, key, cluster.Name, err) - runtime.HandleError(wrappedErr) - return nil, wrappedErr - } - if found { - operations = append(operations, util.FederatedOperation{ - Type: util.OperationTypeDelete, - Obj: clusterObj.(pkgruntime.Object), - ClusterName: cluster.Name, - Key: key, - }) - } - } - - return operations, nil -} diff --git a/federation/pkg/federation-controller/sync/controller_test.go b/federation/pkg/federation-controller/sync/controller_test.go deleted file mode 100644 index dd5c7bf8f1..0000000000 --- a/federation/pkg/federation-controller/sync/controller_test.go +++ /dev/null @@ -1,231 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sync - -import ( - "errors" - "testing" - - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - "k8s.io/kubernetes/federation/pkg/federatedtypes" - "k8s.io/kubernetes/federation/pkg/federation-controller/util" - fedtest "k8s.io/kubernetes/federation/pkg/federation-controller/util/test" - - "github.com/stretchr/testify/require" -) - -var awfulError error = errors.New("Something bad happened") - -func TestSyncToClusters(t *testing.T) { - adapter := &federatedtypes.SecretAdapter{} - obj := adapter.NewTestObject("foo") - - testCases := map[string]struct { - clusterError bool - operationsError bool - executionError bool - operations []util.FederatedOperation - status reconciliationStatus - }{ - "Error listing clusters redelivers with cluster delay": { - clusterError: true, - status: statusNotSynced, - }, - "Error retrieving cluster operations redelivers": { - operationsError: true, - status: statusError, - }, - "No operations returns ok": { - status: statusAllOK, - }, - "Execution error redelivers": { - executionError: true, - operations: []util.FederatedOperation{{}}, - status: statusError, - }, - "Successful update indicates recheck": { - operations: []util.FederatedOperation{{}}, - status: statusNeedsRecheck, - }, - } - - for testName, testCase := range testCases { - t.Run(testName, func(t *testing.T) { - status := syncToClusters( - func() ([]*federationapi.Cluster, error) { - if testCase.clusterError { - return nil, awfulError - } - return nil, nil - }, - func(federatedtypes.FederatedTypeAdapter, []*federationapi.Cluster, []*federationapi.Cluster, pkgruntime.Object, interface{}) ([]util.FederatedOperation, error) { - if testCase.operationsError { - return nil, awfulError - } - return testCase.operations, nil - }, - func(objMeta *metav1.ObjectMeta, selector func(map[string]string, map[string]string) (bool, error), clusters []*federationapi.Cluster) ([]*federationapi.Cluster, []*federationapi.Cluster, error) { - return clusters, []*federationapi.Cluster{}, nil - }, - func([]util.FederatedOperation) error { - if testCase.executionError { - return awfulError - } - return nil - }, - adapter, - nil, - obj, - ) - require.Equal(t, testCase.status, status, "Unexpected status!") - }) - } -} - -func TestSelectedClusters(t *testing.T) { - clusterOne := fedtest.NewCluster("cluster1", apiv1.ConditionTrue) - clusterOne.Labels = map[string]string{"name": "cluster1"} - clusterTwo := fedtest.NewCluster("cluster2", apiv1.ConditionTrue) - clusterTwo.Labels = map[string]string{"name": "cluster2"} - - clusters := []*federationapi.Cluster{clusterOne, clusterTwo} - testCases := map[string]struct { - expectedSelectorError bool - clusterOneSelected bool - clusterTwoSelected bool - expectedSelectedClusters []*federationapi.Cluster - expectedUnselectedClusters []*federationapi.Cluster - }{ - "Selector returned error": { - expectedSelectorError: true, - }, - "All clusters selected": { - clusterOneSelected: true, - clusterTwoSelected: true, - expectedSelectedClusters: clusters, - expectedUnselectedClusters: []*federationapi.Cluster{}, - }, - "One cluster selected": { - clusterOneSelected: true, - expectedSelectedClusters: []*federationapi.Cluster{clusterOne}, - expectedUnselectedClusters: []*federationapi.Cluster{clusterTwo}, - }, - "No clusters selected": { - expectedSelectedClusters: []*federationapi.Cluster{}, - expectedUnselectedClusters: clusters, - }, - } - - for testName, testCase := range testCases { - t.Run(testName, func(t *testing.T) { - selectedClusters, unselectedClusters, err := selectedClusters(&metav1.ObjectMeta{}, func(labels map[string]string, annotations map[string]string) (bool, error) { - if testCase.expectedSelectorError { - return false, awfulError - } - if labels["name"] == "cluster1" { - return testCase.clusterOneSelected, nil - } - if labels["name"] == "cluster2" { - return testCase.clusterTwoSelected, nil - } - t.Errorf("Unexpected cluster") - return false, nil - }, clusters) - - if testCase.expectedSelectorError { - require.Error(t, err, "An error was expected") - } else { - require.NoError(t, err, "An error was not expected") - } - require.Equal(t, testCase.expectedSelectedClusters, selectedClusters, "Expected the correct clusters to be selected.") - require.Equal(t, testCase.expectedUnselectedClusters, unselectedClusters, "Expected the correct clusters to be unselected.") - }) - } -} - -func TestClusterOperations(t *testing.T) { - adapter := &federatedtypes.SecretAdapter{} - obj := adapter.NewTestObject("foo") - differingObj := adapter.Copy(obj) - federatedtypes.SetAnnotation(adapter, differingObj, "foo", "bar") - - testCases := map[string]struct { - clusterObject pkgruntime.Object - expectedErr bool - sendToCluster bool - - operationType util.FederatedOperationType - }{ - "Accessor error returned": { - expectedErr: true, - }, - "Missing cluster object should result in add operation": { - operationType: util.OperationTypeAdd, - sendToCluster: true, - }, - "Differing cluster object should result in update operation": { - clusterObject: differingObj, - operationType: util.OperationTypeUpdate, - sendToCluster: true, - }, - "Matching object and not matching ClusterSelector should result in delete operation": { - clusterObject: obj, - operationType: util.OperationTypeDelete, - sendToCluster: false, - }, - "Matching cluster object should not result in an operation": { - clusterObject: obj, - sendToCluster: true, - }, - } - for testName, testCase := range testCases { - t.Run(testName, func(t *testing.T) { - clusters := []*federationapi.Cluster{fedtest.NewCluster("cluster1", apiv1.ConditionTrue)} - key := federatedtypes.ObjectKey(adapter, obj) - - var selectedClusters, unselectedClusters []*federationapi.Cluster - if testCase.sendToCluster { - selectedClusters = clusters - unselectedClusters = []*federationapi.Cluster{} - } else { - selectedClusters = []*federationapi.Cluster{} - unselectedClusters = clusters - } - // TODO: Tests for ScheduleObject on type adapter - operations, err := clusterOperations(adapter, selectedClusters, unselectedClusters, obj, key, nil, func(string) (interface{}, bool, error) { - if testCase.expectedErr { - return nil, false, awfulError - } - return testCase.clusterObject, (testCase.clusterObject != nil), nil - }) - if testCase.expectedErr { - require.Error(t, err, "An error was expected") - } else { - require.NoError(t, err, "An error was not expected") - } - if len(testCase.operationType) == 0 { - require.True(t, len(operations) == 0, "An operation was not expected") - } else { - require.True(t, len(operations) == 1, "A single operation was expected") - require.Equal(t, testCase.operationType, operations[0].Type, "Unexpected operation returned") - } - }) - } -} diff --git a/federation/pkg/federation-controller/util/BUILD b/federation/pkg/federation-controller/util/BUILD deleted file mode 100644 index 52cfc5d620..0000000000 --- a/federation/pkg/federation-controller/util/BUILD +++ /dev/null @@ -1,100 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = [ - "backoff.go", - "cluster_util.go", - "configmap.go", - "delaying_deliverer.go", - "deployment.go", - "federated_informer.go", - "federated_updater.go", - "handlers.go", - "meta.go", - "secret.go", - ], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//pkg/api:go_default_library", - "//pkg/client/clientset_generated/internalclientset:go_default_library", - "//pkg/controller/deployment/util:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors: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/util/net:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd/api:go_default_library", - "//vendor/k8s.io/client-go/tools/record:go_default_library", - "//vendor/k8s.io/client-go/util/flowcontrol:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = [ - "delaying_deliverer_test.go", - "deployment_test.go", - "federated_informer_test.go", - "federated_updater_test.go", - "handlers_test.go", - "meta_test.go", - ], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util", - library = ":go_default_library", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset/fake:go_default_library", - "//pkg/controller/deployment/util:go_default_library", - "//vendor/github.com/stretchr/testify/assert:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1: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/watch:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library", - "//vendor/k8s.io/client-go/testing:go_default_library", - "//vendor/k8s.io/client-go/tools/cache:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/pkg/federation-controller/util/clusterselector:all-srcs", - "//federation/pkg/federation-controller/util/deletionhelper:all-srcs", - "//federation/pkg/federation-controller/util/eventsink:all-srcs", - "//federation/pkg/federation-controller/util/finalizers:all-srcs", - "//federation/pkg/federation-controller/util/hpa:all-srcs", - "//federation/pkg/federation-controller/util/planner:all-srcs", - "//federation/pkg/federation-controller/util/podanalyzer:all-srcs", - "//federation/pkg/federation-controller/util/replicapreferences:all-srcs", - "//federation/pkg/federation-controller/util/test:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/util/backoff.go b/federation/pkg/federation-controller/util/backoff.go deleted file mode 100644 index b5b01213a0..0000000000 --- a/federation/pkg/federation-controller/util/backoff.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "time" - - "k8s.io/client-go/util/flowcontrol" -) - -func StartBackoffGC(backoff *flowcontrol.Backoff, stopCh <-chan struct{}) { - go func() { - for { - select { - case <-time.After(time.Minute): - backoff.GC() - case <-stopCh: - return - } - } - }() -} diff --git a/federation/pkg/federation-controller/util/cluster_util.go b/federation/pkg/federation-controller/util/cluster_util.go deleted file mode 100644 index a695870c24..0000000000 --- a/federation/pkg/federation-controller/util/cluster_util.go +++ /dev/null @@ -1,148 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "fmt" - "net" - "os" - "time" - - "github.com/golang/glog" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - utilnet "k8s.io/apimachinery/pkg/util/net" - "k8s.io/apimachinery/pkg/util/wait" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - federation_v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" - "k8s.io/kubernetes/pkg/api" - clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" -) - -const ( - KubeAPIQPS = 20.0 - KubeAPIBurst = 30 - KubeconfigSecretDataKey = "kubeconfig" - getSecretTimeout = 1 * time.Minute -) - -func BuildClusterConfig(c *federation_v1beta1.Cluster) (*restclient.Config, error) { - var serverAddress string - var clusterConfig *restclient.Config - hostIP, err := utilnet.ChooseHostInterface() - if err != nil { - return nil, err - } - - for _, item := range c.Spec.ServerAddressByClientCIDRs { - _, cidrnet, err := net.ParseCIDR(item.ClientCIDR) - if err != nil { - return nil, err - } - myaddr := net.ParseIP(hostIP.String()) - if cidrnet.Contains(myaddr) == true { - serverAddress = item.ServerAddress - break - } - } - if serverAddress != "" { - if c.Spec.SecretRef == nil { - glog.Infof("didn't find secretRef for cluster %s. Trying insecure access", c.Name) - clusterConfig, err = clientcmd.BuildConfigFromFlags(serverAddress, "") - } else { - if c.Spec.SecretRef.Name == "" { - return nil, fmt.Errorf("found secretRef but no secret name for cluster %s", c.Name) - } - var secret *api.Secret - secret, err = getSecret(c.Spec.SecretRef.Name) - if err != nil { - return nil, err - } - // Pre-1.7, the secret contained a serialized kubeconfig which contained appropriate credentials. - // Post-1.7, the secret contains credentials for a service account. - // Check for the service account credentials, and use them if they exist; if not, use the - // serialized kubeconfig. - token, tokenFound := secret.Data["token"] - ca, caFound := secret.Data["ca.crt"] - if tokenFound != caFound { - return nil, fmt.Errorf("secret should have values for either both 'ca.crt' and 'token' in its Data, or neither: %v", secret) - } else if tokenFound && caFound { - clusterConfig, err = clientcmd.BuildConfigFromFlags(serverAddress, "") - clusterConfig.CAData = ca - clusterConfig.BearerToken = string(token) - } else { - kubeconfigGetter := KubeconfigGetterForSecret(secret) - clusterConfig, err = clientcmd.BuildConfigFromKubeconfigGetter(serverAddress, kubeconfigGetter) - } - } - if err != nil { - return nil, err - } - clusterConfig.QPS = KubeAPIQPS - clusterConfig.Burst = KubeAPIBurst - } - return clusterConfig, nil -} - -// getSecret gets a secret from the cluster. -func getSecret(secretName string) (*api.Secret, error) { - // Get the namespace this is running in from the env variable. - namespace := os.Getenv("POD_NAMESPACE") - if namespace == "" { - return nil, fmt.Errorf("unexpected: POD_NAMESPACE env var returned empty string") - } - // Get a client to talk to the k8s apiserver, to fetch secrets from it. - cc, err := restclient.InClusterConfig() - if err != nil { - return nil, fmt.Errorf("error in creating in-cluster config: %s", err) - } - client, err := clientset.NewForConfig(cc) - if err != nil { - return nil, fmt.Errorf("error in creating in-cluster client: %s", err) - } - var secret *api.Secret - err = wait.PollImmediate(1*time.Second, getSecretTimeout, func() (bool, error) { - secret, err = client.Core().Secrets(namespace).Get(secretName, metav1.GetOptions{}) - if err == nil { - return true, nil - } - glog.Warningf("error in fetching secret: %s", err) - return false, nil - }) - if err != nil { - return nil, fmt.Errorf("timed out waiting for secret: %s", err) - } - if secret == nil { - return nil, fmt.Errorf("unexpected: received null secret %s", secretName) - } - return secret, nil -} - -// KubeconfigGetterForSecret gets the kubeconfig from the given secret. -// This is to inject a different KubeconfigGetter in tests. We don't use -// the standard one which calls NewInCluster in tests to avoid having to -// set up service accounts and mount files with secret tokens. -var KubeconfigGetterForSecret = func(secret *api.Secret) clientcmd.KubeconfigGetter { - return func() (*clientcmdapi.Config, error) { - data, ok := secret.Data[KubeconfigSecretDataKey] - if !ok { - return nil, fmt.Errorf("secret does not have data with key %s", KubeconfigSecretDataKey) - } - return clientcmd.Load(data) - } -} diff --git a/federation/pkg/federation-controller/util/clusterselector/BUILD b/federation/pkg/federation-controller/util/clusterselector/BUILD deleted file mode 100644 index 7298f36846..0000000000 --- a/federation/pkg/federation-controller/util/clusterselector/BUILD +++ /dev/null @@ -1,42 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_test( - name = "go_default_test", - srcs = ["clusterselector_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/clusterselector", - library = ":go_default_library", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//vendor/github.com/stretchr/testify/require:go_default_library", - ], -) - -go_library( - name = "go_default_library", - srcs = ["clusterselector.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/clusterselector", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/selection:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/util/clusterselector/clusterselector.go b/federation/pkg/federation-controller/util/clusterselector/clusterselector.go deleted file mode 100644 index e4a56f25a9..0000000000 --- a/federation/pkg/federation-controller/util/clusterselector/clusterselector.go +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package clusterselector - -import ( - "encoding/json" - - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/selection" - federation_v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" -) - -// Parses the cluster selector annotation to find out if the object with that annotation should be forwarded to a cluster with the given clusterLabels. -func SendToCluster(clusterLabels map[string]string, annotations map[string]string) (bool, error) { - // Check if a ClusterSelector annotation exists and send to all clusters when it does not exist - val, ok := annotations[federation_v1beta1.FederationClusterSelectorAnnotation] - if !ok { - return true, nil - } - - selector, err := getSelector(val) - if err != nil { - return false, err - } - return selector.Matches(labels.Set(clusterLabels)), nil -} - -func getSelector(annotation string) (labels.Selector, error) { - selector := labels.NewSelector() - requirements := make([]federation_v1beta1.ClusterSelectorRequirement, 0) - err := json.Unmarshal([]byte(annotation), &requirements) - if err != nil { - return nil, err - } - - for _, requirement := range requirements { - r, err := labels.NewRequirement(requirement.Key, ConvertOperator(requirement.Operator), requirement.Values) - if err != nil { - // Stop processing and assume failure since we have no way of knowing the end users intent for this or any other clusters. - return nil, err - } - selector = selector.Add(*r) - } - - return selector, nil -} - -// ConvertOperator converts a string operator into selection.Operator type -func ConvertOperator(source string) selection.Operator { - var op selection.Operator - switch source { - case "!", "DoesNotExist": - op = selection.DoesNotExist - case "=": - op = selection.Equals - case "==": - op = selection.DoubleEquals - case "in", "In": - op = selection.In - case "!=": - op = selection.NotEquals - case "notin", "NotIn": - op = selection.NotIn - case "exists", "Exists": - op = selection.Exists - case "gt", "Gt", ">": - op = selection.GreaterThan - case "lt", "Lt", "<": - op = selection.LessThan - } - return op -} diff --git a/federation/pkg/federation-controller/util/clusterselector/clusterselector_test.go b/federation/pkg/federation-controller/util/clusterselector/clusterselector_test.go deleted file mode 100644 index 247ef299cc..0000000000 --- a/federation/pkg/federation-controller/util/clusterselector/clusterselector_test.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package clusterselector - -import ( - "testing" - - "github.com/stretchr/testify/require" - - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" -) - -func TestSendToCluster(t *testing.T) { - - clusterLabels := map[string]string{ - "location": "europe", - "environment": "prod", - "version": "15", - } - - testCases := map[string]struct { - objectAnnotations map[string]string - expectedResult bool - expectedErr bool - }{ - "match with single annotation": { - objectAnnotations: map[string]string{ - federationapi.FederationClusterSelectorAnnotation: `[{"key": "location", "operator": "in", "values": ["europe"]}]`, - }, - expectedResult: true, - }, - "match on multiple annotations": { - objectAnnotations: map[string]string{ - federationapi.FederationClusterSelectorAnnotation: `[{"key": "location", "operator": "in", "values": ["europe"]}, {"key": "environment", "operator": "==", "values": ["prod"]}]`, - }, - expectedResult: true, - }, - "mismatch on one annotation": { - objectAnnotations: map[string]string{ - federationapi.FederationClusterSelectorAnnotation: `[{"key": "location", "operator": "in", "values": ["europe"]}, {"key": "environment", "operator": "==", "values": ["test"]}]`, - }, - expectedResult: false, - }, - "match on not equal annotation": { - objectAnnotations: map[string]string{ - federationapi.FederationClusterSelectorAnnotation: `[{"key": "location", "operator": "!=", "values": ["usa"]}, {"key": "environment", "operator": "in", "values": ["prod"]}]`, - }, - expectedResult: true, - }, - "match on greater than annotation": { - objectAnnotations: map[string]string{ - federationapi.FederationClusterSelectorAnnotation: `[{"key": "version", "operator": ">", "values": ["14"]}]`, - }, - expectedResult: true, - }, - "mismatch on greater than annotation": { - objectAnnotations: map[string]string{ - federationapi.FederationClusterSelectorAnnotation: `[{"key": "version", "operator": ">", "values": ["15"]}]`, - }, - expectedResult: false, - }, - "unable to parse annotation": { - objectAnnotations: map[string]string{ - federationapi.FederationClusterSelectorAnnotation: `[{"not able to parse",}]`, - }, - expectedResult: false, - expectedErr: true, - }, - } - - for testName, testCase := range testCases { - t.Run(testName, func(t *testing.T) { - result, err := SendToCluster(clusterLabels, testCase.objectAnnotations) - - if testCase.expectedErr { - require.Error(t, err, "An error was expected") - } else { - require.NoError(t, err, "An error was not expected") - } - - require.Equal(t, testCase.expectedResult, result, "Unexpected response from SendToCluster") - }) - } -} diff --git a/federation/pkg/federation-controller/util/configmap.go b/federation/pkg/federation-controller/util/configmap.go deleted file mode 100644 index c09df8ab00..0000000000 --- a/federation/pkg/federation-controller/util/configmap.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "reflect" - - api_v1 "k8s.io/api/core/v1" -) - -// Checks if cluster-independent, user provided data in two given ConfigMaps are equal. If in -// the future the ConfigMap structure is expanded then any field that is not populated. -// by the api server should be included here. -func ConfigMapEquivalent(s1, s2 *api_v1.ConfigMap) bool { - return ObjectMetaEquivalent(s1.ObjectMeta, s2.ObjectMeta) && - reflect.DeepEqual(s1.Data, s2.Data) -} diff --git a/federation/pkg/federation-controller/util/delaying_deliverer.go b/federation/pkg/federation-controller/util/delaying_deliverer.go deleted file mode 100644 index e087ad6d97..0000000000 --- a/federation/pkg/federation-controller/util/delaying_deliverer.go +++ /dev/null @@ -1,183 +0,0 @@ -/* -Copyright 2016 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. -*/ - -// TODO: consider moving it to a more generic package. -package util - -import ( - "container/heap" - "time" -) - -const ( - // TODO: Investigate what capacity is right. - delayingDelivererUpdateChanCapacity = 1000 -) - -// DelayingDelivererItem is structure delivered by DelayingDeliverer to the -// target channel. -type DelayingDelivererItem struct { - // Key under which the value was added to deliverer. - Key string - // Value of the item. - Value interface{} - // When the item should be delivered. - DeliveryTime time.Time -} - -type delivererHeap struct { - keyPosition map[string]int - data []*DelayingDelivererItem -} - -// Functions required by container.Heap. - -func (dh *delivererHeap) Len() int { return len(dh.data) } -func (dh *delivererHeap) Less(i, j int) bool { - return dh.data[i].DeliveryTime.Before(dh.data[j].DeliveryTime) -} -func (dh *delivererHeap) Swap(i, j int) { - dh.keyPosition[dh.data[i].Key] = j - dh.keyPosition[dh.data[j].Key] = i - dh.data[i], dh.data[j] = dh.data[j], dh.data[i] -} - -func (dh *delivererHeap) Push(x interface{}) { - item := x.(*DelayingDelivererItem) - dh.data = append(dh.data, item) - dh.keyPosition[item.Key] = len(dh.data) - 1 -} - -func (dh *delivererHeap) Pop() interface{} { - n := len(dh.data) - item := dh.data[n-1] - dh.data = dh.data[:n-1] - delete(dh.keyPosition, item.Key) - return item -} - -// A structure that pushes the items to the target channel at a given time. -type DelayingDeliverer struct { - // Channel to deliver the data when their time comes. - targetChannel chan *DelayingDelivererItem - // Store for data - heap *delivererHeap - // Channel to feed the main goroutine with updates. - updateChannel chan *DelayingDelivererItem - // To stop the main goroutine. - stopChannel chan struct{} -} - -func NewDelayingDeliverer() *DelayingDeliverer { - return NewDelayingDelivererWithChannel(make(chan *DelayingDelivererItem, 100)) -} - -func NewDelayingDelivererWithChannel(targetChannel chan *DelayingDelivererItem) *DelayingDeliverer { - return &DelayingDeliverer{ - targetChannel: targetChannel, - heap: &delivererHeap{ - keyPosition: make(map[string]int), - data: make([]*DelayingDelivererItem, 0), - }, - updateChannel: make(chan *DelayingDelivererItem, delayingDelivererUpdateChanCapacity), - stopChannel: make(chan struct{}), - } -} - -// Deliver all items due before or equal to timestamp. -func (d *DelayingDeliverer) deliver(timestamp time.Time) { - for d.heap.Len() > 0 { - if timestamp.Before(d.heap.data[0].DeliveryTime) { - return - } - item := heap.Pop(d.heap).(*DelayingDelivererItem) - d.targetChannel <- item - } -} - -func (d *DelayingDeliverer) run() { - for { - now := time.Now() - d.deliver(now) - - nextWakeUp := now.Add(time.Hour) - if d.heap.Len() > 0 { - nextWakeUp = d.heap.data[0].DeliveryTime - } - sleepTime := nextWakeUp.Sub(now) - - select { - case <-time.After(sleepTime): - break // just wake up and process the data - case item := <-d.updateChannel: - if position, found := d.heap.keyPosition[item.Key]; found { - if item.DeliveryTime.Before(d.heap.data[position].DeliveryTime) { - d.heap.data[position] = item - heap.Fix(d.heap, position) - } - // Ignore if later. - } else { - heap.Push(d.heap, item) - } - case <-d.stopChannel: - return - } - } -} - -// Starts the DelayingDeliverer. -func (d *DelayingDeliverer) Start() { - go d.run() -} - -// Stops the DelayingDeliverer. Undelivered items are discarded. -func (d *DelayingDeliverer) Stop() { - close(d.stopChannel) -} - -// Delivers value at the given time. -func (d *DelayingDeliverer) DeliverAt(key string, value interface{}, deliveryTime time.Time) { - d.updateChannel <- &DelayingDelivererItem{ - Key: key, - Value: value, - DeliveryTime: deliveryTime, - } -} - -// Delivers value after the given delay. -func (d *DelayingDeliverer) DeliverAfter(key string, value interface{}, delay time.Duration) { - d.DeliverAt(key, value, time.Now().Add(delay)) -} - -// Gets target channel of the deliverer. -func (d *DelayingDeliverer) GetTargetChannel() chan *DelayingDelivererItem { - return d.targetChannel -} - -// Starts Delaying deliverer with a handler listening on the target channel. -func (d *DelayingDeliverer) StartWithHandler(handler func(*DelayingDelivererItem)) { - go func() { - for { - select { - case item := <-d.targetChannel: - handler(item) - case <-d.stopChannel: - return - } - } - }() - d.Start() -} diff --git a/federation/pkg/federation-controller/util/delaying_deliverer_test.go b/federation/pkg/federation-controller/util/delaying_deliverer_test.go deleted file mode 100644 index 006bab4c45..0000000000 --- a/federation/pkg/federation-controller/util/delaying_deliverer_test.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -func TestDelayingDeliverer(t *testing.T) { - targetChannel := make(chan *DelayingDelivererItem) - now := time.Now() - d := NewDelayingDelivererWithChannel(targetChannel) - d.Start() - defer d.Stop() - startupDelay := time.Second - d.DeliverAt("a", "aaa", now.Add(startupDelay+2*time.Millisecond)) - d.DeliverAt("b", "bbb", now.Add(startupDelay+3*time.Millisecond)) - d.DeliverAt("c", "ccc", now.Add(startupDelay+1*time.Millisecond)) - d.DeliverAt("e", "eee", now.Add(time.Hour)) - d.DeliverAt("e", "eee", now) - - d.DeliverAt("d", "ddd", now.Add(time.Hour)) - - i0 := <-targetChannel - assert.Equal(t, "e", i0.Key) - assert.Equal(t, "eee", i0.Value.(string)) - assert.Equal(t, now, i0.DeliveryTime) - - i1 := <-targetChannel - received1 := time.Now() - assert.True(t, received1.Sub(now).Nanoseconds() > startupDelay.Nanoseconds()) - assert.Equal(t, "c", i1.Key) - - i2 := <-targetChannel - assert.Equal(t, "a", i2.Key) - - i3 := <-targetChannel - assert.Equal(t, "b", i3.Key) - - select { - case <-targetChannel: - t.Fatalf("Nothing should be received") - case <-time.After(time.Second): - // Ok. Expected - } -} diff --git a/federation/pkg/federation-controller/util/deletionhelper/BUILD b/federation/pkg/federation-controller/util/deletionhelper/BUILD deleted file mode 100644 index ae9397cde3..0000000000 --- a/federation/pkg/federation-controller/util/deletionhelper/BUILD +++ /dev/null @@ -1,33 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["deletion_helper.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/deletionhelper", - deps = [ - "//federation/pkg/federation-controller/util:go_default_library", - "//federation/pkg/federation-controller/util/finalizers:go_default_library", - "//vendor/github.com/golang/glog: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/util/sets:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/util/deletionhelper/deletion_helper.go b/federation/pkg/federation-controller/util/deletionhelper/deletion_helper.go deleted file mode 100644 index d18570a982..0000000000 --- a/federation/pkg/federation-controller/util/deletionhelper/deletion_helper.go +++ /dev/null @@ -1,210 +0,0 @@ -/* -Copyright 2016 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 to help federation controllers to delete federated resources from -// underlying clusters when the resource is deleted from federation control -// plane. -package deletionhelper - -import ( - "fmt" - "strings" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/kubernetes/federation/pkg/federation-controller/util" - finalizersutil "k8s.io/kubernetes/federation/pkg/federation-controller/util/finalizers" - - "github.com/golang/glog" -) - -const ( - // Add this finalizer to a federation resource if the resource should be - // deleted from all underlying clusters before being deleted from - // federation control plane. - // This is ignored if FinalizerOrphan is also present on the resource. - // In that case, both finalizers are removed from the resource and the - // resource is deleted from federation control plane without affecting - // the underlying clusters. - FinalizerDeleteFromUnderlyingClusters string = "federation.kubernetes.io/delete-from-underlying-clusters" -) - -type UpdateObjFunc func(runtime.Object) (runtime.Object, error) -type ObjNameFunc func(runtime.Object) string - -type DeletionHelper struct { - updateObjFunc UpdateObjFunc - objNameFunc ObjNameFunc - informer util.FederatedInformer - updater util.FederatedUpdater -} - -func NewDeletionHelper( - updateObjFunc UpdateObjFunc, objNameFunc ObjNameFunc, - informer util.FederatedInformer, updater util.FederatedUpdater) *DeletionHelper { - return &DeletionHelper{ - updateObjFunc: updateObjFunc, - objNameFunc: objNameFunc, - informer: informer, - updater: updater, - } -} - -// Ensures that the given object has both FinalizerDeleteFromUnderlyingClusters -// and FinalizerOrphan finalizers. -// We do this so that the controller is always notified when a federation resource is deleted. -// If user deletes the resource with nil DeleteOptions or -// DeletionOptions.OrphanDependents = true then the apiserver removes the orphan finalizer -// and deletion helper does a cascading deletion. -// Otherwise, deletion helper just removes the federation resource and orphans -// the corresponding resources in underlying clusters. -// This method should be called before creating objects in underlying clusters. -func (dh *DeletionHelper) EnsureFinalizers(obj runtime.Object) ( - runtime.Object, error) { - finalizers := sets.String{} - hasFinalizer, err := finalizersutil.HasFinalizer(obj, FinalizerDeleteFromUnderlyingClusters) - if err != nil { - return obj, err - } - if !hasFinalizer { - finalizers.Insert(FinalizerDeleteFromUnderlyingClusters) - } - hasFinalizer, err = finalizersutil.HasFinalizer(obj, metav1.FinalizerOrphanDependents) - if err != nil { - return obj, err - } - if !hasFinalizer { - finalizers.Insert(metav1.FinalizerOrphanDependents) - } - if finalizers.Len() != 0 { - glog.V(2).Infof("Adding finalizers %v to %s", finalizers.List(), dh.objNameFunc(obj)) - return dh.addFinalizers(obj, finalizers) - } - return obj, nil -} - -// Deletes the resources corresponding to the given federated resource from -// all underlying clusters, unless it has the FinalizerOrphan finalizer. -// Removes FinalizerOrphan and FinalizerDeleteFromUnderlyingClusters finalizers -// when done. -// Callers are expected to keep calling this (with appropriate backoff) until -// it succeeds. -func (dh *DeletionHelper) HandleObjectInUnderlyingClusters(obj runtime.Object) ( - runtime.Object, error) { - objName := dh.objNameFunc(obj) - glog.V(2).Infof("Handling deletion of federated dependents for object: %s", objName) - hasFinalizer, err := finalizersutil.HasFinalizer(obj, FinalizerDeleteFromUnderlyingClusters) - if err != nil { - return obj, err - } - if !hasFinalizer { - glog.V(2).Infof("obj does not have %s finalizer. Nothing to do", FinalizerDeleteFromUnderlyingClusters) - return obj, nil - } - hasOrphanFinalizer, err := finalizersutil.HasFinalizer(obj, metav1.FinalizerOrphanDependents) - if err != nil { - return obj, err - } - if hasOrphanFinalizer { - glog.V(2).Infof("Found finalizer orphan. Nothing to do, just remove the finalizer") - // If the obj has FinalizerOrphan finalizer, then we need to orphan the - // corresponding objects in underlying clusters. - // Just remove both the finalizers in that case. - finalizers := sets.NewString(FinalizerDeleteFromUnderlyingClusters, metav1.FinalizerOrphanDependents) - return dh.removeFinalizers(obj, finalizers) - } - - glog.V(2).Infof("Deleting obj %s from underlying clusters", objName) - // Else, we need to delete the obj from all underlying clusters. - unreadyClusters, err := dh.informer.GetUnreadyClusters() - if err != nil { - return nil, fmt.Errorf("failed to get a list of unready clusters: %v", err) - } - // TODO: Handle the case when cluster resource is watched after this is executed. - // This can happen if a namespace is deleted before its creation had been - // observed in all underlying clusters. - storeKey := dh.informer.GetTargetStore().GetKeyFor(obj) - clusterNsObjs, err := dh.informer.GetTargetStore().GetFromAllClusters(storeKey) - glog.V(3).Infof("Found %d objects in underlying clusters", len(clusterNsObjs)) - if err != nil { - return nil, fmt.Errorf("failed to get object %s from underlying clusters: %v", objName, err) - } - operations := make([]util.FederatedOperation, 0) - for _, clusterNsObj := range clusterNsObjs { - operations = append(operations, util.FederatedOperation{ - Type: util.OperationTypeDelete, - ClusterName: clusterNsObj.ClusterName, - Obj: clusterNsObj.Object.(runtime.Object), - Key: objName, - }) - } - err = dh.updater.Update(operations) - if err != nil { - return nil, fmt.Errorf("failed to execute updates for obj %s: %v", objName, err) - } - if len(operations) > 0 { - // We have deleted a bunch of resources. - // Wait for the store to observe all the deletions. - var clusterNames []string - for _, op := range operations { - clusterNames = append(clusterNames, op.ClusterName) - } - return nil, fmt.Errorf("waiting for object %s to be deleted from clusters: %s", objName, strings.Join(clusterNames, ", ")) - } - - // We have now deleted the object from all *ready* clusters. - // But still need to wait for clusters that are not ready to ensure that - // the object has been deleted from *all* clusters. - if len(unreadyClusters) != 0 { - var clusterNames []string - for _, cluster := range unreadyClusters { - clusterNames = append(clusterNames, cluster.Name) - } - return nil, fmt.Errorf("waiting for clusters %s to become ready to verify that obj %s has been deleted", strings.Join(clusterNames, ", "), objName) - } - - // All done. Just remove the finalizer. - return dh.removeFinalizers(obj, sets.NewString(FinalizerDeleteFromUnderlyingClusters)) -} - -// Adds the given finalizers to the given objects ObjectMeta. -func (dh *DeletionHelper) addFinalizers(obj runtime.Object, finalizers sets.String) (runtime.Object, error) { - isUpdated, err := finalizersutil.AddFinalizers(obj, finalizers) - if err != nil || !isUpdated { - return obj, err - } - // Send the update to apiserver. - updatedObj, err := dh.updateObjFunc(obj) - if err != nil { - return nil, fmt.Errorf("failed to add finalizers %v to object %s: %v", finalizers, dh.objNameFunc(obj), err) - } - return updatedObj, nil -} - -// Removes the given finalizers from the given objects ObjectMeta. -func (dh *DeletionHelper) removeFinalizers(obj runtime.Object, finalizers sets.String) (runtime.Object, error) { - isUpdated, err := finalizersutil.RemoveFinalizers(obj, finalizers) - if err != nil || !isUpdated { - return obj, err - } - // Send the update to apiserver. - updatedObj, err := dh.updateObjFunc(obj) - if err != nil { - return nil, fmt.Errorf("failed to remove finalizers %v from object %s: %v", finalizers, dh.objNameFunc(obj), err) - } - return updatedObj, nil -} diff --git a/federation/pkg/federation-controller/util/deployment.go b/federation/pkg/federation-controller/util/deployment.go deleted file mode 100644 index 8c9627affe..0000000000 --- a/federation/pkg/federation-controller/util/deployment.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "reflect" - - extensions_v1 "k8s.io/api/extensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - deputils "k8s.io/kubernetes/pkg/controller/deployment/util" -) - -// Checks if cluster-independent, user provided data in two given Deployment are equal. -// This function assumes that revisions are not kept in sync across the clusters. -func DeploymentEquivalent(a, b *extensions_v1.Deployment) bool { - if a.Name != b.Name { - return false - } - if a.Namespace != b.Namespace { - return false - } - if !reflect.DeepEqual(a.Labels, b.Labels) && (len(a.Labels) != 0 || len(b.Labels) != 0) { - return false - } - hasKeysAndVals := func(x, y map[string]string) bool { - if x == nil { - x = map[string]string{} - } - if y == nil { - y = map[string]string{} - } - for k, v := range x { - if k == deputils.RevisionAnnotation { - continue - } - v2, found := y[k] - if !found || v != v2 { - return false - } - } - return true - } - return hasKeysAndVals(a.Annotations, b.Annotations) && - hasKeysAndVals(b.Annotations, a.Annotations) && - reflect.DeepEqual(a.Spec, b.Spec) -} - -// Copies object meta for Deployment, skipping revision information. -func DeepCopyDeploymentObjectMeta(meta metav1.ObjectMeta) metav1.ObjectMeta { - meta = DeepCopyRelevantObjectMeta(meta) - delete(meta.Annotations, deputils.RevisionAnnotation) - return meta -} - -// Copies object meta for Deployment, skipping revision information. -func DeepCopyDeployment(a *extensions_v1.Deployment) *extensions_v1.Deployment { - return &extensions_v1.Deployment{ - ObjectMeta: DeepCopyDeploymentObjectMeta(a.ObjectMeta), - Spec: *a.Spec.DeepCopy(), - } -} diff --git a/federation/pkg/federation-controller/util/deployment_test.go b/federation/pkg/federation-controller/util/deployment_test.go deleted file mode 100644 index 97d59699f8..0000000000 --- a/federation/pkg/federation-controller/util/deployment_test.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "testing" - - extensionsv1 "k8s.io/api/extensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - deputils "k8s.io/kubernetes/pkg/controller/deployment/util" - - "github.com/stretchr/testify/assert" -) - -func TestDeploymentEquivalent(t *testing.T) { - d1 := newDeployment() - d2 := newDeployment() - d2.Annotations = make(map[string]string) - - d3 := newDeployment() - d3.Annotations = map[string]string{"a": "b"} - - d4 := newDeployment() - d4.Annotations = map[string]string{deputils.RevisionAnnotation: "9"} - - assert.True(t, DeploymentEquivalent(d1, d2)) - assert.True(t, DeploymentEquivalent(d1, d2)) - assert.True(t, DeploymentEquivalent(d1, d4)) - assert.True(t, DeploymentEquivalent(d4, d1)) - assert.False(t, DeploymentEquivalent(d3, d4)) - assert.False(t, DeploymentEquivalent(d3, d1)) - assert.True(t, DeploymentEquivalent(d3, d3)) -} - -func TestDeploymentCopy(t *testing.T) { - d1 := newDeployment() - d1.Annotations = map[string]string{deputils.RevisionAnnotation: "9", "a": "b"} - d2 := DeepCopyDeployment(d1) - assert.True(t, DeploymentEquivalent(d1, d2)) - assert.Contains(t, d2.Annotations, "a") - assert.NotContains(t, d2.Annotations, deputils.RevisionAnnotation) -} - -func newDeployment() *extensionsv1.Deployment { - replicas := int32(5) - return &extensionsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "wrr", - Namespace: metav1.NamespaceDefault, - SelfLink: "/api/v1/namespaces/default/deployments/name123", - }, - Spec: extensionsv1.DeploymentSpec{ - Replicas: &replicas, - }, - } -} diff --git a/federation/pkg/federation-controller/util/eventsink/BUILD b/federation/pkg/federation-controller/util/eventsink/BUILD deleted file mode 100644 index bf5fbe5657..0000000000 --- a/federation/pkg/federation-controller/util/eventsink/BUILD +++ /dev/null @@ -1,52 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = ["eventsink.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/eventsink", - deps = [ - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//vendor/k8s.io/api/core/v1: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/types:go_default_library", - "//vendor/k8s.io/client-go/tools/record:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["eventsink_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/eventsink", - library = ":go_default_library", - deps = [ - "//federation/client/clientset_generated/federation_clientset/fake:go_default_library", - "//federation/pkg/federation-controller/util/test:go_default_library", - "//vendor/github.com/stretchr/testify/assert:go_default_library", - "//vendor/k8s.io/api/core/v1: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/client-go/testing:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/util/eventsink/eventsink.go b/federation/pkg/federation-controller/util/eventsink/eventsink.go deleted file mode 100644 index 343fef5df7..0000000000 --- a/federation/pkg/federation-controller/util/eventsink/eventsink.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -Copyright 2016 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 eventsink - -import ( - "reflect" - - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/conversion" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/tools/record" - fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" -) - -// Implements k8s.io/client-go/tools/record.EventSink. -type FederatedEventSink struct { - clientset fedclientset.Interface -} - -// To check if all required functions are implemented. -var _ record.EventSink = &FederatedEventSink{} - -func NewFederatedEventSink(clientset fedclientset.Interface) *FederatedEventSink { - return &FederatedEventSink{ - clientset: clientset, - } -} - -// TODO this is uses a reflection conversion path and is very expensive. federation should update to use client-go - -var scheme = runtime.NewScheme() - -func init() { - // register client-go's and kube's Event type under two different GroupVersions - // TODO: switch to client-go client for events - scheme.AddKnownTypes(v1.SchemeGroupVersion, &v1.Event{}) - scheme.AddKnownTypes(schema.GroupVersion{Group: "fake-kube-" + v1.SchemeGroupVersion.Group, Version: v1.SchemeGroupVersion.Version}, &v1.Event{}) - - if err := scheme.AddConversionFuncs( - metav1.Convert_unversioned_Time_To_unversioned_Time, - ); err != nil { - panic(err) - } - if err := scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{ - Fn: func(in, out interface{}, c *conversion.Cloner) error { - in.(*metav1.Time).DeepCopyInto(out.(*metav1.Time)) - return nil - }, - InType: reflect.TypeOf(&metav1.Time{}), - }, - ); err != nil { - panic(err) - } -} - -func (fes *FederatedEventSink) Create(event *v1.Event) (*v1.Event, error) { - ret, err := fes.clientset.Core().Events(event.Namespace).Create(event) - if err != nil { - return nil, err - } - - retEvent := &v1.Event{} - if err := scheme.Convert(ret, retEvent, nil); err != nil { - return nil, err - } - return retEvent, nil -} - -func (fes *FederatedEventSink) Update(event *v1.Event) (*v1.Event, error) { - ret, err := fes.clientset.Core().Events(event.Namespace).Update(event) - if err != nil { - return nil, err - } - - retEvent := &v1.Event{} - if err := scheme.Convert(ret, retEvent, nil); err != nil { - return nil, err - } - return retEvent, nil -} - -func (fes *FederatedEventSink) Patch(event *v1.Event, data []byte) (*v1.Event, error) { - ret, err := fes.clientset.Core().Events(event.Namespace).Patch(event.Name, types.StrategicMergePatchType, data) - if err != nil { - return nil, err - } - - retEvent := &v1.Event{} - if err := scheme.Convert(ret, retEvent, nil); err != nil { - return nil, err - } - return retEvent, nil -} diff --git a/federation/pkg/federation-controller/util/eventsink/eventsink_test.go b/federation/pkg/federation-controller/util/eventsink/eventsink_test.go deleted file mode 100644 index 230ef8d0d5..0000000000 --- a/federation/pkg/federation-controller/util/eventsink/eventsink_test.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright 2016 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 eventsink - -import ( - "testing" - - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - core "k8s.io/client-go/testing" - fakefedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/fake" - . "k8s.io/kubernetes/federation/pkg/federation-controller/util/test" - - "github.com/stretchr/testify/assert" -) - -func TestEventSink(t *testing.T) { - fakeFederationClient := &fakefedclientset.Clientset{} - createdChan := make(chan runtime.Object, 100) - fakeFederationClient.AddReactor("create", "events", func(action core.Action) (bool, runtime.Object, error) { - createAction := action.(core.CreateAction) - obj := createAction.GetObject() - createdChan <- obj - return true, obj, nil - }) - updateChan := make(chan runtime.Object, 100) - fakeFederationClient.AddReactor("update", "events", func(action core.Action) (bool, runtime.Object, error) { - updateAction := action.(core.UpdateAction) - obj := updateAction.GetObject() - updateChan <- obj - return true, obj, nil - }) - - event := v1.Event{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bzium", - Namespace: "ns", - }, - } - sink := NewFederatedEventSink(fakeFederationClient) - eventUpdated, err := sink.Create(&event) - assert.NoError(t, err) - eventV1 := GetObjectFromChan(createdChan).(*v1.Event) - assert.NotNil(t, eventV1) - // Just some simple sanity checks. - assert.Equal(t, event.Name, eventV1.Name) - assert.Equal(t, event.Name, eventUpdated.Name) - - eventUpdated, err = sink.Update(&event) - assert.NoError(t, err) - eventV1 = GetObjectFromChan(updateChan).(*v1.Event) - assert.NotNil(t, eventV1) - // Just some simple sanity checks. - assert.Equal(t, event.Name, eventV1.Name) - assert.Equal(t, event.Name, eventUpdated.Name) -} diff --git a/federation/pkg/federation-controller/util/federated_informer.go b/federation/pkg/federation-controller/util/federated_informer.go deleted file mode 100644 index b3b0dedb82..0000000000 --- a/federation/pkg/federation-controller/util/federated_informer.go +++ /dev/null @@ -1,524 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "fmt" - "reflect" - "sync" - "time" - - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - kubeclientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/cache" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - - "github.com/golang/glog" -) - -const ( - clusterSyncPeriod = 10 * time.Minute - userAgentName = "federation-controller" -) - -// An object with an origin information. -type FederatedObject struct { - Object interface{} - ClusterName string -} - -// FederatedReadOnlyStore is an overlay over multiple stores created in federated clusters. -type FederatedReadOnlyStore interface { - // Returns all items in the store. - List() ([]FederatedObject, error) - - // Returns all items from a cluster. - ListFromCluster(clusterName string) ([]interface{}, error) - - // GetKeyFor returns the key under which the item would be put in the store. - GetKeyFor(item interface{}) string - - // GetByKey returns the item stored under the given key in the specified cluster (if exist). - GetByKey(clusterName string, key string) (interface{}, bool, error) - - // Returns the items stored under the given key in all clusters. - GetFromAllClusters(key string) ([]FederatedObject, error) - - // Checks whether stores for all clusters form the lists (and only these) are there and - // are synced. This is only a basic check whether the data inside of the store is usable. - // It is not a full synchronization/locking mechanism it only tries to ensure that out-of-sync - // issues occur less often. All users of the interface should assume - // that there may be significant delays in content updates of all kinds and write their - // code that it doesn't break if something is slightly out-of-sync. - ClustersSynced(clusters []*federationapi.Cluster) bool -} - -// An interface to access federation members and clients. -type FederationView interface { - // GetClientsetForCluster returns a clientset for the cluster, if present. - GetClientsetForCluster(clusterName string) (kubeclientset.Interface, error) - - // GetUnreadyClusters returns a list of all clusters that are not ready yet. - GetUnreadyClusters() ([]*federationapi.Cluster, error) - - // GetReadyClusters returns all clusters for which the sub-informers are run. - GetReadyClusters() ([]*federationapi.Cluster, error) - - // GetReadyCluster returns the cluster with the given name, if found. - GetReadyCluster(name string) (*federationapi.Cluster, bool, error) - - // ClustersSynced returns true if the view is synced (for the first time). - ClustersSynced() bool -} - -// A structure that combines an informer running against federated api server and listening for cluster updates -// with multiple Kubernetes API informers (called target informers) running against federation members. Whenever a new -// cluster is added to the federation an informer is created for it using TargetInformerFactory. Informers are stopped -// when a cluster is either put offline of deleted. It is assumed that some controller keeps an eye on the cluster list -// and thus the clusters in ETCD are up to date. -type FederatedInformer interface { - FederationView - - // Returns a store created over all stores from target informers. - GetTargetStore() FederatedReadOnlyStore - - // Starts all the processes. - Start() - - // Stops all the processes inside the informer. - Stop() -} - -// FederatedInformer with extra method for setting fake clients. -type FederatedInformerForTestOnly interface { - FederatedInformer - - SetClientFactory(func(*federationapi.Cluster) (kubeclientset.Interface, error)) -} - -// A function that should be used to create an informer on the target object. Store should use -// cache.DeletionHandlingMetaNamespaceKeyFunc as a keying function. -type TargetInformerFactory func(*federationapi.Cluster, kubeclientset.Interface) (cache.Store, cache.Controller) - -// A structure with cluster lifecycle handler functions. Cluster is available (and ClusterAvailable is fired) -// when it is created in federated etcd and ready. Cluster becomes unavailable (and ClusterUnavailable is fired) -// when it is either deleted or becomes not ready. When cluster spec (IP)is modified both ClusterAvailable -// and ClusterUnavailable are fired. -type ClusterLifecycleHandlerFuncs struct { - // Fired when the cluster becomes available. - ClusterAvailable func(*federationapi.Cluster) - // Fired when the cluster becomes unavailable. The second arg contains data that was present - // in the cluster before deletion. - ClusterUnavailable func(*federationapi.Cluster, []interface{}) -} - -// Builds a FederatedInformer for the given federation client and factory. -func NewFederatedInformer( - federationClient federationclientset.Interface, - targetInformerFactory TargetInformerFactory, - clusterLifecycle *ClusterLifecycleHandlerFuncs) FederatedInformer { - - federatedInformer := &federatedInformerImpl{ - targetInformerFactory: targetInformerFactory, - clientFactory: func(cluster *federationapi.Cluster) (kubeclientset.Interface, error) { - clusterConfig, err := BuildClusterConfig(cluster) - if err == nil && clusterConfig != nil { - clientset := kubeclientset.NewForConfigOrDie(restclient.AddUserAgent(clusterConfig, userAgentName)) - return clientset, nil - } - return nil, err - }, - targetInformers: make(map[string]informer), - } - - getClusterData := func(name string) []interface{} { - data, err := federatedInformer.GetTargetStore().ListFromCluster(name) - if err != nil { - glog.Errorf("Failed to list %s content: %v", name, err) - return make([]interface{}, 0) - } - return data - } - - federatedInformer.clusterInformer.store, federatedInformer.clusterInformer.controller = cache.NewInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (pkgruntime.Object, error) { - return federationClient.Federation().Clusters().List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - return federationClient.Federation().Clusters().Watch(options) - }, - }, - &federationapi.Cluster{}, - clusterSyncPeriod, - cache.ResourceEventHandlerFuncs{ - DeleteFunc: func(old interface{}) { - oldCluster, ok := old.(*federationapi.Cluster) - if ok { - var data []interface{} - if clusterLifecycle.ClusterUnavailable != nil { - data = getClusterData(oldCluster.Name) - } - federatedInformer.deleteCluster(oldCluster) - if clusterLifecycle.ClusterUnavailable != nil { - clusterLifecycle.ClusterUnavailable(oldCluster, data) - } - } - }, - AddFunc: func(cur interface{}) { - curCluster, ok := cur.(*federationapi.Cluster) - if ok && isClusterReady(curCluster) { - federatedInformer.addCluster(curCluster) - if clusterLifecycle.ClusterAvailable != nil { - clusterLifecycle.ClusterAvailable(curCluster) - } - } else { - glog.Errorf("Cluster %v not added. Not of correct type, or cluster not ready.", cur) - } - }, - UpdateFunc: func(old, cur interface{}) { - oldCluster, ok := old.(*federationapi.Cluster) - if !ok { - glog.Errorf("Internal error: Cluster %v not updated. Old cluster not of correct type.", old) - return - } - curCluster, ok := cur.(*federationapi.Cluster) - if !ok { - glog.Errorf("Internal error: Cluster %v not updated. New cluster not of correct type.", cur) - return - } - if isClusterReady(oldCluster) != isClusterReady(curCluster) || !reflect.DeepEqual(oldCluster.Spec, curCluster.Spec) || !reflect.DeepEqual(oldCluster.ObjectMeta.Annotations, curCluster.ObjectMeta.Annotations) { - var data []interface{} - if clusterLifecycle.ClusterUnavailable != nil { - data = getClusterData(oldCluster.Name) - } - federatedInformer.deleteCluster(oldCluster) - if clusterLifecycle.ClusterUnavailable != nil { - clusterLifecycle.ClusterUnavailable(oldCluster, data) - } - - if isClusterReady(curCluster) { - federatedInformer.addCluster(curCluster) - if clusterLifecycle.ClusterAvailable != nil { - clusterLifecycle.ClusterAvailable(curCluster) - } - } - } else { - glog.V(4).Infof("Cluster %v not updated to %v as ready status and specs are identical", oldCluster, curCluster) - } - }, - }, - ) - return federatedInformer -} - -func isClusterReady(cluster *federationapi.Cluster) bool { - for _, condition := range cluster.Status.Conditions { - if condition.Type == federationapi.ClusterReady { - if condition.Status == apiv1.ConditionTrue { - return true - } - } - } - return false -} - -type informer struct { - controller cache.Controller - store cache.Store - stopChan chan struct{} -} - -type federatedInformerImpl struct { - sync.Mutex - - // Informer on federated clusters. - clusterInformer informer - - // Target informers factory - targetInformerFactory TargetInformerFactory - - // Structures returned by targetInformerFactory - targetInformers map[string]informer - - // A function to build clients. - clientFactory func(*federationapi.Cluster) (kubeclientset.Interface, error) -} - -// *federatedInformerImpl implements FederatedInformer interface. -var _ FederatedInformer = &federatedInformerImpl{} - -type federatedStoreImpl struct { - federatedInformer *federatedInformerImpl -} - -func (f *federatedInformerImpl) Stop() { - glog.V(4).Infof("Stopping federated informer.") - f.Lock() - defer f.Unlock() - - glog.V(4).Infof("... Closing cluster informer channel.") - close(f.clusterInformer.stopChan) - for key, informer := range f.targetInformers { - glog.V(4).Infof("... Closing informer channel for %q.", key) - close(informer.stopChan) - // Remove each informer after it has been stopped to prevent - // subsequent cluster deletion from attempting to double close - // an informer's stop channel. - delete(f.targetInformers, key) - } -} - -func (f *federatedInformerImpl) Start() { - f.Lock() - defer f.Unlock() - - f.clusterInformer.stopChan = make(chan struct{}) - go f.clusterInformer.controller.Run(f.clusterInformer.stopChan) -} - -func (f *federatedInformerImpl) SetClientFactory(clientFactory func(*federationapi.Cluster) (kubeclientset.Interface, error)) { - f.Lock() - defer f.Unlock() - - f.clientFactory = clientFactory -} - -// GetClientsetForCluster returns a clientset for the cluster, if present. -func (f *federatedInformerImpl) GetClientsetForCluster(clusterName string) (kubeclientset.Interface, error) { - f.Lock() - defer f.Unlock() - return f.getClientsetForClusterUnlocked(clusterName) -} - -func (f *federatedInformerImpl) getClientsetForClusterUnlocked(clusterName string) (kubeclientset.Interface, error) { - // No locking needed. Will happen in f.GetCluster. - glog.V(4).Infof("Getting clientset for cluster %q", clusterName) - if cluster, found, err := f.getReadyClusterUnlocked(clusterName); found && err == nil { - glog.V(4).Infof("Got clientset for cluster %q", clusterName) - return f.clientFactory(cluster) - } else { - if err != nil { - return nil, err - } - } - return nil, fmt.Errorf("cluster %q not found", clusterName) -} - -func (f *federatedInformerImpl) GetUnreadyClusters() ([]*federationapi.Cluster, error) { - f.Lock() - defer f.Unlock() - - items := f.clusterInformer.store.List() - result := make([]*federationapi.Cluster, 0, len(items)) - for _, item := range items { - if cluster, ok := item.(*federationapi.Cluster); ok { - if !isClusterReady(cluster) { - result = append(result, cluster) - } - } else { - return nil, fmt.Errorf("wrong data in FederatedInformerImpl cluster store: %v", item) - } - } - return result, nil -} - -// GetReadyClusters returns all clusters for which the sub-informers are run. -func (f *federatedInformerImpl) GetReadyClusters() ([]*federationapi.Cluster, error) { - f.Lock() - defer f.Unlock() - - items := f.clusterInformer.store.List() - result := make([]*federationapi.Cluster, 0, len(items)) - for _, item := range items { - if cluster, ok := item.(*federationapi.Cluster); ok { - if isClusterReady(cluster) { - result = append(result, cluster) - } - } else { - return nil, fmt.Errorf("wrong data in FederatedInformerImpl cluster store: %v", item) - } - } - return result, nil -} - -// GetCluster returns the cluster with the given name, if found. -func (f *federatedInformerImpl) GetReadyCluster(name string) (*federationapi.Cluster, bool, error) { - f.Lock() - defer f.Unlock() - return f.getReadyClusterUnlocked(name) -} - -func (f *federatedInformerImpl) getReadyClusterUnlocked(name string) (*federationapi.Cluster, bool, error) { - if obj, exist, err := f.clusterInformer.store.GetByKey(name); exist && err == nil { - if cluster, ok := obj.(*federationapi.Cluster); ok { - if isClusterReady(cluster) { - return cluster, true, nil - } - return nil, false, nil - - } - return nil, false, fmt.Errorf("wrong data in FederatedInformerImpl cluster store: %v", obj) - - } else { - return nil, false, err - } -} - -// Synced returns true if the view is synced (for the first time) -func (f *federatedInformerImpl) ClustersSynced() bool { - return f.clusterInformer.controller.HasSynced() -} - -// Adds the given cluster to federated informer. -func (f *federatedInformerImpl) addCluster(cluster *federationapi.Cluster) { - f.Lock() - defer f.Unlock() - name := cluster.Name - if client, err := f.getClientsetForClusterUnlocked(name); err == nil { - store, controller := f.targetInformerFactory(cluster, client) - targetInformer := informer{ - controller: controller, - store: store, - stopChan: make(chan struct{}), - } - f.targetInformers[name] = targetInformer - go targetInformer.controller.Run(targetInformer.stopChan) - } else { - // TODO: create also an event for cluster. - glog.Errorf("Failed to create a client for cluster: %v", err) - } -} - -// Removes the cluster from federated informer. -func (f *federatedInformerImpl) deleteCluster(cluster *federationapi.Cluster) { - f.Lock() - defer f.Unlock() - name := cluster.Name - if targetInformer, found := f.targetInformers[name]; found { - close(targetInformer.stopChan) - } - delete(f.targetInformers, name) -} - -// Returns a store created over all stores from target informers. -func (f *federatedInformerImpl) GetTargetStore() FederatedReadOnlyStore { - return &federatedStoreImpl{ - federatedInformer: f, - } -} - -// Returns all items in the store. -func (fs *federatedStoreImpl) List() ([]FederatedObject, error) { - fs.federatedInformer.Lock() - defer fs.federatedInformer.Unlock() - - result := make([]FederatedObject, 0) - for clusterName, targetInformer := range fs.federatedInformer.targetInformers { - for _, value := range targetInformer.store.List() { - result = append(result, FederatedObject{ClusterName: clusterName, Object: value}) - } - } - return result, nil -} - -// Returns all items in the given cluster. -func (fs *federatedStoreImpl) ListFromCluster(clusterName string) ([]interface{}, error) { - fs.federatedInformer.Lock() - defer fs.federatedInformer.Unlock() - - result := make([]interface{}, 0) - if targetInformer, found := fs.federatedInformer.targetInformers[clusterName]; found { - values := targetInformer.store.List() - result = append(result, values...) - } - return result, nil -} - -// GetByKey returns the item stored under the given key in the specified cluster (if exist). -func (fs *federatedStoreImpl) GetByKey(clusterName string, key string) (interface{}, bool, error) { - fs.federatedInformer.Lock() - defer fs.federatedInformer.Unlock() - if targetInformer, found := fs.federatedInformer.targetInformers[clusterName]; found { - return targetInformer.store.GetByKey(key) - } - return nil, false, nil -} - -// Returns the items stored under the given key in all clusters. -func (fs *federatedStoreImpl) GetFromAllClusters(key string) ([]FederatedObject, error) { - fs.federatedInformer.Lock() - defer fs.federatedInformer.Unlock() - - result := make([]FederatedObject, 0) - for clusterName, targetInformer := range fs.federatedInformer.targetInformers { - value, exist, err := targetInformer.store.GetByKey(key) - if err != nil { - return nil, err - } - if exist { - result = append(result, FederatedObject{ClusterName: clusterName, Object: value}) - } - } - return result, nil -} - -// GetKeyFor returns the key under which the item would be put in the store. -func (fs *federatedStoreImpl) GetKeyFor(item interface{}) string { - // TODO: support other keying functions. - key, _ := cache.DeletionHandlingMetaNamespaceKeyFunc(item) - return key -} - -// Checks whether stores for all clusters form the lists (and only these) are there and -// are synced. -func (fs *federatedStoreImpl) ClustersSynced(clusters []*federationapi.Cluster) bool { - - // Get the list of informers to check under a lock and check it outside. - okSoFar, informersToCheck := func() (bool, []informer) { - fs.federatedInformer.Lock() - defer fs.federatedInformer.Unlock() - - if len(fs.federatedInformer.targetInformers) != len(clusters) { - return false, []informer{} - } - informersToCheck := make([]informer, 0, len(clusters)) - for _, cluster := range clusters { - if targetInformer, found := fs.federatedInformer.targetInformers[cluster.Name]; found { - informersToCheck = append(informersToCheck, targetInformer) - } else { - return false, []informer{} - } - } - return true, informersToCheck - }() - - if !okSoFar { - return false - } - for _, informerToCheck := range informersToCheck { - if !informerToCheck.controller.HasSynced() { - return false - } - } - return true -} diff --git a/federation/pkg/federation-controller/util/federated_informer_test.go b/federation/pkg/federation-controller/util/federated_informer_test.go deleted file mode 100644 index ce4ab70a1d..0000000000 --- a/federation/pkg/federation-controller/util/federated_informer_test.go +++ /dev/null @@ -1,150 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "testing" - "time" - - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - kubeclientset "k8s.io/client-go/kubernetes" - fakekubeclientset "k8s.io/client-go/kubernetes/fake" - core "k8s.io/client-go/testing" - "k8s.io/client-go/tools/cache" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - fakefederationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/fake" - - "github.com/stretchr/testify/assert" -) - -// Basic test for Federated Informer. Checks whether the subinformer are added and deleted -// when the corresponding cluster entries appear and disappear from etcd. -func TestFederatedInformer(t *testing.T) { - fakeFederationClient := &fakefederationclientset.Clientset{} - - // Add a single cluster to federation and remove it when needed. - cluster := federationapi.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "mycluster", - }, - Status: federationapi.ClusterStatus{ - Conditions: []federationapi.ClusterCondition{ - {Type: federationapi.ClusterReady, Status: apiv1.ConditionTrue}, - }, - }, - } - fakeFederationClient.AddReactor("list", "clusters", func(action core.Action) (bool, runtime.Object, error) { - return true, &federationapi.ClusterList{Items: []federationapi.Cluster{cluster}}, nil - }) - deleteChan := make(chan struct{}) - fakeFederationClient.AddWatchReactor("clusters", func(action core.Action) (bool, watch.Interface, error) { - fakeWatch := watch.NewFake() - go func() { - <-deleteChan - fakeWatch.Delete(&cluster) - }() - return true, fakeWatch, nil - }) - - fakeKubeClient := &fakekubeclientset.Clientset{} - // There is a single service ns1/s1 in cluster mycluster. - service := apiv1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "ns1", - Name: "s1", - }, - } - fakeKubeClient.AddReactor("list", "services", func(action core.Action) (bool, runtime.Object, error) { - return true, &apiv1.ServiceList{Items: []apiv1.Service{service}}, nil - }) - fakeKubeClient.AddWatchReactor("services", func(action core.Action) (bool, watch.Interface, error) { - return true, watch.NewFake(), nil - }) - - targetInformerFactory := func(cluster *federationapi.Cluster, clientset kubeclientset.Interface) (cache.Store, cache.Controller) { - return cache.NewInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - return clientset.Core().Services(metav1.NamespaceAll).List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - return clientset.Core().Services(metav1.NamespaceAll).Watch(options) - }, - }, - &apiv1.Service{}, - 10*time.Second, - cache.ResourceEventHandlerFuncs{}) - } - - addedClusters := make(chan string, 1) - deletedClusters := make(chan string, 1) - lifecycle := ClusterLifecycleHandlerFuncs{ - ClusterAvailable: func(cluster *federationapi.Cluster) { - addedClusters <- cluster.Name - close(addedClusters) - }, - ClusterUnavailable: func(cluster *federationapi.Cluster, _ []interface{}) { - deletedClusters <- cluster.Name - close(deletedClusters) - }, - } - - informer := NewFederatedInformer(fakeFederationClient, targetInformerFactory, &lifecycle).(*federatedInformerImpl) - informer.clientFactory = func(cluster *federationapi.Cluster) (kubeclientset.Interface, error) { - return fakeKubeClient, nil - } - assert.NotNil(t, informer) - informer.Start() - - // Wait until mycluster is synced. - for !informer.GetTargetStore().ClustersSynced([]*federationapi.Cluster{&cluster}) { - time.Sleep(time.Millisecond * 100) - } - readyClusters, err := informer.GetReadyClusters() - assert.NoError(t, err) - assert.Contains(t, readyClusters, &cluster) - serviceList, err := informer.GetTargetStore().List() - assert.NoError(t, err) - federatedService := FederatedObject{ClusterName: "mycluster", Object: &service} - assert.Contains(t, serviceList, federatedService) - service1, found, err := informer.GetTargetStore().GetByKey("mycluster", "ns1/s1") - assert.NoError(t, err) - assert.True(t, found) - assert.EqualValues(t, &service, service1) - assert.Equal(t, "mycluster", <-addedClusters) - - // All checked, lets delete the cluster. - deleteChan <- struct{}{} - for !informer.GetTargetStore().ClustersSynced([]*federationapi.Cluster{}) { - time.Sleep(time.Millisecond * 100) - } - readyClusters, err = informer.GetReadyClusters() - assert.NoError(t, err) - assert.Empty(t, readyClusters) - - serviceList, err = informer.GetTargetStore().List() - assert.NoError(t, err) - assert.Empty(t, serviceList) - - assert.Equal(t, "mycluster", <-deletedClusters) - - // Test complete. - informer.Stop() -} diff --git a/federation/pkg/federation-controller/util/federated_updater.go b/federation/pkg/federation-controller/util/federated_updater.go deleted file mode 100644 index af37580465..0000000000 --- a/federation/pkg/federation-controller/util/federated_updater.go +++ /dev/null @@ -1,157 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "fmt" - "strings" - "time" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - kubeclientset "k8s.io/client-go/kubernetes" - "k8s.io/client-go/tools/record" - "k8s.io/kubernetes/pkg/api" -) - -// Type of the operation that can be executed in Federated. -type FederatedOperationType string - -const ( - OperationTypeAdd = "add" - OperationTypeUpdate = "update" - OperationTypeDelete = "delete" -) - -// FederatedOperation definition contains type (add/update/delete) and the object itself. -type FederatedOperation struct { - Type FederatedOperationType - ClusterName string - Obj pkgruntime.Object - Key string -} - -// A helper that executes the given set of updates on federation, in parallel. -type FederatedUpdater interface { - // Executes the given set of operations. - Update([]FederatedOperation) error -} - -// A function that executes some operation using the passed client and object. -type FederatedOperationHandler func(kubeclientset.Interface, pkgruntime.Object) error - -type federatedUpdaterImpl struct { - federation FederationView - - kind string - - timeout time.Duration - - eventRecorder record.EventRecorder - - addFunction FederatedOperationHandler - updateFunction FederatedOperationHandler - deleteFunction FederatedOperationHandler -} - -func NewFederatedUpdater(federation FederationView, kind string, timeout time.Duration, recorder record.EventRecorder, add, update, del FederatedOperationHandler) FederatedUpdater { - return &federatedUpdaterImpl{ - federation: federation, - kind: kind, - timeout: timeout, - eventRecorder: recorder, - addFunction: add, - updateFunction: update, - deleteFunction: del, - } -} - -func (fu *federatedUpdaterImpl) recordEvent(obj runtime.Object, eventType, eventVerb string, args ...interface{}) { - messageFmt := eventVerb + " %s %q in cluster %s" - fu.eventRecorder.Eventf(obj, api.EventTypeNormal, eventType, messageFmt, args...) -} - -// Update executes the given set of operations within the timeout specified for -// the instance. Timeout is best-effort. There is no guarantee that the -// underlying operations are stopped when it is reached. However the function -// will return after the timeout with a non-nil error. -func (fu *federatedUpdaterImpl) Update(ops []FederatedOperation) error { - done := make(chan error, len(ops)) - for _, op := range ops { - go func(op FederatedOperation) { - clusterName := op.ClusterName - - // TODO: Ensure that the clientset has reasonable timeout. - clientset, err := fu.federation.GetClientsetForCluster(clusterName) - if err != nil { - done <- err - return - } - - eventArgs := []interface{}{fu.kind, op.Key, clusterName} - baseEventType := fmt.Sprintf("%s", op.Type) - eventType := fmt.Sprintf("%sInCluster", strings.Title(baseEventType)) - - switch op.Type { - case OperationTypeAdd: - // TODO s+OperationTypeAdd+OperationTypeCreate+ - baseEventType = "create" - eventType := "CreateInCluster" - - fu.recordEvent(op.Obj, eventType, "Creating", eventArgs...) - err = fu.addFunction(clientset, op.Obj) - case OperationTypeUpdate: - fu.recordEvent(op.Obj, eventType, "Updating", eventArgs...) - err = fu.updateFunction(clientset, op.Obj) - case OperationTypeDelete: - fu.recordEvent(op.Obj, eventType, "Deleting", eventArgs...) - err = fu.deleteFunction(clientset, op.Obj) - // IsNotFound error is fine since that means the object is deleted already. - if errors.IsNotFound(err) { - err = nil - } - } - - if err != nil { - eventType := eventType + "Failed" - messageFmt := "Failed to " + baseEventType + " %s %q in cluster %s: %v" - eventArgs = append(eventArgs, err) - fu.eventRecorder.Eventf(op.Obj, api.EventTypeWarning, eventType, messageFmt, eventArgs...) - } - - done <- err - }(op) - } - start := time.Now() - for i := 0; i < len(ops); i++ { - now := time.Now() - if !now.Before(start.Add(fu.timeout)) { - return fmt.Errorf("failed to finish all operations in %v", fu.timeout) - } - select { - case err := <-done: - if err != nil { - return err - } - case <-time.After(start.Add(fu.timeout).Sub(now)): - return fmt.Errorf("failed to finish all operations in %v", fu.timeout) - } - } - // All operations finished in time. - return nil -} diff --git a/federation/pkg/federation-controller/util/federated_updater_test.go b/federation/pkg/federation-controller/util/federated_updater_test.go deleted file mode 100644 index 242cc906dd..0000000000 --- a/federation/pkg/federation-controller/util/federated_updater_test.go +++ /dev/null @@ -1,157 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "fmt" - "testing" - "time" - - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - kubeclientset "k8s.io/client-go/kubernetes" - fakekubeclientset "k8s.io/client-go/kubernetes/fake" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - - "github.com/stretchr/testify/assert" -) - -// Fake federation view. -type fakeFederationView struct { -} - -// Verify that fakeFederationView implements FederationView interface -var _ FederationView = &fakeFederationView{} - -func (f *fakeFederationView) GetClientsetForCluster(clusterName string) (kubeclientset.Interface, error) { - return &fakekubeclientset.Clientset{}, nil -} - -func (f *fakeFederationView) GetReadyClusters() ([]*federationapi.Cluster, error) { - return []*federationapi.Cluster{}, nil -} - -func (f *fakeFederationView) GetUnreadyClusters() ([]*federationapi.Cluster, error) { - return []*federationapi.Cluster{}, nil -} - -func (f *fakeFederationView) GetReadyCluster(name string) (*federationapi.Cluster, bool, error) { - return nil, false, nil -} - -func (f *fakeFederationView) ClustersSynced() bool { - return true -} - -type fakeEventRecorder struct{} - -func (f *fakeEventRecorder) Event(object pkgruntime.Object, eventtype, reason, message string) {} -func (f *fakeEventRecorder) Eventf(object pkgruntime.Object, eventtype, reason, messageFmt string, args ...interface{}) { -} -func (f *fakeEventRecorder) PastEventf(object pkgruntime.Object, timestamp metav1.Time, eventtype, reason, messageFmt string, args ...interface{}) { -} - -func TestFederatedUpdaterOK(t *testing.T) { - addChan := make(chan string, 5) - updateChan := make(chan string, 5) - - updater := NewFederatedUpdater(&fakeFederationView{}, "foo", time.Minute, &fakeEventRecorder{}, - func(_ kubeclientset.Interface, obj pkgruntime.Object) error { - service := obj.(*apiv1.Service) - addChan <- service.Name - return nil - }, - func(_ kubeclientset.Interface, obj pkgruntime.Object) error { - service := obj.(*apiv1.Service) - updateChan <- service.Name - return nil - }, - noop) - - err := updater.Update([]FederatedOperation{ - { - Type: OperationTypeAdd, - Obj: makeService("A", "s1"), - }, - { - Type: OperationTypeUpdate, - Obj: makeService("B", "s2"), - }, - }) - assert.NoError(t, err) - add := <-addChan - update := <-updateChan - assert.Equal(t, "s1", add) - assert.Equal(t, "s2", update) -} - -func TestFederatedUpdaterError(t *testing.T) { - updater := NewFederatedUpdater(&fakeFederationView{}, "foo", time.Minute, &fakeEventRecorder{}, - func(_ kubeclientset.Interface, obj pkgruntime.Object) error { - return fmt.Errorf("boom") - }, noop, noop) - - err := updater.Update([]FederatedOperation{ - { - Type: OperationTypeAdd, - Obj: makeService("A", "s1"), - }, - { - Type: OperationTypeUpdate, - Obj: makeService("B", "s1"), - }, - }) - assert.Error(t, err) -} - -func TestFederatedUpdaterTimeout(t *testing.T) { - start := time.Now() - updater := NewFederatedUpdater(&fakeFederationView{}, "foo", time.Second, &fakeEventRecorder{}, - func(_ kubeclientset.Interface, obj pkgruntime.Object) error { - time.Sleep(time.Minute) - return nil - }, - noop, noop) - - err := updater.Update([]FederatedOperation{ - { - Type: OperationTypeAdd, - Obj: makeService("A", "s1"), - }, - { - Type: OperationTypeUpdate, - Obj: makeService("B", "s1"), - }, - }) - end := time.Now() - assert.Error(t, err) - assert.True(t, start.Add(10*time.Second).After(end)) -} - -func makeService(cluster, name string) *apiv1.Service { - return &apiv1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "ns1", - Name: name, - }, - } -} - -func noop(_ kubeclientset.Interface, _ pkgruntime.Object) error { - return nil -} diff --git a/federation/pkg/federation-controller/util/finalizers/BUILD b/federation/pkg/federation-controller/util/finalizers/BUILD deleted file mode 100644 index ec6a91ef73..0000000000 --- a/federation/pkg/federation-controller/util/finalizers/BUILD +++ /dev/null @@ -1,45 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = ["finalizers.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/finalizers", - deps = [ - "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) - -go_test( - name = "go_default_test", - srcs = ["finalizers_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/finalizers", - library = ":go_default_library", - deps = [ - "//vendor/github.com/stretchr/testify/assert:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", - ], -) diff --git a/federation/pkg/federation-controller/util/finalizers/finalizers.go b/federation/pkg/federation-controller/util/finalizers/finalizers.go deleted file mode 100644 index c1644887fc..0000000000 --- a/federation/pkg/federation-controller/util/finalizers/finalizers.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Helper functions for manipulating finalizers. -package finalizers - -import ( - meta "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/sets" -) - -// HasFinalizer returns true if the given object has the given finalizer in its ObjectMeta. -func HasFinalizer(obj runtime.Object, finalizer string) (bool, error) { - accessor, err := meta.Accessor(obj) - if err != nil { - return false, err - } - finalizers := sets.NewString(accessor.GetFinalizers()...) - return finalizers.Has(finalizer), nil -} - -// AddFinalizers adds the given finalizers to the given objects ObjectMeta. -// Returns true if the object was updated. -func AddFinalizers(obj runtime.Object, newFinalizers sets.String) (bool, error) { - accessor, err := meta.Accessor(obj) - if err != nil { - return false, err - } - oldFinalizers := sets.NewString(accessor.GetFinalizers()...) - if oldFinalizers.IsSuperset(newFinalizers) { - return false, nil - } - allFinalizers := oldFinalizers.Union(newFinalizers) - accessor.SetFinalizers(allFinalizers.List()) - return true, nil -} - -// RemoveFinalizers removes the given finalizers from the given objects ObjectMeta. -// Returns true if the object was updated. -func RemoveFinalizers(obj runtime.Object, finalizers sets.String) (bool, error) { - accessor, err := meta.Accessor(obj) - if err != nil { - return false, err - } - oldFinalizers := sets.NewString(accessor.GetFinalizers()...) - if oldFinalizers.Intersection(finalizers).Len() == 0 { - return false, nil - } - newFinalizers := oldFinalizers.Difference(finalizers) - accessor.SetFinalizers(newFinalizers.List()) - return true, nil -} diff --git a/federation/pkg/federation-controller/util/finalizers/finalizers_test.go b/federation/pkg/federation-controller/util/finalizers/finalizers_test.go deleted file mode 100644 index 7783c8f972..0000000000 --- a/federation/pkg/federation-controller/util/finalizers/finalizers_test.go +++ /dev/null @@ -1,171 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package finalizers - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/assert" - "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/sets" -) - -func newObj(finalizers []string) runtime.Object { - pod := v1.Pod{} - pod.ObjectMeta.Finalizers = finalizers - return &pod -} - -func TestHasFinalizer(t *testing.T) { - testCases := []struct { - obj runtime.Object - finalizer string - result bool - }{ - { - newObj([]string{}), - "", - false, - }, - { - newObj([]string{}), - "someFinalizer", - false, - }, - { - newObj([]string{"someFinalizer"}), - "", - false, - }, - { - newObj([]string{"someFinalizer"}), - "anotherFinalizer", - false, - }, - { - newObj([]string{"someFinalizer"}), - "someFinalizer", - true, - }, - { - newObj([]string{"anotherFinalizer", "someFinalizer"}), - "someFinalizer", - true, - }, - } - for index, test := range testCases { - hasFinalizer, _ := HasFinalizer(test.obj, test.finalizer) - assert.Equal(t, hasFinalizer, test.result, fmt.Sprintf("Test case %d failed. Expected: %v, actual: %v", index, test.result, hasFinalizer)) - } -} - -func TestAddFinalizers(t *testing.T) { - testCases := []struct { - obj runtime.Object - finalizers sets.String - isUpdated bool - newFinalizers []string - }{ - { - newObj([]string{}), - sets.NewString(), - false, - []string{}, - }, - { - newObj([]string{}), - sets.NewString("someFinalizer"), - true, - []string{"someFinalizer"}, - }, - { - newObj([]string{"someFinalizer"}), - sets.NewString(), - false, - []string{"someFinalizer"}, - }, - { - newObj([]string{"someFinalizer"}), - sets.NewString("anotherFinalizer"), - true, - []string{"anotherFinalizer", "someFinalizer"}, - }, - { - newObj([]string{"someFinalizer"}), - sets.NewString("someFinalizer"), - false, - []string{"someFinalizer"}, - }, - } - for index, test := range testCases { - isUpdated, _ := AddFinalizers(test.obj, test.finalizers) - assert.Equal(t, isUpdated, test.isUpdated, fmt.Sprintf("Test case %d failed. Expected isUpdated: %v, actual: %v", index, test.isUpdated, isUpdated)) - accessor, _ := meta.Accessor(test.obj) - newFinalizers := accessor.GetFinalizers() - assert.Equal(t, test.newFinalizers, newFinalizers, fmt.Sprintf("Test case %d failed. Expected finalizers: %v, actual: %v", index, test.newFinalizers, newFinalizers)) - } -} - -func TestRemoveFinalizers(t *testing.T) { - testCases := []struct { - obj runtime.Object - finalizers sets.String - isUpdated bool - newFinalizers []string - }{ - { - newObj([]string{}), - sets.NewString(), - false, - []string{}, - }, - { - newObj([]string{}), - sets.NewString("someFinalizer"), - false, - []string{}, - }, - { - newObj([]string{"someFinalizer"}), - sets.NewString(), - false, - []string{"someFinalizer"}, - }, - { - newObj([]string{"someFinalizer"}), - sets.NewString("anotherFinalizer"), - false, - []string{"someFinalizer"}, - }, - { - newObj([]string{"someFinalizer", "anotherFinalizer"}), - sets.NewString("someFinalizer"), - true, - []string{"anotherFinalizer"}, - }, - } - for index, test := range testCases { - isUpdated, _ := RemoveFinalizers(test.obj, test.finalizers) - assert.Equal(t, isUpdated, test.isUpdated, fmt.Sprintf("Test case %d failed. Expected isUpdated: %v, actual: %v", index, test.isUpdated, isUpdated)) - accessor, _ := meta.Accessor(test.obj) - newFinalizers := accessor.GetFinalizers() - assert.Equal(t, test.newFinalizers, newFinalizers, fmt.Sprintf("Test case %d failed. Expected finalizers: %v, actual: %v", index, test.newFinalizers, newFinalizers)) - } -} diff --git a/federation/pkg/federation-controller/util/handlers.go b/federation/pkg/federation-controller/util/handlers.go deleted file mode 100644 index 406d5ca316..0000000000 --- a/federation/pkg/federation-controller/util/handlers.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "fmt" - "reflect" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/tools/cache" -) - -// Returns cache.ResourceEventHandlerFuncs that trigger the given function -// on all object changes. -func NewTriggerOnAllChanges(triggerFunc func(pkgruntime.Object)) *cache.ResourceEventHandlerFuncs { - return &cache.ResourceEventHandlerFuncs{ - DeleteFunc: func(old interface{}) { - oldObj := old.(pkgruntime.Object) - triggerFunc(oldObj) - }, - AddFunc: func(cur interface{}) { - curObj := cur.(pkgruntime.Object) - triggerFunc(curObj) - }, - UpdateFunc: func(old, cur interface{}) { - curObj := cur.(pkgruntime.Object) - if !reflect.DeepEqual(old, cur) { - triggerFunc(curObj) - } - }, - } -} - -// Returns cache.ResourceEventHandlerFuncs that trigger the given function -// on object add and delete as well as spec/object meta on update. -func NewTriggerOnMetaAndSpecChanges(triggerFunc func(pkgruntime.Object)) *cache.ResourceEventHandlerFuncs { - getFieldOrPanic := func(obj interface{}, fieldName string) interface{} { - val := reflect.ValueOf(obj).Elem().FieldByName(fieldName) - if val.IsValid() { - return val.Interface() - } else { - panic(fmt.Errorf("field not found: %s", fieldName)) - } - } - return &cache.ResourceEventHandlerFuncs{ - DeleteFunc: func(old interface{}) { - oldObj := old.(pkgruntime.Object) - triggerFunc(oldObj) - }, - AddFunc: func(cur interface{}) { - curObj := cur.(pkgruntime.Object) - triggerFunc(curObj) - }, - UpdateFunc: func(old, cur interface{}) { - curObj := cur.(pkgruntime.Object) - oldMeta := getFieldOrPanic(old, "ObjectMeta").(metav1.ObjectMeta) - curMeta := getFieldOrPanic(cur, "ObjectMeta").(metav1.ObjectMeta) - if !ObjectMetaEquivalent(oldMeta, curMeta) || - !reflect.DeepEqual(oldMeta.DeletionTimestamp, curMeta.DeletionTimestamp) || - !reflect.DeepEqual(getFieldOrPanic(old, "Spec"), getFieldOrPanic(cur, "Spec")) { - triggerFunc(curObj) - } - }, - } -} - -// Returns cache.ResourceEventHandlerFuncs that trigger the given function -// on object add/delete or ObjectMeta or given field is updated. -func NewTriggerOnMetaAndFieldChanges(field string, triggerFunc func(pkgruntime.Object)) *cache.ResourceEventHandlerFuncs { - getFieldOrPanic := func(obj interface{}, fieldName string) interface{} { - val := reflect.ValueOf(obj).Elem().FieldByName(fieldName) - if val.IsValid() { - return val.Interface() - } else { - panic(fmt.Errorf("field not found: %s", fieldName)) - } - } - return &cache.ResourceEventHandlerFuncs{ - DeleteFunc: func(old interface{}) { - oldObj := old.(pkgruntime.Object) - triggerFunc(oldObj) - }, - AddFunc: func(cur interface{}) { - curObj := cur.(pkgruntime.Object) - triggerFunc(curObj) - }, - UpdateFunc: func(old, cur interface{}) { - curObj := cur.(pkgruntime.Object) - oldMeta := getFieldOrPanic(old, "ObjectMeta").(metav1.ObjectMeta) - curMeta := getFieldOrPanic(cur, "ObjectMeta").(metav1.ObjectMeta) - if !ObjectMetaEquivalent(oldMeta, curMeta) || - !reflect.DeepEqual(getFieldOrPanic(old, field), getFieldOrPanic(cur, field)) { - triggerFunc(curObj) - } - }, - } -} diff --git a/federation/pkg/federation-controller/util/handlers_test.go b/federation/pkg/federation-controller/util/handlers_test.go deleted file mode 100644 index 20c2753352..0000000000 --- a/federation/pkg/federation-controller/util/handlers_test.go +++ /dev/null @@ -1,100 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "testing" - - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - pkgruntime "k8s.io/apimachinery/pkg/runtime" - - "github.com/stretchr/testify/assert" -) - -func TestHandlers(t *testing.T) { - // There is a single service ns1/s1 in cluster mycluster. - service := apiv1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "ns1", - Name: "s1", - }, - } - service2 := apiv1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "ns1", - Name: "s1", - Annotations: map[string]string{ - "A": "B", - }, - }, - } - triggerChan := make(chan struct{}, 1) - triggered := func() bool { - select { - case <-triggerChan: - return true - default: - return false - } - } - - trigger := NewTriggerOnAllChanges( - func(obj pkgruntime.Object) { - triggerChan <- struct{}{} - }) - - trigger.OnAdd(&service) - assert.True(t, triggered()) - trigger.OnDelete(&service) - assert.True(t, triggered()) - trigger.OnUpdate(&service, &service) - assert.False(t, triggered()) - trigger.OnUpdate(&service, &service2) - assert.True(t, triggered()) - - trigger2 := NewTriggerOnMetaAndSpecChanges( - func(obj pkgruntime.Object) { - triggerChan <- struct{}{} - }, - ) - - trigger2.OnAdd(&service) - assert.True(t, triggered()) - trigger2.OnDelete(&service) - assert.True(t, triggered()) - trigger2.OnUpdate(&service, &service) - assert.False(t, triggered()) - trigger2.OnUpdate(&service, &service2) - assert.True(t, triggered()) - - service3 := apiv1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "ns1", - Name: "s1", - }, - Status: apiv1.ServiceStatus{ - LoadBalancer: apiv1.LoadBalancerStatus{ - Ingress: []apiv1.LoadBalancerIngress{{ - Hostname: "A", - }}, - }, - }, - } - trigger2.OnUpdate(&service, &service3) - assert.False(t, triggered()) -} diff --git a/federation/pkg/federation-controller/util/hpa/BUILD b/federation/pkg/federation-controller/util/hpa/BUILD deleted file mode 100644 index 1b86ba4583..0000000000 --- a/federation/pkg/federation-controller/util/hpa/BUILD +++ /dev/null @@ -1,39 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = ["hpa.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/hpa", - visibility = ["//visibility:public"], - deps = [ - "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["hpa_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/hpa", - library = ":go_default_library", - deps = [ - "//vendor/github.com/stretchr/testify/require:go_default_library", - "//vendor/k8s.io/api/autoscaling/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], - visibility = ["//visibility:public"], -) diff --git a/federation/pkg/federation-controller/util/hpa/hpa.go b/federation/pkg/federation-controller/util/hpa/hpa.go deleted file mode 100644 index d7a056f5e2..0000000000 --- a/federation/pkg/federation-controller/util/hpa/hpa.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package hpa - -import ( - "encoding/json" - - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/runtime" -) - -const ( - // FederatedAnnotationOnHpaTargetObj as key, is used by hpa controller to - // set selected cluster name list as annotation on the target object. - FederatedAnnotationOnHpaTargetObj = "federation.kubernetes.io/hpa-target-cluster-list" -) - -// ClusterNames stores the list of clusters represented by names as appearing on federation -// cluster objects. This is set by federation hpa and used by target objects federation -// controller to restrict that target object to only these clusters. -type ClusterNames struct { - Names []string -} - -func (cn *ClusterNames) String() string { - annotationBytes, _ := json.Marshal(cn) - return string(annotationBytes[:]) -} - -// GetHpaTargetClusterList is used to get the list of clusters from the target object -// annotations. -func GetHpaTargetClusterList(obj runtime.Object) (*ClusterNames, error) { - accessor, _ := meta.Accessor(obj) - targetObjAnno := accessor.GetAnnotations() - if targetObjAnno == nil { - return nil, nil - } - targetObjAnnoString, exists := targetObjAnno[FederatedAnnotationOnHpaTargetObj] - if !exists { - return nil, nil - } - - clusterNames := &ClusterNames{} - if err := json.Unmarshal([]byte(targetObjAnnoString), clusterNames); err != nil { - return nil, err - } - return clusterNames, nil -} - -// SetHpaTargetClusterList is used to set the list of clusters on the target object -// annotations. -func SetHpaTargetClusterList(obj runtime.Object, clusterNames ClusterNames) runtime.Object { - accessor, _ := meta.Accessor(obj) - anno := accessor.GetAnnotations() - if anno == nil { - anno = make(map[string]string) - accessor.SetAnnotations(anno) - } - anno[FederatedAnnotationOnHpaTargetObj] = clusterNames.String() - return obj -} diff --git a/federation/pkg/federation-controller/util/hpa/hpa_test.go b/federation/pkg/federation-controller/util/hpa/hpa_test.go deleted file mode 100644 index d12943bae7..0000000000 --- a/federation/pkg/federation-controller/util/hpa/hpa_test.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package hpa - -import ( - "testing" - - autoscalingv1 "k8s.io/api/autoscaling/v1" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/stretchr/testify/require" -) - -func TestGetHpaTargetClusterList(t *testing.T) { - // Any object is fine for this test. - obj := &autoscalingv1.HorizontalPodAutoscaler{ - ObjectMeta: metav1.ObjectMeta{ - Name: "myhpa", - Namespace: "myNamespace", - SelfLink: "/api/mylink", - }, - } - - testCases := map[string]struct { - clusterNames *ClusterNames - expectedErr bool - }{ - "Wrong data set on annotations should return unmarshalling error when retrieving": { - expectedErr: true, - }, - "Get clusternames on annotations with 2 clusters, should have same names, which were set": { - clusterNames: &ClusterNames{ - Names: []string{ - "c1", - "c2", - }, - }, - }, - } - - for testName, testCase := range testCases { - t.Run(testName, func(t *testing.T) { - accessor, _ := meta.Accessor(obj) - anno := accessor.GetAnnotations() - if anno == nil { - anno = make(map[string]string) - accessor.SetAnnotations(anno) - } - if testCase.expectedErr { - anno[FederatedAnnotationOnHpaTargetObj] = "{" //some random string - } else { - anno[FederatedAnnotationOnHpaTargetObj] = testCase.clusterNames.String() - } - - readNames, err := GetHpaTargetClusterList(obj) - - if testCase.expectedErr { - require.Error(t, err, "An error was expected") - } else { - require.Equal(t, testCase.clusterNames, readNames, "Names should have been equal") - } - }) - } -} - -func TestSetHpaTargetClusterList(t *testing.T) { - // Any object is fine for this test. - obj := &autoscalingv1.HorizontalPodAutoscaler{ - ObjectMeta: metav1.ObjectMeta{ - Name: "myhpa", - Namespace: "myNamespace", - SelfLink: "/api/mylink", - }, - } - - testCases := map[string]struct { - clusterNames ClusterNames - expectedErr bool - }{ - "Get clusternames on annotations with 2 clusters, should have same names, which were set": { - clusterNames: ClusterNames{ - Names: []string{ - "c1", - "c2", - }, - }, - }, - } - - for testName, testCase := range testCases { - t.Run(testName, func(t *testing.T) { - - SetHpaTargetClusterList(obj, testCase.clusterNames) - readNames, err := GetHpaTargetClusterList(obj) - require.NoError(t, err, "An error should not have happened") - require.Equal(t, &testCase.clusterNames, readNames, "Names should have been equal") - - }) - } -} diff --git a/federation/pkg/federation-controller/util/meta.go b/federation/pkg/federation-controller/util/meta.go deleted file mode 100644 index 2bd14d1659..0000000000 --- a/federation/pkg/federation-controller/util/meta.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "reflect" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" -) - -// Copies cluster-independent, user provided data from the given ObjectMeta struct. If in -// the future the ObjectMeta structure is expanded then any field that is not populated -// by the api server should be included here. -func copyObjectMeta(obj metav1.ObjectMeta) metav1.ObjectMeta { - return metav1.ObjectMeta{ - Name: obj.Name, - Namespace: obj.Namespace, - Labels: obj.Labels, - Annotations: obj.Annotations, - } -} - -// Deep copies cluster-independent, user provided data from the given ObjectMeta struct. If in -// the future the ObjectMeta structure is expanded then any field that is not populated -// by the api server should be included here. -func DeepCopyRelevantObjectMeta(obj metav1.ObjectMeta) metav1.ObjectMeta { - copyMeta := copyObjectMeta(obj) - if obj.Labels != nil { - copyMeta.Labels = make(map[string]string) - for key, val := range obj.Labels { - copyMeta.Labels[key] = val - } - } - if obj.Annotations != nil { - copyMeta.Annotations = make(map[string]string) - for key, val := range obj.Annotations { - copyMeta.Annotations[key] = val - } - } - return copyMeta -} - -// Checks if cluster-independent, user provided data in two given ObjectMeta are equal. If in -// the future the ObjectMeta structure is expanded then any field that is not populated -// by the api server should be included here. -func ObjectMetaEquivalent(a, b metav1.ObjectMeta) bool { - if a.Name != b.Name { - return false - } - if a.Namespace != b.Namespace { - return false - } - if !reflect.DeepEqual(a.Labels, b.Labels) && (len(a.Labels) != 0 || len(b.Labels) != 0) { - return false - } - if !reflect.DeepEqual(a.Annotations, b.Annotations) && (len(a.Annotations) != 0 || len(b.Annotations) != 0) { - return false - } - return true -} - -// Checks if cluster-independent, user provided data in ObjectMeta and Spec in two given top -// level api objects are equivalent. -func ObjectMetaAndSpecEquivalent(a, b runtime.Object) bool { - objectMetaA := reflect.ValueOf(a).Elem().FieldByName("ObjectMeta").Interface().(metav1.ObjectMeta) - objectMetaB := reflect.ValueOf(b).Elem().FieldByName("ObjectMeta").Interface().(metav1.ObjectMeta) - specA := reflect.ValueOf(a).Elem().FieldByName("Spec").Interface() - specB := reflect.ValueOf(b).Elem().FieldByName("Spec").Interface() - return ObjectMetaEquivalent(objectMetaA, objectMetaB) && reflect.DeepEqual(specA, specB) -} diff --git a/federation/pkg/federation-controller/util/meta_test.go b/federation/pkg/federation-controller/util/meta_test.go deleted file mode 100644 index b41c26297a..0000000000 --- a/federation/pkg/federation-controller/util/meta_test.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "testing" - - api_v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/stretchr/testify/assert" -) - -func TestObjectMeta(t *testing.T) { - o1 := metav1.ObjectMeta{ - Namespace: "ns1", - Name: "s1", - UID: "1231231412", - ResourceVersion: "999", - } - o2 := copyObjectMeta(o1) - o3 := metav1.ObjectMeta{ - Namespace: "ns1", - Name: "s1", - UID: "1231231412", - Annotations: map[string]string{"A": "B"}, - } - o4 := metav1.ObjectMeta{ - Namespace: "ns1", - Name: "s1", - UID: "1231255531412", - Annotations: map[string]string{"A": "B"}, - } - o5 := metav1.ObjectMeta{ - Namespace: "ns1", - Name: "s1", - ResourceVersion: "1231231412", - Annotations: map[string]string{"A": "B"}, - } - o6 := metav1.ObjectMeta{ - Namespace: "ns1", - Name: "s1", - ResourceVersion: "1231255531412", - Annotations: map[string]string{"A": "B"}, - } - o7 := metav1.ObjectMeta{ - Namespace: "ns1", - Name: "s1", - ResourceVersion: "1231255531412", - Annotations: map[string]string{}, - Labels: map[string]string{}, - } - o8 := metav1.ObjectMeta{ - Namespace: "ns1", - Name: "s1", - ResourceVersion: "1231255531412", - } - assert.Equal(t, 0, len(o2.UID)) - assert.Equal(t, 0, len(o2.ResourceVersion)) - assert.Equal(t, o1.Name, o2.Name) - assert.True(t, ObjectMetaEquivalent(o1, o2)) - assert.False(t, ObjectMetaEquivalent(o1, o3)) - assert.True(t, ObjectMetaEquivalent(o3, o4)) - assert.True(t, ObjectMetaEquivalent(o5, o6)) - assert.True(t, ObjectMetaEquivalent(o3, o5)) - assert.True(t, ObjectMetaEquivalent(o7, o8)) - assert.True(t, ObjectMetaEquivalent(o8, o7)) -} - -func TestObjectMetaAndSpec(t *testing.T) { - s1 := api_v1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "ns1", - Name: "s1", - }, - Spec: api_v1.ServiceSpec{ - ExternalName: "Service1", - }, - } - s1b := s1 - s2 := api_v1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "ns1", - Name: "s2", - }, - Spec: api_v1.ServiceSpec{ - ExternalName: "Service1", - }, - } - s3 := api_v1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "ns1", - Name: "s1", - }, - Spec: api_v1.ServiceSpec{ - ExternalName: "Service2", - }, - } - assert.True(t, ObjectMetaAndSpecEquivalent(&s1, &s1b)) - assert.False(t, ObjectMetaAndSpecEquivalent(&s1, &s2)) - assert.False(t, ObjectMetaAndSpecEquivalent(&s1, &s3)) - assert.False(t, ObjectMetaAndSpecEquivalent(&s2, &s3)) -} diff --git a/federation/pkg/federation-controller/util/planner/BUILD b/federation/pkg/federation-controller/util/planner/BUILD deleted file mode 100644 index 132e36601a..0000000000 --- a/federation/pkg/federation-controller/util/planner/BUILD +++ /dev/null @@ -1,38 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = ["planner.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/planner", - deps = ["//federation/apis/federation:go_default_library"], -) - -go_test( - name = "go_default_test", - srcs = ["planner_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/planner", - library = ":go_default_library", - deps = [ - "//federation/apis/federation:go_default_library", - "//vendor/github.com/stretchr/testify/assert:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/util/planner/planner.go b/federation/pkg/federation-controller/util/planner/planner.go deleted file mode 100644 index f25fbbc0ce..0000000000 --- a/federation/pkg/federation-controller/util/planner/planner.go +++ /dev/null @@ -1,238 +0,0 @@ -/* -Copyright 2016 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 planner - -import ( - "hash/fnv" - "sort" - - fedapi "k8s.io/kubernetes/federation/apis/federation" -) - -// Planner decides how many out of the given replicas should be placed in each of the -// federated clusters. -type Planner struct { - preferences *fedapi.ReplicaAllocationPreferences -} - -type namedClusterPreferences struct { - clusterName string - hash uint32 - fedapi.ClusterPreferences -} - -type byWeight []*namedClusterPreferences - -func (a byWeight) Len() int { return len(a) } -func (a byWeight) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -// Preferences are sorted according by decreasing weight and increasing hash (built on top of cluster name and rs name). -// Sorting is made by a hash to avoid assigning single-replica rs to the alphabetically smallest cluster. -func (a byWeight) Less(i, j int) bool { - return (a[i].Weight > a[j].Weight) || (a[i].Weight == a[j].Weight && a[i].hash < a[j].hash) -} - -func NewPlanner(preferences *fedapi.ReplicaAllocationPreferences) *Planner { - return &Planner{ - preferences: preferences, - } -} - -// Distribute the desired number of replicas among the given cluster according to the planner preferences. -// The function tries its best to assign each cluster the preferred number of replicas, however if -// sum of MinReplicas for all cluster is bigger thant replicasToDistribute then some cluster will not -// have all of the replicas assigned. In such case a cluster with higher weight has priority over -// cluster with lower weight (or with lexicographically smaller name in case of draw). -// It can also use the current replica count and estimated capacity to provide better planning and -// adhere to rebalance policy. To avoid prioritization of clusters with smaller lexicographical names -// a semi-random string (like replica set name) can be provided. -// Two maps are returned: -// * a map that contains information how many replicas will be possible to run in a cluster. -// * a map that contains information how many extra replicas would be nice to schedule in a cluster so, -// if by chance, they are scheduled we will be closer to the desired replicas layout. -func (p *Planner) Plan(replicasToDistribute int64, availableClusters []string, currentReplicaCount map[string]int64, - estimatedCapacity map[string]int64, replicaSetKey string) (map[string]int64, map[string]int64) { - - preferences := make([]*namedClusterPreferences, 0, len(availableClusters)) - plan := make(map[string]int64, len(preferences)) - overflow := make(map[string]int64, len(preferences)) - - named := func(name string, pref fedapi.ClusterPreferences) *namedClusterPreferences { - // Seems to work better than addler for our case. - hasher := fnv.New32() - hasher.Write([]byte(name)) - hasher.Write([]byte(replicaSetKey)) - - return &namedClusterPreferences{ - clusterName: name, - hash: hasher.Sum32(), - ClusterPreferences: pref, - } - } - - for _, cluster := range availableClusters { - if localRSP, found := p.preferences.Clusters[cluster]; found { - preferences = append(preferences, named(cluster, localRSP)) - } else { - if localRSP, found := p.preferences.Clusters["*"]; found { - preferences = append(preferences, named(cluster, localRSP)) - } else { - plan[cluster] = int64(0) - } - } - } - sort.Sort(byWeight(preferences)) - - remainingReplicas := replicasToDistribute - - // Assign each cluster the minimum number of replicas it requested. - for _, preference := range preferences { - min := minInt64(preference.MinReplicas, remainingReplicas) - if capacity, hasCapacity := estimatedCapacity[preference.clusterName]; hasCapacity { - min = minInt64(min, capacity) - } - remainingReplicas -= min - plan[preference.clusterName] = min - } - - // This map contains information how many replicas were assigned to - // the cluster based only on the current replica count and - // rebalance=false preference. It will be later used in remaining replica - // distribution code. - preallocated := make(map[string]int64) - - if p.preferences.Rebalance == false { - for _, preference := range preferences { - planned := plan[preference.clusterName] - count, hasSome := currentReplicaCount[preference.clusterName] - if hasSome && count > planned { - target := count - if preference.MaxReplicas != nil { - target = minInt64(*preference.MaxReplicas, target) - } - if capacity, hasCapacity := estimatedCapacity[preference.clusterName]; hasCapacity { - target = minInt64(capacity, target) - } - extra := minInt64(target-planned, remainingReplicas) - if extra < 0 { - extra = 0 - } - remainingReplicas -= extra - preallocated[preference.clusterName] = extra - plan[preference.clusterName] = extra + planned - } - } - } - - modified := true - - // It is possible single pass of the loop is not enough to distribute all replicas among clusters due - // to weight, max and rounding corner cases. In such case we iterate until either - // there is no replicas or no cluster gets any more replicas or the number - // of attempts is less than available cluster count. If there is no preallocated pods - // every loop either distributes all remainingReplicas or maxes out at least one cluster. - // If there are preallocated then the replica spreading may take longer. - // We reduce the number of pending preallocated replicas by at least half with each iteration so - // we may need log(replicasAtStart) iterations. - // TODO: Prove that clusterCount * log(replicas) iterations solves the problem or adjust the number. - // TODO: This algorithm is O(clusterCount^2 * log(replicas)) which is good for up to 100 clusters. - // Find something faster. - for trial := 0; modified && remainingReplicas > 0; trial++ { - - modified = false - weightSum := int64(0) - for _, preference := range preferences { - weightSum += preference.Weight - } - newPreferences := make([]*namedClusterPreferences, 0, len(preferences)) - - distributeInThisLoop := remainingReplicas - - for _, preference := range preferences { - if weightSum > 0 { - start := plan[preference.clusterName] - // Distribute the remaining replicas, rounding fractions always up. - extra := (distributeInThisLoop*preference.Weight + weightSum - 1) / weightSum - extra = minInt64(extra, remainingReplicas) - - // Account preallocated. - prealloc := preallocated[preference.clusterName] - usedPrealloc := minInt64(extra, prealloc) - preallocated[preference.clusterName] = prealloc - usedPrealloc - extra = extra - usedPrealloc - if usedPrealloc > 0 { - modified = true - } - - // In total there should be the amount that was there at start plus whatever is due - // in this iteration - total := start + extra - - // Check if we don't overflow the cluster, and if yes don't consider this cluster - // in any of the following iterations. - full := false - if preference.MaxReplicas != nil && total > *preference.MaxReplicas { - total = *preference.MaxReplicas - full = true - } - if capacity, hasCapacity := estimatedCapacity[preference.clusterName]; hasCapacity && total > capacity { - overflow[preference.clusterName] = total - capacity - total = capacity - full = true - } - - if !full { - newPreferences = append(newPreferences, preference) - } - - // Only total-start replicas were actually taken. - remainingReplicas -= (total - start) - plan[preference.clusterName] = total - - // Something extra got scheduled on this cluster. - if total > start { - modified = true - } - } else { - break - } - } - preferences = newPreferences - } - - if p.preferences.Rebalance { - return plan, overflow - } else { - // If rebalance = false then overflow is trimmed at the level - // of replicas that it failed to place somewhere. - newOverflow := make(map[string]int64) - for key, value := range overflow { - value = minInt64(value, remainingReplicas) - if value > 0 { - newOverflow[key] = value - } - } - return plan, newOverflow - } -} - -func minInt64(a int64, b int64) int64 { - if a < b { - return a - } - return b -} diff --git a/federation/pkg/federation-controller/util/planner/planner_test.go b/federation/pkg/federation-controller/util/planner/planner_test.go deleted file mode 100644 index 597ee60708..0000000000 --- a/federation/pkg/federation-controller/util/planner/planner_test.go +++ /dev/null @@ -1,348 +0,0 @@ -/* -Copyright 2016 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 planner - -import ( - "testing" - - fedapi "k8s.io/kubernetes/federation/apis/federation" - - "github.com/stretchr/testify/assert" -) - -func doCheck(t *testing.T, pref map[string]fedapi.ClusterPreferences, replicas int64, clusters []string, expected map[string]int64) { - planer := NewPlanner(&fedapi.ReplicaAllocationPreferences{ - Clusters: pref, - }) - plan, overflow := planer.Plan(replicas, clusters, map[string]int64{}, map[string]int64{}, "") - assert.EqualValues(t, expected, plan) - assert.Equal(t, 0, len(overflow)) -} - -func doCheckWithExisting(t *testing.T, pref map[string]fedapi.ClusterPreferences, replicas int64, clusters []string, - existing map[string]int64, expected map[string]int64) { - planer := NewPlanner(&fedapi.ReplicaAllocationPreferences{ - Clusters: pref, - }) - plan, overflow := planer.Plan(replicas, clusters, existing, map[string]int64{}, "") - assert.Equal(t, 0, len(overflow)) - assert.EqualValues(t, expected, plan) -} - -func doCheckWithExistingAndCapacity(t *testing.T, rebalance bool, pref map[string]fedapi.ClusterPreferences, replicas int64, clusters []string, - existing map[string]int64, - capacity map[string]int64, - expected map[string]int64, - expectedOverflow map[string]int64) { - planer := NewPlanner(&fedapi.ReplicaAllocationPreferences{ - Rebalance: rebalance, - Clusters: pref, - }) - plan, overflow := planer.Plan(replicas, clusters, existing, capacity, "") - assert.EqualValues(t, expected, plan) - assert.Equal(t, expectedOverflow, overflow) -} - -func pint(val int64) *int64 { - return &val -} - -func TestEqual(t *testing.T) { - doCheck(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 50, []string{"A", "B", "C"}, - // hash dependent - map[string]int64{"A": 16, "B": 17, "C": 17}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 50, []string{"A", "B"}, - map[string]int64{"A": 25, "B": 25}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 1, []string{"A", "B"}, - // hash dependent - map[string]int64{"A": 0, "B": 1}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 1, []string{"A", "B", "C", "D"}, - // hash dependent - map[string]int64{"A": 0, "B": 0, "C": 0, "D": 1}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 1, []string{"A"}, - map[string]int64{"A": 1}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 1, []string{}, - map[string]int64{}) -} - -func TestEqualWithExisting(t *testing.T) { - doCheckWithExisting(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 50, []string{"A", "B", "C"}, - map[string]int64{"C": 30}, - map[string]int64{"A": 10, "B": 10, "C": 30}) - - doCheckWithExisting(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 50, []string{"A", "B"}, - map[string]int64{"A": 30}, - map[string]int64{"A": 30, "B": 20}) - - doCheckWithExisting(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 15, []string{"A", "B"}, - map[string]int64{"A": 0, "B": 8}, - map[string]int64{"A": 7, "B": 8}) - - doCheckWithExisting(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 15, []string{"A", "B"}, - map[string]int64{"A": 1, "B": 8}, - map[string]int64{"A": 7, "B": 8}) - - doCheckWithExisting(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 15, []string{"A", "B"}, - map[string]int64{"A": 4, "B": 8}, - map[string]int64{"A": 7, "B": 8}) - - doCheckWithExisting(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 15, []string{"A", "B"}, - map[string]int64{"A": 5, "B": 8}, - map[string]int64{"A": 7, "B": 8}) - - doCheckWithExisting(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 15, []string{"A", "B"}, - map[string]int64{"A": 6, "B": 8}, - map[string]int64{"A": 7, "B": 8}) - - doCheckWithExisting(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 15, []string{"A", "B"}, - map[string]int64{"A": 7, "B": 8}, - map[string]int64{"A": 7, "B": 8}) - - doCheckWithExisting(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 500000, []string{"A", "B"}, - map[string]int64{"A": 300000}, - map[string]int64{"A": 300000, "B": 200000}) - - doCheckWithExisting(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 50, []string{"A", "B"}, - map[string]int64{"A": 10}, - map[string]int64{"A": 25, "B": 25}) - - doCheckWithExisting(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 50, []string{"A", "B"}, - map[string]int64{"A": 10, "B": 70}, - // hash dependent - // TODO: Should be 10:40, update algorithm. Issue: #31816 - map[string]int64{"A": 0, "B": 50}) - - doCheckWithExisting(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 1, []string{"A", "B"}, - map[string]int64{"A": 30}, - map[string]int64{"A": 1, "B": 0}) - - doCheckWithExisting(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 50, []string{"A", "B"}, - map[string]int64{"A": 10, "B": 20}, - map[string]int64{"A": 25, "B": 25}) -} - -func TestWithExistingAndCapacity(t *testing.T) { - // desired without capacity: map[string]int64{"A": 17, "B": 17, "C": 16}) - doCheckWithExistingAndCapacity(t, true, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1}}, - 50, []string{"A", "B", "C"}, - map[string]int64{}, - map[string]int64{"C": 10}, - map[string]int64{"A": 20, "B": 20, "C": 10}, - map[string]int64{"C": 7}) - - // desired B:50 C:0 - doCheckWithExistingAndCapacity(t, true, map[string]fedapi.ClusterPreferences{ - "A": {Weight: 10000}, - "B": {Weight: 1}}, - 50, []string{"B", "C"}, - map[string]int64{}, - map[string]int64{"B": 10}, - map[string]int64{"B": 10, "C": 0}, - map[string]int64{"B": 40}, - ) - - // desired A:20 B:40 - doCheckWithExistingAndCapacity(t, true, map[string]fedapi.ClusterPreferences{ - "A": {Weight: 1}, - "B": {Weight: 2}}, - 60, []string{"A", "B", "C"}, - map[string]int64{}, - map[string]int64{"B": 10}, - map[string]int64{"A": 50, "B": 10, "C": 0}, - map[string]int64{"B": 30}) - - // map[string]int64{"A": 10, "B": 30, "C": 21, "D": 10}) - doCheckWithExistingAndCapacity(t, true, map[string]fedapi.ClusterPreferences{ - "A": {Weight: 10000, MaxReplicas: pint(10)}, - "B": {Weight: 1}, - "C": {Weight: 1, MaxReplicas: pint(21)}, - "D": {Weight: 1, MaxReplicas: pint(10)}}, - 71, []string{"A", "B", "C", "D"}, - map[string]int64{}, - map[string]int64{"C": 10}, - map[string]int64{"A": 10, "B": 41, "C": 10, "D": 10}, - map[string]int64{"C": 11}, - ) - - // desired A:20 B:20 - doCheckWithExistingAndCapacity(t, false, map[string]fedapi.ClusterPreferences{ - "A": {Weight: 1}, - "B": {Weight: 1}}, - 60, []string{"A", "B", "C"}, - map[string]int64{}, - map[string]int64{"A": 10, "B": 10}, - map[string]int64{"A": 10, "B": 10, "C": 0}, - map[string]int64{"A": 20, "B": 20}) - - // desired A:10 B:50 although A:50 B:10 is fuly acceptable because rebalance = false - doCheckWithExistingAndCapacity(t, false, map[string]fedapi.ClusterPreferences{ - "A": {Weight: 1}, - "B": {Weight: 5}}, - 60, []string{"A", "B", "C"}, - map[string]int64{}, - map[string]int64{"B": 10}, - map[string]int64{"A": 50, "B": 10, "C": 0}, - map[string]int64{}) - - doCheckWithExistingAndCapacity(t, false, map[string]fedapi.ClusterPreferences{ - "*": {MinReplicas: 20, Weight: 0}}, - 50, []string{"A", "B", "C"}, - map[string]int64{}, - map[string]int64{"B": 10}, - map[string]int64{"A": 20, "B": 10, "C": 20}, - map[string]int64{}) - - // Actually we would like to have extra 20 in B but 15 is also good. - doCheckWithExistingAndCapacity(t, true, map[string]fedapi.ClusterPreferences{ - "*": {MinReplicas: 20, Weight: 1}}, - 60, []string{"A", "B"}, - map[string]int64{}, - map[string]int64{"B": 10}, - map[string]int64{"A": 50, "B": 10}, - map[string]int64{"B": 15}) -} - -func TestMin(t *testing.T) { - doCheck(t, map[string]fedapi.ClusterPreferences{ - "*": {MinReplicas: 2, Weight: 0}}, - 50, []string{"A", "B", "C"}, - map[string]int64{"A": 2, "B": 2, "C": 2}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "*": {MinReplicas: 20, Weight: 0}}, - 50, []string{"A", "B", "C"}, - // hash dependant. - map[string]int64{"A": 10, "B": 20, "C": 20}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "*": {MinReplicas: 20, Weight: 0}, - "A": {MinReplicas: 100, Weight: 1}}, - 50, []string{"A", "B", "C"}, - map[string]int64{"A": 50, "B": 0, "C": 0}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "*": {MinReplicas: 10, Weight: 1, MaxReplicas: pint(12)}}, - 50, []string{"A", "B", "C"}, - map[string]int64{"A": 12, "B": 12, "C": 12}) -} - -func TestMax(t *testing.T) { - doCheck(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 1, MaxReplicas: pint(2)}}, - 50, []string{"A", "B", "C"}, - map[string]int64{"A": 2, "B": 2, "C": 2}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "*": {Weight: 0, MaxReplicas: pint(2)}}, - 50, []string{"A", "B", "C"}, - map[string]int64{"A": 0, "B": 0, "C": 0}) -} - -func TestWeight(t *testing.T) { - doCheck(t, map[string]fedapi.ClusterPreferences{ - "A": {Weight: 1}, - "B": {Weight: 2}}, - 60, []string{"A", "B", "C"}, - map[string]int64{"A": 20, "B": 40, "C": 0}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "A": {Weight: 10000}, - "B": {Weight: 1}}, - 50, []string{"A", "B", "C"}, - map[string]int64{"A": 50, "B": 0, "C": 0}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "A": {Weight: 10000}, - "B": {Weight: 1}}, - 50, []string{"B", "C"}, - map[string]int64{"B": 50, "C": 0}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "A": {Weight: 10000, MaxReplicas: pint(10)}, - "B": {Weight: 1}, - "C": {Weight: 1}}, - 50, []string{"A", "B", "C"}, - map[string]int64{"A": 10, "B": 20, "C": 20}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "A": {Weight: 10000, MaxReplicas: pint(10)}, - "B": {Weight: 1}, - "C": {Weight: 1, MaxReplicas: pint(10)}}, - 50, []string{"A", "B", "C"}, - map[string]int64{"A": 10, "B": 30, "C": 10}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "A": {Weight: 10000, MaxReplicas: pint(10)}, - "B": {Weight: 1}, - "C": {Weight: 1, MaxReplicas: pint(21)}, - "D": {Weight: 1, MaxReplicas: pint(10)}}, - 71, []string{"A", "B", "C", "D"}, - map[string]int64{"A": 10, "B": 30, "C": 21, "D": 10}) - - doCheck(t, map[string]fedapi.ClusterPreferences{ - "A": {Weight: 10000, MaxReplicas: pint(10)}, - "B": {Weight: 1}, - "C": {Weight: 1, MaxReplicas: pint(21)}, - "D": {Weight: 1, MaxReplicas: pint(10)}, - "E": {Weight: 1}}, - 91, []string{"A", "B", "C", "D", "E"}, - map[string]int64{"A": 10, "B": 25, "C": 21, "D": 10, "E": 25}) -} diff --git a/federation/pkg/federation-controller/util/podanalyzer/BUILD b/federation/pkg/federation-controller/util/podanalyzer/BUILD deleted file mode 100644 index e94314ca6b..0000000000 --- a/federation/pkg/federation-controller/util/podanalyzer/BUILD +++ /dev/null @@ -1,40 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = ["pod_helper.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/podanalyzer", - deps = ["//vendor/k8s.io/api/core/v1:go_default_library"], -) - -go_test( - name = "go_default_test", - srcs = ["pod_helper_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/podanalyzer", - library = ":go_default_library", - deps = [ - "//vendor/github.com/stretchr/testify/assert:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/util/podanalyzer/pod_helper.go b/federation/pkg/federation-controller/util/podanalyzer/pod_helper.go deleted file mode 100644 index 53b308f1d9..0000000000 --- a/federation/pkg/federation-controller/util/podanalyzer/pod_helper.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2016 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 podanalyzer - -import ( - "time" - - api_v1 "k8s.io/api/core/v1" -) - -type PodAnalysisResult struct { - // Total number of pods created. - Total int - // Number of pods that are running and ready. - RunningAndReady int - // Number of pods that have been in unschedulable state for UnshedulableThreshold seconds. - Unschedulable int - - // TODO: Handle other scenarios like pod waiting too long for scheduler etc. -} - -const ( - // TODO: make it configurable - UnschedulableThreshold = 60 * time.Second -) - -// AnalyzePods calculates how many pods from the list are in one of -// the meaningful (from the replica set perspective) states. This function is -// a temporary workaround against the current lack of ownerRef in pods. -func AnalyzePods(pods *api_v1.PodList, currentTime time.Time) PodAnalysisResult { - result := PodAnalysisResult{} - for _, pod := range pods.Items { - result.Total++ - for _, condition := range pod.Status.Conditions { - if pod.Status.Phase == api_v1.PodRunning { - if condition.Type == api_v1.PodReady { - result.RunningAndReady++ - } - } else if condition.Type == api_v1.PodScheduled && - condition.Status == api_v1.ConditionFalse && - condition.Reason == api_v1.PodReasonUnschedulable && - condition.LastTransitionTime.Add(UnschedulableThreshold).Before(currentTime) { - - result.Unschedulable++ - } - } - } - return result -} diff --git a/federation/pkg/federation-controller/util/podanalyzer/pod_helper_test.go b/federation/pkg/federation-controller/util/podanalyzer/pod_helper_test.go deleted file mode 100644 index 99a1611201..0000000000 --- a/federation/pkg/federation-controller/util/podanalyzer/pod_helper_test.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2016 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 podanalyzer - -import ( - "testing" - "time" - - api_v1 "k8s.io/api/core/v1" - "k8s.io/api/extensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/stretchr/testify/assert" -) - -func TestAnalyze(t *testing.T) { - now := time.Now() - podRunning := newPod("p1", - api_v1.PodStatus{ - Phase: api_v1.PodRunning, - Conditions: []api_v1.PodCondition{ - { - Type: api_v1.PodReady, - Status: api_v1.ConditionTrue, - }, - }, - }) - podUnschedulable := newPod("pU", - api_v1.PodStatus{ - Phase: api_v1.PodPending, - Conditions: []api_v1.PodCondition{ - { - Type: api_v1.PodScheduled, - Status: api_v1.ConditionFalse, - Reason: api_v1.PodReasonUnschedulable, - LastTransitionTime: metav1.Time{Time: now.Add(-10 * time.Minute)}, - }, - }, - }) - podOther := newPod("pO", - api_v1.PodStatus{ - Phase: api_v1.PodPending, - Conditions: []api_v1.PodCondition{}, - }) - - result := AnalyzePods(&api_v1.PodList{Items: []api_v1.Pod{*podRunning, *podRunning, *podRunning, *podUnschedulable, *podUnschedulable}}, now) - assert.Equal(t, PodAnalysisResult{ - Total: 5, - RunningAndReady: 3, - Unschedulable: 2, - }, result) - - result = AnalyzePods(&api_v1.PodList{Items: []api_v1.Pod{*podOther}}, now) - assert.Equal(t, PodAnalysisResult{ - Total: 1, - RunningAndReady: 0, - Unschedulable: 0, - }, result) -} - -func newReplicaSet(selectorMap map[string]string) *v1beta1.ReplicaSet { - replicas := int32(3) - rs := &v1beta1.ReplicaSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foobar", - Namespace: metav1.NamespaceDefault, - }, - Spec: v1beta1.ReplicaSetSpec{ - Replicas: &replicas, - Selector: &metav1.LabelSelector{MatchLabels: selectorMap}, - }, - } - return rs -} - -func newPod(name string, status api_v1.PodStatus) *api_v1.Pod { - return &api_v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: metav1.NamespaceDefault, - }, - Status: status, - } -} diff --git a/federation/pkg/federation-controller/util/replicapreferences/BUILD b/federation/pkg/federation-controller/util/replicapreferences/BUILD deleted file mode 100644 index d8c4266095..0000000000 --- a/federation/pkg/federation-controller/util/replicapreferences/BUILD +++ /dev/null @@ -1,45 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = ["preferences.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/replicapreferences", - deps = [ - "//federation/apis/federation:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) - -go_test( - name = "go_default_test", - srcs = ["preferences_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/replicapreferences", - library = ":go_default_library", - deps = [ - "//vendor/github.com/stretchr/testify/assert:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - ], -) diff --git a/federation/pkg/federation-controller/util/replicapreferences/preferences.go b/federation/pkg/federation-controller/util/replicapreferences/preferences.go deleted file mode 100644 index 030b3c01aa..0000000000 --- a/federation/pkg/federation-controller/util/replicapreferences/preferences.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package replicapreferences - -import ( - "encoding/json" - - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/runtime" - fed "k8s.io/kubernetes/federation/apis/federation" -) - -// GetAllocationPreferences reads the preferences from the annotations on the given object. -// It takes in an object and determines the supported types. -// Callers need to pass the string key used to store the annotations. -// Returns nil if the annotations with the given key are not found. -func GetAllocationPreferences(obj runtime.Object, key string) (*fed.ReplicaAllocationPreferences, error) { - if obj == nil { - return nil, nil - } - - accessor, err := meta.Accessor(obj) - if err != nil { - return nil, err - } - annotations := accessor.GetAnnotations() - if annotations == nil { - return nil, nil - } - - prefString, found := annotations[key] - if !found { - return nil, nil - } - - var pref fed.ReplicaAllocationPreferences - if err := json.Unmarshal([]byte(prefString), &pref); err != nil { - return nil, err - } - return &pref, nil -} diff --git a/federation/pkg/federation-controller/util/replicapreferences/preferences_test.go b/federation/pkg/federation-controller/util/replicapreferences/preferences_test.go deleted file mode 100644 index 4a91097f84..0000000000 --- a/federation/pkg/federation-controller/util/replicapreferences/preferences_test.go +++ /dev/null @@ -1,92 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package replicapreferences - -import ( - "testing" - - extensionsv1 "k8s.io/api/extensions/v1beta1" - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/stretchr/testify/assert" - "k8s.io/apimachinery/pkg/runtime" -) - -const ( - TestPreferencesAnnotationKey = "federation.kubernetes.io/test-preferences" -) - -func TestGetAllocationPreferences(t *testing.T) { - testCases := []struct { - testname string - prefs string - obj runtime.Object - errorExpected bool - }{ - { - testname: "good preferences", - prefs: `{"rebalance": true, - "clusters": { - "k8s-1": {"minReplicas": 10, "maxReplicas": 20, "weight": 2}, - "*": {"weight": 1} - }}`, - obj: &extensionsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-obj", - Namespace: metav1.NamespaceDefault, - SelfLink: "/api/v1/namespaces/default/obj/test-obj", - }, - }, - errorExpected: false, - }, - { - testname: "failed preferences", - prefs: `{`, // bad json - obj: &extensionsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-obj", - Namespace: metav1.NamespaceDefault, - SelfLink: "/api/v1/namespaces/default/obj/test-obj", - }, - }, - errorExpected: true, - }, - } - - // prepare the objects - for _, tc := range testCases { - accessor, _ := meta.Accessor(tc.obj) - anno := accessor.GetAnnotations() - if anno == nil { - anno = make(map[string]string) - accessor.SetAnnotations(anno) - } - anno[TestPreferencesAnnotationKey] = tc.prefs - } - - // test get preferences - for _, tc := range testCases { - pref, err := GetAllocationPreferences(tc.obj, TestPreferencesAnnotationKey) - if tc.errorExpected { - assert.NotNil(t, err) - } else { - assert.NotNil(t, pref) - assert.Nil(t, err) - } - } -} diff --git a/federation/pkg/federation-controller/util/secret.go b/federation/pkg/federation-controller/util/secret.go deleted file mode 100644 index e3635fbb83..0000000000 --- a/federation/pkg/federation-controller/util/secret.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "reflect" - - api_v1 "k8s.io/api/core/v1" -) - -// Checks if cluster-independent, user provided data in two given Secrets are equal. If in -// the future the Secret structure is expanded then any field that is not populated. -// by the api server should be included here. -func SecretEquivalent(s1, s2 api_v1.Secret) bool { - return ObjectMetaEquivalent(s1.ObjectMeta, s2.ObjectMeta) && - reflect.DeepEqual(s1.Data, s2.Data) && - reflect.DeepEqual(s1.Type, s2.Type) -} diff --git a/federation/pkg/federation-controller/util/test/BUILD b/federation/pkg/federation-controller/util/test/BUILD deleted file mode 100644 index 6a56a395e6..0000000000 --- a/federation/pkg/federation-controller/util/test/BUILD +++ /dev/null @@ -1,39 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["test_helper.go"], - importpath = "k8s.io/kubernetes/federation/pkg/federation-controller/util/test", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/pkg/federation-controller/util:go_default_library", - "//federation/pkg/federation-controller/util/finalizers:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/github.com/stretchr/testify/assert:go_default_library", - "//vendor/github.com/stretchr/testify/require:go_default_library", - "//vendor/k8s.io/api/core/v1: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/util/wait:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", - "//vendor/k8s.io/client-go/testing:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/federation-controller/util/test/test_helper.go b/federation/pkg/federation-controller/util/test/test_helper.go deleted file mode 100644 index 84db1babe3..0000000000 --- a/federation/pkg/federation-controller/util/test/test_helper.go +++ /dev/null @@ -1,445 +0,0 @@ -/* -Copyright 2016 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 testutil - -import ( - "fmt" - "os" - "reflect" - "runtime/pprof" - "sync" - "testing" - "time" - - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" - core "k8s.io/client-go/testing" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - "k8s.io/kubernetes/federation/pkg/federation-controller/util" - finalizersutil "k8s.io/kubernetes/federation/pkg/federation-controller/util/finalizers" - - "github.com/golang/glog" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -const ( - pushTimeout = 5 * time.Second -) - -// A structure that distributes events to multiple watchers. -type WatcherDispatcher struct { - sync.Mutex - watchers []*watch.RaceFreeFakeWatcher - eventsSoFar []*watch.Event - orderExecution chan func() - stopChan chan struct{} -} - -func (wd *WatcherDispatcher) register(watcher *watch.RaceFreeFakeWatcher) { - wd.Lock() - defer wd.Unlock() - wd.watchers = append(wd.watchers, watcher) - for _, event := range wd.eventsSoFar { - watcher.Action(event.Type, event.Object) - } -} - -func (wd *WatcherDispatcher) Stop() { - wd.Lock() - defer wd.Unlock() - close(wd.stopChan) - glog.Infof("Stopping WatcherDispatcher") - for _, watcher := range wd.watchers { - watcher.Stop() - } -} - -// Add sends an add event. -func (wd *WatcherDispatcher) Add(obj runtime.Object) { - wd.Lock() - defer wd.Unlock() - wd.eventsSoFar = append(wd.eventsSoFar, &watch.Event{Type: watch.Added, Object: obj.DeepCopyObject()}) - for _, watcher := range wd.watchers { - if !watcher.IsStopped() { - watcher.Add(obj.DeepCopyObject()) - } - } -} - -// Modify sends a modify event. -func (wd *WatcherDispatcher) Modify(obj runtime.Object) { - wd.Lock() - defer wd.Unlock() - glog.V(4).Infof("->WatcherDispatcher.Modify(%v)", obj) - wd.eventsSoFar = append(wd.eventsSoFar, &watch.Event{Type: watch.Modified, Object: obj.DeepCopyObject()}) - for i, watcher := range wd.watchers { - if !watcher.IsStopped() { - glog.V(4).Infof("->Watcher(%d).Modify(%v)", i, obj) - watcher.Modify(obj.DeepCopyObject()) - } else { - glog.V(4).Infof("->Watcher(%d) is stopped. Not calling Modify(%v)", i, obj) - } - } -} - -// Delete sends a delete event. -func (wd *WatcherDispatcher) Delete(lastValue runtime.Object) { - wd.Lock() - defer wd.Unlock() - wd.eventsSoFar = append(wd.eventsSoFar, &watch.Event{Type: watch.Deleted, Object: lastValue.DeepCopyObject()}) - for _, watcher := range wd.watchers { - if !watcher.IsStopped() { - watcher.Delete(lastValue.DeepCopyObject()) - } - } -} - -// Error sends an Error event. -func (wd *WatcherDispatcher) Error(errValue runtime.Object) { - wd.Lock() - defer wd.Unlock() - wd.eventsSoFar = append(wd.eventsSoFar, &watch.Event{Type: watch.Error, Object: errValue.DeepCopyObject()}) - for _, watcher := range wd.watchers { - if !watcher.IsStopped() { - watcher.Error(errValue.DeepCopyObject()) - } - } -} - -// Action sends an event of the requested type, for table-based testing. -func (wd *WatcherDispatcher) Action(action watch.EventType, obj runtime.Object) { - wd.Lock() - defer wd.Unlock() - wd.eventsSoFar = append(wd.eventsSoFar, &watch.Event{Type: action, Object: obj.DeepCopyObject()}) - for _, watcher := range wd.watchers { - if !watcher.IsStopped() { - watcher.Action(action, obj.DeepCopyObject()) - } - } -} - -// RegisterFakeWatch adds a new fake watcher for the specified resource in the given fake client. -// All subsequent requests for a watch on the client will result in returning this fake watcher. -func RegisterFakeWatch(resource string, client *core.Fake) *WatcherDispatcher { - dispatcher := &WatcherDispatcher{ - watchers: make([]*watch.RaceFreeFakeWatcher, 0), - eventsSoFar: make([]*watch.Event, 0), - orderExecution: make(chan func(), 100), - stopChan: make(chan struct{}), - } - go func() { - for { - select { - case fun := <-dispatcher.orderExecution: - fun() - case <-dispatcher.stopChan: - return - } - } - }() - - client.AddWatchReactor(resource, func(action core.Action) (bool, watch.Interface, error) { - watcher := watch.NewRaceFreeFake() - dispatcher.register(watcher) - return true, watcher, nil - }) - return dispatcher -} - -// RegisterFakeList registers a list response for the specified resource inside the given fake client. -// The passed value will be returned with every list call. -func RegisterFakeList(resource string, client *core.Fake, obj runtime.Object) { - client.AddReactor("list", resource, func(action core.Action) (bool, runtime.Object, error) { - return true, obj, nil - }) -} - -// RegisterFakeClusterGet registers a get response for the cluster resource inside the given fake client. -func RegisterFakeClusterGet(client *core.Fake, obj runtime.Object) { - clusterList, ok := obj.(*federationapi.ClusterList) - client.AddReactor("get", "clusters", func(action core.Action) (bool, runtime.Object, error) { - name := action.(core.GetAction).GetName() - if ok { - for _, cluster := range clusterList.Items { - if cluster.Name == name { - return true, &cluster, nil - } - } - } - return false, nil, fmt.Errorf("could not find the requested cluster: %s", name) - }) -} - -// RegisterFakeOnCreate registers a reactor in the given fake client that passes -// all created objects to the given watcher. -func RegisterFakeOnCreate(resource string, client *core.Fake, watcher *WatcherDispatcher) { - client.AddReactor("create", resource, func(action core.Action) (bool, runtime.Object, error) { - createAction := action.(core.CreateAction) - originalObj := createAction.GetObject() - // Create a copy of the object here to prevent data races while reading the object in go routine. - obj := originalObj.DeepCopyObject() - watcher.orderExecution <- func() { - glog.V(4).Infof("Object created: %v", obj) - watcher.Add(obj) - } - return true, originalObj, nil - }) -} - -// RegisterFakeCopyOnCreate registers a reactor in the given fake client that passes -// all created objects to the given watcher and also copies them to a channel for -// in-test inspection. -func RegisterFakeCopyOnCreate(resource string, client *core.Fake, watcher *WatcherDispatcher) chan runtime.Object { - objChan := make(chan runtime.Object, 100) - client.AddReactor("create", resource, func(action core.Action) (bool, runtime.Object, error) { - createAction := action.(core.CreateAction) - originalObj := createAction.GetObject() - // Create a copy of the object here to prevent data races while reading the object in go routine. - obj := originalObj.DeepCopyObject() - watcher.orderExecution <- func() { - glog.V(4).Infof("Object created. Writing to channel: %v", obj) - watcher.Add(obj) - objChan <- obj - } - return true, originalObj, nil - }) - return objChan -} - -// RegisterFakeOnUpdate registers a reactor in the given fake client that passes -// all updated objects to the given watcher. -func RegisterFakeOnUpdate(resource string, client *core.Fake, watcher *WatcherDispatcher) { - client.AddReactor("update", resource, func(action core.Action) (bool, runtime.Object, error) { - updateAction := action.(core.UpdateAction) - originalObj := updateAction.GetObject() - glog.V(7).Infof("Updating %s: %v", resource, updateAction.GetObject()) - - // Create a copy of the object here to prevent data races while reading the object in go routine. - obj := originalObj.DeepCopyObject() - operation := func() { - glog.V(4).Infof("Object updated %v", obj) - watcher.Modify(obj) - } - select { - case watcher.orderExecution <- operation: - break - case <-time.After(pushTimeout): - glog.Errorf("Fake client execution channel blocked") - glog.Errorf("Tried to push %v", updateAction) - } - return true, originalObj, nil - }) - return -} - -// RegisterFakeCopyOnUpdate registers a reactor in the given fake client that passes -// all updated objects to the given watcher and also copies them to a channel for -// in-test inspection. -func RegisterFakeCopyOnUpdate(resource string, client *core.Fake, watcher *WatcherDispatcher) chan runtime.Object { - objChan := make(chan runtime.Object, 100) - client.AddReactor("update", resource, func(action core.Action) (bool, runtime.Object, error) { - updateAction := action.(core.UpdateAction) - originalObj := updateAction.GetObject() - glog.V(7).Infof("Updating %s: %v", resource, updateAction.GetObject()) - - // Create a copy of the object here to prevent data races while reading the object in go routine. - obj := originalObj.DeepCopyObject() - operation := func() { - glog.V(4).Infof("Object updated. Writing to channel: %v", obj) - watcher.Modify(obj) - objChan <- obj - } - select { - case watcher.orderExecution <- operation: - break - case <-time.After(pushTimeout): - glog.Errorf("Fake client execution channel blocked") - glog.Errorf("Tried to push %v", updateAction) - } - return true, originalObj, nil - }) - return objChan -} - -// RegisterFakeOnDelete registers a reactor in the given fake client that passes -// all deleted objects to the given watcher. Since we could get only name of the -// deleted object from DeleteAction, this register function relies on the getObject -// function passed to get the object by name and pass it watcher. -func RegisterFakeOnDelete(resource string, client *core.Fake, watcher *WatcherDispatcher, getObject func(name, namespace string) runtime.Object) { - client.AddReactor("delete", resource, func(action core.Action) (bool, runtime.Object, error) { - deleteAction := action.(core.DeleteAction) - obj := getObject(deleteAction.GetName(), deleteAction.GetNamespace()) - glog.V(7).Infof("Deleting %s: %v", resource, obj) - - operation := func() { - glog.V(4).Infof("Object deleted %v", obj) - watcher.Delete(obj) - } - select { - case watcher.orderExecution <- operation: - break - case <-time.After(pushTimeout): - glog.Errorf("Fake client execution channel blocked") - glog.Errorf("Tried to push %v", deleteAction) - } - return true, obj, nil - }) - return -} - -// Adds an update reactor to the given fake client. -// The reactor just returns the object passed to update action. -// This is used as a hack to workaround https://github.com/kubernetes/kubernetes/issues/40939. -// Without this, all update actions using fake client return empty objects. -func AddFakeUpdateReactor(resource string, client *core.Fake) { - client.AddReactor("update", resource, func(action core.Action) (bool, runtime.Object, error) { - updateAction := action.(core.UpdateAction) - originalObj := updateAction.GetObject() - return true, originalObj, nil - }) -} - -// GetObjectFromChan tries to get an api object from the given channel -// within a reasonable time. -func GetObjectFromChan(c chan runtime.Object) runtime.Object { - select { - case obj := <-c: - return obj - case <-time.After(wait.ForeverTestTimeout): - pprof.Lookup("goroutine").WriteTo(os.Stderr, 1) - return nil - } -} - -type CheckingFunction func(runtime.Object) error - -// CheckObjectFromChan tries to get an object matching the given check function -// within a reasonable time. -func CheckObjectFromChan(c chan runtime.Object, checkFunction CheckingFunction) error { - delay := 20 * time.Second - var lastError error - for { - select { - case obj := <-c: - if lastError = checkFunction(obj); lastError == nil { - return nil - } - glog.Infof("Check function failed with %v", lastError) - delay = 5 * time.Second - case <-time.After(delay): - pprof.Lookup("goroutine").WriteTo(os.Stderr, 1) - if lastError == nil { - return fmt.Errorf("Failed to get an object from channel") - } else { - return lastError - } - } - } -} - -// CompareObjectMeta returns an error when the given objects are not equivalent. -func CompareObjectMeta(a, b metav1.ObjectMeta) error { - if a.Namespace != b.Namespace { - return fmt.Errorf("Different namespace expected:%s observed:%s", a.Namespace, b.Namespace) - } - if a.Name != b.Name { - return fmt.Errorf("Different name expected:%s observed:%s", a.Name, b.Name) - } - if !reflect.DeepEqual(a.Labels, b.Labels) && (len(a.Labels) != 0 || len(b.Labels) != 0) { - return fmt.Errorf("Labels are different expected:%v observed:%v", a.Labels, b.Labels) - } - if !reflect.DeepEqual(a.Annotations, b.Annotations) && (len(a.Annotations) != 0 || len(b.Annotations) != 0) { - return fmt.Errorf("Annotations are different expected:%v observed:%v", a.Annotations, b.Annotations) - } - return nil -} - -func ToFederatedInformerForTestOnly(informer util.FederatedInformer) util.FederatedInformerForTestOnly { - inter := informer.(interface{}) - return inter.(util.FederatedInformerForTestOnly) -} - -// NewCluster builds a new cluster object. -func NewCluster(name string, readyStatus apiv1.ConditionStatus) *federationapi.Cluster { - return &federationapi.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Annotations: map[string]string{}, - Labels: map[string]string{"cluster": name}, - }, - Status: federationapi.ClusterStatus{ - Conditions: []federationapi.ClusterCondition{ - {Type: federationapi.ClusterReady, Status: readyStatus}, - }, - Zones: []string{"foozone"}, - Region: "fooregion", - }, - } -} - -// Ensure a key is in the store before returning (or timeout w/ error) -func WaitForStoreUpdate(store util.FederatedReadOnlyStore, clusterName, key string, timeout time.Duration) error { - retryInterval := 100 * time.Millisecond - err := wait.PollImmediate(retryInterval, timeout, func() (bool, error) { - _, found, err := store.GetByKey(clusterName, key) - return found, err - }) - return err -} - -// Ensure a key is in the store before returning (or timeout w/ error) -func WaitForStoreUpdateChecking(store util.FederatedReadOnlyStore, clusterName, key string, timeout time.Duration, - checkFunction CheckingFunction) error { - retryInterval := 500 * time.Millisecond - var lastError error - err := wait.PollImmediate(retryInterval, timeout, func() (bool, error) { - item, found, err := store.GetByKey(clusterName, key) - if err != nil || !found { - return found, err - } - runtimeObj := item.(runtime.Object) - lastError = checkFunction(runtimeObj) - glog.V(2).Infof("Check function failed for %s %v %v", key, runtimeObj, lastError) - return lastError == nil, nil - }) - return err -} - -func MetaAndSpecCheckingFunction(expected runtime.Object) CheckingFunction { - return func(obj runtime.Object) error { - if util.ObjectMetaAndSpecEquivalent(obj, expected) { - return nil - } - return fmt.Errorf("Object different expected=%#v received=%#v", expected, obj) - } -} - -func AssertHasFinalizer(t *testing.T, obj runtime.Object, finalizer string) { - hasFinalizer, err := finalizersutil.HasFinalizer(obj, finalizer) - require.Nil(t, err) - assert.True(t, hasFinalizer) -} - -func NewInt32(val int32) *int32 { - p := new(int32) - *p = val - return p -} diff --git a/federation/pkg/kubefed/BUILD b/federation/pkg/kubefed/BUILD deleted file mode 100644 index dd2a8a0df1..0000000000 --- a/federation/pkg/kubefed/BUILD +++ /dev/null @@ -1,101 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = [ - "cluster.go", - "join.go", - "kubefed.go", - "unjoin.go", - ], - importpath = "k8s.io/kubernetes/federation/pkg/kubefed", - deps = [ - "//federation/apis/federation:go_default_library", - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/pkg/kubefed/init:go_default_library", - "//federation/pkg/kubefed/util:go_default_library", - "//pkg/api:go_default_library", - "//pkg/apis/extensions:go_default_library", - "//pkg/apis/rbac:go_default_library", - "//pkg/client/clientset_generated/internalclientset:go_default_library", - "//pkg/kubectl:go_default_library", - "//pkg/kubectl/cmd:go_default_library", - "//pkg/kubectl/cmd/templates:go_default_library", - "//pkg/kubectl/cmd/util:go_default_library", - "//pkg/kubectl/resource:go_default_library", - "//pkg/kubectl/util/i18n:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/github.com/spf13/cobra:go_default_library", - "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors: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/wait:go_default_library", - "//vendor/k8s.io/apiserver/pkg/storage/names:go_default_library", - "//vendor/k8s.io/apiserver/pkg/util/flag:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd/api:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = [ - "cluster_test.go", - "join_test.go", - "unjoin_test.go", - ], - importpath = "k8s.io/kubernetes/federation/pkg/kubefed", - library = ":go_default_library", - deps = [ - "//federation/apis/federation:go_default_library", - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/pkg/kubefed/testing:go_default_library", - "//federation/pkg/kubefed/util:go_default_library", - "//pkg/api:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//pkg/api/testapi:go_default_library", - "//pkg/apis/rbac/v1:go_default_library", - "//pkg/kubectl/cmd/testing:go_default_library", - "//pkg/kubectl/cmd/util:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", - "//vendor/k8s.io/api/rbac/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors: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/serializer:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/diff:go_default_library", - "//vendor/k8s.io/client-go/dynamic:go_default_library", - "//vendor/k8s.io/client-go/rest/fake:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd/api:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/pkg/kubefed/init:all-srcs", - "//federation/pkg/kubefed/testing:all-srcs", - "//federation/pkg/kubefed/util:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/pkg/kubefed/cluster.go b/federation/pkg/kubefed/cluster.go deleted file mode 100644 index fdc130a157..0000000000 --- a/federation/pkg/kubefed/cluster.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright 2016 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 kubefed - -import ( - "fmt" - - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - "k8s.io/kubernetes/pkg/kubectl" -) - -const ( - ServiceAccountNameAnnotation = "federation.kubernetes.io/servive-account-name" - ClusterRoleNameAnnotation = "federation.kubernetes.io/cluster-role-name" -) - -// ClusterGeneratorV1Beta1 supports stable generation of a -// federation/cluster resource. -type ClusterGeneratorV1Beta1 struct { - // Name of the cluster context (required) - Name string - // ClientCIDR is the CIDR range in which the Kubernetes APIServer - // is available for the client (optional) - ClientCIDR string - // ServerAddress is the APIServer address of the Kubernetes cluster - // that is being registered (required) - ServerAddress string - // SecretName is the name of the secret that stores the credentials - // for the Kubernetes cluster that is being registered (optional) - SecretName string - // ServiceAccountName is the name of the service account that is - // created in the cluster being registered. If this is provided, - // then ClusterRoleName must also be provided (optional) - ServiceAccountName string - // ClusterRoleName is the name of the cluster role and cluster role - // binding that are created in the cluster being registered. If this - // is provided, then ServiceAccountName must also be provided - // (optional) - ClusterRoleName string -} - -// Ensure it supports the generator pattern that uses parameter -// injection. -var _ kubectl.Generator = &ClusterGeneratorV1Beta1{} - -// Ensure it supports the generator pattern that uses parameters -// specified during construction. -var _ kubectl.StructuredGenerator = &ClusterGeneratorV1Beta1{} - -// Generate returns a cluster resource using the specified parameters. -func (s ClusterGeneratorV1Beta1) Generate(genericParams map[string]interface{}) (runtime.Object, error) { - err := kubectl.ValidateParams(s.ParamNames(), genericParams) - if err != nil { - return nil, err - } - clustergen := &ClusterGeneratorV1Beta1{} - params := map[string]string{} - for key, value := range genericParams { - strVal, isString := value.(string) - if !isString { - return nil, fmt.Errorf("expected string, saw %v for '%s'", value, key) - } - params[key] = strVal - } - clustergen.Name = params["name"] - clustergen.ClientCIDR = params["client-cidr"] - clustergen.ServerAddress = params["server-address"] - clustergen.SecretName = params["secret"] - clustergen.ServiceAccountName = params["service-account-name"] - clustergen.ClusterRoleName = params["cluster-role-name"] - return clustergen.StructuredGenerate() -} - -// ParamNames returns the set of supported input parameters when using -// the parameter injection generator pattern. -func (s ClusterGeneratorV1Beta1) ParamNames() []kubectl.GeneratorParam { - return []kubectl.GeneratorParam{ - { - Name: "name", - Required: true, - }, - { - Name: "client-cidr", - Required: false, - }, - { - Name: "server-address", - Required: true, - }, - { - Name: "secret", - Required: false, - }, - { - Name: "service-account-name", - Required: false, - }, - { - Name: "cluster-role-name", - Required: false, - }, - } -} - -// StructuredGenerate outputs a federation cluster resource object -// using the configured fields. -func (s ClusterGeneratorV1Beta1) StructuredGenerate() (runtime.Object, error) { - if err := s.validate(); err != nil { - return nil, err - } - if s.ClientCIDR == "" { - s.ClientCIDR = "0.0.0.0/0" - } - if s.SecretName == "" { - s.SecretName = s.Name - } - cluster := &federationapi.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: s.Name, - }, - Spec: federationapi.ClusterSpec{ - ServerAddressByClientCIDRs: []federationapi.ServerAddressByClientCIDR{ - { - ClientCIDR: s.ClientCIDR, - ServerAddress: s.ServerAddress, - }, - }, - SecretRef: &v1.LocalObjectReference{ - Name: s.SecretName, - }, - }, - } - - annotations := make(map[string]string) - if s.ServiceAccountName != "" { - annotations[ServiceAccountNameAnnotation] = s.ServiceAccountName - } - if s.ClusterRoleName != "" { - annotations[ClusterRoleNameAnnotation] = s.ClusterRoleName - } - if len(annotations) == 1 { - return nil, fmt.Errorf("Either both or neither of ServiceAccountName and ClusterRoleName must be provided.") - } - if len(annotations) > 0 { - cluster.SetAnnotations(annotations) - } - - return cluster, nil -} - -// validate validates required fields are set to support structured -// generation. -func (s ClusterGeneratorV1Beta1) validate() error { - if len(s.Name) == 0 { - return fmt.Errorf("name must be specified") - } - if len(s.ServerAddress) == 0 { - return fmt.Errorf("server address must be specified") - } - return nil -} diff --git a/federation/pkg/kubefed/cluster_test.go b/federation/pkg/kubefed/cluster_test.go deleted file mode 100644 index aced6bbfe9..0000000000 --- a/federation/pkg/kubefed/cluster_test.go +++ /dev/null @@ -1,239 +0,0 @@ -/* -Copyright 2016 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 kubefed - -import ( - "reflect" - "testing" - - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" -) - -func TestClusterGenerate(t *testing.T) { - tests := []struct { - params map[string]interface{} - expected *federationapi.Cluster - expectErr bool - }{ - { - params: map[string]interface{}{ - "name": "foo", - "client-cidr": "0.0.0.0/0", - "server-address": "10.20.30.40", - "secret": "foo-credentials", - }, - expected: &federationapi.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - }, - Spec: federationapi.ClusterSpec{ - ServerAddressByClientCIDRs: []federationapi.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: "10.20.30.40", - }, - }, - SecretRef: &v1.LocalObjectReference{ - Name: "foo-credentials", - }, - }, - }, - expectErr: false, - }, - { - params: map[string]interface{}{ - "name": "foo", - "client-cidr": "10.20.30.40/16", - "server-address": "https://foo.example.com", - "secret": "foo-credentials", - }, - expected: &federationapi.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - }, - Spec: federationapi.ClusterSpec{ - ServerAddressByClientCIDRs: []federationapi.ServerAddressByClientCIDR{ - { - ClientCIDR: "10.20.30.40/16", - ServerAddress: "https://foo.example.com", - }, - }, - SecretRef: &v1.LocalObjectReference{ - Name: "foo-credentials", - }, - }, - }, - expectErr: false, - }, - { - params: map[string]interface{}{ - "name": "bar-cluster", - "client-cidr": "10.20.30.40/16", - "server-address": "http://10.20.30.40", - "secret": "credentials", - }, - expected: &federationapi.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar-cluster", - }, - Spec: federationapi.ClusterSpec{ - ServerAddressByClientCIDRs: []federationapi.ServerAddressByClientCIDR{ - { - ClientCIDR: "10.20.30.40/16", - ServerAddress: "http://10.20.30.40", - }, - }, - SecretRef: &v1.LocalObjectReference{ - Name: "credentials", - }, - }, - }, - expectErr: false, - }, - { - params: map[string]interface{}{ - "name": "bar-cluster", - "client-cidr": "10.20.30.40/16", - "server-address": "http://10.20.30.40", - "secret": "credentials", - }, - expected: &federationapi.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar-cluster", - }, - Spec: federationapi.ClusterSpec{ - ServerAddressByClientCIDRs: []federationapi.ServerAddressByClientCIDR{ - { - ClientCIDR: "10.20.30.40/16", - ServerAddress: "http://10.20.30.40", - }, - }, - SecretRef: &v1.LocalObjectReference{ - Name: "credentials", - }, - }, - }, - expectErr: false, - }, - { - params: map[string]interface{}{ - "name": "bar-cluster", - "client-cidr": "10.20.30.40/16", - "server-address": "http://10.20.30.40", - "secret": "credentials", - "service-account-name": "service-account", - "cluster-role-name": "cluster-role", - }, - expected: &federationapi.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar-cluster", - Annotations: map[string]string{ - ServiceAccountNameAnnotation: "service-account", - ClusterRoleNameAnnotation: "cluster-role", - }, - }, - Spec: federationapi.ClusterSpec{ - ServerAddressByClientCIDRs: []federationapi.ServerAddressByClientCIDR{ - { - ClientCIDR: "10.20.30.40/16", - ServerAddress: "http://10.20.30.40", - }, - }, - SecretRef: &v1.LocalObjectReference{ - Name: "credentials", - }, - }, - }, - expectErr: false, - }, - { - params: map[string]interface{}{ - "server-address": "https://10.20.30.40", - }, - expected: nil, - expectErr: true, - }, - { - params: map[string]interface{}{ - "secret": "baz-credentials", - }, - expected: nil, - expectErr: true, - }, - { - params: map[string]interface{}{ - "server-address": "http://foo.example.com", - "secret": "foo-credentials", - }, - expected: nil, - expectErr: true, - }, - { - params: map[string]interface{}{ - "name": "foo", - "secret": "foo-credentials", - }, - expected: nil, - expectErr: true, - }, - { - params: map[string]interface{}{ - "name": "foo", - "client-cidr": "10.20.30.40/16", - }, - expected: nil, - expectErr: true, - }, - { - params: map[string]interface{}{ - "name": "bar-cluster", - "client-cidr": "10.20.30.40/16", - "server-address": "http://10.20.30.40", - "secret": "credentials", - "cluster-role-name": "cluster-role", - }, - expected: nil, - expectErr: true, - }, - { - params: map[string]interface{}{ - "name": "bar-cluster", - "client-cidr": "10.20.30.40/16", - "server-address": "http://10.20.30.40", - "secret": "credentials", - "service-account-name": "service-account", - }, - expected: nil, - expectErr: true, - }, - } - generator := ClusterGeneratorV1Beta1{} - for i, test := range tests { - obj, err := generator.Generate(test.params) - if !test.expectErr && err != nil { - t.Errorf("[%d] unexpected error: %v", i, err) - } - if test.expectErr && err != nil { - continue - } - if !reflect.DeepEqual(obj.(*federationapi.Cluster), test.expected) { - t.Errorf("\n[%d] want:\n%#v\n[%d] got:\n%#v", i, test.expected, i, obj.(*federationapi.Cluster)) - } - } -} diff --git a/federation/pkg/kubefed/init/BUILD b/federation/pkg/kubefed/init/BUILD deleted file mode 100644 index d0f8d4bf5e..0000000000 --- a/federation/pkg/kubefed/init/BUILD +++ /dev/null @@ -1,86 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = ["init.go"], - importpath = "k8s.io/kubernetes/federation/pkg/kubefed/init", - deps = [ - "//cmd/kubeadm/app/util/kubeconfig:go_default_library", - "//federation/apis/federation:go_default_library", - "//federation/pkg/dnsprovider/providers/coredns:go_default_library", - "//federation/pkg/kubefed/util:go_default_library", - "//pkg/api:go_default_library", - "//pkg/apis/extensions:go_default_library", - "//pkg/apis/rbac:go_default_library", - "//pkg/client/clientset_generated/internalclientset:go_default_library", - "//pkg/kubectl/cmd/templates:go_default_library", - "//pkg/kubectl/cmd/util:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/github.com/spf13/cobra:go_default_library", - "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/gopkg.in/gcfg.v1:go_default_library", - "//vendor/k8s.io/api/core/v1: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/util/intstr:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/uuid:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd/api:go_default_library", - "//vendor/k8s.io/client-go/util/cert:go_default_library", - "//vendor/k8s.io/client-go/util/cert/triple:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["init_test.go"], - importpath = "k8s.io/kubernetes/federation/pkg/kubefed/init", - library = ":go_default_library", - deps = [ - "//federation/apis/federation:go_default_library", - "//federation/pkg/dnsprovider/providers/coredns:go_default_library", - "//federation/pkg/kubefed/testing:go_default_library", - "//federation/pkg/kubefed/util:go_default_library", - "//pkg/api:go_default_library", - "//pkg/api/helper:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//pkg/api/testapi:go_default_library", - "//pkg/apis/rbac:go_default_library", - "//pkg/kubectl/cmd/testing:go_default_library", - "//pkg/kubectl/cmd/util:go_default_library", - "//vendor/gopkg.in/gcfg.v1:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", - "//vendor/k8s.io/api/rbac/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors: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/util/diff:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", - "//vendor/k8s.io/client-go/dynamic:go_default_library", - "//vendor/k8s.io/client-go/rest/fake:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/kubefed/init/init.go b/federation/pkg/kubefed/init/init.go deleted file mode 100644 index 4193c598b4..0000000000 --- a/federation/pkg/kubefed/init/init.go +++ /dev/null @@ -1,1229 +0,0 @@ -/* -Copyright 2016 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. -*/ - -// TODO(madhusdancs): -// 1. Make printSuccess prepend protocol/scheme to the IPs/hostnames. -// 2. Separate etcd container from API server pod as a first step towards enabling HA. -// 3. Make API server and controller manager replicas customizable via the HA work. -package init - -import ( - "fmt" - "io" - "io/ioutil" - "net" - "os" - "sort" - "strconv" - "strings" - "time" - - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/apimachinery/pkg/util/uuid" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/tools/clientcmd" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - certutil "k8s.io/client-go/util/cert" - triple "k8s.io/client-go/util/cert/triple" - kubeconfigutil "k8s.io/kubernetes/cmd/kubeadm/app/util/kubeconfig" - "k8s.io/kubernetes/federation/apis/federation" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/coredns" - "k8s.io/kubernetes/federation/pkg/kubefed/util" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/apis/extensions" - "k8s.io/kubernetes/pkg/apis/rbac" - client "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" - "k8s.io/kubernetes/pkg/kubectl/cmd/templates" - cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" - - "github.com/golang/glog" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "gopkg.in/gcfg.v1" -) - -const ( - APIServerCN = "federation-apiserver" - ControllerManagerCN = "federation-controller-manager" - AdminCN = "admin" - HostClusterLocalDNSZoneName = "cluster.local." - APIServerNameSuffix = "apiserver" - CMNameSuffix = "controller-manager" - CredentialSuffix = "credentials" - KubeconfigNameSuffix = "kubeconfig" - - // User name used by federation controller manager to make - // calls to federation API server. - ControllerManagerUser = "federation-controller-manager" - - // Name of the ServiceAccount used by the federation controller manager - // to access the secrets in the host cluster. - ControllerManagerSA = "federation-controller-manager" - - // Group name of the legacy/core API group - legacyAPIGroup = "" - - lbAddrRetryInterval = 5 * time.Second - podWaitInterval = 2 * time.Second - - apiserverServiceTypeFlag = "api-server-service-type" - apiserverAdvertiseAddressFlag = "api-server-advertise-address" - apiserverPortFlag = "api-server-port" - - dnsProviderSecretName = "federation-dns-provider.conf" - - apiServerSecurePortName = "https" - // Set the secure port to 8443 to avoid requiring root privileges - // to bind to port < 1000. The apiserver's service will still - // expose on port 443. - apiServerSecurePort = 8443 -) - -var ( - init_long = templates.LongDesc(` - Init initializes a federation control plane. - - Federation control plane is hosted inside a Kubernetes - cluster. The host cluster must be specified using the - --host-cluster-context flag.`) - init_example = templates.Examples(` - # Initialize federation control plane for a federation - # named foo in the host cluster whose local kubeconfig - # context is bar. - kubefed init foo --host-cluster-context=bar`) - - componentLabel = map[string]string{ - "app": "federated-cluster", - } - - apiserverSvcSelector = map[string]string{ - "app": "federated-cluster", - "module": "federation-apiserver", - } - - apiserverPodLabels = map[string]string{ - "app": "federated-cluster", - "module": "federation-apiserver", - } - - controllerManagerPodLabels = map[string]string{ - "app": "federated-cluster", - "module": "federation-controller-manager", - } -) - -type initFederation struct { - commonOptions util.SubcommandOptions - options initFederationOptions -} - -type initFederationOptions struct { - dnsZoneName string - serverImage string - imagePullPolicy string - imagePullSecrets string - dnsProvider string - dnsProviderConfig string - etcdImage string - etcdPVCapacity string - etcdPVStorageClass string - etcdPersistentStorage bool - dryRun bool - apiServerOverridesString string - apiServerOverrides map[string]string - controllerManagerOverridesString string - controllerManagerOverrides map[string]string - apiServerServiceTypeString string - apiServerServiceType v1.ServiceType - apiServerAdvertiseAddress string - apiServerNodePortPort int32 - apiServerNodePortPortPtr *int32 - apiServerEnableHTTPBasicAuth bool - apiServerEnableTokenAuth bool - nodeSelector map[string]string - nodeSelectorString string -} - -func (o *initFederationOptions) Bind(flags *pflag.FlagSet, defaultServerImage, defaultEtcdImage string) { - flags.StringVar(&o.dnsZoneName, "dns-zone-name", "", "DNS suffix for this federation. Federated Service DNS names are published with this suffix.") - flags.StringVar(&o.serverImage, "image", defaultServerImage, "Image to use for federation API server and controller manager binaries.") - flags.StringVar(&o.imagePullPolicy, "image-pull-policy", string(api.PullIfNotPresent), "PullPolicy describes a policy for if/when to pull a container image. The default pull policy is IfNotPresent which will not pull an image if it already exists.") - flags.StringVar(&o.imagePullSecrets, "image-pull-secrets", "", "Provide secrets that can access the private registry.") - flags.StringVar(&o.dnsProvider, "dns-provider", "", "Dns provider to be used for this deployment.") - flags.StringVar(&o.dnsProviderConfig, "dns-provider-config", "", "Config file path on local file system for configuring DNS provider.") - flags.StringVar(&o.etcdImage, "etcd-image", defaultEtcdImage, "Image to use for etcd server.") - flags.StringVar(&o.etcdPVCapacity, "etcd-pv-capacity", "10Gi", "Size of persistent volume claim to be used for etcd.") - flags.StringVar(&o.etcdPVStorageClass, "etcd-pv-storage-class", "", "The storage class of the persistent volume claim used for etcd. Must be provided if a default storage class is not enabled for the host cluster.") - flags.BoolVar(&o.etcdPersistentStorage, "etcd-persistent-storage", true, "Use persistent volume for etcd. Defaults to 'true'.") - flags.BoolVar(&o.dryRun, "dry-run", false, "dry run without sending commands to server.") - flags.StringVar(&o.apiServerOverridesString, "apiserver-arg-overrides", "", "comma separated list of federation-apiserver arguments to override: Example \"--arg1=value1,--arg2=value2...\"") - flags.StringVar(&o.controllerManagerOverridesString, "controllermanager-arg-overrides", "", "comma separated list of federation-controller-manager arguments to override: Example \"--arg1=value1,--arg2=value2...\"") - flags.StringVar(&o.apiServerServiceTypeString, apiserverServiceTypeFlag, string(v1.ServiceTypeLoadBalancer), "The type of service to create for federation API server. Options: 'LoadBalancer' (default), 'NodePort'.") - flags.StringVar(&o.apiServerAdvertiseAddress, apiserverAdvertiseAddressFlag, "", "Preferred address to advertise api server nodeport service. Valid only if '"+apiserverServiceTypeFlag+"=NodePort'.") - flags.Int32Var(&o.apiServerNodePortPort, apiserverPortFlag, 0, "Preferred port to use for api server nodeport service (0 for random port assignment). Valid only if '"+apiserverServiceTypeFlag+"=NodePort'.") - flags.BoolVar(&o.apiServerEnableHTTPBasicAuth, "apiserver-enable-basic-auth", false, "Enables HTTP Basic authentication for the federation-apiserver. Defaults to false.") - flags.BoolVar(&o.apiServerEnableTokenAuth, "apiserver-enable-token-auth", false, "Enables token authentication for the federation-apiserver. Defaults to false.") - flags.StringVar(&o.nodeSelectorString, "node-selector", "", "comma separated list of nodeSelector arguments: Example \"arg1=value1,arg2=value2...\"") -} - -// NewCmdInit defines the `init` command that bootstraps a federation -// control plane inside a set of host clusters. -func NewCmdInit(cmdOut io.Writer, config util.AdminConfig, defaultServerImage, defaultEtcdImage string) *cobra.Command { - opts := &initFederation{} - - cmd := &cobra.Command{ - Use: "init FEDERATION_NAME --host-cluster-context=HOST_CONTEXT", - Short: "Initialize a federation control plane", - Long: init_long, - Example: init_example, - Run: func(cmd *cobra.Command, args []string) { - cmdutil.CheckErr(opts.Complete(cmd, args)) - cmdutil.CheckErr(opts.Run(cmdOut, config)) - }, - } - - flags := cmd.Flags() - opts.commonOptions.Bind(flags) - opts.options.Bind(flags, defaultServerImage, defaultEtcdImage) - - return cmd -} - -type entityKeyPairs struct { - ca *triple.KeyPair - server *triple.KeyPair - controllerManager *triple.KeyPair - admin *triple.KeyPair -} - -type credentials struct { - username string - password string - token string - certEntKeyPairs *entityKeyPairs -} - -// Complete ensures that options are valid and marshals them if necessary. -func (i *initFederation) Complete(cmd *cobra.Command, args []string) error { - if len(i.options.dnsProvider) == 0 { - return fmt.Errorf("--dns-provider is mandatory") - } - - err := i.commonOptions.SetName(cmd, args) - if err != nil { - return err - } - - i.options.apiServerServiceType = v1.ServiceType(i.options.apiServerServiceTypeString) - if i.options.apiServerServiceType != v1.ServiceTypeLoadBalancer && i.options.apiServerServiceType != v1.ServiceTypeNodePort { - return fmt.Errorf("invalid %s: %s, should be either %s or %s", apiserverServiceTypeFlag, i.options.apiServerServiceType, v1.ServiceTypeLoadBalancer, v1.ServiceTypeNodePort) - } - if i.options.apiServerAdvertiseAddress != "" { - ip := net.ParseIP(i.options.apiServerAdvertiseAddress) - if ip == nil { - return fmt.Errorf("invalid %s: %s, should be a valid ip address", apiserverAdvertiseAddressFlag, i.options.apiServerAdvertiseAddress) - } - if i.options.apiServerServiceType != v1.ServiceTypeNodePort { - return fmt.Errorf("%s should be passed only with '%s=NodePort'", apiserverAdvertiseAddressFlag, apiserverServiceTypeFlag) - } - } - - if i.options.apiServerNodePortPort != 0 { - if i.options.apiServerServiceType != v1.ServiceTypeNodePort { - return fmt.Errorf("%s should be passed only with '%s=NodePort'", apiserverPortFlag, apiserverServiceTypeFlag) - } - i.options.apiServerNodePortPortPtr = &i.options.apiServerNodePortPort - } else { - i.options.apiServerNodePortPortPtr = nil - } - if i.options.apiServerNodePortPort < 0 || i.options.apiServerNodePortPort > 65535 { - return fmt.Errorf("Please provide a valid port number for %s", apiserverPortFlag) - } - - i.options.apiServerOverrides, err = marshallOverrides(i.options.apiServerOverridesString) - if err != nil { - return fmt.Errorf("error marshalling --apiserver-arg-overrides: %v", err) - } - i.options.controllerManagerOverrides, err = marshallOverrides(i.options.controllerManagerOverridesString) - if err != nil { - return fmt.Errorf("error marshalling --controllermanager-arg-overrides: %v", err) - } - i.options.nodeSelector, err = marshallOverrides(i.options.nodeSelectorString) - if err != nil { - return fmt.Errorf("error marshalling --node-selector: %v", err) - } - - if i.options.dnsProviderConfig != "" { - if _, err := os.Stat(i.options.dnsProviderConfig); err != nil { - return fmt.Errorf("error reading file provided to --dns-provider-config flag, err: %v", err) - } - } - - return nil -} - -// Run initializes a federation control plane. -// See the design doc in https://github.com/kubernetes/kubernetes/pull/34484 -// for details. -func (i *initFederation) Run(cmdOut io.Writer, config util.AdminConfig) error { - hostFactory := config.ClusterFactory(i.commonOptions.Host, i.commonOptions.Kubeconfig) - hostClientset, err := hostFactory.ClientSet() - if err != nil { - return err - } - - rbacAvailable := true - rbacVersionedClientset, err := util.GetVersionedClientForRBACOrFail(hostFactory) - if err != nil { - if _, ok := err.(*util.NoRBACAPIError); !ok { - return err - } - // If the error is type NoRBACAPIError, We continue to create the rest of - // the resources, without the SA and roles (in the absence of RBAC support). - rbacAvailable = false - } - - serverName := fmt.Sprintf("%s-%s", i.commonOptions.Name, APIServerNameSuffix) - serverCredName := fmt.Sprintf("%s-%s", serverName, CredentialSuffix) - cmName := fmt.Sprintf("%s-%s", i.commonOptions.Name, CMNameSuffix) - cmKubeconfigName := fmt.Sprintf("%s-%s", cmName, KubeconfigNameSuffix) - - var dnsProviderConfigBytes []byte - if i.options.dnsProviderConfig != "" { - dnsProviderConfigBytes, err = ioutil.ReadFile(i.options.dnsProviderConfig) - if err != nil { - return fmt.Errorf("Error reading file provided to --dns-provider-config flag, err: %v", err) - } - } - - fmt.Fprintf(cmdOut, "Creating a namespace %s for federation system components...", i.commonOptions.FederationSystemNamespace) - glog.V(4).Infof("Creating a namespace %s for federation system components", i.commonOptions.FederationSystemNamespace) - _, err = createNamespace(hostClientset, i.commonOptions.Name, i.commonOptions.FederationSystemNamespace, i.options.dryRun) - if err != nil { - return err - } - - fmt.Fprintln(cmdOut, " done") - - fmt.Fprint(cmdOut, "Creating federation control plane service...") - glog.V(4).Info("Creating federation control plane service") - svc, ips, hostnames, err := createService(cmdOut, hostClientset, i.commonOptions.FederationSystemNamespace, serverName, i.commonOptions.Name, i.options.apiServerAdvertiseAddress, i.options.apiServerNodePortPortPtr, i.options.apiServerServiceType, i.options.dryRun) - if err != nil { - return err - } - fmt.Fprintln(cmdOut, " done") - glog.V(4).Infof("Created service named %s with IP addresses %v, hostnames %v", svc.Name, ips, hostnames) - - fmt.Fprint(cmdOut, "Creating federation control plane objects (credentials, persistent volume claim)...") - glog.V(4).Info("Generating TLS certificates and credentials for communicating with the federation API server") - credentials, err := generateCredentials(i.commonOptions.FederationSystemNamespace, i.commonOptions.Name, svc.Name, HostClusterLocalDNSZoneName, serverCredName, ips, hostnames, i.options.apiServerEnableHTTPBasicAuth, i.options.apiServerEnableTokenAuth, i.options.dryRun) - if err != nil { - return err - } - - // Create the secret containing the credentials. - _, err = createAPIServerCredentialsSecret(hostClientset, i.commonOptions.FederationSystemNamespace, serverCredName, i.commonOptions.Name, credentials, i.options.dryRun) - if err != nil { - return err - } - glog.V(4).Info("Certificates and credentials generated") - - glog.V(4).Info("Creating an entry in the kubeconfig file with the certificate and credential data") - _, err = createControllerManagerKubeconfigSecret(hostClientset, i.commonOptions.FederationSystemNamespace, i.commonOptions.Name, svc.Name, cmKubeconfigName, credentials.certEntKeyPairs, i.options.dryRun) - if err != nil { - return err - } - glog.V(4).Info("Credentials secret successfully created") - - var pvc *api.PersistentVolumeClaim - if i.options.etcdPersistentStorage { - glog.V(4).Info("Creating a persistent volume and a claim to store the federation API server's state, including etcd data") - pvc, err = createPVC(hostClientset, i.commonOptions.FederationSystemNamespace, svc.Name, i.commonOptions.Name, i.options.etcdPVCapacity, i.options.etcdPVStorageClass, i.options.dryRun) - if err != nil { - return err - } - glog.V(4).Info("Persistent volume and claim created") - fmt.Fprintln(cmdOut, " done") - } - - // Since only one IP address can be specified as advertise address, - // we arbitrarily pick the first available IP address - // Pick user provided apiserverAdvertiseAddress over other available IP addresses. - advertiseAddress := i.options.apiServerAdvertiseAddress - if advertiseAddress == "" && len(ips) > 0 { - advertiseAddress = ips[0] - } - - fmt.Fprint(cmdOut, "Creating federation component deployments...") - glog.V(4).Info("Creating federation control plane components") - _, err = createAPIServer(hostClientset, i.commonOptions.FederationSystemNamespace, serverName, i.commonOptions.Name, i.options.serverImage, i.options.etcdImage, advertiseAddress, serverCredName, i.options.apiServerEnableHTTPBasicAuth, i.options.apiServerEnableTokenAuth, i.options.apiServerOverrides, pvc, i.options.dryRun, i.options.nodeSelector, i.options.imagePullPolicy, i.options.imagePullSecrets) - if err != nil { - return err - } - glog.V(4).Info("Successfully created federation API server") - - sa := &api.ServiceAccount{} - sa.Name = "" - // Create a service account and related RBAC roles if the host cluster has RBAC support. - // TODO: We must evaluate creating a separate service account even when RBAC support is missing - if rbacAvailable { - glog.V(4).Info("Creating service account for federation controller manager in the host cluster") - sa, err = createControllerManagerSA(rbacVersionedClientset, i.commonOptions.FederationSystemNamespace, i.commonOptions.Name, i.options.dryRun) - if err != nil { - return err - } - glog.V(4).Info("Successfully created federation controller manager service account") - - glog.V(4).Info("Creating RBAC role and role bindings for the federation controller manager's service account") - _, _, err = createRoleBindings(rbacVersionedClientset, i.commonOptions.FederationSystemNamespace, sa.Name, i.commonOptions.Name, i.options.dryRun) - if err != nil { - return err - } - glog.V(4).Info("Successfully created RBAC role and role bindings") - } - - glog.V(4).Info("Creating a DNS provider config secret") - dnsProviderSecret, err := createDNSProviderConfigSecret(hostClientset, i.commonOptions.FederationSystemNamespace, dnsProviderSecretName, i.commonOptions.Name, dnsProviderConfigBytes, i.options.dryRun) - if err != nil { - return err - } - glog.V(4).Info("Successfully created DNS provider config secret") - - glog.V(4).Info("Creating federation controller manager deployment") - - _, err = createControllerManager(hostClientset, i.commonOptions.FederationSystemNamespace, i.commonOptions.Name, svc.Name, cmName, i.options.serverImage, cmKubeconfigName, i.options.dnsZoneName, i.options.dnsProvider, i.options.dnsProviderConfig, sa.Name, dnsProviderSecret, i.options.controllerManagerOverrides, i.options.dryRun, i.options.nodeSelector, i.options.imagePullPolicy, i.options.imagePullSecrets) - if err != nil { - return err - } - glog.V(4).Info("Successfully created federation controller manager deployment") - fmt.Fprintln(cmdOut, " done") - - fmt.Fprint(cmdOut, "Updating kubeconfig...") - glog.V(4).Info("Updating kubeconfig") - // Pick the first ip/hostname to update the api server endpoint in kubeconfig and also to give information to user - // In case of NodePort Service for api server, ips are node external ips. - endpoint := "" - if len(ips) > 0 { - endpoint = ips[0] - } else if len(hostnames) > 0 { - endpoint = hostnames[0] - } - // If the service is nodeport, need to append the port to endpoint as it is non-standard port - if i.options.apiServerServiceType == v1.ServiceTypeNodePort { - endpoint = endpoint + ":" + strconv.Itoa(int(svc.Spec.Ports[0].NodePort)) - } - - err = updateKubeconfig(config, i.commonOptions.Name, endpoint, i.commonOptions.Kubeconfig, credentials, i.options.dryRun) - if err != nil { - glog.V(4).Infof("Failed to update kubeconfig: %v", err) - return err - } - fmt.Fprintln(cmdOut, " done") - glog.V(4).Info("Successfully updated kubeconfig") - - if !i.options.dryRun { - fmt.Fprint(cmdOut, "Waiting for federation control plane to come up...") - glog.V(4).Info("Waiting for federation control plane to come up") - fedPods := []string{serverName, cmName} - err = waitForPods(cmdOut, hostClientset, fedPods, i.commonOptions.FederationSystemNamespace) - if err != nil { - return err - } - err = waitSrvHealthy(cmdOut, config, i.commonOptions.Name, i.commonOptions.Kubeconfig) - if err != nil { - return err - } - glog.V(4).Info("Federation control plane running") - fmt.Fprintln(cmdOut, " done") - return printSuccess(cmdOut, ips, hostnames, svc) - } - _, err = fmt.Fprintln(cmdOut, "Federation control plane runs (dry run)") - glog.V(4).Info("Federation control plane runs (dry run)") - return err -} - -func createNamespace(clientset client.Interface, federationName, namespace string, dryRun bool) (*api.Namespace, error) { - ns := &api.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - Name: namespace, - Annotations: map[string]string{federation.FederationNameAnnotation: federationName}, - }, - } - - if dryRun { - return ns, nil - } - - return clientset.Core().Namespaces().Create(ns) -} - -func createService(cmdOut io.Writer, clientset client.Interface, namespace, svcName, federationName, apiserverAdvertiseAddress string, apiserverPort *int32, apiserverServiceType v1.ServiceType, dryRun bool) (*api.Service, []string, []string, error) { - port := api.ServicePort{ - Name: "https", - Protocol: "TCP", - Port: 443, - TargetPort: intstr.FromString(apiServerSecurePortName), - } - if apiserverServiceType == v1.ServiceTypeNodePort && apiserverPort != nil { - port.NodePort = *apiserverPort - } - svc := &api.Service{ - ObjectMeta: metav1.ObjectMeta{ - Name: svcName, - Namespace: namespace, - Labels: componentLabel, - Annotations: map[string]string{federation.FederationNameAnnotation: federationName}, - }, - Spec: api.ServiceSpec{ - Type: api.ServiceType(apiserverServiceType), - Selector: apiserverSvcSelector, - Ports: []api.ServicePort{port}, - }, - } - - if dryRun { - return svc, nil, nil, nil - } - - var err error - svc, err = clientset.Core().Services(namespace).Create(svc) - if err != nil { - return nil, nil, nil, err - } - - ips := []string{} - hostnames := []string{} - if apiserverServiceType == v1.ServiceTypeLoadBalancer { - ips, hostnames, err = waitForLoadBalancerAddress(cmdOut, clientset, svc, dryRun) - } else { - if apiserverAdvertiseAddress != "" { - ips = append(ips, apiserverAdvertiseAddress) - } else { - ips, err = getClusterNodeIPs(clientset) - } - } - if err != nil { - return svc, nil, nil, err - } - - return svc, ips, hostnames, err -} - -func getClusterNodeIPs(clientset client.Interface) ([]string, error) { - preferredAddressTypes := []api.NodeAddressType{ - api.NodeExternalIP, - api.NodeInternalIP, - } - nodeList, err := clientset.Core().Nodes().List(metav1.ListOptions{}) - if err != nil { - return nil, err - } - nodeAddresses := []string{} - for _, node := range nodeList.Items { - OuterLoop: - for _, addressType := range preferredAddressTypes { - for _, address := range node.Status.Addresses { - if address.Type == addressType { - nodeAddresses = append(nodeAddresses, address.Address) - break OuterLoop - } - } - } - } - - return nodeAddresses, nil -} - -func waitForLoadBalancerAddress(cmdOut io.Writer, clientset client.Interface, svc *api.Service, dryRun bool) ([]string, []string, error) { - ips := []string{} - hostnames := []string{} - - if dryRun { - return ips, hostnames, nil - } - - err := wait.PollImmediateInfinite(lbAddrRetryInterval, func() (bool, error) { - fmt.Fprint(cmdOut, ".") - pollSvc, err := clientset.Core().Services(svc.Namespace).Get(svc.Name, metav1.GetOptions{}) - if err != nil { - return false, nil - } - if ings := pollSvc.Status.LoadBalancer.Ingress; len(ings) > 0 { - for _, ing := range ings { - if len(ing.IP) > 0 { - ips = append(ips, ing.IP) - } - if len(ing.Hostname) > 0 { - hostnames = append(hostnames, ing.Hostname) - } - } - if len(ips) > 0 || len(hostnames) > 0 { - return true, nil - } - } - return false, nil - }) - if err != nil { - return nil, nil, err - } - - return ips, hostnames, nil -} - -func generateCredentials(svcNamespace, name, svcName, localDNSZoneName, serverCredName string, ips, hostnames []string, enableHTTPBasicAuth, enableTokenAuth, dryRun bool) (*credentials, error) { - credentials := credentials{ - username: AdminCN, - } - if enableHTTPBasicAuth { - credentials.password = string(uuid.NewUUID()) - } - if enableTokenAuth { - credentials.token = string(uuid.NewUUID()) - } - - entKeyPairs, err := genCerts(svcNamespace, name, svcName, localDNSZoneName, ips, hostnames) - if err != nil { - return nil, err - } - credentials.certEntKeyPairs = entKeyPairs - return &credentials, nil -} - -func genCerts(svcNamespace, name, svcName, localDNSZoneName string, ips, hostnames []string) (*entityKeyPairs, error) { - ca, err := triple.NewCA(name) - if err != nil { - return nil, fmt.Errorf("failed to create CA key and certificate: %v", err) - } - server, err := triple.NewServerKeyPair(ca, APIServerCN, svcName, svcNamespace, localDNSZoneName, ips, hostnames) - if err != nil { - return nil, fmt.Errorf("failed to create federation API server key and certificate: %v", err) - } - cm, err := triple.NewClientKeyPair(ca, ControllerManagerCN, nil) - if err != nil { - return nil, fmt.Errorf("failed to create federation controller manager client key and certificate: %v", err) - } - admin, err := triple.NewClientKeyPair(ca, AdminCN, nil) - if err != nil { - return nil, fmt.Errorf("failed to create client key and certificate for an admin: %v", err) - } - return &entityKeyPairs{ - ca: ca, - server: server, - controllerManager: cm, - admin: admin, - }, nil -} - -func createAPIServerCredentialsSecret(clientset client.Interface, namespace, credentialsName, federationName string, credentials *credentials, dryRun bool) (*api.Secret, error) { - // Build the secret object with API server credentials. - data := map[string][]byte{ - "ca.crt": certutil.EncodeCertPEM(credentials.certEntKeyPairs.ca.Cert), - "server.crt": certutil.EncodeCertPEM(credentials.certEntKeyPairs.server.Cert), - "server.key": certutil.EncodePrivateKeyPEM(credentials.certEntKeyPairs.server.Key), - } - if credentials.password != "" { - data["basicauth.csv"] = authFileContents(credentials.username, credentials.password) - } - if credentials.token != "" { - data["token.csv"] = authFileContents(credentials.username, credentials.token) - } - - secret := &api.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: credentialsName, - Namespace: namespace, - Annotations: map[string]string{federation.FederationNameAnnotation: federationName}, - }, - Data: data, - } - - if dryRun { - return secret, nil - } - // Boilerplate to create the secret in the host cluster. - return clientset.Core().Secrets(namespace).Create(secret) -} - -func createControllerManagerKubeconfigSecret(clientset client.Interface, namespace, name, svcName, kubeconfigName string, entKeyPairs *entityKeyPairs, dryRun bool) (*api.Secret, error) { - config := kubeconfigutil.CreateWithCerts( - fmt.Sprintf("https://%s", svcName), - name, - ControllerManagerUser, - certutil.EncodeCertPEM(entKeyPairs.ca.Cert), - certutil.EncodePrivateKeyPEM(entKeyPairs.controllerManager.Key), - certutil.EncodeCertPEM(entKeyPairs.controllerManager.Cert), - ) - - return util.CreateKubeconfigSecret(clientset, config, namespace, kubeconfigName, name, "", dryRun) -} - -func createPVC(clientset client.Interface, namespace, svcName, federationName, etcdPVCapacity, etcdPVStorageClass string, dryRun bool) (*api.PersistentVolumeClaim, error) { - capacity, err := resource.ParseQuantity(etcdPVCapacity) - if err != nil { - return nil, err - } - - var storageClassName *string - if len(etcdPVStorageClass) > 0 { - storageClassName = &etcdPVStorageClass - } - - pvc := &api.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("%s-etcd-claim", svcName), - Namespace: namespace, - Labels: componentLabel, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - }, - }, - Spec: api.PersistentVolumeClaimSpec{ - AccessModes: []api.PersistentVolumeAccessMode{ - api.ReadWriteOnce, - }, - Resources: api.ResourceRequirements{ - Requests: api.ResourceList{ - api.ResourceStorage: capacity, - }, - }, - StorageClassName: storageClassName, - }, - } - - if dryRun { - return pvc, nil - } - - return clientset.Core().PersistentVolumeClaims(namespace).Create(pvc) -} - -func createAPIServer(clientset client.Interface, namespace, name, federationName, serverImage, etcdImage, advertiseAddress, credentialsName string, hasHTTPBasicAuthFile, hasTokenAuthFile bool, argOverrides map[string]string, pvc *api.PersistentVolumeClaim, dryRun bool, nodeSelector map[string]string, imagePullPolicy, imagePullSecrets string) (*extensions.Deployment, error) { - command := []string{ - "/hyperkube", - "federation-apiserver", - } - argsMap := map[string]string{ - "--bind-address": "0.0.0.0", - "--etcd-servers": "http://localhost:2379", - "--secure-port": fmt.Sprintf("%d", apiServerSecurePort), - "--client-ca-file": "/etc/federation/apiserver/ca.crt", - "--tls-cert-file": "/etc/federation/apiserver/server.crt", - "--tls-private-key-file": "/etc/federation/apiserver/server.key", - "--admission-control": "NamespaceLifecycle", - } - - if advertiseAddress != "" { - argsMap["--advertise-address"] = advertiseAddress - } - if hasHTTPBasicAuthFile { - argsMap["--basic-auth-file"] = "/etc/federation/apiserver/basicauth.csv" - } - if hasTokenAuthFile { - argsMap["--token-auth-file"] = "/etc/federation/apiserver/token.csv" - } - - args := argMapsToArgStrings(argsMap, argOverrides) - command = append(command, args...) - - dep := &extensions.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - Labels: componentLabel, - Annotations: map[string]string{federation.FederationNameAnnotation: federationName}, - }, - Spec: extensions.DeploymentSpec{ - Replicas: 1, - Template: api.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Labels: apiserverPodLabels, - Annotations: map[string]string{federation.FederationNameAnnotation: federationName}, - }, - Spec: api.PodSpec{ - Containers: []api.Container{ - { - Name: "apiserver", - Image: serverImage, - ImagePullPolicy: api.PullPolicy(imagePullPolicy), - Command: command, - Ports: []api.ContainerPort{ - { - Name: apiServerSecurePortName, - ContainerPort: apiServerSecurePort, - }, - { - Name: "local", - ContainerPort: 8080, - }, - }, - VolumeMounts: []api.VolumeMount{ - { - Name: credentialsName, - MountPath: "/etc/federation/apiserver", - ReadOnly: true, - }, - }, - }, - { - Name: "etcd", - Image: etcdImage, - Command: []string{ - "/usr/local/bin/etcd", - "--data-dir", - "/var/etcd/data", - }, - }, - }, - NodeSelector: nodeSelector, - ImagePullSecrets: []api.LocalObjectReference{ - { - Name: imagePullSecrets, - }, - }, - Volumes: []api.Volume{ - { - Name: credentialsName, - VolumeSource: api.VolumeSource{ - Secret: &api.SecretVolumeSource{ - SecretName: credentialsName, - }, - }, - }, - }, - }, - }, - }, - } - - if pvc != nil { - dataVolumeName := "etcddata" - etcdVolume := api.Volume{ - Name: dataVolumeName, - VolumeSource: api.VolumeSource{ - PersistentVolumeClaim: &api.PersistentVolumeClaimVolumeSource{ - ClaimName: pvc.Name, - }, - }, - } - etcdVolumeMount := api.VolumeMount{ - Name: dataVolumeName, - MountPath: "/var/etcd", - } - - dep.Spec.Template.Spec.Volumes = append(dep.Spec.Template.Spec.Volumes, etcdVolume) - for i, container := range dep.Spec.Template.Spec.Containers { - if container.Name == "etcd" { - dep.Spec.Template.Spec.Containers[i].VolumeMounts = append(dep.Spec.Template.Spec.Containers[i].VolumeMounts, etcdVolumeMount) - } - } - } - - if dryRun { - return dep, nil - } - - createdDep, err := clientset.Extensions().Deployments(namespace).Create(dep) - return createdDep, err -} - -func createControllerManagerSA(clientset client.Interface, namespace, federationName string, dryRun bool) (*api.ServiceAccount, error) { - sa := &api.ServiceAccount{ - ObjectMeta: metav1.ObjectMeta{ - Name: ControllerManagerSA, - Namespace: namespace, - Labels: componentLabel, - Annotations: map[string]string{federation.FederationNameAnnotation: federationName}, - }, - } - if dryRun { - return sa, nil - } - return clientset.Core().ServiceAccounts(namespace).Create(sa) -} - -func createRoleBindings(clientset client.Interface, namespace, saName, federationName string, dryRun bool) (*rbac.Role, *rbac.RoleBinding, error) { - roleName := "federation-system:federation-controller-manager" - role := &rbac.Role{ - // a role to use for bootstrapping the federation-controller-manager so it can access - // secrets in the host cluster to access other clusters. - ObjectMeta: metav1.ObjectMeta{ - Name: roleName, - Namespace: namespace, - Labels: componentLabel, - Annotations: map[string]string{federation.FederationNameAnnotation: federationName}, - }, - Rules: []rbac.PolicyRule{ - rbac.NewRule("get", "list", "watch").Groups(legacyAPIGroup).Resources("secrets").RuleOrDie(), - }, - } - - rolebinding, err := rbac.NewRoleBinding(roleName, namespace).SAs(namespace, saName).Binding() - if err != nil { - return nil, nil, err - } - rolebinding.Labels = componentLabel - rolebinding.Annotations = map[string]string{federation.FederationNameAnnotation: federationName} - - if dryRun { - return role, &rolebinding, nil - } - - newRole, err := clientset.Rbac().Roles(namespace).Create(role) - if err != nil { - return nil, nil, err - } - - newRolebinding, err := clientset.Rbac().RoleBindings(namespace).Create(&rolebinding) - return newRole, newRolebinding, err -} - -func createControllerManager(clientset client.Interface, namespace, name, svcName, cmName, image, kubeconfigName, dnsZoneName, dnsProvider, dnsProviderConfig, saName string, dnsProviderSecret *api.Secret, argOverrides map[string]string, dryRun bool, nodeSelector map[string]string, imagePullPolicy, imagePullSecrets string) (*extensions.Deployment, error) { - command := []string{ - "/hyperkube", - "federation-controller-manager", - } - argsMap := map[string]string{ - "--kubeconfig": "/etc/federation/controller-manager/kubeconfig", - } - - argsMap["--master"] = fmt.Sprintf("https://%s", svcName) - argsMap["--dns-provider"] = dnsProvider - argsMap["--federation-name"] = name - argsMap["--zone-name"] = dnsZoneName - - args := argMapsToArgStrings(argsMap, argOverrides) - command = append(command, args...) - - dep := &extensions.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: cmName, - Namespace: namespace, - Labels: componentLabel, - // We additionally update the details (in annotations) about the - // kube-dns config map which needs to be created in the clusters - // registering to this federation (at kubefed join). - // We wont otherwise have this information available at kubefed join. - Annotations: map[string]string{ - // TODO: the name/domain name pair should ideally be checked for naming convention - // as done in kube-dns federation flags check. - // https://github.com/kubernetes/dns/blob/master/pkg/dns/federation/federation.go - // TODO v2: Until kube-dns can handle trailing periods we strip them all. - // See https://github.com/kubernetes/dns/issues/67 - util.FedDomainMapKey: fmt.Sprintf("%s=%s", name, strings.TrimRight(dnsZoneName, ".")), - federation.FederationNameAnnotation: name, - }, - }, - Spec: extensions.DeploymentSpec{ - Replicas: 1, - Template: api.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Name: cmName, - Labels: controllerManagerPodLabels, - Annotations: map[string]string{federation.FederationNameAnnotation: name}, - }, - Spec: api.PodSpec{ - Containers: []api.Container{ - { - Name: "controller-manager", - Image: image, - ImagePullPolicy: api.PullPolicy(imagePullPolicy), - Command: command, - VolumeMounts: []api.VolumeMount{ - { - Name: kubeconfigName, - MountPath: "/etc/federation/controller-manager", - ReadOnly: true, - }, - }, - Env: []api.EnvVar{ - { - Name: "POD_NAMESPACE", - ValueFrom: &api.EnvVarSource{ - FieldRef: &api.ObjectFieldSelector{ - FieldPath: "metadata.namespace", - }, - }, - }, - }, - }, - }, - NodeSelector: nodeSelector, - ImagePullSecrets: []api.LocalObjectReference{ - { - Name: imagePullSecrets, - }, - }, - Volumes: []api.Volume{ - { - Name: kubeconfigName, - VolumeSource: api.VolumeSource{ - Secret: &api.SecretVolumeSource{ - SecretName: kubeconfigName, - }, - }, - }, - }, - }, - }, - }, - } - - if saName != "" { - dep.Spec.Template.Spec.ServiceAccountName = saName - } - - if dnsProviderSecret != nil { - dep = addDNSProviderConfig(dep, dnsProviderSecret.Name) - if dnsProvider == util.FedDNSProviderCoreDNS { - var err error - dep, err = addCoreDNSServerAnnotation(dep, dnsZoneName, dnsProviderConfig) - if err != nil { - return nil, err - } - } - } - - if dryRun { - return dep, nil - } - - return clientset.Extensions().Deployments(namespace).Create(dep) -} - -func marshallOverrides(overrideArgString string) (map[string]string, error) { - if overrideArgString == "" { - return nil, nil - } - - argsMap := make(map[string]string) - overrideArgs := strings.Split(overrideArgString, ",") - for _, overrideArg := range overrideArgs { - splitArg := strings.SplitN(overrideArg, "=", 2) - if len(splitArg) != 2 { - return nil, fmt.Errorf("wrong format for override arg: %s", overrideArg) - } - key := strings.TrimSpace(splitArg[0]) - val := strings.TrimSpace(splitArg[1]) - if len(key) == 0 { - return nil, fmt.Errorf("wrong format for override arg: %s, arg name cannot be empty", overrideArg) - } - argsMap[key] = val - } - return argsMap, nil -} - -func argMapsToArgStrings(argsMap, overrides map[string]string) []string { - for key, val := range overrides { - argsMap[key] = val - } - args := []string{} - for key, value := range argsMap { - args = append(args, fmt.Sprintf("%s=%s", key, value)) - } - // This is needed for the unit test deep copy to get an exact match - sort.Strings(args) - return args -} - -func waitForPods(cmdOut io.Writer, clientset client.Interface, fedPods []string, namespace string) error { - err := wait.PollInfinite(podWaitInterval, func() (bool, error) { - fmt.Fprint(cmdOut, ".") - podCheck := len(fedPods) - podList, err := clientset.Core().Pods(namespace).List(metav1.ListOptions{}) - if err != nil { - return false, nil - } - for _, pod := range podList.Items { - for _, fedPod := range fedPods { - if strings.HasPrefix(pod.Name, fedPod) && pod.Status.Phase == "Running" { - podCheck -= 1 - } - } - //ensure that all pods are in running state or keep waiting - if podCheck == 0 { - return true, nil - } - } - return false, nil - }) - return err -} - -func waitSrvHealthy(cmdOut io.Writer, config util.AdminConfig, context, kubeconfig string) error { - fedClientSet, err := config.FederationClientset(context, kubeconfig) - if err != nil { - return err - } - fedDiscoveryClient := fedClientSet.Discovery() - err = wait.PollInfinite(podWaitInterval, func() (bool, error) { - fmt.Fprint(cmdOut, ".") - body, err := fedDiscoveryClient.RESTClient().Get().AbsPath("/healthz").Do().Raw() - if err != nil { - return false, nil - } - if strings.EqualFold(string(body), "ok") { - return true, nil - } - return false, nil - }) - return err -} - -func printSuccess(cmdOut io.Writer, ips, hostnames []string, svc *api.Service) error { - svcEndpoints := append(ips, hostnames...) - endpoints := strings.Join(svcEndpoints, ", ") - if svc.Spec.Type == api.ServiceTypeNodePort { - endpoints = ips[0] + ":" + strconv.Itoa(int(svc.Spec.Ports[0].NodePort)) - if len(ips) > 1 { - endpoints = endpoints + ", ..." - } - } - - _, err := fmt.Fprintf(cmdOut, "Federation API server is running at: %s\n", endpoints) - return err -} - -func updateKubeconfig(config util.AdminConfig, name, endpoint, kubeConfigPath string, credentials *credentials, dryRun bool) error { - po := config.PathOptions() - po.LoadingRules.ExplicitPath = kubeConfigPath - kubeconfig, err := po.GetStartingConfig() - if err != nil { - return err - } - - // Populate API server endpoint info. - cluster := clientcmdapi.NewCluster() - // Prefix "https" as the URL scheme to endpoint. - if !strings.HasPrefix(endpoint, "https://") { - endpoint = fmt.Sprintf("https://%s", endpoint) - } - cluster.Server = endpoint - cluster.CertificateAuthorityData = certutil.EncodeCertPEM(credentials.certEntKeyPairs.ca.Cert) - - // Populate credentials. - authInfo := clientcmdapi.NewAuthInfo() - authInfo.ClientCertificateData = certutil.EncodeCertPEM(credentials.certEntKeyPairs.admin.Cert) - authInfo.ClientKeyData = certutil.EncodePrivateKeyPEM(credentials.certEntKeyPairs.admin.Key) - authInfo.Token = credentials.token - - var httpBasicAuthInfo *clientcmdapi.AuthInfo - if credentials.password != "" { - httpBasicAuthInfo = clientcmdapi.NewAuthInfo() - httpBasicAuthInfo.Password = credentials.password - httpBasicAuthInfo.Username = credentials.username - } - - // Populate context. - context := clientcmdapi.NewContext() - context.Cluster = name - context.AuthInfo = name - - // Update the config struct with API server endpoint info, - // credentials and context. - kubeconfig.Clusters[name] = cluster - kubeconfig.AuthInfos[name] = authInfo - if httpBasicAuthInfo != nil { - kubeconfig.AuthInfos[fmt.Sprintf("%s-basic-auth", name)] = httpBasicAuthInfo - } - kubeconfig.Contexts[name] = context - - if !dryRun { - // Write the update kubeconfig. - if err := clientcmd.ModifyConfig(po, *kubeconfig, true); err != nil { - return err - } - } - - return nil -} - -func createDNSProviderConfigSecret(clientset client.Interface, namespace, name, federationName string, dnsProviderConfigBytes []byte, dryRun bool) (*api.Secret, error) { - if dnsProviderConfigBytes == nil { - return nil, nil - } - - secretSpec := &api.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - Annotations: map[string]string{federation.FederationNameAnnotation: federationName}, - }, - Data: map[string][]byte{ - name: dnsProviderConfigBytes, - }, - } - - var secret *api.Secret - var err error - if !dryRun { - secret, err = clientset.Core().Secrets(namespace).Create(secretSpec) - if err != nil { - return nil, err - } - } - return secret, nil -} - -func addDNSProviderConfig(dep *extensions.Deployment, secretName string) *extensions.Deployment { - const ( - dnsProviderConfigVolume = "config-volume" - dnsProviderConfigMountPath = "/etc/federation/dns-provider" - ) - - // Create a volume from dns-provider secret - volume := api.Volume{ - Name: dnsProviderConfigVolume, - VolumeSource: api.VolumeSource{ - Secret: &api.SecretVolumeSource{ - SecretName: secretName, - }, - }, - } - dep.Spec.Template.Spec.Volumes = append(dep.Spec.Template.Spec.Volumes, volume) - - // Mount dns-provider secret volume to controller-manager container - volumeMount := api.VolumeMount{ - Name: dnsProviderConfigVolume, - MountPath: dnsProviderConfigMountPath, - ReadOnly: true, - } - dep.Spec.Template.Spec.Containers[0].VolumeMounts = append(dep.Spec.Template.Spec.Containers[0].VolumeMounts, volumeMount) - dep.Spec.Template.Spec.Containers[0].Command = append(dep.Spec.Template.Spec.Containers[0].Command, fmt.Sprintf("--dns-provider-config=%s/%s", dnsProviderConfigMountPath, secretName)) - - return dep -} - -// authFileContents returns a CSV string containing the contents of an -// authentication file in the format required by the federation-apiserver. -func authFileContents(username, authSecret string) []byte { - return []byte(fmt.Sprintf("%s,%s,%s\n", authSecret, username, uuid.NewUUID())) -} - -func addCoreDNSServerAnnotation(deployment *extensions.Deployment, dnsZoneName, dnsProviderConfig string) (*extensions.Deployment, error) { - var cfg coredns.Config - if err := gcfg.ReadFileInto(&cfg, dnsProviderConfig); err != nil { - return nil, err - } - - deployment.Annotations[util.FedDNSZoneName] = dnsZoneName - deployment.Annotations[util.FedNameServer] = cfg.Global.CoreDNSEndpoints - deployment.Annotations[util.FedDNSProvider] = util.FedDNSProviderCoreDNS - return deployment, nil -} diff --git a/federation/pkg/kubefed/init/init_test.go b/federation/pkg/kubefed/init/init_test.go deleted file mode 100644 index bc5cf61ea7..0000000000 --- a/federation/pkg/kubefed/init/init_test.go +++ /dev/null @@ -1,1634 +0,0 @@ -/* -Copyright 2016 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 init - -import ( - "bytes" - "crypto/tls" - "crypto/x509" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "net/url" - "os" - "sort" - "strconv" - "strings" - "testing" - "time" - - "k8s.io/api/core/v1" - "k8s.io/api/extensions/v1beta1" - rbacv1 "k8s.io/api/rbac/v1" - apiequality "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/diff" - "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/client-go/dynamic" - "k8s.io/client-go/rest/fake" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/kubernetes/federation/apis/federation" - "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/coredns" - kubefedtesting "k8s.io/kubernetes/federation/pkg/kubefed/testing" - "k8s.io/kubernetes/federation/pkg/kubefed/util" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/helper" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/apis/rbac" - cmdtesting "k8s.io/kubernetes/pkg/kubectl/cmd/testing" - cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" - - "gopkg.in/gcfg.v1" -) - -const ( - testNamespace = "test-ns" - testSvcName = "test-service" - testCertValidity = 1 * time.Hour - - helloMsg = "Hello, certificate test!" - - lbIP = "10.20.30.40" - nodeIP = "10.20.30.50" - nodePort = 32111 - - testAPIGroup = "testGroup" - testAPIVersion = "testVersion" -) - -func TestInitFederation(t *testing.T) { - cmdErrMsg := "" - cmdutil.BehaviorOnFatal(func(str string, code int) { - cmdErrMsg = str - }) - - fakeKubeFiles, err := kubefedtesting.FakeKubeconfigFiles() - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - defer kubefedtesting.RemoveFakeKubeconfigFiles(fakeKubeFiles) - - testCases := []struct { - federation string - kubeconfigGlobal string - kubeconfigExplicit string - dnsZoneName string - lbIP string - apiserverServiceType v1.ServiceType - advertiseAddress string - serverImage string - imagePullPolicy string - imagePullSecrets string - etcdImage string - etcdPVCapacity string - etcdPVStorageClass string - etcdPersistence string - expectedErr string - dnsProvider string - dnsProviderConfig string - dryRun string - apiserverArgOverrides string - cmArgOverrides string - apiserverEnableHTTPBasicAuth bool - apiserverEnableTokenAuth bool - isRBACAPIAvailable bool - nodeSelector string - }{ - { - federation: "union", - kubeconfigGlobal: fakeKubeFiles[0], - kubeconfigExplicit: "", - dnsZoneName: "example.test.", - lbIP: lbIP, - apiserverServiceType: v1.ServiceTypeLoadBalancer, - serverImage: "example.test/foo:bar", - imagePullPolicy: "IfNotPresent", - etcdPVCapacity: "5Gi", - etcdPersistence: "true", - expectedErr: "", - dnsProvider: util.FedDNSProviderCoreDNS, - dnsProviderConfig: "dns-provider.conf", - dryRun: "", - apiserverArgOverrides: "--client-ca-file=override,--log-dir=override", - cmArgOverrides: "--dns-provider=override,--log-dir=override", - nodeSelector: "disk=ssh,role=node", - }, - { - federation: "union", - kubeconfigGlobal: fakeKubeFiles[1], - kubeconfigExplicit: fakeKubeFiles[2], - dnsZoneName: "example.test.", - lbIP: lbIP, - apiserverServiceType: v1.ServiceTypeLoadBalancer, - serverImage: "example.test/foo:bar", - imagePullPolicy: "IfNotPresent", - etcdPVCapacity: "", //test for default value of pvc-size - etcdPersistence: "true", - expectedErr: "", - dryRun: "", - }, - { - federation: "union", - kubeconfigGlobal: fakeKubeFiles[0], - kubeconfigExplicit: "", - dnsZoneName: "example.test.", - lbIP: lbIP, - apiserverServiceType: v1.ServiceTypeLoadBalancer, - serverImage: "example.test/foo:bar", - imagePullPolicy: "IfNotPresent", - etcdPVCapacity: "", - etcdPersistence: "true", - expectedErr: "", - dryRun: "valid-run", - }, - { - federation: "union", - kubeconfigGlobal: fakeKubeFiles[0], - kubeconfigExplicit: "", - dnsZoneName: "example.test.", - lbIP: lbIP, - apiserverServiceType: v1.ServiceTypeLoadBalancer, - serverImage: "example.test/foo:bar", - imagePullPolicy: "IfNotPresent", - etcdPVCapacity: "5Gi", - etcdPersistence: "false", - expectedErr: "", - dryRun: "", - }, - { - federation: "union", - kubeconfigGlobal: fakeKubeFiles[0], - kubeconfigExplicit: "", - dnsZoneName: "example.test.", - apiserverServiceType: v1.ServiceTypeNodePort, - serverImage: "example.test/foo:bar", - imagePullPolicy: "IfNotPresent", - etcdPVCapacity: "5Gi", - etcdPersistence: "true", - expectedErr: "", - dryRun: "", - }, - { - federation: "union", - kubeconfigGlobal: fakeKubeFiles[0], - kubeconfigExplicit: "", - dnsZoneName: "example.test.", - apiserverServiceType: v1.ServiceTypeNodePort, - advertiseAddress: nodeIP, - serverImage: "example.test/foo:bar", - imagePullPolicy: "IfNotPresent", - etcdPVCapacity: "5Gi", - etcdPersistence: "true", - expectedErr: "", - dryRun: "", - }, - { - federation: "union", - kubeconfigGlobal: fakeKubeFiles[0], - kubeconfigExplicit: "", - dnsZoneName: "example.test.", - apiserverServiceType: v1.ServiceTypeNodePort, - advertiseAddress: nodeIP, - serverImage: "example.test/foo:bar", - imagePullPolicy: "IfNotPresent", - etcdImage: "gcr.io/google_containers/etcd:latest", - etcdPVCapacity: "5Gi", - etcdPVStorageClass: "fast", - etcdPersistence: "true", - expectedErr: "", - dryRun: "", - apiserverEnableHTTPBasicAuth: true, - apiserverEnableTokenAuth: true, - isRBACAPIAvailable: true, - }, - } - - defaultEtcdImage := "gcr.io/google_containers/etcd:3.1.10" - - //TODO: implement a negative case for dry run - - for i, tc := range testCases { - cmdErrMsg = "" - tmpDirPath := "" - buf := bytes.NewBuffer([]byte{}) - - if tc.dnsProvider == "" { - tc.dnsProvider = "google-clouddns" - } - if tc.dnsProviderConfig != "" { - tmpfile, err := ioutil.TempFile("", tc.dnsProviderConfig) - if err != nil { - t.Fatalf("[%d] unexpected error: %v", i, err) - } - tc.dnsProviderConfig = tmpfile.Name() - defer os.Remove(tmpfile.Name()) - } - - // Check pkg/kubectl/cmd/testing/fake (fakeAPIFactory.DiscoveryClient()) for details of tmpDir - // We want an unique discovery cache path for each test run, else the case from previous case would be used - tmpDirPath, err = ioutil.TempDir("", "") - if err != nil { - t.Fatalf("[%d] unexpected error: %v", i, err) - } - defer os.Remove(tmpDirPath) - - // If tc.etcdImage is set, setting the etcd image via the flag will be - // validated. If not set, the default value will be validated. - if tc.etcdImage == "" { - tc.etcdImage = defaultEtcdImage - } - if tc.imagePullPolicy == "" { - tc.imagePullPolicy = "IfNotPresent" - } - - hostFactory, err := fakeInitHostFactory(tc.apiserverServiceType, tc.federation, util.DefaultFederationSystemNamespace, tc.advertiseAddress, tc.lbIP, tc.dnsZoneName, tc.serverImage, tc.etcdImage, tc.dnsProvider, tc.dnsProviderConfig, tc.etcdPersistence, tc.etcdPVCapacity, tc.etcdPVStorageClass, tc.apiserverArgOverrides, tc.cmArgOverrides, tmpDirPath, tc.apiserverEnableHTTPBasicAuth, tc.apiserverEnableTokenAuth, tc.isRBACAPIAvailable, tc.nodeSelector, tc.imagePullPolicy, tc.imagePullSecrets) - if err != nil { - t.Fatalf("[%d] unexpected error: %v", i, err) - } - - adminConfig, err := kubefedtesting.NewFakeAdminConfig(hostFactory, nil, "", tc.kubeconfigGlobal) - if err != nil { - t.Fatalf("[%d] unexpected error: %v", i, err) - } - - cmd := NewCmdInit(buf, adminConfig, "serverImage", defaultEtcdImage) - - cmd.Flags().Set("kubeconfig", tc.kubeconfigExplicit) - cmd.Flags().Set("host-cluster-context", "substrate") - cmd.Flags().Set("dns-zone-name", tc.dnsZoneName) - cmd.Flags().Set("image", tc.serverImage) - cmd.Flags().Set("etcd-image", tc.etcdImage) - cmd.Flags().Set("image-pull-policy", tc.imagePullPolicy) - cmd.Flags().Set("dns-provider", tc.dnsProvider) - cmd.Flags().Set("apiserver-arg-overrides", tc.apiserverArgOverrides) - cmd.Flags().Set("controllermanager-arg-overrides", tc.cmArgOverrides) - - if tc.dnsProviderConfig != "" { - cmd.Flags().Set("dns-provider-config", tc.dnsProviderConfig) - } - if tc.etcdPVCapacity != "" { - cmd.Flags().Set("etcd-pv-capacity", tc.etcdPVCapacity) - } - if tc.etcdPVStorageClass != "" { - cmd.Flags().Set("etcd-pv-storage-class", tc.etcdPVStorageClass) - } - if tc.etcdPersistence != "true" { - cmd.Flags().Set("etcd-persistent-storage", tc.etcdPersistence) - } - if tc.imagePullSecrets != "" { - cmd.Flags().Set("image-pull-secrets", tc.imagePullSecrets) - } - if tc.apiserverServiceType != v1.ServiceTypeLoadBalancer { - cmd.Flags().Set(apiserverServiceTypeFlag, string(tc.apiserverServiceType)) - cmd.Flags().Set(apiserverAdvertiseAddressFlag, tc.advertiseAddress) - } - if tc.dryRun == "valid-run" { - cmd.Flags().Set("dry-run", "true") - } - if tc.apiserverEnableHTTPBasicAuth { - cmd.Flags().Set("apiserver-enable-basic-auth", "true") - } - if tc.apiserverEnableTokenAuth { - cmd.Flags().Set("apiserver-enable-token-auth", "true") - } - if tc.nodeSelector != "" { - cmd.Flags().Set("node-selector", tc.nodeSelector) - } - - cmd.Run(cmd, []string{tc.federation}) - - if tc.expectedErr == "" { - // uses the name from the federation, not the response - // Actual data passed are tested in the fake secret and cluster - // REST clients. - endpoint := getEndpoint(tc.apiserverServiceType, tc.lbIP, tc.advertiseAddress) - wantedSuffix := fmt.Sprintf("Federation API server is running at: %s\n", endpoint) - if tc.dryRun != "" { - wantedSuffix = fmt.Sprintf("Federation control plane runs (dry run)\n") - } - - if got := buf.String(); !strings.HasSuffix(got, wantedSuffix) { - t.Errorf("[%d] unexpected output: got: %s, wanted suffix: %s", i, got, wantedSuffix) - if cmdErrMsg != "" { - t.Errorf("[%d] unexpected error message: %s", i, cmdErrMsg) - } - } - } else { - if cmdErrMsg != tc.expectedErr { - t.Errorf("[%d] expected error: %s, got: %s, output: %s", i, tc.expectedErr, cmdErrMsg, buf.String()) - } - return - } - - testKubeconfigUpdate(t, tc.apiserverServiceType, tc.federation, tc.advertiseAddress, tc.lbIP, tc.kubeconfigGlobal, tc.kubeconfigExplicit, tc.apiserverEnableHTTPBasicAuth, tc.apiserverEnableTokenAuth) - } -} - -func TestMarshallAndMergeOverrides(t *testing.T) { - testCases := []struct { - overrideParams string - expectedSet sets.String - expectedErr string - }{ - { - overrideParams: "valid-format-param1=override1,valid-format-param2=override2", - expectedSet: sets.NewString("arg2=val2", "arg1=val1", "valid-format-param1=override1", "valid-format-param2=override2"), - expectedErr: "", - }, - { - overrideParams: "valid-format-param1=override1,arg1=override1", - expectedSet: sets.NewString("arg2=val2", "arg1=override1", "valid-format-param1=override1"), - expectedErr: "", - }, - { - overrideParams: "zero-value-arg=", - expectedSet: sets.NewString("arg2=val2", "arg1=val1", "zero-value-arg="), - expectedErr: "", - }, - { - overrideParams: "wrong-format-arg", - expectedErr: "wrong format for override arg: wrong-format-arg", - }, - { - // TODO: Multiple arg values separated by , are not supported yet - overrideParams: "multiple-equalto-char=first-key=1", - expectedSet: sets.NewString("arg2=val2", "arg1=val1", "multiple-equalto-char=first-key=1"), - expectedErr: "", - }, - { - overrideParams: "=wrong-format-only-value", - expectedErr: "wrong format for override arg: =wrong-format-only-value, arg name cannot be empty", - }, - } - - for i, tc := range testCases { - args, err := marshallOverrides(tc.overrideParams) - if tc.expectedErr == "" { - origArgs := map[string]string{ - "arg1": "val1", - "arg2": "val2", - } - merged := argMapsToArgStrings(origArgs, args) - - got := sets.NewString(merged...) - want := tc.expectedSet - - if !got.Equal(want) { - t.Errorf("[%d] unexpected output: got: %v, want: %v", i, got, want) - } - } else { - if err.Error() != tc.expectedErr { - t.Errorf("[%d] unexpected error output: got: %s, want: %s", i, err.Error(), tc.expectedErr) - } - } - } -} - -// TestCertsTLS tests TLS handshake with client authentication for any server -// name. There is a separate test below to test the certificate generation -// end-to-end over HTTPS. -// TODO(madhusudancs): Consider using a deterministic random number generator -// for generating certificates in tests. -func TestCertsTLS(t *testing.T) { - params := []certParams{ - { - cAddr: "10.1.2.3", - ips: []string{"10.1.2.3", "10.2.3.4"}, - hostnames: []string{"federation.test", "federation2.test"}, - }, - { - cAddr: "10.10.20.30", - ips: []string{"10.20.30.40", "10.64.128.4"}, - hostnames: []string{"tls.federation.test"}, - }, - } - - tlsCfgs, err := tlsConfigs(params) - if err != nil { - t.Errorf("failed to generate tls configs: %v", err) - // No point in proceeding further - return - } - - testCases := []struct { - serverName string - sCfg *tls.Config - cCfg *tls.Config - failType string - }{ - { - serverName: "10.1.2.3", - sCfg: tlsCfgs[0].server, - cCfg: tlsCfgs[0].client, - }, - { - serverName: "10.2.3.4", - sCfg: tlsCfgs[0].server, - cCfg: tlsCfgs[0].client, - }, - { - serverName: "federation.test", - sCfg: tlsCfgs[0].server, - cCfg: tlsCfgs[0].client, - }, - { - serverName: "federation2.test", - sCfg: tlsCfgs[0].server, - cCfg: tlsCfgs[0].client, - }, - { - serverName: "10.20.30.40", - sCfg: tlsCfgs[1].server, - cCfg: tlsCfgs[1].client, - }, - { - serverName: "tls.federation.test", - sCfg: tlsCfgs[1].server, - cCfg: tlsCfgs[1].client, - }, - { - serverName: "10.100.200.50", - sCfg: tlsCfgs[0].server, - cCfg: tlsCfgs[0].client, - failType: "HostnameError", - }, - { - serverName: "noexist.test", - sCfg: tlsCfgs[0].server, - cCfg: tlsCfgs[0].client, - failType: "HostnameError", - }, - { - serverName: "10.64.128.4", - sCfg: tlsCfgs[0].server, - cCfg: tlsCfgs[0].client, - failType: "HostnameError", - }, - { - serverName: "tls.federation.test", - sCfg: tlsCfgs[0].server, - cCfg: tlsCfgs[0].client, - failType: "HostnameError", - }, - { - serverName: "10.1.2.3", - sCfg: tlsCfgs[0].server, - cCfg: tlsCfgs[1].client, - failType: "UnknownAuthorityError", - }, - { - serverName: "federation2.test", - sCfg: tlsCfgs[0].server, - cCfg: tlsCfgs[1].client, - failType: "UnknownAuthorityError", - }, - { - serverName: "10.1.2.3", - sCfg: tlsCfgs[1].server, - cCfg: tlsCfgs[0].client, - failType: "HostnameError", - }, - { - serverName: "federation2.test", - sCfg: tlsCfgs[1].server, - cCfg: tlsCfgs[0].client, - failType: "HostnameError", - }, - } - - for i, tc := range testCases { - // Make a copy of the client config before modifying it. - // We can't do a regular pointer deref shallow copy because - // tls.Config contains an unexported sync.Once field which - // must not be copied. This was pointed out by go vet. - cCfg := copyTLSConfig(tc.cCfg) - cCfg.ServerName = tc.serverName - cCfg.BuildNameToCertificate() - - err := tlsHandshake(t, tc.sCfg, cCfg) - if len(tc.failType) > 0 { - switch tc.failType { - case "HostnameError": - if _, ok := err.(x509.HostnameError); !ok { - t.Errorf("[%d] unexpected error: want x509.HostnameError, got: %T", i, err) - } - case "UnknownAuthorityError": - if _, ok := err.(x509.UnknownAuthorityError); !ok { - t.Errorf("[%d] unexpected error: want x509.UnknownAuthorityError, got: %T", i, err) - } - default: - t.Errorf("cannot handle error type: %s", tc.failType) - - } - } else if err != nil { - t.Errorf("[%d] unexpected error: %v", i, err) - } - } -} - -// TestCertsHTTPS cannot test client authentication for non-localhost server -// names, but it tests TLS handshake end-to-end over HTTPS. -func TestCertsHTTPS(t *testing.T) { - params := []certParams{ - { - // Unfortunately, due to the limitation in the way Go - // net/http/httptest package sets up the test HTTPS/TLS server, - // 127.0.0.1 is the only accepted server address. So, we need to - // generate certificates for this address. - cAddr: "127.0.0.1", - ips: []string{"127.0.0.1"}, - hostnames: []string{}, - }, - { - // Unfortunately, due to the limitation in the way Go - // net/http/httptest package sets up the test HTTPS/TLS server, - // 127.0.0.1 is the only accepted server address. So, we need to - // generate certificates for this address. - cAddr: "localhost", - ips: []string{"127.0.0.1"}, - hostnames: []string{"localhost"}, - }, - } - - tlsCfgs, err := tlsConfigs(params) - if err != nil { - t.Errorf("failed to generate tls configs: %v", err) - // No point in proceeding further - return - } - - testCases := []struct { - sCfg *tls.Config - cCfg *tls.Config - fail bool - }{ - { - sCfg: tlsCfgs[0].server, - cCfg: tlsCfgs[0].client, - fail: false, - }, - { - sCfg: tlsCfgs[0].server, - cCfg: tlsCfgs[1].client, - fail: true, - }, - { - sCfg: tlsCfgs[1].server, - cCfg: tlsCfgs[0].client, - fail: true, - }, - } - - for i, tc := range testCases { - // Make a copy of the client config before modifying it. - // We can't do a regular pointer deref shallow copy because - // tls.Config contains an unexported sync.Once field which - // must not be copied. This was pointed out by go vet. - cCfg := copyTLSConfig(tc.cCfg) - cCfg.BuildNameToCertificate() - - s, err := fakeHTTPSServer(tc.sCfg) - if err != nil { - t.Errorf("[%d] unexpected error starting TLS server: %v", i, err) - // No point in proceeding - continue - } - defer s.Close() - - tr := &http.Transport{ - TLSClientConfig: cCfg, - } - client := &http.Client{Transport: tr} - resp, err := client.Get(s.URL) - if tc.fail { - _, ok := err.(*url.Error) - if !ok || !strings.HasSuffix(err.Error(), "x509: certificate signed by unknown authority") { - t.Errorf("[%d] unexpected error: want x509.HostnameError, got: %T", i, err) - } - // We are done for this test. - continue - } else if err != nil { - t.Errorf("[%d] unexpected error while sending GET request to the server: %T", i, err) - // No point in proceeding - continue - } - defer resp.Body.Close() - - got, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Errorf("[%d] unexpected error reading server response: %v", i, err) - } else if string(got) != helloMsg { - t.Errorf("[%d] want %q, got %q", i, helloMsg, got) - } - } -} - -func fakeInitHostFactory(apiserverServiceType v1.ServiceType, federationName, namespaceName, advertiseAddress, lbIp, dnsZoneName, serverImage, etcdImage, dnsProvider, dnsProviderConfig, etcdPersistence, etcdPVCapacity, etcdPVStorageClass, apiserverOverrideArg, cmOverrideArg, tmpDirPath string, apiserverEnableHTTPBasicAuth, apiserverEnableTokenAuth, isRBACAPIAvailable bool, nodeSelectorString string, imagePullPolicy, imagePullSecrets string) (cmdutil.Factory, error) { - svcName := federationName + "-apiserver" - svcUrlPrefix := "/api/v1/namespaces/federation-system/services" - credSecretName := svcName + "-credentials" - cmKubeconfigSecretName := federationName + "-controller-manager-kubeconfig" - pvCap := "10Gi" - if etcdPVCapacity != "" { - pvCap = etcdPVCapacity - } - - capacity, err := resource.ParseQuantity(pvCap) - if err != nil { - return nil, err - } - pvcName := svcName + "-etcd-claim" - replicas := int32(1) - - namespace := v1.Namespace{ - TypeMeta: metav1.TypeMeta{ - Kind: "Namespace", - APIVersion: testapi.Default.GroupVersion().String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: namespaceName, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - }, - }, - } - - svc := v1.Service{ - TypeMeta: metav1.TypeMeta{ - Kind: "Service", - APIVersion: testapi.Default.GroupVersion().String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: namespaceName, - Name: svcName, - Labels: componentLabel, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - }, - }, - Spec: v1.ServiceSpec{ - Type: apiserverServiceType, - Selector: apiserverSvcSelector, - Ports: []v1.ServicePort{ - { - Name: "https", - Protocol: "TCP", - Port: 443, - TargetPort: intstr.FromString(apiServerSecurePortName), - }, - }, - }, - } - - svcWithLB := svc - svcWithLB.Status = v1.ServiceStatus{ - LoadBalancer: v1.LoadBalancerStatus{ - Ingress: []v1.LoadBalancerIngress{ - { - IP: lbIp, - }, - }, - }, - } - - credSecret := v1.Secret{ - TypeMeta: metav1.TypeMeta{ - Kind: "Secret", - APIVersion: testapi.Default.GroupVersion().String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: credSecretName, - Namespace: namespaceName, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - }, - }, - Data: nil, - } - - cmKubeconfigSecret := v1.Secret{ - TypeMeta: metav1.TypeMeta{ - Kind: "Secret", - APIVersion: testapi.Default.GroupVersion().String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: cmKubeconfigSecretName, - Namespace: namespaceName, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - }, - }, - Data: nil, - } - - cmDNSProviderSecret := v1.Secret{ - TypeMeta: metav1.TypeMeta{ - Kind: "Secret", - APIVersion: testapi.Default.GroupVersion().String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: dnsProviderSecretName, - Namespace: namespaceName, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - }, - }, - Data: nil, - } - - var storageClassName *string - if len(etcdPVStorageClass) > 0 { - storageClassName = &etcdPVStorageClass - } - - pvc := v1.PersistentVolumeClaim{ - TypeMeta: metav1.TypeMeta{ - Kind: "PersistentVolumeClaim", - APIVersion: testapi.Default.GroupVersion().String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: pvcName, - Namespace: namespaceName, - Labels: componentLabel, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - }, - }, - Spec: v1.PersistentVolumeClaimSpec{ - AccessModes: []v1.PersistentVolumeAccessMode{ - v1.ReadWriteOnce, - }, - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceStorage: capacity, - }, - }, - StorageClassName: storageClassName, - }, - } - - sa := v1.ServiceAccount{ - TypeMeta: metav1.TypeMeta{ - Kind: "ServiceAccount", - APIVersion: testapi.Default.GroupVersion().String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "federation-controller-manager", - Namespace: namespaceName, - Labels: componentLabel, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - }, - }, - } - - role := rbacv1.Role{ - TypeMeta: metav1.TypeMeta{ - Kind: "Role", - APIVersion: rbacv1.SchemeGroupVersion.String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "federation-system:federation-controller-manager", - Namespace: namespaceName, - Labels: componentLabel, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - }, - }, - Rules: []rbacv1.PolicyRule{ - { - Verbs: []string{"get", "list", "watch"}, - APIGroups: []string{""}, - Resources: []string{"secrets"}, - }, - }, - } - - rolebinding := rbacv1.RoleBinding{ - TypeMeta: metav1.TypeMeta{ - Kind: "RoleBinding", - APIVersion: rbacv1.SchemeGroupVersion.String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "federation-system:federation-controller-manager", - Namespace: namespaceName, - Labels: componentLabel, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - }, - }, - Subjects: []rbacv1.Subject{ - { - Kind: "ServiceAccount", - APIGroup: "", - Name: "federation-controller-manager", - Namespace: "federation-system", - }, - }, - RoleRef: rbacv1.RoleRef{ - APIGroup: "rbac.authorization.k8s.io", - Kind: "Role", - Name: "federation-system:federation-controller-manager", - }, - } - - node := v1.Node{ - TypeMeta: metav1.TypeMeta{ - Kind: "Node", - APIVersion: testapi.Extensions.GroupVersion().String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: nodeIP, - }, - Status: v1.NodeStatus{ - Addresses: []v1.NodeAddress{ - { - Type: v1.NodeExternalIP, - Address: nodeIP, - }, - }, - }, - } - nodeList := v1.NodeList{} - nodeList.Items = append(nodeList.Items, node) - - address := lbIp - if apiserverServiceType == v1.ServiceTypeNodePort { - if advertiseAddress != "" { - address = advertiseAddress - } else { - address = nodeIP - } - } - - apiserverCommand := []string{ - "/hyperkube", - "federation-apiserver", - } - apiserverArgs := []string{ - "--bind-address=0.0.0.0", - "--etcd-servers=http://localhost:2379", - fmt.Sprintf("--secure-port=%d", apiServerSecurePort), - "--tls-cert-file=/etc/federation/apiserver/server.crt", - "--tls-private-key-file=/etc/federation/apiserver/server.key", - "--admission-control=NamespaceLifecycle", - fmt.Sprintf("--advertise-address=%s", address), - } - - if apiserverOverrideArg != "" { - apiserverArgs = append(apiserverArgs, "--client-ca-file=override") - apiserverArgs = append(apiserverArgs, "--log-dir=override") - - } else { - apiserverArgs = append(apiserverArgs, "--client-ca-file=/etc/federation/apiserver/ca.crt") - } - if apiserverEnableHTTPBasicAuth { - apiserverArgs = append(apiserverArgs, "--basic-auth-file=/etc/federation/apiserver/basicauth.csv") - } - if apiserverEnableTokenAuth { - apiserverArgs = append(apiserverArgs, "--token-auth-file=/etc/federation/apiserver/token.csv") - } - sort.Strings(apiserverArgs) - apiserverCommand = append(apiserverCommand, apiserverArgs...) - - nodeSelector, err := marshallOverrides(nodeSelectorString) - if err != nil { - return nil, fmt.Errorf("error marshalling --node-selector: %v", err) - } - - apiserver := &v1beta1.Deployment{ - TypeMeta: metav1.TypeMeta{ - Kind: "Deployment", - APIVersion: testapi.Extensions.GroupVersion().String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: svcName, - Namespace: namespaceName, - Labels: componentLabel, - Annotations: map[string]string{federation.FederationNameAnnotation: federationName}, - }, - Spec: v1beta1.DeploymentSpec{ - Replicas: &replicas, - Selector: nil, - Template: v1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Name: svcName, - Labels: apiserverPodLabels, - Annotations: map[string]string{federation.FederationNameAnnotation: federationName}, - }, - Spec: v1.PodSpec{ - Containers: []v1.Container{ - { - Name: "apiserver", - Image: serverImage, - ImagePullPolicy: v1.PullPolicy(imagePullPolicy), - Command: apiserverCommand, - Ports: []v1.ContainerPort{ - { - Name: apiServerSecurePortName, - ContainerPort: apiServerSecurePort, - }, - { - Name: "local", - ContainerPort: 8080, - }, - }, - VolumeMounts: []v1.VolumeMount{ - { - Name: credSecretName, - MountPath: "/etc/federation/apiserver", - ReadOnly: true, - }, - }, - }, - { - Name: "etcd", - Image: etcdImage, - Command: []string{ - "/usr/local/bin/etcd", - "--data-dir", - "/var/etcd/data", - }, - }, - }, - NodeSelector: nodeSelector, - ImagePullSecrets: []v1.LocalObjectReference{ - { - Name: imagePullSecrets, - }, - }, - Volumes: []v1.Volume{ - { - Name: credSecretName, - VolumeSource: v1.VolumeSource{ - Secret: &v1.SecretVolumeSource{ - SecretName: credSecretName, - }, - }, - }, - }, - }, - }, - }, - } - if etcdPersistence == "true" { - dataVolumeName := "etcddata" - etcdVolume := v1.Volume{ - Name: dataVolumeName, - VolumeSource: v1.VolumeSource{ - PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{ - ClaimName: pvcName, - }, - }, - } - etcdVolumeMount := v1.VolumeMount{ - Name: dataVolumeName, - MountPath: "/var/etcd", - } - - apiserver.Spec.Template.Spec.Volumes = append(apiserver.Spec.Template.Spec.Volumes, etcdVolume) - for i, container := range apiserver.Spec.Template.Spec.Containers { - if container.Name == "etcd" { - apiserver.Spec.Template.Spec.Containers[i].VolumeMounts = append(apiserver.Spec.Template.Spec.Containers[i].VolumeMounts, etcdVolumeMount) - } - } - } - - cmCommand := []string{ - "/hyperkube", - "federation-controller-manager", - } - - cmArgs := []string{ - "--kubeconfig=/etc/federation/controller-manager/kubeconfig", - fmt.Sprintf("--federation-name=%s", federationName), - fmt.Sprintf("--zone-name=%s", dnsZoneName), - fmt.Sprintf("--master=https://%s", svcName), - } - - if cmOverrideArg != "" { - cmArgs = append(cmArgs, "--dns-provider=override") - cmArgs = append(cmArgs, "--log-dir=override") - } else { - cmArgs = append(cmArgs, fmt.Sprintf("--dns-provider=%s", dnsProvider)) - } - - sort.Strings(cmArgs) - cmCommand = append(cmCommand, cmArgs...) - - cmName := federationName + "-controller-manager" - cm := &v1beta1.Deployment{ - TypeMeta: metav1.TypeMeta{ - Kind: "Deployment", - APIVersion: testapi.Extensions.GroupVersion().String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: cmName, - Namespace: namespaceName, - Labels: componentLabel, - Annotations: map[string]string{ - util.FedDomainMapKey: fmt.Sprintf("%s=%s", federationName, strings.TrimRight(dnsZoneName, ".")), - federation.FederationNameAnnotation: federationName, - }, - }, - Spec: v1beta1.DeploymentSpec{ - Replicas: &replicas, - Selector: nil, - Template: v1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Name: cmName, - Labels: controllerManagerPodLabels, - Annotations: map[string]string{federation.FederationNameAnnotation: federationName}, - }, - Spec: v1.PodSpec{ - Containers: []v1.Container{ - { - Name: "controller-manager", - Image: serverImage, - ImagePullPolicy: v1.PullPolicy(imagePullPolicy), - Command: cmCommand, - VolumeMounts: []v1.VolumeMount{ - { - Name: cmKubeconfigSecretName, - MountPath: "/etc/federation/controller-manager", - ReadOnly: true, - }, - }, - Env: []v1.EnvVar{ - { - Name: "POD_NAMESPACE", - ValueFrom: &v1.EnvVarSource{ - FieldRef: &v1.ObjectFieldSelector{ - FieldPath: "metadata.namespace", - }, - }, - }, - }, - }, - }, - NodeSelector: nodeSelector, - ImagePullSecrets: []v1.LocalObjectReference{ - { - Name: imagePullSecrets, - }, - }, - Volumes: []v1.Volume{ - { - Name: cmKubeconfigSecretName, - VolumeSource: v1.VolumeSource{ - Secret: &v1.SecretVolumeSource{ - SecretName: cmKubeconfigSecretName, - }, - }, - }, - }, - }, - }, - }, - } - if isRBACAPIAvailable { - cm.Spec.Template.Spec.ServiceAccountName = "federation-controller-manager" - cm.Spec.Template.Spec.DeprecatedServiceAccount = "federation-controller-manager" - } - if dnsProviderConfig != "" { - cm = addDNSProviderConfigTest(cm, cmDNSProviderSecret.Name) - if dnsProvider == util.FedDNSProviderCoreDNS { - cm, err = addCoreDNSServerAnnotationTest(cm, dnsZoneName, dnsProviderConfig) - if err != nil { - return nil, err - } - } - } - - podList := v1.PodList{} - apiServerPod := v1.Pod{ - TypeMeta: metav1.TypeMeta{ - Kind: "Pod", - APIVersion: testapi.Extensions.GroupVersion().String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: svcName, - Namespace: namespaceName, - }, - Status: v1.PodStatus{ - Phase: "Running", - }, - } - - cmPod := v1.Pod{ - TypeMeta: metav1.TypeMeta{ - Kind: "Pod", - APIVersion: testapi.Extensions.GroupVersion().String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: cmName, - Namespace: namespaceName, - }, - Status: v1.PodStatus{ - Phase: "Running", - }, - } - - podList.Items = append(podList.Items, apiServerPod) - podList.Items = append(podList.Items, cmPod) - - apiGroupList := &metav1.APIGroupList{} - testGroup := metav1.APIGroup{ - Name: testAPIGroup, - Versions: []metav1.GroupVersionForDiscovery{ - { - GroupVersion: testAPIGroup + "/" + testAPIVersion, - Version: testAPIVersion, - }, - }, - } - rbacGroup := metav1.APIGroup{ - Name: rbac.GroupName, - Versions: []metav1.GroupVersionForDiscovery{ - { - GroupVersion: rbac.GroupName + "/v1", - Version: "v1", - }, - }, - } - - apiGroupList.Groups = append(apiGroupList.Groups, testGroup) - if isRBACAPIAvailable { - apiGroupList.Groups = append(apiGroupList.Groups, rbacGroup) - } - - f, tf, codec, _ := cmdtesting.NewAPIFactory() - extCodec := testapi.Extensions.Codec() - rbacCodec := testapi.Rbac.Codec() - ns := dynamic.ContentConfig().NegotiatedSerializer - tf.ClientConfig = kubefedtesting.DefaultClientConfig() - tf.TmpDir = tmpDirPath - tf.Client = &fake.RESTClient{ - GroupVersion: legacyscheme.Registry.GroupOrDie(api.GroupName).GroupVersion, - NegotiatedSerializer: ns, - Client: fake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) { - switch p, m := req.URL.Path, req.Method; { - case p == "/healthz": - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: ioutil.NopCloser(bytes.NewReader([]byte("ok")))}, nil - case p == "/api" && m == http.MethodGet: - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &metav1.APIVersions{})}, nil - case p == "/apis" && m == http.MethodGet: - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, apiGroupList)}, nil - case p == "/api/v1/namespaces" && m == http.MethodPost: - body, err := ioutil.ReadAll(req.Body) - if err != nil { - return nil, err - } - var got v1.Namespace - _, _, err = codec.Decode(body, nil, &got) - if err != nil { - return nil, err - } - if !apiequality.Semantic.DeepEqual(got, namespace) { - return nil, fmt.Errorf("unexpected namespace object\n\tDiff: %s", diff.ObjectGoPrintDiff(got, namespace)) - } - return &http.Response{StatusCode: http.StatusCreated, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &namespace)}, nil - case p == svcUrlPrefix && m == http.MethodPost: - body, err := ioutil.ReadAll(req.Body) - if err != nil { - return nil, err - } - var got v1.Service - _, _, err = codec.Decode(body, nil, &got) - if err != nil { - return nil, err - } - if !apiequality.Semantic.DeepEqual(got, svc) { - return nil, fmt.Errorf("unexpected service object\n\tDiff: %s", diff.ObjectGoPrintDiff(got, svc)) - } - if apiserverServiceType == v1.ServiceTypeNodePort { - svc.Spec.Type = v1.ServiceTypeNodePort - svc.Spec.Ports[0].NodePort = nodePort - } - return &http.Response{StatusCode: http.StatusCreated, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &svc)}, nil - case strings.HasPrefix(p, svcUrlPrefix) && m == http.MethodGet: - got := strings.TrimPrefix(p, svcUrlPrefix+"/") - if got != svcName { - return nil, errors.NewNotFound(api.Resource("services"), got) - } - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &svcWithLB)}, nil - case p == "/api/v1/namespaces/federation-system/secrets" && m == http.MethodPost: - body, err := ioutil.ReadAll(req.Body) - if err != nil { - return nil, err - } - var got, want v1.Secret - _, _, err = codec.Decode(body, nil, &got) - if err != nil { - return nil, err - } - - switch got.Name { - case credSecretName: - want = credSecret - if apiserverEnableHTTPBasicAuth { - if got.Data["basicauth.csv"] == nil { - return nil, fmt.Errorf("expected secret data key 'basicauth.csv', but got nil") - } - } else { - if got.Data["basicauth.csv"] != nil { - return nil, fmt.Errorf("unexpected secret data key 'basicauth.csv'") - } - } - if apiserverEnableTokenAuth { - if got.Data["token.csv"] == nil { - return nil, fmt.Errorf("expected secret data key 'token.csv', but got nil") - } - } else { - if got.Data["token.csv"] != nil { - return nil, fmt.Errorf("unexpected secret data key 'token.csv'") - } - } - case cmKubeconfigSecretName: - want = cmKubeconfigSecret - case dnsProviderSecretName: - want = cmDNSProviderSecret - } - got.Data = nil - if !apiequality.Semantic.DeepEqual(got, want) { - return nil, fmt.Errorf("unexpected secret object\n\tDiff: %s", diff.ObjectGoPrintDiff(got, want)) - } - return &http.Response{StatusCode: http.StatusCreated, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &want)}, nil - case p == "/api/v1/namespaces/federation-system/persistentvolumeclaims" && m == http.MethodPost: - body, err := ioutil.ReadAll(req.Body) - if err != nil { - return nil, err - } - var got v1.PersistentVolumeClaim - _, _, err = codec.Decode(body, nil, &got) - if err != nil { - return nil, err - } - if !apiequality.Semantic.DeepEqual(got, pvc) { - return nil, fmt.Errorf("unexpected PVC object\n\tDiff: %s", diff.ObjectGoPrintDiff(got, pvc)) - } - return &http.Response{StatusCode: http.StatusCreated, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &pvc)}, nil - case p == "/apis/extensions/v1beta1/namespaces/federation-system/deployments" && m == http.MethodPost: - body, err := ioutil.ReadAll(req.Body) - if err != nil { - return nil, err - } - var got, want v1beta1.Deployment - _, _, err = codec.Decode(body, nil, &got) - if err != nil { - return nil, err - } - switch got.Name { - case svcName: - want = *apiserver - case cmName: - want = *cm - } - //want = *cm - if !apiequality.Semantic.DeepEqual(got, want) { - return nil, fmt.Errorf("unexpected deployment object\n\tDiff: %s", diff.ObjectGoPrintDiff(got, want)) - } - return &http.Response{StatusCode: http.StatusCreated, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(extCodec, &want)}, nil - case p == "/api/v1/namespaces/federation-system/pods" && m == http.MethodGet: - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &podList)}, nil - case p == "/api/v1/namespaces/federation-system/serviceaccounts" && m == http.MethodPost: - body, err := ioutil.ReadAll(req.Body) - if err != nil { - return nil, err - } - var got v1.ServiceAccount - _, _, err = codec.Decode(body, nil, &got) - if err != nil { - return nil, err - } - if !helper.Semantic.DeepEqual(got, sa) { - return nil, fmt.Errorf("unexpected service account object\n\tDiff: %s", diff.ObjectGoPrintDiff(got, sa)) - } - return &http.Response{StatusCode: http.StatusCreated, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &sa)}, nil - case p == "/apis/rbac.authorization.k8s.io/v1/namespaces/federation-system/roles" && m == http.MethodPost: - body, err := ioutil.ReadAll(req.Body) - if err != nil { - return nil, err - } - var got rbacv1.Role - _, _, err = codec.Decode(body, nil, &got) - if err != nil { - return nil, err - } - if !helper.Semantic.DeepEqual(got, role) { - return nil, fmt.Errorf("unexpected role object\n\tDiff: %s", diff.ObjectGoPrintDiff(got, role)) - } - return &http.Response{StatusCode: http.StatusCreated, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(rbacCodec, &role)}, nil - case p == "/apis/rbac.authorization.k8s.io/v1/namespaces/federation-system/rolebindings" && m == http.MethodPost: - body, err := ioutil.ReadAll(req.Body) - if err != nil { - return nil, err - } - var got rbacv1.RoleBinding - _, _, err = codec.Decode(body, nil, &got) - if err != nil { - return nil, err - } - if !helper.Semantic.DeepEqual(got, rolebinding) { - return nil, fmt.Errorf("unexpected rolebinding object\n\tDiff: %s", diff.ObjectGoPrintDiff(got, rolebinding)) - } - return &http.Response{StatusCode: http.StatusCreated, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(rbacCodec, &rolebinding)}, nil - case p == "/api/v1/nodes" && m == http.MethodGet: - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &nodeList)}, nil - default: - return nil, fmt.Errorf("unexpected request: %#v\n%#v", req.URL, req) - } - }), - } - return f, nil -} - -func testKubeconfigUpdate(t *testing.T, apiserverServiceType v1.ServiceType, federationName, advertiseAddress, lbIP, kubeconfigGlobal, kubeconfigExplicit string, apiserverEnableHTTPBasicAuth, apiserverEnableTokenAuth bool) { - filename := kubeconfigGlobal - if kubeconfigExplicit != "" { - filename = kubeconfigExplicit - } - config, err := clientcmd.LoadFromFile(filename) - if err != nil { - t.Errorf("Failed to open kubeconfig file: %v", err) - return - } - - cluster, ok := config.Clusters[federationName] - if !ok { - t.Errorf("No cluster info for %q", federationName) - return - } - endpoint := getEndpoint(apiserverServiceType, lbIP, advertiseAddress) - if !strings.HasSuffix(endpoint, "https://") { - endpoint = fmt.Sprintf("https://%s", endpoint) - } - if cluster.Server != endpoint { - t.Errorf("Want federation API server endpoint %q, got %q", endpoint, cluster.Server) - } - - authInfo, ok := config.AuthInfos[federationName] - if !ok { - t.Errorf("No credentials for %q", federationName) - return - } - if len(authInfo.ClientCertificateData) == 0 { - t.Errorf("Expected client certificate to be non-empty") - return - } - if len(authInfo.ClientKeyData) == 0 { - t.Errorf("Expected client key to be non-empty") - return - } - if !apiserverEnableTokenAuth && len(authInfo.Token) != 0 { - t.Errorf("Expected token to be empty: got: %s", authInfo.Token) - } - if apiserverEnableTokenAuth && len(authInfo.Token) == 0 { - t.Errorf("Expected token to be non-empty") - } - - httpBasicAuthInfo, ok := config.AuthInfos[fmt.Sprintf("%s-basic-auth", federationName)] - if !apiserverEnableHTTPBasicAuth && ok { - t.Errorf("Expected basic auth AuthInfo entry not to exist: got %v", httpBasicAuthInfo) - return - } - - if apiserverEnableHTTPBasicAuth { - if !ok { - t.Errorf("Expected basic auth AuthInfo entry to exist") - return - } - if httpBasicAuthInfo.Username != "admin" { - t.Errorf("Unexpected username in basic auth AuthInfo entry: got %s, want admin", httpBasicAuthInfo.Username) - } - if len(httpBasicAuthInfo.Password) == 0 { - t.Errorf("Expected basic auth AuthInfo entry to contain password") - } - } - - context, ok := config.Contexts[federationName] - if !ok { - t.Errorf("No context for %q", federationName) - return - } - if context.Cluster != federationName { - t.Errorf("Want context cluster name: %q, got: %q", federationName, context.Cluster) - } - if context.AuthInfo != federationName { - t.Errorf("Want context auth info: %q, got: %q", federationName, context.AuthInfo) - } -} - -type clientServerTLSConfigs struct { - server *tls.Config - client *tls.Config -} - -type certParams struct { - cAddr string - ips []string - hostnames []string -} - -func tlsHandshake(t *testing.T, sCfg, cCfg *tls.Config) error { - // Tried to use net.Pipe() instead of TCP. But the connections returned by - // net.Pipe() do a fully-synchronous reads and writes on both the ends. - // So if a TLS handshake fails, they can't return the error until the - // other side reads the message which it did not expect. Since the other - // side does not read the message it did not expect, the server and - // clients hang. Since TCP is non-blocking we use that as transport - // instead. One could have as well used a Unix Domain Socket, but TCP is - // more portable. - s, err := tls.Listen("tcp", "", sCfg) - if err != nil { - return fmt.Errorf("failed to create a test TLS server: %v", err) - } - defer s.Close() - - errCh := make(chan error) - go func() { - for { - conn, err := s.Accept() - if err != nil { - errCh <- fmt.Errorf("failed to accept a TLS connection: %v", err) - return - } - gotByte := make([]byte, len(helloMsg)) - _, err = conn.Read(gotByte) - if err != nil && err != io.EOF { - errCh <- fmt.Errorf("failed to read input: %v", err) - } else if got := string(gotByte); got != helloMsg { - errCh <- fmt.Errorf("got %q, want %q", got, helloMsg) - } - errCh <- nil - return - } - }() - - // workaround [::] not working in ipv4 only systems (https://github.com/golang/go/issues/18806) - // TODO: remove with Golang 1.9 with https://go-review.googlesource.com/c/45088/ - addr := strings.TrimPrefix(s.Addr().String(), "[::]") - - c, err := tls.Dial("tcp", addr, cCfg) - if err != nil { - // Intentionally not serializing the error received because we want to - // test for the failure case in the caller test function. - return err - } - defer c.Close() - if _, err := c.Write([]byte(helloMsg)); err != nil { - return fmt.Errorf("failed to write to server: %v", err) - } - - return <-errCh -} - -func fakeHTTPSServer(sCfg *tls.Config) (*httptest.Server, error) { - s := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprint(w, helloMsg) - })) - - s.TLS.Certificates = sCfg.Certificates - s.TLS.RootCAs = sCfg.RootCAs - s.TLS.ClientAuth = sCfg.ClientAuth - s.TLS.ClientCAs = sCfg.ClientCAs - s.TLS.InsecureSkipVerify = sCfg.InsecureSkipVerify - return s, nil -} - -func tlsConfigs(params []certParams) ([]clientServerTLSConfigs, error) { - tlsCfgs := []clientServerTLSConfigs{} - for i, p := range params { - sCfg, cCfg, err := genServerClientTLSConfigs(testNamespace, p.cAddr, testSvcName, HostClusterLocalDNSZoneName, p.ips, p.hostnames) - if err != nil { - return nil, fmt.Errorf("[%d] failed to generate tls configs: %v", i, err) - } - tlsCfgs = append(tlsCfgs, clientServerTLSConfigs{sCfg, cCfg}) - } - return tlsCfgs, nil -} - -func genServerClientTLSConfigs(namespace, name, svcName, localDNSZoneName string, ips, hostnames []string) (*tls.Config, *tls.Config, error) { - entKeyPairs, err := genCerts(namespace, name, svcName, localDNSZoneName, ips, hostnames) - if err != nil { - return nil, nil, fmt.Errorf("unexpected error generating certs: %v", err) - } - - roots := x509.NewCertPool() - roots.AddCert(entKeyPairs.ca.Cert) - - serverCert := tls.Certificate{ - Certificate: [][]byte{ - entKeyPairs.server.Cert.Raw, - }, - PrivateKey: entKeyPairs.server.Key, - } - - cmCert := tls.Certificate{ - Certificate: [][]byte{ - entKeyPairs.controllerManager.Cert.Raw, - }, - PrivateKey: entKeyPairs.controllerManager.Key, - } - - sCfg := &tls.Config{ - Certificates: []tls.Certificate{serverCert}, - RootCAs: roots, - ClientAuth: tls.RequireAndVerifyClientCert, - ClientCAs: roots, - InsecureSkipVerify: false, - } - - cCfg := &tls.Config{ - Certificates: []tls.Certificate{cmCert}, - RootCAs: roots, - } - - return sCfg, cCfg, nil -} - -func copyTLSConfig(cfg *tls.Config) *tls.Config { - // We are copying only the required fields. - return &tls.Config{ - Certificates: cfg.Certificates, - RootCAs: cfg.RootCAs, - ClientAuth: cfg.ClientAuth, - ClientCAs: cfg.ClientCAs, - InsecureSkipVerify: cfg.InsecureSkipVerify, - } -} - -func getEndpoint(apiserverServiceType v1.ServiceType, lbIP, advertiseAddress string) string { - endpoint := lbIP - if apiserverServiceType == v1.ServiceTypeNodePort { - if advertiseAddress != "" { - endpoint = advertiseAddress + ":" + strconv.Itoa(nodePort) - } else { - endpoint = nodeIP + ":" + strconv.Itoa(nodePort) - } - } - return endpoint -} - -// TODO: Reuse the function addDNSProviderConfig once that function is converted to use versioned objects. -func addDNSProviderConfigTest(dep *v1beta1.Deployment, secretName string) *v1beta1.Deployment { - const ( - dnsProviderConfigVolume = "config-volume" - dnsProviderConfigMountPath = "/etc/federation/dns-provider" - ) - - // Create a volume from dns-provider secret - volume := v1.Volume{ - Name: dnsProviderConfigVolume, - VolumeSource: v1.VolumeSource{ - Secret: &v1.SecretVolumeSource{ - SecretName: secretName, - }, - }, - } - dep.Spec.Template.Spec.Volumes = append(dep.Spec.Template.Spec.Volumes, volume) - - // Mount dns-provider secret volume to controller-manager container - volumeMount := v1.VolumeMount{ - Name: dnsProviderConfigVolume, - MountPath: dnsProviderConfigMountPath, - ReadOnly: true, - } - dep.Spec.Template.Spec.Containers[0].VolumeMounts = append(dep.Spec.Template.Spec.Containers[0].VolumeMounts, volumeMount) - dep.Spec.Template.Spec.Containers[0].Command = append(dep.Spec.Template.Spec.Containers[0].Command, fmt.Sprintf("--dns-provider-config=%s/%s", dnsProviderConfigMountPath, secretName)) - - return dep -} - -// TODO: Reuse the function addCoreDNSServerAnnotation once that function is converted to use versioned objects. -func addCoreDNSServerAnnotationTest(deployment *v1beta1.Deployment, dnsZoneName, dnsProviderConfig string) (*v1beta1.Deployment, error) { - var cfg coredns.Config - if err := gcfg.ReadFileInto(&cfg, dnsProviderConfig); err != nil { - return nil, err - } - - deployment.Annotations[util.FedDNSZoneName] = dnsZoneName - deployment.Annotations[util.FedNameServer] = cfg.Global.CoreDNSEndpoints - deployment.Annotations[util.FedDNSProvider] = util.FedDNSProviderCoreDNS - return deployment, nil -} diff --git a/federation/pkg/kubefed/join.go b/federation/pkg/kubefed/join.go deleted file mode 100644 index 9c55ec3824..0000000000 --- a/federation/pkg/kubefed/join.go +++ /dev/null @@ -1,700 +0,0 @@ -/* -Copyright 2016 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 kubefed - -import ( - "fmt" - "io" - "strings" - "time" - - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apiserver/pkg/storage/names" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - "k8s.io/kubernetes/federation/apis/federation" - "k8s.io/kubernetes/federation/pkg/kubefed/util" - "k8s.io/kubernetes/pkg/api" - extensions "k8s.io/kubernetes/pkg/apis/extensions" - "k8s.io/kubernetes/pkg/apis/rbac" - "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" - "k8s.io/kubernetes/pkg/kubectl" - kubectlcmd "k8s.io/kubernetes/pkg/kubectl/cmd" - "k8s.io/kubernetes/pkg/kubectl/cmd/templates" - cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" - - "github.com/golang/glog" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - // defaultClusterCIDR is the default CIDR range accepted by the - // joining API server. See `apis/federation.ClusterSpec` for - // details. - // TODO(madhusudancs): Make this value customizable. - defaultClientCIDR = "0.0.0.0/0" - CMNameSuffix = "controller-manager" - serviceAccountSecretTimeout = 30 * time.Second -) - -var ( - join_long = templates.LongDesc(` - Join adds a cluster to a federation. - - Current context is assumed to be a federation API - server. Please use the --context flag otherwise.`) - join_example = templates.Examples(` - # Join a cluster to a federation by specifying the - # cluster name and the context name of the federation - # control plane's host cluster. Cluster name must be - # a valid RFC 1123 subdomain name. Cluster context - # must be specified if the cluster name is different - # than the cluster's context in the local kubeconfig. - kubefed join foo --host-cluster-context=bar`) -) - -type joinFederation struct { - commonOptions util.SubcommandOptions - options joinFederationOptions -} - -type joinFederationOptions struct { - clusterContext string - secretName string - dryRun bool -} - -func (o *joinFederationOptions) Bind(flags *pflag.FlagSet) { - flags.StringVar(&o.clusterContext, "cluster-context", "", "Name of the cluster's context in the local kubeconfig. Defaults to cluster name if unspecified.") - flags.StringVar(&o.secretName, "secret-name", "", "Name of the secret where the cluster's credentials will be stored in the host cluster. This name should be a valid RFC 1035 label. Defaults to cluster name if unspecified.") - flags.MarkDeprecated("secret-name", "kubefed now generates a secret name, and this flag will be removed in a future release.") -} - -// NewCmdJoin defines the `join` command that joins a cluster to a -// federation. -func NewCmdJoin(f cmdutil.Factory, cmdOut io.Writer, config util.AdminConfig) *cobra.Command { - opts := &joinFederation{} - - cmd := &cobra.Command{ - Use: "join CLUSTER_NAME --host-cluster-context=HOST_CONTEXT", - Short: "Join a cluster to a federation", - Long: join_long, - Example: join_example, - Run: func(cmd *cobra.Command, args []string) { - cmdutil.CheckErr(opts.Complete(cmd, args, config)) - cmdutil.CheckErr(opts.Run(f, cmdOut, config, cmd)) - }, - } - - cmdutil.AddApplyAnnotationFlags(cmd) - cmdutil.AddValidateFlags(cmd) - cmdutil.AddPrinterFlags(cmd) - cmdutil.AddGeneratorFlags(cmd, cmdutil.ClusterV1Beta1GeneratorName) - - flags := cmd.Flags() - opts.commonOptions.Bind(flags) - opts.options.Bind(flags) - - return cmd -} - -// Complete ensures that options are valid and marshals them if necessary. -func (j *joinFederation) Complete(cmd *cobra.Command, args []string, config util.AdminConfig) error { - err := j.commonOptions.SetName(cmd, args) - if err != nil { - return err - } - - j.options.dryRun = cmdutil.GetDryRunFlag(cmd) - - if j.options.clusterContext == "" { - j.options.clusterContext = j.commonOptions.Name - } - - glog.V(2).Infof("Args and flags: name %s, host: %s, host-system-namespace: %s, kubeconfig: %s, cluster-context: %s, secret-name: %s, dry-run: %s", j.commonOptions.Name, j.commonOptions.Host, j.commonOptions.FederationSystemNamespace, j.commonOptions.Kubeconfig, j.options.clusterContext, j.options.secretName, j.options.dryRun) - - glog.V(2).Infof("Performing preflight checks.") - err = j.performPreflightChecks(config) - if err != nil { - return err - } - return nil -} - -// performPreflightChecks checks that the host and joining clusters are in -// a consistent state. -// TODO: This currently only verifies a few things. Add more checks. -func (j *joinFederation) performPreflightChecks(config util.AdminConfig) error { - joiningClusterFactory := j.joningClusterFactory(config) - - // If RBAC is not available, then skip checking for a service account. - // If RBAC availability cannot be determined, return an error. - rbacVersionedClientset, err := util.GetVersionedClientForRBACOrFail(joiningClusterFactory) - if err != nil { - if _, ok := err.(*util.NoRBACAPIError); ok { - return nil - } - return err - } - - // Make sure there is no existing service account in the joining cluster. - saName := util.ClusterServiceAccountName(j.commonOptions.Name, j.commonOptions.Host) - sa, err := rbacVersionedClientset.Core().ServiceAccounts(j.commonOptions.FederationSystemNamespace).Get(saName, metav1.GetOptions{}) - if errors.IsNotFound(err) { - return nil - } else if err != nil { - return err - } else if sa != nil { - return fmt.Errorf("service account already exists in joining cluster") - } - - return nil -} - -// joiningClusterClientset returns a factory for the joining cluster. -func (j *joinFederation) joningClusterFactory(config util.AdminConfig) cmdutil.Factory { - return config.ClusterFactory(j.options.clusterContext, j.commonOptions.Kubeconfig) -} - -// Run is the implementation of the `join federation` command. -func (j *joinFederation) Run(f cmdutil.Factory, cmdOut io.Writer, config util.AdminConfig, cmd *cobra.Command) error { - clusterContext := j.options.clusterContext - dryRun := j.options.dryRun - federationNamespace := j.commonOptions.FederationSystemNamespace - host := j.commonOptions.Host - kubeconfig := j.commonOptions.Kubeconfig - joiningClusterName := j.commonOptions.Name - secretName := j.options.secretName - if secretName == "" { - secretName = names.SimpleNameGenerator.GenerateName(j.commonOptions.Name + "-") - } - - joiningClusterFactory := j.joningClusterFactory(config) - joiningClusterClientset, err := joiningClusterFactory.ClientSet() - if err != nil { - glog.V(2).Infof("Could not create client for joining cluster: %v", err) - return err - } - - hostFactory := config.ClusterFactory(host, kubeconfig) - hostClientset, err := hostFactory.ClientSet() - if err != nil { - glog.V(2).Infof("Could not create client for host cluster: %v", err) - return err - } - - federationName, err := getFederationName(hostClientset, federationNamespace) - if err != nil { - glog.V(2).Infof("Failed to get the federation name: %v", err) - return err - } - - glog.V(2).Info("Creating federation system namespace in joining cluster") - _, err = createFederationSystemNamespace(joiningClusterClientset, federationNamespace, federationName, joiningClusterName, dryRun) - if err != nil { - glog.V(2).Infof("Error creating federation system namespace in joining cluster: %v", err) - return err - } - glog.V(2).Info("Created federation system namespace in joining cluster") - - po := config.PathOptions() - po.LoadingRules.ExplicitPath = kubeconfig - clientConfig, err := po.GetStartingConfig() - if err != nil { - glog.V(2).Infof("Could not load clientConfig from %s: %v", kubeconfig, err) - return err - } - - serviceAccountName := "" - clusterRoleName := "" - // Check for RBAC in the joining cluster. If it supports RBAC, then create - // a service account and use its credentials; otherwise, use the credentials - // from the local kubeconfig. - glog.V(2).Info("Creating cluster credentials secret") - rbacClientset, err := util.GetVersionedClientForRBACOrFail(joiningClusterFactory) - if err == nil { - if _, serviceAccountName, clusterRoleName, err = createRBACSecret(hostClientset, rbacClientset, federationNamespace, federationName, joiningClusterName, host, clusterContext, secretName, dryRun); err != nil { - glog.V(2).Infof("Could not create cluster credentials secret: %v", err) - return err - } - } else { - if _, ok := err.(*util.NoRBACAPIError); ok { - - // We are not using the `kubectl create secret` machinery through - // `RunCreateSubcommand` as we do to the cluster resource below - // because we have a bunch of requirements that the machinery does - // not satisfy. - // 1. We want to create the secret in a specific namespace, which - // is neither the "default" namespace nor the one specified - // via the `--namespace` flag. - // 2. `SecretGeneratorV1` requires LiteralSources in a string-ified - // form that it parses to generate the secret data key-value - // pairs. We, however, have the key-value pairs ready without a - // need for parsing. - // 3. The result printing mechanism needs to be mostly quiet. We - // don't have to print the created secret in the default case. - // Having said that, secret generation machinery could be altered to - // suit our needs, but it is far less invasive and readable this way. - _, err = createSecret(hostClientset, clientConfig, federationNamespace, federationName, joiningClusterName, clusterContext, secretName, dryRun) - if err != nil { - glog.V(2).Infof("Failed creating the cluster credentials secret: %v", err) - return err - } - } else { - glog.V(2).Infof("Failed to get or verify absence of RBAC client: %v", err) - return err - } - } - glog.V(2).Info("Cluster credentials secret created") - - glog.V(2).Info("Creating a generator for the cluster API object") - generator, err := clusterGenerator(clientConfig, joiningClusterName, clusterContext, secretName, serviceAccountName, clusterRoleName) - if err != nil { - glog.V(2).Infof("Failed to create a generator for the cluster API object: %v", err) - return err - } - glog.V(2).Info("Created a generator for the cluster API object") - - glog.V(2).Info("Running create cluster command against the federation API server") - err = kubectlcmd.RunCreateSubcommand(f, cmd, cmdOut, &kubectlcmd.CreateSubcommandOptions{ - Name: joiningClusterName, - StructuredGenerator: generator, - DryRun: dryRun, - OutputFormat: cmdutil.GetFlagString(cmd, "output"), - }) - if err != nil { - glog.V(2).Infof("Failed running create cluster command against the federation API server: %v", err) - return err - } - glog.V(2).Info("Successfully ran create cluster command against the federation API server") - - // We further need to create a configmap named kube-config in the - // just registered cluster which will be consumed by the kube-dns - // of this cluster. - glog.V(2).Info("Creating configmap in host cluster") - _, err = createConfigMap(hostClientset, config, federationNamespace, federationName, joiningClusterName, clusterContext, kubeconfig, dryRun) - if err != nil { - glog.V(2).Infof("Failed to create configmap in cluster: %v", err) - return err - } - glog.V(2).Info("Created configmap in host cluster") - - return err -} - -// minifyConfig is a wrapper around `clientcmdapi.MinifyConfig()` that -// sets the current context to the given context before calling -// `clientcmdapi.MinifyConfig()`. -func minifyConfig(clientConfig *clientcmdapi.Config, context string) (*clientcmdapi.Config, error) { - // MinifyConfig inline-modifies the passed clientConfig. So we make a - // copy of it before passing the config to it. A shallow copy is - // sufficient because the underlying fields will be reconstructed by - // MinifyConfig anyway. - newClientConfig := *clientConfig - newClientConfig.CurrentContext = context - err := clientcmdapi.MinifyConfig(&newClientConfig) - if err != nil { - return nil, err - } - return &newClientConfig, nil -} - -// createSecret extracts the kubeconfig for a given cluster and populates -// a secret with that kubeconfig. -func createSecret(clientset internalclientset.Interface, clientConfig *clientcmdapi.Config, namespace, federationName, joiningClusterName, contextName, secretName string, dryRun bool) (runtime.Object, error) { - // Minify the kubeconfig to ensure that there is only information - // relevant to the cluster we are registering. - newClientConfig, err := minifyConfig(clientConfig, contextName) - if err != nil { - glog.V(2).Infof("Failed to minify the kubeconfig for the given context %q: %v", contextName, err) - return nil, err - } - - // Flatten the kubeconfig to ensure that all the referenced file - // contents are inlined. - err = clientcmdapi.FlattenConfig(newClientConfig) - if err != nil { - glog.V(2).Infof("Failed to flatten the kubeconfig for the given context %q: %v", contextName, err) - return nil, err - } - - return util.CreateKubeconfigSecret(clientset, newClientConfig, namespace, secretName, federationName, joiningClusterName, dryRun) -} - -// createConfigMap creates a configmap with name kube-dns in the joining cluster -// which stores the information about this federation zone name. -// If the configmap with this name already exists, its updated with this information. -func createConfigMap(hostClientSet internalclientset.Interface, config util.AdminConfig, fedSystemNamespace, federationName, joiningClusterName, targetClusterContext, kubeconfigPath string, dryRun bool) (*api.ConfigMap, error) { - cmDep, err := getCMDeployment(hostClientSet, fedSystemNamespace) - if err != nil { - return nil, err - } - domainMap, ok := cmDep.Annotations[util.FedDomainMapKey] - if !ok { - return nil, fmt.Errorf("kube-dns config map data missing from controller manager annotations") - } - - targetFactory := config.ClusterFactory(targetClusterContext, kubeconfigPath) - targetClientSet, err := targetFactory.ClientSet() - if err != nil { - return nil, err - } - - existingConfigMap, err := targetClientSet.Core().ConfigMaps(metav1.NamespaceSystem).Get(util.KubeDnsConfigmapName, metav1.GetOptions{}) - if isNotFound(err) { - newConfigMap := &api.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: util.KubeDnsConfigmapName, - Namespace: metav1.NamespaceSystem, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - federation.ClusterNameAnnotation: joiningClusterName, - }, - }, - Data: map[string]string{ - util.FedDomainMapKey: domainMap, - }, - } - newConfigMap = populateStubDomainsIfRequired(newConfigMap, cmDep.Annotations) - - if dryRun { - return newConfigMap, nil - } - return targetClientSet.Core().ConfigMaps(metav1.NamespaceSystem).Create(newConfigMap) - } - if err != nil { - return nil, err - } - - if existingConfigMap.Data == nil { - existingConfigMap.Data = make(map[string]string) - } - if _, ok := existingConfigMap.Data[util.FedDomainMapKey]; ok { - // Append this federation info - existingConfigMap.Data[util.FedDomainMapKey] = appendConfigMapString(existingConfigMap.Data[util.FedDomainMapKey], cmDep.Annotations[util.FedDomainMapKey]) - - } else { - // For some reason the configMap exists but this data is empty - existingConfigMap.Data[util.FedDomainMapKey] = cmDep.Annotations[util.FedDomainMapKey] - } - - if dryRun { - return existingConfigMap, nil - } - return targetClientSet.Core().ConfigMaps(metav1.NamespaceSystem).Update(existingConfigMap) -} - -// clusterGenerator extracts the cluster information from the supplied -// kubeconfig and builds a StructuredGenerator for the -// `federation/cluster` API resource. -func clusterGenerator(clientConfig *clientcmdapi.Config, name, contextName, secretName, serviceAccountName, clusterRoleName string) (kubectl.StructuredGenerator, error) { - // Get the context from the config. - ctx, found := clientConfig.Contexts[contextName] - if !found { - return nil, fmt.Errorf("cluster context %q not found", contextName) - } - - // Get the cluster object corresponding to the supplied context. - cluster, found := clientConfig.Clusters[ctx.Cluster] - if !found { - return nil, fmt.Errorf("cluster endpoint not found for %q", name) - } - - // Extract the scheme portion of the cluster APIServer endpoint and - // default it to `https` if it isn't specified. - scheme := extractScheme(cluster.Server) - serverAddress := cluster.Server - if scheme == "" { - // Use "https" as the default scheme. - scheme := "https" - serverAddress = strings.Join([]string{scheme, serverAddress}, "://") - } - - generator := &ClusterGeneratorV1Beta1{ - Name: name, - ClientCIDR: defaultClientCIDR, - ServerAddress: serverAddress, - SecretName: secretName, - ServiceAccountName: serviceAccountName, - ClusterRoleName: clusterRoleName, - } - return generator, nil -} - -// extractScheme parses the given URL to extract the scheme portion -// out of it. -func extractScheme(url string) string { - scheme := "" - segs := strings.SplitN(url, "://", 2) - if len(segs) == 2 { - scheme = segs[0] - } - return scheme -} - -func getCMDeployment(hostClientSet internalclientset.Interface, fedNamespace string) (*extensions.Deployment, error) { - depList, err := hostClientSet.Extensions().Deployments(fedNamespace).List(metav1.ListOptions{}) - if err != nil { - return nil, err - } - - for _, dep := range depList.Items { - if strings.HasSuffix(dep.Name, CMNameSuffix) { - return &dep, nil - } - } - return nil, fmt.Errorf("could not find the deployment for controller manager in host cluster") -} - -func appendConfigMapString(existing string, toAppend string) string { - if existing == "" { - return toAppend - } - - values := strings.Split(existing, ",") - for _, v := range values { - // Somehow this federation string is already present, - // Nothing should be done - if v == toAppend { - return existing - } - } - return fmt.Sprintf("%s,%s", existing, toAppend) -} - -// getFederationName gets the federation name from the appropriate annotation on the -// control manager deployment. -func getFederationName(hostClientSet internalclientset.Interface, fedNamespace string) (string, error) { - d, err := getCMDeployment(hostClientSet, fedNamespace) - if err != nil { - return "", err - } - - name, ok := d.Annotations[federation.FederationNameAnnotation] - if !ok { - return "", fmt.Errorf("Federation control manager does not have federation name annotation. Please recreate the federation with a newer version of kubefed, or use an older version of kubefed to join this cluster.") - } - - return name, nil -} - -func populateStubDomainsIfRequired(configMap *api.ConfigMap, annotations map[string]string) *api.ConfigMap { - dnsProvider := annotations[util.FedDNSProvider] - dnsZoneName := annotations[util.FedDNSZoneName] - nameServer := annotations[util.FedNameServer] - - if dnsProvider != util.FedDNSProviderCoreDNS || dnsZoneName == "" || nameServer == "" { - return configMap - } - configMap.Data[util.KubeDnsStubDomains] = fmt.Sprintf(`{"%s":["%s"]}`, dnsZoneName, nameServer) - return configMap -} - -// createFederationSystemNamespace creates the federation-system namespace in the cluster -// associated with clusterClientset, if it doesn't already exist. -func createFederationSystemNamespace(clusterClientset internalclientset.Interface, federationNamespace, federationName, joiningClusterName string, dryRun bool) (*api.Namespace, error) { - federationNS := &api.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - Name: federationNamespace, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - federation.ClusterNameAnnotation: joiningClusterName, - }, - }, - } - - if dryRun { - return federationNS, nil - } - - _, err := clusterClientset.Core().Namespaces().Create(federationNS) - if err != nil && !errors.IsAlreadyExists(err) { - glog.V(2).Infof("Could not create federation-system namespace in client: %v", err) - return nil, err - } - return federationNS, nil -} - -// createRBACSecret creates a secret in the joining cluster using a service account, and -// populates that secret into the host cluster to allow it to access the joining cluster. -func createRBACSecret(hostClusterClientset, joiningClusterClientset internalclientset.Interface, namespace, federationName, joiningClusterName, hostClusterContext, joiningClusterContext, secretName string, dryRun bool) (*api.Secret, string, string, error) { - glog.V(2).Info("Creating service account in joining cluster") - saName, err := createServiceAccount(joiningClusterClientset, namespace, federationName, joiningClusterName, hostClusterContext, dryRun) - if err != nil { - glog.V(2).Infof("Error creating service account in joining cluster: %v", err) - return nil, "", "", err - } - glog.V(2).Infof("Created service account in joining cluster") - - glog.V(2).Info("Creating role binding for service account in joining cluster") - crb, err := createClusterRoleBinding(joiningClusterClientset, saName, namespace, federationName, joiningClusterName, dryRun) - if err != nil { - glog.V(2).Infof("Error creating role binding for service account in joining cluster: %v", err) - return nil, "", "", err - } - glog.V(2).Info("Created role binding for service account in joining cluster") - - glog.V(2).Info("Creating secret in host cluster") - secret, err := populateSecretInHostCluster(joiningClusterClientset, hostClusterClientset, saName, namespace, federationName, joiningClusterName, secretName, dryRun) - if err != nil { - glog.V(2).Infof("Error creating secret in host cluster: %v", err) - return nil, "", "", err - } - glog.V(2).Info("Created secret in host cluster") - return secret, saName, crb.Name, nil -} - -// createServiceAccount creates a service account in the cluster associated with clusterClientset with -// credentials that will be used by the host cluster to access its API server. -func createServiceAccount(clusterClientset internalclientset.Interface, namespace, federationName, joiningClusterName, hostContext string, dryRun bool) (string, error) { - saName := util.ClusterServiceAccountName(joiningClusterName, hostContext) - sa := &api.ServiceAccount{ - ObjectMeta: metav1.ObjectMeta{ - Name: saName, - Namespace: namespace, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - federation.ClusterNameAnnotation: joiningClusterName, - }, - }, - } - - if dryRun { - return saName, nil - } - - // Create a new service account. - _, err := clusterClientset.Core().ServiceAccounts(namespace).Create(sa) - if err != nil { - return "", err - } - - return saName, nil -} - -// createClusterRoleBinding creates an RBAC role and binding that allows the -// service account identified by saName to access all resources in all namespaces -// in the cluster associated with clusterClientset. -func createClusterRoleBinding(clusterClientset internalclientset.Interface, saName, namespace, federationName, joiningClusterName string, dryRun bool) (*rbac.ClusterRoleBinding, error) { - roleName := util.ClusterRoleName(federationName, saName) - role := &rbac.ClusterRole{ - ObjectMeta: metav1.ObjectMeta{ - Name: roleName, - Namespace: namespace, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - federation.ClusterNameAnnotation: joiningClusterName, - }, - }, - Rules: []rbac.PolicyRule{ - rbac.NewRule(rbac.VerbAll).Groups(rbac.APIGroupAll).Resources(rbac.ResourceAll).RuleOrDie(), - rbac.NewRule("get").URLs("/healthz").RuleOrDie(), - }, - } - - // TODO: This should limit its access to only necessary resources. - rolebinding, err := rbac.NewClusterBinding(roleName).SAs(namespace, saName).Binding() - rolebinding.ObjectMeta.Namespace = namespace - rolebinding.ObjectMeta.Annotations = map[string]string{ - federation.FederationNameAnnotation: federationName, - federation.ClusterNameAnnotation: joiningClusterName, - } - if err != nil { - glog.V(2).Infof("Could not create role binding for service account: %v", err) - return nil, err - } - - if dryRun { - return &rolebinding, nil - } - - _, err = clusterClientset.Rbac().ClusterRoles().Create(role) - if err != nil { - glog.V(2).Infof("Could not create role for service account in joining cluster: %v", err) - return nil, err - } - - _, err = clusterClientset.Rbac().ClusterRoleBindings().Create(&rolebinding) - if err != nil { - glog.V(2).Infof("Could not create role binding for service account in joining cluster: %v", err) - return nil, err - } - - return &rolebinding, nil -} - -// populateSecretInHostCluster copies the service account secret for saName from the cluster -// referenced by clusterClientset to the client referenced by hostClientset, putting it in a secret -// named secretName in the provided namespace. -func populateSecretInHostCluster(clusterClientset, hostClientset internalclientset.Interface, saName, namespace, federationName, joiningClusterName, secretName string, dryRun bool) (*api.Secret, error) { - if dryRun { - // The secret is created indirectly with the service account, and so there is no local copy to return in a dry run. - return nil, nil - } - // Get the secret from the joining cluster. - var sa *api.ServiceAccount - err := wait.PollImmediate(1*time.Second, serviceAccountSecretTimeout, func() (bool, error) { - var err error - sa, err = clusterClientset.Core().ServiceAccounts(namespace).Get(saName, metav1.GetOptions{}) - if err != nil { - return false, nil - } - return len(sa.Secrets) == 1, nil - }) - if err != nil { - return nil, err - } - - glog.V(2).Infof("Getting secret named: %s", sa.Secrets[0].Name) - var secret *api.Secret - err = wait.PollImmediate(1*time.Second, serviceAccountSecretTimeout, func() (bool, error) { - var err error - secret, err = clusterClientset.Core().Secrets(namespace).Get(sa.Secrets[0].Name, metav1.GetOptions{}) - if err != nil { - return false, nil - } - return true, nil - }) - if err != nil { - glog.V(2).Infof("Could not get service account secret from joining cluster: %v", err) - return nil, err - } - - // Create a parallel secret in the host cluster. - v1Secret := api.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: secretName, - Namespace: namespace, - Annotations: map[string]string{ - federation.FederationNameAnnotation: federationName, - federation.ClusterNameAnnotation: joiningClusterName, - }, - }, - Data: secret.Data, - } - - glog.V(2).Infof("Creating secret in host cluster named: %s", v1Secret.Name) - _, err = hostClientset.Core().Secrets(namespace).Create(&v1Secret) - if err != nil { - glog.V(2).Infof("Could not create secret in host cluster: %v", err) - return nil, err - } - return &v1Secret, nil -} diff --git a/federation/pkg/kubefed/join_test.go b/federation/pkg/kubefed/join_test.go deleted file mode 100644 index e55312e399..0000000000 --- a/federation/pkg/kubefed/join_test.go +++ /dev/null @@ -1,616 +0,0 @@ -/* -Copyright 2016 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 kubefed - -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "os" - "testing" - - "k8s.io/api/core/v1" - "k8s.io/api/extensions/v1beta1" - rbacv1 "k8s.io/api/rbac/v1" - apiequality "k8s.io/apimachinery/pkg/api/equality" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/diff" - "k8s.io/client-go/dynamic" - "k8s.io/client-go/rest/fake" - "k8s.io/client-go/tools/clientcmd" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - "k8s.io/kubernetes/federation/apis/federation" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - kubefedtesting "k8s.io/kubernetes/federation/pkg/kubefed/testing" - "k8s.io/kubernetes/federation/pkg/kubefed/util" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/api/testapi" - k8srbacv1 "k8s.io/kubernetes/pkg/apis/rbac/v1" - cmdtesting "k8s.io/kubernetes/pkg/kubectl/cmd/testing" - cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" -) - -const ( - // testFederationName is a name to use for the federation in tests. Since the federation - // name is recovered from the federation itself, this constant is an appropriate - // functional replica. - testFederationName = "test-federation" - - zoneName = "test-dns-zone" - coreDNSServer = "11.22.33.44:53" -) - -func TestJoinFederation(t *testing.T) { - cmdErrMsg := "" - cmdutil.BehaviorOnFatal(func(str string, code int) { - cmdErrMsg = str - }) - - fakeKubeFiles, err := kubefedtesting.FakeKubeconfigFiles() - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - defer kubefedtesting.RemoveFakeKubeconfigFiles(fakeKubeFiles) - - testCases := []struct { - cluster string - clusterCtx string - secret string - server string - token string - kubeconfigGlobal string - kubeconfigExplicit string - expectedServer string - expectedErr string - dnsProvider string - isRBACAPIAvailable bool - }{ - { - cluster: "syndicate", - clusterCtx: "", - server: "https://10.20.30.40", - token: "badge", - kubeconfigGlobal: fakeKubeFiles[0], - kubeconfigExplicit: "", - expectedServer: "https://10.20.30.40", - expectedErr: "", - dnsProvider: util.FedDNSProviderCoreDNS, - isRBACAPIAvailable: true, - }, - { - cluster: "syndicate", - clusterCtx: "", - secret: "", - server: "https://10.20.30.40", - token: "badge", - kubeconfigGlobal: fakeKubeFiles[0], - kubeconfigExplicit: "", - expectedServer: "https://10.20.30.40", - expectedErr: "", - isRBACAPIAvailable: false, - }, - { - cluster: "ally", - clusterCtx: "", - server: "ally256.example.com:80", - token: "souvenir", - kubeconfigGlobal: fakeKubeFiles[0], - kubeconfigExplicit: fakeKubeFiles[1], - expectedServer: "https://ally256.example.com:80", - expectedErr: "", - isRBACAPIAvailable: true, - }, - { - cluster: "confederate", - clusterCtx: "", - server: "10.8.8.8", - token: "totem", - kubeconfigGlobal: fakeKubeFiles[1], - kubeconfigExplicit: fakeKubeFiles[2], - expectedServer: "https://10.8.8.8", - expectedErr: "", - isRBACAPIAvailable: true, - }, - { - cluster: "associate", - clusterCtx: "confederate", - server: "10.8.8.8", - token: "totem", - kubeconfigGlobal: fakeKubeFiles[1], - kubeconfigExplicit: fakeKubeFiles[2], - expectedServer: "https://10.8.8.8", - expectedErr: "", - isRBACAPIAvailable: true, - }, - { - cluster: "affiliate", - clusterCtx: "", - server: "https://10.20.30.40", - token: "badge", - kubeconfigGlobal: fakeKubeFiles[0], - kubeconfigExplicit: "", - expectedServer: "https://10.20.30.40", - expectedErr: fmt.Sprintf("error: cluster context %q not found", "affiliate"), - isRBACAPIAvailable: true, - }, - { - cluster: "associate", - clusterCtx: "confederate", - secret: "confidential", - server: "10.8.8.8", - token: "totem", - kubeconfigGlobal: fakeKubeFiles[1], - kubeconfigExplicit: fakeKubeFiles[2], - expectedServer: "https://10.8.8.8", - expectedErr: "", - }, - } - - for i, tc := range testCases { - cmdErrMsg = "" - f := testJoinFederationFactory(tc.cluster, tc.secret, tc.expectedServer, tc.isRBACAPIAvailable) - buf := bytes.NewBuffer([]byte{}) - - hostFactory, err := fakeJoinHostFactory(tc.cluster, tc.clusterCtx, tc.secret, tc.server, tc.token, tc.dnsProvider, tc.isRBACAPIAvailable) - if err != nil { - t.Fatalf("[%d] unexpected error: %v", i, err) - } - - // The fake discovery client caches results by default, so invalidate it by modifying the temporary directory. - // Refer to pkg/kubectl/cmd/testing/fake (fakeAPIFactory.DiscoveryClient()) for details of tmpDir - tmpDirPath, err := ioutil.TempDir("", "") - if err != nil { - t.Fatalf("[%d] unexpected error: %v", i, err) - } - defer os.Remove(tmpDirPath) - - targetClusterFactory, err := fakeJoinTargetClusterFactory(tc.cluster, tc.clusterCtx, tc.dnsProvider, tmpDirPath, tc.isRBACAPIAvailable) - if err != nil { - t.Fatalf("[%d] unexpected error: %v", i, err) - } - - targetClusterContext := tc.clusterCtx - if targetClusterContext == "" { - targetClusterContext = tc.cluster - } - adminConfig, err := kubefedtesting.NewFakeAdminConfig(hostFactory, targetClusterFactory, targetClusterContext, tc.kubeconfigGlobal) - if err != nil { - t.Fatalf("[%d] unexpected error: %v", i, err) - } - - cmd := NewCmdJoin(f, buf, adminConfig) - - cmd.Flags().Set("kubeconfig", tc.kubeconfigExplicit) - cmd.Flags().Set("host-cluster-context", "substrate") - if tc.clusterCtx != "" { - cmd.Flags().Set("cluster-context", tc.clusterCtx) - } - if tc.secret != "" { - cmd.Flags().Set("secret-name", tc.secret) - } - - cmd.Run(cmd, []string{tc.cluster}) - - if tc.expectedErr == "" { - // uses the name from the cluster, not the response - // Actual data passed are tested in the fake secret and cluster - // REST clients. - if msg := buf.String(); msg != fmt.Sprintf("cluster %q created\n", tc.cluster) { - t.Errorf("[%d] unexpected output: %s", i, msg) - if cmdErrMsg != "" { - t.Errorf("[%d] unexpected error message: %s", i, cmdErrMsg) - } - } - } else { - if cmdErrMsg != tc.expectedErr { - t.Errorf("[%d] expected error: %s, got: %s, output: %s", i, tc.expectedErr, cmdErrMsg, buf.String()) - } - } - } -} - -func testJoinFederationFactory(clusterName, secretName, server string, isRBACAPIAvailable bool) cmdutil.Factory { - - want := fakeCluster(clusterName, secretName, server, isRBACAPIAvailable) - f, tf, _, _ := cmdtesting.NewAPIFactory() - codec := testapi.Federation.Codec() - ns := dynamic.ContentConfig().NegotiatedSerializer - tf.Client = &fake.RESTClient{ - GroupVersion: legacyscheme.Registry.GroupOrDie(v1.GroupName).GroupVersion, - NegotiatedSerializer: ns, - Client: fake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) { - switch p, m := req.URL.Path, req.Method; { - case p == "/clusters" && m == http.MethodPost: - body, err := ioutil.ReadAll(req.Body) - if err != nil { - return nil, err - } - var got federationapi.Cluster - _, _, err = codec.Decode(body, nil, &got) - if err != nil { - return nil, err - } - // If the secret name was generated, test it separately. - if secretName == "" { - if got.Spec.SecretRef.Name == "" { - return nil, fmt.Errorf("expected a generated secret name, got \"\"") - } - got.Spec.SecretRef.Name = "" - } - if !apiequality.Semantic.DeepEqual(got, want) { - return nil, fmt.Errorf("Unexpected cluster object\n\tDiff: %s", diff.ObjectGoPrintDiff(got, want)) - } - return &http.Response{StatusCode: http.StatusCreated, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &want)}, nil - default: - return nil, fmt.Errorf("unexpected request: %#v\n%#v", req.URL, req) - } - }), - } - tf.Namespace = "test" - return f -} - -func fakeJoinHostFactory(clusterName, clusterCtx, secretName, server, token, dnsProvider string, isRBACAPIAvailable bool) (cmdutil.Factory, error) { - if clusterCtx == "" { - clusterCtx = clusterName - } - - placeholderSecretName := secretName - if placeholderSecretName == "" { - placeholderSecretName = "secretName" - } - var secretObject v1.Secret - if isRBACAPIAvailable { - secretObject = v1.Secret{ - TypeMeta: metav1.TypeMeta{ - Kind: "Secret", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: placeholderSecretName, - Namespace: util.DefaultFederationSystemNamespace, - Annotations: map[string]string{ - federation.FederationNameAnnotation: testFederationName, - federation.ClusterNameAnnotation: clusterName, - }, - }, - Data: map[string][]byte{ - "ca.crt": []byte("cert"), - "token": []byte("token"), - }, - } - } else { - kubeconfig := clientcmdapi.Config{ - Clusters: map[string]*clientcmdapi.Cluster{ - clusterCtx: { - Server: server, - }, - }, - AuthInfos: map[string]*clientcmdapi.AuthInfo{ - clusterCtx: { - Token: token, - }, - }, - Contexts: map[string]*clientcmdapi.Context{ - clusterCtx: { - Cluster: clusterCtx, - AuthInfo: clusterCtx, - }, - }, - CurrentContext: clusterCtx, - } - configBytes, err := clientcmd.Write(kubeconfig) - if err != nil { - return nil, err - } - - secretObject = v1.Secret{ - TypeMeta: metav1.TypeMeta{ - Kind: "Secret", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: placeholderSecretName, - Namespace: util.DefaultFederationSystemNamespace, - Annotations: map[string]string{ - federation.FederationNameAnnotation: testFederationName, - federation.ClusterNameAnnotation: clusterName, - }, - }, - Data: map[string][]byte{ - "kubeconfig": configBytes, - }, - } - } - - cmName := "controller-manager" - deployment := v1beta1.Deployment{ - TypeMeta: metav1.TypeMeta{ - Kind: "Deployment", - APIVersion: testapi.Extensions.GroupVersion().String(), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: cmName, - Namespace: util.DefaultFederationSystemNamespace, - Annotations: map[string]string{ - util.FedDomainMapKey: fmt.Sprintf("%s=%s", clusterCtx, zoneName), - federation.FederationNameAnnotation: testFederationName, - }, - }, - } - if dnsProvider == util.FedDNSProviderCoreDNS { - deployment.Annotations[util.FedDNSZoneName] = zoneName - deployment.Annotations[util.FedNameServer] = coreDNSServer - deployment.Annotations[util.FedDNSProvider] = util.FedDNSProviderCoreDNS - } - deploymentList := v1beta1.DeploymentList{Items: []v1beta1.Deployment{deployment}} - - f, tf, codec, _ := cmdtesting.NewAPIFactory() - extensionCodec := testapi.Extensions.Codec() - ns := dynamic.ContentConfig().NegotiatedSerializer - tf.ClientConfig = kubefedtesting.DefaultClientConfig() - tf.Client = &fake.RESTClient{ - GroupVersion: legacyscheme.Registry.GroupOrDie(v1.GroupName).GroupVersion, - NegotiatedSerializer: ns, - Client: fake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) { - switch p, m := req.URL.Path, req.Method; { - case p == "/api/v1/namespaces/federation-system/secrets" && m == http.MethodPost: - body, err := ioutil.ReadAll(req.Body) - if err != nil { - return nil, err - } - var got v1.Secret - _, _, err = codec.Decode(body, nil, &got) - if err != nil { - return nil, err - } - - // If the secret name was generated, test it separately. - if secretName == "" { - if got.Name == "" { - return nil, fmt.Errorf("expected a generated secret name, got \"\"") - } - got.Name = placeholderSecretName - } - - if !apiequality.Semantic.DeepEqual(got, secretObject) { - return nil, fmt.Errorf("Unexpected secret object\n\tDiff: %s", diff.ObjectGoPrintDiff(got, secretObject)) - } - return &http.Response{StatusCode: http.StatusCreated, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &secretObject)}, nil - case p == "/apis/extensions/v1beta1/namespaces/federation-system/deployments" && m == http.MethodGet: - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(extensionCodec, &deploymentList)}, nil - default: - return nil, fmt.Errorf("unexpected request: %#v\n%#v", req.URL, req) - } - }), - } - return f, nil -} - -func serviceAccountName(clusterName string) string { - return fmt.Sprintf("%s-substrate", clusterName) -} - -func fakeJoinTargetClusterFactory(clusterName, clusterCtx, dnsProvider, tmpDirPath string, isRBACAPIAvailable bool) (cmdutil.Factory, error) { - if clusterCtx == "" { - clusterCtx = clusterName - } - - configmapObject := &v1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: util.KubeDnsConfigmapName, - Namespace: metav1.NamespaceSystem, - Annotations: map[string]string{ - federation.FederationNameAnnotation: testFederationName, - federation.ClusterNameAnnotation: clusterName, - }, - }, - Data: map[string]string{ - util.FedDomainMapKey: fmt.Sprintf("%s=%s", clusterCtx, zoneName), - }, - } - - saSecretName := "serviceaccountsecret" - saSecret := v1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: saSecretName, - Namespace: util.DefaultFederationSystemNamespace, - Annotations: map[string]string{ - federation.FederationNameAnnotation: testFederationName, - federation.ClusterNameAnnotation: clusterName, - }, - }, - Data: map[string][]byte{ - "ca.crt": []byte("cert"), - "token": []byte("token"), - }, - Type: v1.SecretTypeServiceAccountToken, - } - - saName := serviceAccountName(clusterName) - - serviceAccount := v1.ServiceAccount{ - ObjectMeta: metav1.ObjectMeta{ - Name: saName, - Annotations: map[string]string{ - federation.FederationNameAnnotation: testFederationName, - federation.ClusterNameAnnotation: clusterName, - }, - }, - Secrets: []v1.ObjectReference{ - {Name: saSecretName}, - }, - } - if dnsProvider == util.FedDNSProviderCoreDNS { - annotations := map[string]string{ - util.FedDNSProvider: util.FedDNSProviderCoreDNS, - util.FedDNSZoneName: zoneName, - util.FedNameServer: coreDNSServer, - } - configmapObject = populateStubDomainsIfRequiredTest(configmapObject, annotations) - } - - namespace := v1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - Name: "federation-system", - Annotations: map[string]string{ - federation.FederationNameAnnotation: testFederationName, - federation.ClusterNameAnnotation: clusterName, - }, - }, - } - - roleName := util.ClusterRoleName(testFederationName, saName) - clusterRole := rbacv1.ClusterRole{ - ObjectMeta: metav1.ObjectMeta{ - Name: roleName, - Namespace: util.DefaultFederationSystemNamespace, - Annotations: map[string]string{ - federation.FederationNameAnnotation: testFederationName, - federation.ClusterNameAnnotation: clusterName, - }, - }, - Rules: []rbacv1.PolicyRule{ - k8srbacv1.NewRule(rbacv1.VerbAll).Groups(rbacv1.APIGroupAll).Resources(rbacv1.ResourceAll).RuleOrDie(), - }, - } - - clusterRoleBinding, err := k8srbacv1.NewClusterBinding(roleName).SAs(util.DefaultFederationSystemNamespace, saName).Binding() - if err != nil { - return nil, err - } - - testGroup := metav1.APIGroup{ - Name: "testAPIGroup", - Versions: []metav1.GroupVersionForDiscovery{ - { - GroupVersion: "testAPIGroup/testAPIVersion", - Version: "testAPIVersion", - }, - }, - } - apiGroupList := &metav1.APIGroupList{} - apiGroupList.Groups = append(apiGroupList.Groups, testGroup) - if isRBACAPIAvailable { - rbacGroup := metav1.APIGroup{ - Name: rbacv1.GroupName, - Versions: []metav1.GroupVersionForDiscovery{ - { - GroupVersion: rbacv1.GroupName + "/v1", - Version: "v1", - }, - }, - } - apiGroupList.Groups = append(apiGroupList.Groups, rbacGroup) - } - - f, tf, codec, _ := cmdtesting.NewAPIFactory() - defaultCodec := testapi.Default.Codec() - rbacCodec := testapi.Rbac.Codec() - ns := dynamic.ContentConfig().NegotiatedSerializer - tf.TmpDir = tmpDirPath - tf.ClientConfig = kubefedtesting.DefaultClientConfig() - tf.Client = &fake.RESTClient{ - GroupVersion: legacyscheme.Registry.GroupOrDie(v1.GroupName).GroupVersion, - NegotiatedSerializer: ns, - Client: fake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) { - switch p, m, r := req.URL.Path, req.Method, isRBACAPIAvailable; { - case p == "/api/v1/namespaces" && m == http.MethodPost: - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(defaultCodec, &namespace)}, nil - - case p == "/api" && m == http.MethodGet: - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &metav1.APIVersions{})}, nil - case p == "/apis" && m == http.MethodGet: - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, apiGroupList)}, nil - - case p == fmt.Sprintf("/api/v1/namespaces/federation-system/serviceaccounts/%s", saName) && m == http.MethodGet && r: - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(defaultCodec, &serviceAccount)}, nil - case p == "/api/v1/namespaces/federation-system/serviceaccounts" && m == http.MethodPost && r: - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(defaultCodec, &serviceAccount)}, nil - - case p == "/apis/rbac.authorization.k8s.io/v1/clusterroles" && m == http.MethodPost && r: - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(rbacCodec, &clusterRole)}, nil - case p == "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" && m == http.MethodPost && r: - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(rbacCodec, &clusterRoleBinding)}, nil - - case p == "/api/v1/namespaces/federation-system/secrets/serviceaccountsecret" && m == http.MethodGet && r: - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(defaultCodec, &saSecret)}, nil - - case p == "/api/v1/namespaces/kube-system/configmaps/" && m == http.MethodPost: - body, err := ioutil.ReadAll(req.Body) - if err != nil { - return nil, err - } - var got v1.ConfigMap - _, _, err = codec.Decode(body, nil, &got) - if err != nil { - return nil, err - } - if !apiequality.Semantic.DeepEqual(&got, configmapObject) { - return nil, fmt.Errorf("Unexpected configmap object\n\tDiff: %s", diff.ObjectGoPrintDiff(&got, configmapObject)) - } - return &http.Response{StatusCode: http.StatusCreated, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, configmapObject)}, nil - default: - return nil, fmt.Errorf("unexpected request: %#v\n%#v", req.URL, req) - } - }), - } - - return f, nil -} - -func fakeCluster(clusterName, secretName, server string, isRBACAPIAvailable bool) federationapi.Cluster { - cluster := federationapi.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: clusterName, - }, - Spec: federationapi.ClusterSpec{ - ServerAddressByClientCIDRs: []federationapi.ServerAddressByClientCIDR{ - { - ClientCIDR: defaultClientCIDR, - ServerAddress: server, - }, - }, - SecretRef: &v1.LocalObjectReference{ - Name: secretName, - }, - }, - } - if isRBACAPIAvailable { - saName := serviceAccountName(clusterName) - annotations := map[string]string{ - ServiceAccountNameAnnotation: saName, - ClusterRoleNameAnnotation: util.ClusterRoleName(testFederationName, saName), - } - cluster.ObjectMeta.SetAnnotations(annotations) - } - return cluster -} - -// TODO: Reuse the function populateStubDomainsIfRequired once that function is converted to use versioned objects. -func populateStubDomainsIfRequiredTest(configMap *v1.ConfigMap, annotations map[string]string) *v1.ConfigMap { - dnsProvider := annotations[util.FedDNSProvider] - dnsZoneName := annotations[util.FedDNSZoneName] - nameServer := annotations[util.FedNameServer] - - if dnsProvider != util.FedDNSProviderCoreDNS || dnsZoneName == "" || nameServer == "" { - return configMap - } - configMap.Data[util.KubeDnsStubDomains] = fmt.Sprintf(`{"%s":["%s"]}`, dnsZoneName, nameServer) - return configMap -} diff --git a/federation/pkg/kubefed/kubefed.go b/federation/pkg/kubefed/kubefed.go deleted file mode 100644 index dede0e282c..0000000000 --- a/federation/pkg/kubefed/kubefed.go +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright 2016 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 kubefed - -import ( - "io" - - "k8s.io/apiserver/pkg/util/flag" - "k8s.io/client-go/tools/clientcmd" - kubefedinit "k8s.io/kubernetes/federation/pkg/kubefed/init" - "k8s.io/kubernetes/federation/pkg/kubefed/util" - kubectl "k8s.io/kubernetes/pkg/kubectl/cmd" - "k8s.io/kubernetes/pkg/kubectl/cmd/templates" - cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" - "k8s.io/kubernetes/pkg/kubectl/util/i18n" - - "github.com/spf13/cobra" -) - -var ( - kubefedVersionExample = templates.Examples(i18n.T(` - # Print the client and server versions for the current context - kubefed version`)) - kubefedOptionsExample = templates.Examples(i18n.T(` - # Print flags inherited by all commands - kubefed options`)) -) - -// NewKubeFedCommand creates the `kubefed` command and its nested children. -func NewKubeFedCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer, defaultServerImage, defaultEtcdImage string) *cobra.Command { - // Parent command to which all subcommands are added. - cmds := &cobra.Command{ - Use: "kubefed", - Short: "kubefed controls a Kubernetes Cluster Federation", - Long: templates.LongDesc(` - kubefed controls a Kubernetes Cluster Federation. - - Find more information at https://github.com/kubernetes/kubernetes.`), - Run: runHelp, - } - - f.BindFlags(cmds.PersistentFlags()) - f.BindExternalFlags(cmds.PersistentFlags()) - - // From this point and forward we get warnings on flags that contain "_" separators - cmds.SetGlobalNormalizationFunc(flag.WarnWordSepNormalizeFunc) - - groups := templates.CommandGroups{ - { - Message: "Basic Commands:", - Commands: []*cobra.Command{ - kubefedinit.NewCmdInit(out, util.NewAdminConfig(clientcmd.NewDefaultPathOptions()), defaultServerImage, defaultEtcdImage), - NewCmdJoin(f, out, util.NewAdminConfig(clientcmd.NewDefaultPathOptions())), - NewCmdUnjoin(f, out, err, util.NewAdminConfig(clientcmd.NewDefaultPathOptions())), - }, - }, - } - groups.Add(cmds) - - filters := []string{ - "options", - } - templates.ActsAsRootCommand(cmds, filters, groups...) - - cmdVersion := kubectl.NewCmdVersion(f, out) - cmdVersion.Example = kubefedVersionExample - cmds.AddCommand(cmdVersion) - cmdOptions := kubectl.NewCmdOptions(out) - cmdOptions.Example = kubefedOptionsExample - cmds.AddCommand(cmdOptions) - - return cmds -} - -func runHelp(cmd *cobra.Command, args []string) { - cmd.Help() -} diff --git a/federation/pkg/kubefed/testing/BUILD b/federation/pkg/kubefed/testing/BUILD deleted file mode 100644 index 90db303228..0000000000 --- a/federation/pkg/kubefed/testing/BUILD +++ /dev/null @@ -1,36 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["testing.go"], - importpath = "k8s.io/kubernetes/federation/pkg/kubefed/testing", - deps = [ - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//federation/pkg/kubefed/util:go_default_library", - "//pkg/api:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//pkg/kubectl/cmd/util:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd/api:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/kubefed/testing/testing.go b/federation/pkg/kubefed/testing/testing.go deleted file mode 100644 index 9b16f0a015..0000000000 --- a/federation/pkg/kubefed/testing/testing.go +++ /dev/null @@ -1,188 +0,0 @@ -/* -Copyright 2016 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 testing - -import ( - "bytes" - "io" - "io/ioutil" - "net/http" - "os" - - "k8s.io/apimachinery/pkg/runtime" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - fedclient "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/federation/pkg/kubefed/util" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/legacyscheme" - cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" -) - -type fakeAdminConfig struct { - pathOptions *clientcmd.PathOptions - hostFactory cmdutil.Factory - targetClusterFactory cmdutil.Factory - targetClusterContext string -} - -func NewFakeAdminConfig(hostFactory cmdutil.Factory, targetFactory cmdutil.Factory, targetClusterContext, kubeconfigGlobal string) (util.AdminConfig, error) { - pathOptions := clientcmd.NewDefaultPathOptions() - pathOptions.GlobalFile = kubeconfigGlobal - pathOptions.EnvVar = "" - - return &fakeAdminConfig{ - pathOptions: pathOptions, - hostFactory: hostFactory, - targetClusterFactory: targetFactory, - targetClusterContext: targetClusterContext, - }, nil -} - -func (f *fakeAdminConfig) PathOptions() *clientcmd.PathOptions { - return f.pathOptions -} - -func (f *fakeAdminConfig) FederationClientset(context, kubeconfigPath string) (*fedclient.Clientset, error) { - fakeRestClient, err := f.hostFactory.RESTClient() - if err != nil { - return nil, err - } - - // we ignore the function params and use the client from - // the same fakefactory to create a federation clientset - // our fake factory exposes only the healthz api for this client - return fedclient.New(fakeRestClient), nil -} - -func (f *fakeAdminConfig) ClusterFactory(context, kubeconfigPath string) cmdutil.Factory { - if f.targetClusterContext != "" && f.targetClusterContext == context { - return f.targetClusterFactory - } - return f.hostFactory -} - -func FakeKubeconfigFiles() ([]string, error) { - kubeconfigs := []clientcmdapi.Config{ - { - Clusters: map[string]*clientcmdapi.Cluster{ - "syndicate": { - Server: "https://10.20.30.40", - }, - }, - AuthInfos: map[string]*clientcmdapi.AuthInfo{ - "syndicate": { - Token: "badge", - }, - }, - Contexts: map[string]*clientcmdapi.Context{ - "syndicate": { - Cluster: "syndicate", - AuthInfo: "syndicate", - }, - }, - CurrentContext: "syndicate", - }, - { - Clusters: map[string]*clientcmdapi.Cluster{ - "ally": { - Server: "ally256.example.com:80", - }, - }, - AuthInfos: map[string]*clientcmdapi.AuthInfo{ - "ally": { - Token: "souvenir", - }, - }, - Contexts: map[string]*clientcmdapi.Context{ - "ally": { - Cluster: "ally", - AuthInfo: "ally", - }, - }, - CurrentContext: "ally", - }, - { - Clusters: map[string]*clientcmdapi.Cluster{ - "ally": { - Server: "https://ally64.example.com", - }, - "confederate": { - Server: "10.8.8.8", - }, - }, - AuthInfos: map[string]*clientcmdapi.AuthInfo{ - "ally": { - Token: "souvenir", - }, - "confederate": { - Token: "totem", - }, - }, - Contexts: map[string]*clientcmdapi.Context{ - "ally": { - Cluster: "ally", - AuthInfo: "ally", - }, - "confederate": { - Cluster: "confederate", - AuthInfo: "confederate", - }, - }, - CurrentContext: "confederate", - }, - } - kubefiles := []string{} - for _, cfg := range kubeconfigs { - fakeKubeFile, _ := ioutil.TempFile("", "") - err := clientcmd.WriteToFile(cfg, fakeKubeFile.Name()) - if err != nil { - return nil, err - } - - kubefiles = append(kubefiles, fakeKubeFile.Name()) - } - return kubefiles, nil -} - -func RemoveFakeKubeconfigFiles(kubefiles []string) { - for _, file := range kubefiles { - os.Remove(file) - } -} - -func DefaultHeader() http.Header { - header := http.Header{} - header.Set("Content-Type", runtime.ContentTypeJSON) - return header -} - -func ObjBody(codec runtime.Codec, obj runtime.Object) io.ReadCloser { - return ioutil.NopCloser(bytes.NewReader([]byte(runtime.EncodeOrDie(codec, obj)))) -} - -func DefaultClientConfig() *restclient.Config { - return &restclient.Config{ - APIPath: "/api", - ContentConfig: restclient.ContentConfig{ - NegotiatedSerializer: legacyscheme.Codecs, - ContentType: runtime.ContentTypeJSON, - GroupVersion: &legacyscheme.Registry.GroupOrDie(api.GroupName).GroupVersion, - }, - } -} diff --git a/federation/pkg/kubefed/unjoin.go b/federation/pkg/kubefed/unjoin.go deleted file mode 100644 index 818c2805da..0000000000 --- a/federation/pkg/kubefed/unjoin.go +++ /dev/null @@ -1,332 +0,0 @@ -/* -Copyright 2016 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 kubefed - -import ( - "fmt" - "io" - "net/url" - "strings" - - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - "k8s.io/kubernetes/federation/pkg/kubefed/util" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" - "k8s.io/kubernetes/pkg/kubectl/cmd/templates" - cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" - "k8s.io/kubernetes/pkg/kubectl/resource" - - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -var ( - unjoin_long = templates.LongDesc(` - Unjoin a cluster from a federation. - - Current context is assumed to be a federation endpoint. - Please use the --context flag otherwise.`) - unjoin_example = templates.Examples(` - # Unjoin the specified cluster from a federation. - # Federation control plane's host cluster context name - # must be specified via the --host-cluster-context flag - # to properly cleanup the credentials. - kubectl unjoin foo --host-cluster-context=bar --cluster-context=baz`) -) - -type unjoinFederation struct { - commonOptions util.SubcommandOptions - options unjoinFederationOptions -} - -type unjoinFederationOptions struct { - clusterContext string -} - -func (o *unjoinFederationOptions) Bind(flags *pflag.FlagSet) { - flags.StringVar(&o.clusterContext, "cluster-context", "", "Name of the cluster's context in the local kubeconfig. Defaults to cluster name if unspecified.") -} - -// NewCmdUnjoin defines the `unjoin` command that removes a cluster -// from a federation. -func NewCmdUnjoin(f cmdutil.Factory, cmdOut, cmdErr io.Writer, config util.AdminConfig) *cobra.Command { - opts := &unjoinFederation{} - - cmd := &cobra.Command{ - Use: "unjoin CLUSTER_NAME --host-cluster-context=HOST_CONTEXT", - Short: "Unjoin a cluster from a federation", - Long: unjoin_long, - Example: unjoin_example, - Run: func(cmd *cobra.Command, args []string) { - cmdutil.CheckErr(opts.commonOptions.SetName(cmd, args)) - cmdutil.CheckErr(opts.Run(f, cmdOut, cmdErr, config)) - }, - } - - flags := cmd.Flags() - opts.commonOptions.Bind(flags) - opts.options.Bind(flags) - - return cmd -} - -// unjoinFederation is the implementation of the `unjoin` command. -func (u *unjoinFederation) Run(f cmdutil.Factory, cmdOut, cmdErr io.Writer, config util.AdminConfig) error { - if u.options.clusterContext == "" { - u.options.clusterContext = u.commonOptions.Name - } - - cluster, err := popCluster(f, u.commonOptions.Name) - if err != nil { - return err - } - if cluster == nil { - fmt.Fprintf(cmdErr, "WARNING: cluster %q not found in federation, so its credentials' secret couldn't be deleted", u.commonOptions.Name) - return nil - } - - // We want a separate client factory to communicate with the - // federation host cluster. See join_federation.go for details. - hostFactory := config.ClusterFactory(u.commonOptions.Host, u.commonOptions.Kubeconfig) - hostClientset, err := hostFactory.ClientSet() - if err != nil { - return err - } - - secretName := cluster.Spec.SecretRef.Name - secret, err := hostClientset.Core().Secrets(u.commonOptions.FederationSystemNamespace).Get(secretName, metav1.GetOptions{}) - if isNotFound(err) { - // If this is the case, we cannot get the cluster clientset to delete the - // config map from that cluster and obviously cannot delete the not existing secret. - // We just publish the warning as cluster has already been removed from federation. - fmt.Fprintf(cmdErr, "WARNING: secret %q not found in the host cluster, so it couldn't be deleted. Cluster has already been removed from the federation.", secretName) - return nil - } else if err != nil { - fmt.Fprintf(cmdErr, "WARNING: Error retrieving secret from the base cluster") - return err - } - - unjoiningClusterFactory := config.ClusterFactory(u.options.clusterContext, u.commonOptions.Kubeconfig) - unjoiningClusterClientset, err := unjoiningClusterFactory.ClientSet() - outerErr := err - if err != nil { - // Attempt to get a clientset using information from the cluster. - unjoiningClusterClientset, err = getClientsetFromCluster(secret, cluster) - if err != nil { - return fmt.Errorf("unable to get clientset from kubeconfig or cluster: %v, %v", outerErr, err) - } - } - - err = deleteSecret(hostClientset, cluster.Spec.SecretRef.Name, u.commonOptions.FederationSystemNamespace) - if err != nil { - fmt.Fprintf(cmdErr, "WARNING: secret %q could not be deleted: %v", secretName, err) - // We anyways continue to try and delete the config map but with above warning - } - - // We need to ensure updating the config map created in the deregistered cluster - // This configmap was created/updated when the cluster joined this federation to aid - // the kube-dns of that cluster to aid service discovery. - err = updateConfigMapFromCluster(hostClientset, unjoiningClusterClientset, u.commonOptions.FederationSystemNamespace) - if err != nil { - fmt.Fprintf(cmdErr, "WARNING: Encountered error in deleting kube-dns configmap: %v", err) - // We anyways continue to print success message but with above warning - } - - // Delete the service account in the unjoining cluster. - err = deleteServiceAccountFromCluster(unjoiningClusterClientset, cluster, u.commonOptions.FederationSystemNamespace) - if err != nil { - fmt.Fprintf(cmdErr, "WARNING: Encountered error in deleting service account: %v", err) - return err - } - - // Delete the cluster role and role binding in the unjoining cluster. - err = deleteClusterRoleBindingFromCluster(unjoiningClusterClientset, cluster) - if err != nil { - fmt.Fprintf(cmdErr, "WARNING: Encountered error in deleting cluster role bindings: %v", err) - return err - } - - _, err = fmt.Fprintf(cmdOut, "Successfully removed cluster %q from federation\n", u.commonOptions.Name) - return err -} - -// popCluster fetches the cluster object with the given name, deletes -// it and returns the deleted cluster object. -func popCluster(f cmdutil.Factory, name string) (*federationapi.Cluster, error) { - mapper, typer := f.Object() - gvks, _, err := typer.ObjectKinds(&federationapi.Cluster{}) - if err != nil { - return nil, err - } - gvk := gvks[0] - mapping, err := mapper.RESTMapping(schema.GroupKind{Group: gvk.Group, Kind: gvk.Kind}, gvk.Version) - if err != nil { - return nil, err - } - client, err := f.ClientForMapping(mapping) - if err != nil { - return nil, err - } - - rh := resource.NewHelper(client, mapping) - obj, err := rh.Get("", name, false) - - if isNotFound(err) { - // Cluster isn't registered, there isn't anything to be done here. - return nil, nil - } else if err != nil { - return nil, err - } - cluster, ok := obj.(*federationapi.Cluster) - if !ok { - return nil, fmt.Errorf("unexpected object type: expected \"federation/v1beta1.Cluster\", got %T: obj: %#v", obj, obj) - } - - // Remove the cluster resource in the federation API server by - // calling rh.Delete() - return cluster, rh.Delete("", name) -} - -func updateConfigMapFromCluster(hostClientset, unjoiningClusterClientset internalclientset.Interface, fedSystemNamespace string) error { - cmDep, err := getCMDeployment(hostClientset, fedSystemNamespace) - if err != nil { - return err - } - domainMap, ok := cmDep.Annotations[util.FedDomainMapKey] - if !ok { - return fmt.Errorf("kube-dns config map data missing from controller manager annotations") - } - - configMap, err := unjoiningClusterClientset.Core().ConfigMaps(metav1.NamespaceSystem).Get(util.KubeDnsConfigmapName, metav1.GetOptions{}) - if err != nil { - return err - } - - needUpdate := false - if _, ok := configMap.Data[util.FedDomainMapKey]; ok { - configMap.Data[util.FedDomainMapKey] = removeConfigMapString(configMap.Data[util.FedDomainMapKey], domainMap) - needUpdate = true - } - - if _, ok := configMap.Data[util.KubeDnsStubDomains]; ok { - delete(configMap.Data, util.KubeDnsStubDomains) - needUpdate = true - } - - if needUpdate { - _, err = unjoiningClusterClientset.Core().ConfigMaps(metav1.NamespaceSystem).Update(configMap) - } - return err -} - -// deleteSecret deletes the secret with the given name from the host -// cluster. -func deleteSecret(clientset internalclientset.Interface, name, namespace string) error { - orphanDependents := false - return clientset.Core().Secrets(namespace).Delete(name, &metav1.DeleteOptions{OrphanDependents: &orphanDependents}) -} - -// isNotFound checks if the given error is a NotFound status error. -func isNotFound(err error) bool { - statusErr := err - if urlErr, ok := err.(*url.Error); ok { - statusErr = urlErr.Err - } - return errors.IsNotFound(statusErr) -} - -func getClientsetFromCluster(secret *api.Secret, cluster *federationapi.Cluster) (*internalclientset.Clientset, error) { - serverAddress, err := util.GetServerAddress(cluster) - if err != nil { - return nil, err - } - if serverAddress == "" { - return nil, fmt.Errorf("failed to get server address for the cluster: %s", cluster.Name) - } - - clientset, err := util.GetClientsetFromSecret(secret, serverAddress) - if err != nil { - return nil, err - } - if clientset == nil { - // There is a possibility that the clientset is nil without any error reported - return nil, fmt.Errorf("failed for get client to access cluster: %s", cluster.Name) - } - - return clientset, nil -} - -// removeConfigMapString returns an empty string if last value is removed -// or returns the remaining comma separated strings minus the one to be removed -func removeConfigMapString(str string, toRemove string) string { - if str == "" { - return "" - } - - values := strings.Split(str, ",") - if len(values) == 1 { - if values[0] == toRemove { - return "" - } else { - // Somehow our federation string is not here - // Dont do anything further - return values[0] - } - } - - for i, v := range values { - if v == toRemove { - values = append(values[:i], values[i+1:]...) - break - } - } - return strings.Join(values, ",") -} - -// deleteServiceAccountFromCluster removes the service account that the federation control plane uses -// to access the cluster from the cluster that is leaving the federation. -func deleteServiceAccountFromCluster(unjoiningClusterClientset internalclientset.Interface, cluster *federationapi.Cluster, fedSystemNamespace string) error { - serviceAccountName, ok := cluster.ObjectMeta.Annotations[ServiceAccountNameAnnotation] - if !ok { - // If there is no service account name annotation, assume that this cluster does not have a federation control plane service account. - return nil - } - return unjoiningClusterClientset.Core().ServiceAccounts(fedSystemNamespace).Delete(serviceAccountName, &metav1.DeleteOptions{}) -} - -// deleteClusterRoleBindingFromCluster deletes the ClusterRole and ClusterRoleBinding from the -// cluster that is leaving the federation. -func deleteClusterRoleBindingFromCluster(unjoiningClusterClientset internalclientset.Interface, cluster *federationapi.Cluster) error { - clusterRoleName, ok := cluster.ObjectMeta.Annotations[ClusterRoleNameAnnotation] - if !ok { - // If there is no cluster role name annotation, assume that this cluster does not have cluster role bindings. - return nil - } - - err := unjoiningClusterClientset.Rbac().ClusterRoleBindings().Delete(clusterRoleName, &metav1.DeleteOptions{}) - if err != nil && !errors.IsMethodNotSupported(err) && !errors.IsNotFound(err) { - return err - } - err = unjoiningClusterClientset.Rbac().ClusterRoles().Delete(clusterRoleName, &metav1.DeleteOptions{}) - if err != nil && !errors.IsMethodNotSupported(err) && !errors.IsNotFound(err) { - return err - } - return nil -} diff --git a/federation/pkg/kubefed/unjoin_test.go b/federation/pkg/kubefed/unjoin_test.go deleted file mode 100644 index 3ff19a1de0..0000000000 --- a/federation/pkg/kubefed/unjoin_test.go +++ /dev/null @@ -1,307 +0,0 @@ -/* -Copyright 2016 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 kubefed - -import ( - "bytes" - "fmt" - "net/http" - "strings" - "testing" - - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/client-go/dynamic" - "k8s.io/client-go/rest/fake" - "k8s.io/client-go/tools/clientcmd" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - federationapi "k8s.io/kubernetes/federation/apis/federation" - fedv1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" - kubefedtesting "k8s.io/kubernetes/federation/pkg/kubefed/testing" - "k8s.io/kubernetes/federation/pkg/kubefed/util" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/api/testapi" - cmdtesting "k8s.io/kubernetes/pkg/kubectl/cmd/testing" - cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" -) - -func TestUnjoinFederation(t *testing.T) { - cmdErrMsg := "" - cmdutil.BehaviorOnFatal(func(str string, code int) { - cmdErrMsg = str - }) - - fakeKubeFiles, err := kubefedtesting.FakeKubeconfigFiles() - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - defer kubefedtesting.RemoveFakeKubeconfigFiles(fakeKubeFiles) - - testCases := []struct { - cluster string - wantCluster string - wantSecret string - kubeconfigGlobal string - kubeconfigExplicit string - expectedServer string - expectedErr string - }{ - // Tests that the contexts and credentials are read from the - // global, default kubeconfig and the correct cluster resource - // is deregisterd and configmap kube-dns is removed from that cluster. - { - cluster: "syndicate", - wantCluster: "syndicate", - wantSecret: "", - kubeconfigGlobal: fakeKubeFiles[0], - kubeconfigExplicit: "", - expectedServer: "https://10.20.30.40", - expectedErr: "", - }, - // Tests that the contexts and credentials are read from the - // explicit kubeconfig file specified and the correct cluster - // resource is deregisterd and configmap kube-dns is removed from that cluster. - // kubeconfig contains a single cluster and context. - { - cluster: "ally", - wantCluster: "ally", - wantSecret: "", - kubeconfigGlobal: fakeKubeFiles[0], - kubeconfigExplicit: fakeKubeFiles[1], - expectedServer: "http://ally256.example.com:80", - expectedErr: "", - }, - // Tests that the contexts and credentials are read from the - // explicit kubeconfig file specified and the correct cluster - // resource is deregisterd and configmap kube-dns is removed from that - // cluster. kubeconfig consists of multiple clusters and contexts. - { - cluster: "confederate", - wantCluster: "confederate", - wantSecret: "", - kubeconfigGlobal: fakeKubeFiles[1], - kubeconfigExplicit: fakeKubeFiles[2], - expectedServer: "https://10.8.8.8", - expectedErr: "", - }, - // Negative test to ensure that we get the right warning - // when the specified cluster to deregister is not found. - { - cluster: "noexist", - wantCluster: "affiliate", - wantSecret: "", - kubeconfigGlobal: fakeKubeFiles[0], - kubeconfigExplicit: "", - expectedServer: "https://10.20.30.40", - expectedErr: fmt.Sprintf("WARNING: cluster %q not found in federation, so its credentials' secret couldn't be deleted", "affiliate"), - }, - // Negative test to ensure that we get the right warning - // when the specified cluster's credentials secret is not - // found. - { - cluster: "affiliate", - wantCluster: "affiliate", - wantSecret: "noexist", - kubeconfigGlobal: fakeKubeFiles[0], - kubeconfigExplicit: "", - expectedServer: "https://10.20.30.40", - expectedErr: fmt.Sprintf("WARNING: secret %q not found in the host cluster, so it couldn't be deleted. Cluster has already been removed from the federation.", "noexist"), - }, - // TODO: Figure out a way to test the scenarios of configmap deletion - // As of now we delete the config map after deriving the clientset using - // the cluster object we retrieved from the federation server and the - // secret object retrieved from the base cluster. - // Still to find out a way to introduce some fakes and unit test this path. - } - - for i, tc := range testCases { - cmdErrMsg = "" - f := testUnjoinFederationFactory(tc.cluster, tc.expectedServer, tc.wantSecret) - buf := bytes.NewBuffer([]byte{}) - errBuf := bytes.NewBuffer([]byte{}) - - hostFactory := fakeUnjoinHostFactory(tc.cluster) - adminConfig, err := kubefedtesting.NewFakeAdminConfig(hostFactory, nil, "", tc.kubeconfigGlobal) - if err != nil { - t.Fatalf("[%d] unexpected error: %v", i, err) - } - - cmd := NewCmdUnjoin(f, buf, errBuf, adminConfig) - - cmd.Flags().Set("kubeconfig", tc.kubeconfigExplicit) - cmd.Flags().Set("host", "substrate") - cmd.Run(cmd, []string{tc.wantCluster}) - - if tc.expectedErr == "" { - // uses the name from the cluster, not the response - // Actual data passed are tested in the fake secret and cluster - // REST clients. - if msg := buf.String(); msg != fmt.Sprintf("Successfully removed cluster %q from federation\n", tc.cluster) { - t.Errorf("[%d] unexpected output: %s", i, msg) - if cmdErrMsg != "" { - t.Errorf("[%d] unexpected error message: %s", i, cmdErrMsg) - } - } - // TODO: There are warnings posted on errBuf, which we ignore as of now - // and we should be able to test out these warnings also in future. - // This is linked to the previous todo comment. - } else { - if errMsg := errBuf.String(); errMsg != tc.expectedErr { - t.Errorf("[%d] expected warning: %s, got: %s, output: %s", i, tc.expectedErr, errMsg, buf.String()) - } - - } - } -} - -func testUnjoinFederationFactory(name, server, secret string) cmdutil.Factory { - urlPrefix := "/clusters/" - - cluster := fakeCluster(name, name, server, true) - if secret != "" { - cluster.Spec.SecretRef.Name = secret - } - - f, tf, _, _ := cmdtesting.NewAPIFactory() - codec := testapi.Federation.Codec() - tf.ClientConfig = kubefedtesting.DefaultClientConfig() - ns := serializer.NegotiatedSerializerWrapper(runtime.SerializerInfo{Serializer: runtime.NewCodec(f.JSONEncoder(), legacyscheme.Codecs.UniversalDecoder(fedv1beta1.SchemeGroupVersion))}) - tf.Client = &fake.RESTClient{ - GroupVersion: legacyscheme.Registry.GroupOrDie("federation").GroupVersion, - NegotiatedSerializer: ns, - Client: fake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) { - switch p, m := req.URL.Path, req.Method; { - case strings.HasPrefix(p, urlPrefix): - got := strings.TrimPrefix(p, urlPrefix) - if got != name { - return nil, errors.NewNotFound(federationapi.Resource("clusters"), got) - } - - switch m { - case http.MethodGet: - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &cluster)}, nil - case http.MethodDelete: - status := metav1.Status{ - Status: "Success", - } - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &status)}, nil - default: - return nil, fmt.Errorf("unexpected method: %#v\n%#v", req.URL, req) - } - default: - return nil, fmt.Errorf("unexpected request: %#v\n%#v", req.URL, req) - } - }), - } - tf.Namespace = "test" - return f -} - -func fakeUnjoinHostFactory(clusterName string) cmdutil.Factory { - secretsPrefix := "/api/v1/namespaces/federation-system/secrets/" - clusterRolePrefix := "/apis/rbac.authorization.k8s.io/v1/clusterroles/" - serviceAccountPrefix := "/api/v1/namespaces/federation-system/serviceaccounts/" - clusterRoleBindingPrefix := "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/" - - // Using dummy bytes for now - configBytes, _ := clientcmd.Write(clientcmdapi.Config{}) - secretObject := v1.Secret{ - TypeMeta: metav1.TypeMeta{ - Kind: "Secret", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: clusterName, - Namespace: util.DefaultFederationSystemNamespace, - }, - Data: map[string][]byte{ - "kubeconfig": configBytes, - }, - } - - f, tf, codec, _ := cmdtesting.NewAPIFactory() - ns := dynamic.ContentConfig().NegotiatedSerializer - tf.ClientConfig = kubefedtesting.DefaultClientConfig() - tf.Client = &fake.RESTClient{ - GroupVersion: legacyscheme.Registry.GroupOrDie(api.GroupName).GroupVersion, - NegotiatedSerializer: ns, - Client: fake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) { - switch p, m := req.URL.Path, req.Method; { - case strings.HasPrefix(p, secretsPrefix): - switch m { - case http.MethodDelete: - got := strings.TrimPrefix(p, secretsPrefix) - if got != clusterName { - return nil, errors.NewNotFound(api.Resource("secrets"), got) - } - status := metav1.Status{ - Status: "Success", - } - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &status)}, nil - case http.MethodGet: - got := strings.TrimPrefix(p, secretsPrefix) - if got != clusterName { - return nil, errors.NewNotFound(api.Resource("secrets"), got) - } - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &secretObject)}, nil - default: - return nil, fmt.Errorf("unexpected request method: %#v\n%#v", req.URL, req) - } - case strings.HasPrefix(p, serviceAccountPrefix) && m == http.MethodDelete: - got := strings.TrimPrefix(p, serviceAccountPrefix) - want := serviceAccountName(clusterName) - if got != want { - return nil, errors.NewNotFound(api.Resource("serviceaccounts"), got) - } - - status := metav1.Status{ - Status: "Success", - } - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &status)}, nil - case strings.HasPrefix(p, clusterRoleBindingPrefix) && m == http.MethodDelete: - got := strings.TrimPrefix(p, clusterRoleBindingPrefix) - want := util.ClusterRoleName(testFederationName, serviceAccountName(clusterName)) - if got != want { - return nil, errors.NewNotFound(api.Resource("clusterrolebindings"), got) - } - - status := metav1.Status{ - Status: "Success", - } - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &status)}, nil - case strings.HasPrefix(p, clusterRolePrefix) && m == http.MethodDelete: - got := strings.TrimPrefix(p, clusterRolePrefix) - want := util.ClusterRoleName(testFederationName, serviceAccountName(clusterName)) - if got != want { - return nil, errors.NewNotFound(api.Resource("clusterroles"), got) - } - - status := metav1.Status{ - Status: "Success", - } - return &http.Response{StatusCode: http.StatusOK, Header: kubefedtesting.DefaultHeader(), Body: kubefedtesting.ObjBody(codec, &status)}, nil - default: - return nil, fmt.Errorf("unexpected request: %#v\n%#v", req.URL, req) - } - }), - } - return f -} diff --git a/federation/pkg/kubefed/util/BUILD b/federation/pkg/kubefed/util/BUILD deleted file mode 100644 index 66cfce8192..0000000000 --- a/federation/pkg/kubefed/util/BUILD +++ /dev/null @@ -1,47 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = ["util.go"], - importpath = "k8s.io/kubernetes/federation/pkg/kubefed/util", - deps = [ - "//federation/apis/federation:go_default_library", - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//pkg/api:go_default_library", - "//pkg/apis/rbac:go_default_library", - "//pkg/apis/rbac/v1:go_default_library", - "//pkg/apis/rbac/v1alpha1:go_default_library", - "//pkg/apis/rbac/v1beta1:go_default_library", - "//pkg/client/clientset_generated/internalclientset:go_default_library", - "//pkg/kubectl/cmd:go_default_library", - "//pkg/kubectl/cmd/util:go_default_library", - "//vendor/github.com/spf13/cobra:go_default_library", - "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library", - "//vendor/k8s.io/client-go/discovery:go_default_library", - "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd/api:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/pkg/kubefed/util/util.go b/federation/pkg/kubefed/util/util.go deleted file mode 100644 index 427bbc2798..0000000000 --- a/federation/pkg/kubefed/util/util.go +++ /dev/null @@ -1,347 +0,0 @@ -/* -Copyright 2016 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 util - -import ( - "fmt" - "net" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - utilnet "k8s.io/apimachinery/pkg/util/net" - "k8s.io/client-go/discovery" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - federationapi "k8s.io/kubernetes/federation/apis/federation" - fedv1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" - fedclient "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/apis/rbac" - rbacv1 "k8s.io/kubernetes/pkg/apis/rbac/v1" - rbacv1alpha1 "k8s.io/kubernetes/pkg/apis/rbac/v1alpha1" - rbacv1beta1 "k8s.io/kubernetes/pkg/apis/rbac/v1beta1" - client "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" - kubectlcmd "k8s.io/kubernetes/pkg/kubectl/cmd" - cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" - - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - // KubeconfigSecretDataKey is the key name used in the secret to - // stores a cluster's credentials. - KubeconfigSecretDataKey = "kubeconfig" - - // Used in and to create the kube-dns configmap storing the zone info - FedDomainMapKey = "federations" - KubeDnsConfigmapName = "kube-dns" - FedDNSZoneName = "dns-zone-name" - FedNameServer = "nameserver" - FedDNSProvider = "dns-provider" - FedDNSProviderCoreDNS = "coredns" - KubeDnsStubDomains = "stubDomains" - - // DefaultFederationSystemNamespace is the namespace in which - // federation system components are hosted. - DefaultFederationSystemNamespace = "federation-system" - - // Used to build a clientset for a cluster using the secret - userAgentName = "kubefed-tool" - KubeAPIQPS = 20.0 - KubeAPIBurst = 30 - - rbacAPINotAvailable = "RBAC API not available" -) - -// used to identify the rbac api availability error. -type NoRBACAPIError struct { - s string -} - -func (n *NoRBACAPIError) Error() string { - return n.s -} - -// AdminConfig provides a filesystem based kubeconfig (via -// `PathOptions()`) and a mechanism to talk to the federation -// host cluster and the federation control plane api server. -type AdminConfig interface { - // PathOptions provides filesystem based kubeconfig access. - PathOptions() *clientcmd.PathOptions - // FedClientSet provides a federation API compliant clientset - // to communicate with the federation control plane api server - FederationClientset(context, kubeconfigPath string) (*fedclient.Clientset, error) - // ClusterFactory provides a mechanism to communicate with the - // cluster derived from the context and the kubeconfig. - ClusterFactory(context, kubeconfigPath string) cmdutil.Factory -} - -// adminConfig implements the AdminConfig interface. -type adminConfig struct { - pathOptions *clientcmd.PathOptions -} - -// NewAdminConfig creates an admin config for `kubefed` commands. -func NewAdminConfig(pathOptions *clientcmd.PathOptions) AdminConfig { - return &adminConfig{ - pathOptions: pathOptions, - } -} - -func (a *adminConfig) PathOptions() *clientcmd.PathOptions { - return a.pathOptions -} - -func (a *adminConfig) FederationClientset(context, kubeconfigPath string) (*fedclient.Clientset, error) { - fedConfig := a.getClientConfig(context, kubeconfigPath) - fedClientConfig, err := fedConfig.ClientConfig() - if err != nil { - return nil, err - } - - return fedclient.NewForConfigOrDie(fedClientConfig), nil -} - -func (a *adminConfig) ClusterFactory(context, kubeconfigPath string) cmdutil.Factory { - hostClientConfig := a.getClientConfig(context, kubeconfigPath) - return cmdutil.NewFactory(hostClientConfig) -} - -func (a *adminConfig) getClientConfig(context, kubeconfigPath string) clientcmd.ClientConfig { - loadingRules := *a.pathOptions.LoadingRules - loadingRules.Precedence = a.pathOptions.GetLoadingPrecedence() - loadingRules.ExplicitPath = kubeconfigPath - overrides := &clientcmd.ConfigOverrides{ - CurrentContext: context, - } - - return clientcmd.NewNonInteractiveDeferredLoadingClientConfig(&loadingRules, overrides) -} - -// SubcommandOptions holds the configuration required by the subcommands of -// `kubefed`. -type SubcommandOptions struct { - Name string - Host string - FederationSystemNamespace string - Kubeconfig string -} - -func (o *SubcommandOptions) Bind(flags *pflag.FlagSet) { - flags.StringVar(&o.Kubeconfig, "kubeconfig", "", "Path to the kubeconfig file to use for CLI requests.") - flags.StringVar(&o.Host, "host-cluster-context", "", "Host cluster context") - flags.StringVar(&o.FederationSystemNamespace, "federation-system-namespace", DefaultFederationSystemNamespace, "Namespace in the host cluster where the federation system components are installed") -} - -func (o *SubcommandOptions) SetName(cmd *cobra.Command, args []string) error { - name, err := kubectlcmd.NameFromCommandArgs(cmd, args) - if err != nil { - return err - } - o.Name = name - return nil -} - -func CreateKubeconfigSecret(clientset client.Interface, kubeconfig *clientcmdapi.Config, namespace, name, federationName, clusterName string, dryRun bool) (*api.Secret, error) { - configBytes, err := clientcmd.Write(*kubeconfig) - if err != nil { - return nil, err - } - annotations := map[string]string{ - federationapi.FederationNameAnnotation: federationName, - } - - if clusterName != "" { - annotations[federationapi.ClusterNameAnnotation] = clusterName - } - - // Build the secret object with the minified and flattened - // kubeconfig content. - secret := &api.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - Annotations: annotations, - }, - Data: map[string][]byte{ - KubeconfigSecretDataKey: configBytes, - }, - } - - if !dryRun { - return clientset.Core().Secrets(namespace).Create(secret) - } - return secret, nil -} - -var kubeconfigGetterForSecret = func(secret *api.Secret) clientcmd.KubeconfigGetter { - return func() (*clientcmdapi.Config, error) { - var data []byte - ok := false - data, ok = secret.Data[KubeconfigSecretDataKey] - if !ok { - return nil, fmt.Errorf("secret does not have data with key: %s", KubeconfigSecretDataKey) - } - return clientcmd.Load(data) - } -} - -func GetClientsetFromSecret(secret *api.Secret, serverAddress string) (*client.Clientset, error) { - clusterConfig, err := buildConfigFromSecret(secret, serverAddress) - if err == nil && clusterConfig != nil { - clientset := client.NewForConfigOrDie(restclient.AddUserAgent(clusterConfig, userAgentName)) - return clientset, nil - } - return nil, err -} - -func GetServerAddress(c *fedv1beta1.Cluster) (string, error) { - hostIP, err := utilnet.ChooseHostInterface() - if err != nil { - return "", err - } - - for _, item := range c.Spec.ServerAddressByClientCIDRs { - _, cidrnet, err := net.ParseCIDR(item.ClientCIDR) - if err != nil { - return "", err - } - if cidrnet.Contains(hostIP) { - return item.ServerAddress, nil - } - } - - return "", nil -} - -func buildConfigFromSecret(secret *api.Secret, serverAddress string) (*restclient.Config, error) { - var clusterConfig *restclient.Config - var err error - // Pre-1.7, the secret contained a serialized kubeconfig which contained appropriate credentials. - // Post-1.7, the secret contains credentials for a service account. - // Check for the service account credentials, and use them if they exist; if not, use the - // serialized kubeconfig. - token, tokenFound := secret.Data["token"] - ca, caFound := secret.Data["ca.crt"] - if tokenFound != caFound { - return nil, fmt.Errorf("secret should have values for either both 'ca.crt' and 'token' in its Data, or neither: %v", secret) - } else if tokenFound && caFound { - clusterConfig, err = clientcmd.BuildConfigFromFlags(serverAddress, "") - clusterConfig.CAData = ca - clusterConfig.BearerToken = string(token) - } else { - kubeconfigGetter := kubeconfigGetterForSecret(secret) - clusterConfig, err = clientcmd.BuildConfigFromKubeconfigGetter(serverAddress, kubeconfigGetter) - } - - if err != nil { - return nil, err - } - - clusterConfig.QPS = KubeAPIQPS - clusterConfig.Burst = KubeAPIBurst - - return clusterConfig, nil -} - -// GetVersionedClientForRBACOrFail discovers the versioned rbac APIs and gets the versioned -// clientset for either the preferred version or the first listed version (if no preference listed) -// TODO: We need to evaluate the usage of RESTMapper interface to achieve the same functionality -func GetVersionedClientForRBACOrFail(hostFactory cmdutil.Factory) (client.Interface, error) { - discoveryclient, err := hostFactory.DiscoveryClient() - if err != nil { - return nil, err - } - - rbacVersion, err := getRBACVersion(discoveryclient) - if err != nil && !discoveryclient.Fresh() { - discoveryclient.Invalidate() - rbacVersion, err = getRBACVersion(discoveryclient) - } - if err != nil { - return nil, err - } - - return hostFactory.ClientSetForVersion(rbacVersion) -} - -func getRBACVersion(discoveryclient discovery.CachedDiscoveryInterface) (*schema.GroupVersion, error) { - - groupList, err := discoveryclient.ServerGroups() - if err != nil { - return nil, fmt.Errorf("Couldn't get clientset to create RBAC roles in the host cluster: %v", err) - } - - // These are the RBAC versions we can speak - knownVersions := map[schema.GroupVersion]bool{ - rbacv1.SchemeGroupVersion: true, - rbacv1alpha1.SchemeGroupVersion: true, - rbacv1beta1.SchemeGroupVersion: true, - } - - // This holds any RBAC versions listed in discovery we do not know how to speak - unknownVersions := []schema.GroupVersion{} - - for _, g := range groupList.Groups { - if g.Name == rbac.GroupName { - if g.PreferredVersion.GroupVersion != "" { - gv, err := schema.ParseGroupVersion(g.PreferredVersion.GroupVersion) - if err != nil { - return nil, err - } - if knownVersions[gv] { - return &gv, nil - } - } - for _, version := range g.Versions { - if version.GroupVersion != "" { - gv, err := schema.ParseGroupVersion(version.GroupVersion) - if err != nil { - return nil, err - } - if knownVersions[gv] { - return &gv, nil - } else { - unknownVersions = append(unknownVersions, gv) - } - } - } - } - } - - if len(unknownVersions) > 0 { - return nil, &NoRBACAPIError{fmt.Sprintf("%s\nUnknown RBAC API versions: %v", rbacAPINotAvailable, unknownVersions)} - } - - return nil, &NoRBACAPIError{rbacAPINotAvailable} -} - -// ClusterServiceAccountName returns the name of a service account -// whose credentials are used by the host cluster to access the -// client cluster. -func ClusterServiceAccountName(joiningClusterName, hostContext string) string { - return fmt.Sprintf("%s-%s", joiningClusterName, hostContext) -} - -// ClusterRoleName returns the name of a ClusterRole and its associated -// ClusterRoleBinding that are used to allow the service account to -// access necessary resources on the cluster. -func ClusterRoleName(federationName, serviceAccountName string) string { - return fmt.Sprintf("federation-controller-manager:%s-%s", federationName, serviceAccountName) -} diff --git a/federation/plugin/pkg/admission/schedulingpolicy/BUILD b/federation/plugin/pkg/admission/schedulingpolicy/BUILD deleted file mode 100644 index 58cd42e091..0000000000 --- a/federation/plugin/pkg/admission/schedulingpolicy/BUILD +++ /dev/null @@ -1,69 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_test( - name = "go_default_test", - srcs = [ - "admission_test.go", - "merge_test.go", - ], - importpath = "k8s.io/kubernetes/federation/plugin/pkg/admission/schedulingpolicy", - library = ":go_default_library", - deps = [ - "//pkg/api:go_default_library", - "//pkg/client/clientset_generated/internalclientset/fake:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1: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/apiserver/pkg/admission:go_default_library", - "//vendor/k8s.io/apiserver/pkg/authentication/user:go_default_library", - "//vendor/k8s.io/client-go/testing:go_default_library", - ], -) - -go_library( - name = "go_default_library", - srcs = [ - "admission.go", - "merge.go", - "query.go", - ], - importpath = "k8s.io/kubernetes/federation/plugin/pkg/admission/schedulingpolicy", - deps = [ - "//pkg/api:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//pkg/api/ref:go_default_library", - "//pkg/client/clientset_generated/internalclientset:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/meta: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/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/yaml:go_default_library", - "//vendor/k8s.io/apiserver/pkg/admission:go_default_library", - "//vendor/k8s.io/apiserver/pkg/util/webhook:go_default_library", - "//vendor/k8s.io/client-go/dynamic:go_default_library", - "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/plugin/pkg/admission/schedulingpolicy/admission.go b/federation/plugin/pkg/admission/schedulingpolicy/admission.go deleted file mode 100644 index 7b52468786..0000000000 --- a/federation/plugin/pkg/admission/schedulingpolicy/admission.go +++ /dev/null @@ -1,214 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package schedulingpolicy implements a webhook that queries an external API -// to obtain scheduling decisions for Federated sources. -package schedulingpolicy - -import ( - "fmt" - "io" - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/yaml" - "k8s.io/apiserver/pkg/admission" - "k8s.io/client-go/dynamic" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/api/ref" - "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" -) - -const ( - pluginName = "SchedulingPolicy" - configKey = "schedulingPolicy" - policyConfigMapNamespace = "kube-federation-scheduling-policy" - - // Default backoff delay for policy engine query retries. The actual - // backoff implementation is handled by k8s.io/apiserver/pkg/util/webhook. - // If the admission controller config file does not specify a backoff, this - // one is used. - defaultRetryBackoff = time.Millisecond * 100 -) - -type admissionConfig struct { - Kubeconfig string `json:"kubeconfig"` - RetryBackoff time.Duration `json:"retryBackoff"` -} - -type admissionController struct { - *admission.Handler - policyEngineClient *rest.RESTClient // client to communicate with policy engine - policyEngineRetryBackoff time.Duration // backoff for policy engine queries - client internalclientset.Interface // client to communicate with federation-apiserver -} - -// Register registers the plugin. -func Register(plugins *admission.Plugins) { - plugins.Register(pluginName, func(file io.Reader) (admission.Interface, error) { - return newAdmissionController(file) - }) -} - -func newAdmissionController(file io.Reader) (*admissionController, error) { - config, err := loadConfig(file) - if err != nil { - return nil, err - } - - policyEngineClient, err := loadRestClient(config.Kubeconfig) - if err != nil { - return nil, err - } - - c := &admissionController{ - Handler: admission.NewHandler(admission.Create, admission.Update), - policyEngineClient: policyEngineClient, - policyEngineRetryBackoff: config.RetryBackoff, - } - - return c, nil -} - -func (c *admissionController) Validate() error { - if c.client == nil { - return fmt.Errorf("%s requires a client", pluginName) - } - return nil -} - -func (c *admissionController) SetInternalKubeClientSet(client internalclientset.Interface) { - c.client = client -} - -func (c *admissionController) Admit(a admission.Attributes) (err error) { - exists, err := c.policyExists() - if err != nil { - return c.handleError(a, err) - } - - if !exists { - return nil - } - - obj := a.GetObject() - decision, err := newPolicyEngineQuery(c.policyEngineClient, c.policyEngineRetryBackoff, obj, a.GetKind()).Do() - - if err != nil { - return c.handleError(a, err) - } - - if err := decision.Error(); err != nil { - return c.handleError(a, err) - } - - mergeAnnotations(obj, decision.Annotations) - - return nil -} - -func (c *admissionController) handleError(a admission.Attributes, err error) error { - - c.publishEvent(a, err.Error()) - - return admission.NewForbidden(a, err) -} - -func (c *admissionController) publishEvent(a admission.Attributes, msg string) { - - obj := a.GetObject() - - ref, err := ref.GetReference(legacyscheme.Scheme, obj) - if err != nil { - runtime.HandleError(err) - return - } - - event := &api.Event{ - InvolvedObject: *ref, - Message: msg, - Source: api.EventSource{ - Component: fmt.Sprintf("schedulingpolicy"), - }, - Type: "Warning", - } - - if _, err := c.client.Core().Events(a.GetNamespace()).Create(event); err != nil { - runtime.HandleError(err) - return - } -} - -func (c *admissionController) policyExists() (bool, error) { - lst, err := c.client.Core().ConfigMaps(policyConfigMapNamespace).List(metav1.ListOptions{}) - if err != nil { - return true, err - } - return len(lst.Items) > 0, nil -} - -func loadConfig(file io.Reader) (*admissionConfig, error) { - var cfg admissionConfig - if file == nil { - return nil, fmt.Errorf("--admission-control-config-file not specified or invalid") - } - - if err := yaml.NewYAMLOrJSONDecoder(file, 4096).Decode(&cfg); err != nil { - return nil, err - } - - if len(cfg.Kubeconfig) == 0 { - return nil, fmt.Errorf("kubeconfig path must not be empty") - } - - if cfg.RetryBackoff == 0 { - cfg.RetryBackoff = defaultRetryBackoff - } else { - // Scale up value from config (which is unmarshalled as ns). - cfg.RetryBackoff *= time.Millisecond - } - - if cfg.RetryBackoff.Nanoseconds() < 0 { - return nil, fmt.Errorf("retryBackoff must not be negative") - } - - return &cfg, nil -} - -func loadRestClient(kubeConfigFile string) (*rest.RESTClient, error) { - - loadingRules := clientcmd.NewDefaultClientConfigLoadingRules() - loadingRules.ExplicitPath = kubeConfigFile - loader := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, &clientcmd.ConfigOverrides{}) - - clientConfig, err := loader.ClientConfig() - if err != nil { - return nil, err - } - - clientConfig.ContentConfig.NegotiatedSerializer = dynamic.ContentConfig().NegotiatedSerializer - - restClient, err := rest.UnversionedRESTClientFor(clientConfig) - if err != nil { - return nil, err - } - - return restClient, nil -} diff --git a/federation/plugin/pkg/admission/schedulingpolicy/admission_test.go b/federation/plugin/pkg/admission/schedulingpolicy/admission_test.go deleted file mode 100644 index 7871343328..0000000000 --- a/federation/plugin/pkg/admission/schedulingpolicy/admission_test.go +++ /dev/null @@ -1,474 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package schedulingpolicy - -import ( - "bytes" - "encoding/json" - "fmt" - "html/template" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "os" - "reflect" - "testing" - - extensionsv1 "k8s.io/api/extensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apiserver/pkg/admission" - "k8s.io/apiserver/pkg/authentication/user" - core "k8s.io/client-go/testing" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/fake" -) - -func TestNewAdmissionController(t *testing.T) { - tempfile, err := ioutil.TempFile("", "") - if err != nil { - t.Fatalf("Unexpected error while creating temporary file: %v", err) - } - p := tempfile.Name() - defer os.Remove(p) - - kubeconfig := ` -clusters: - - name: foo - cluster: - server: https://example.com -users: - - name: alice - user: - token: deadbeef -contexts: - - name: default - context: - cluster: foo - user: alice -current-context: default -` - - if _, err := tempfile.WriteString(kubeconfig); err != nil { - t.Fatalf("Unexpected error while writing test kubeconfig file: %v", err) - } - - tests := []struct { - note string - input string - wantErr bool - }{ - {"no config", "", true}, - {"bad json", `{"foo": `, true}, - {"bad yaml", `{foo" `, true}, - { - "missing kubeconfig", - `{"foo": {}}`, - true, - }, - { - "kubeconfig not found", - `{ - "kubeconfig": "/kube-federation-scheduling-policy-file-not-found-test" - }`, - true, - }, - { - "bad retry backoff", - fmt.Sprintf(` - { - "kubeconfig": %q, - "retryBackoff": -1 - } - `, p), - true, - }, - { - "a valid config", - fmt.Sprintf(` - { - "kubeconfig": %q - } - `, p), - false, - }, - { - "a valid config with retry backoff", - fmt.Sprintf(` - { - "kubeconfig": %q, - "retryBackoff": 200 - } - `, p), - false, - }, - } - - for _, tc := range tests { - var file io.Reader - if tc.input == "" { - file = nil - } else { - file = bytes.NewBufferString(tc.input) - } - - _, err := newAdmissionController(file) - - if tc.wantErr && err == nil { - t.Errorf("%v: Expected error", tc.note) - } else if !tc.wantErr && err != nil { - t.Errorf("%v: Unexpected error: %v", tc.note, err) - } - } -} - -func TestAdmitQueryPayload(t *testing.T) { - var body interface{} - - serve := func(w http.ResponseWriter, r *http.Request) { - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { - t.Fatalf("Unexpected error reading admission payload: %v", err) - } - - // No errors or annotations. - w.Write([]byte(`{}`)) - } - - controller, err := newControllerWithTestServer(serve, true) - if err != nil { - t.Fatalf("Unexpected error while creating test admission controller/server: %v", err) - } - - rs := makeReplicaSet() - rs.Spec.MinReadySeconds = 100 - attrs := makeAdmissionRecord(rs) - err = controller.Admit(attrs) - - if err != nil { - t.Fatalf("Unexpected error from admission controller: %v", err) - } - - obj := body.(map[string]interface{}) - metadata := obj["metadata"].(map[string]interface{}) - spec := obj["spec"].(map[string]interface{}) - name := metadata["name"].(string) - minReadySeconds := spec["minReadySeconds"].(float64) - - expectedName := "myapp" - if name != expectedName { - t.Fatalf("Expected replicaset.metadata.name to be %v but got: %v", expectedName, name) - } - - expectedMinReadySeconds := float64(100) - if minReadySeconds != expectedMinReadySeconds { - t.Fatalf("Expected replicaset.spec.minReadySeconds to be %v but got: %v", expectedMinReadySeconds, minReadySeconds) - } -} - -func TestAdmitFailInternal(t *testing.T) { - serve := func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(200) - } - - controller, err := newControllerWithTestServer(serve, false) - if err != nil { - t.Fatalf("Unexpected error while creating test admission controller/server: %v", err) - } - - mockClient := &fake.Clientset{} - mockClient.AddReactor("list", "configmaps", func(action core.Action) (bool, runtime.Object, error) { - return true, nil, fmt.Errorf("unknown error") - }) - - controller.SetInternalKubeClientSet(mockClient) - - attrs := makeAdmissionRecord(makeReplicaSet()) - err = controller.Admit(attrs) - - if err == nil { - t.Fatalf("Expected admission controller to fail closed") - } -} - -func TestAdmitPolicyDoesNotExist(t *testing.T) { - - controller, err := newControllerWithTestServer(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(404) - }, false) - if err != nil { - t.Fatalf("Unexpected error while creating test admission controller/server: %v", err) - } - - attrs := makeAdmissionRecord(makeReplicaSet()) - err = controller.Admit(attrs) - - if err != nil { - t.Fatalf("Expected admission controller to fail open but got error: %v", err) - } -} - -func TestAdmitFailClosed(t *testing.T) { - tests := []struct { - note string - statusCode int - body string - }{ - {"server error", 500, ""}, - {"unmarshal error", 200, "{"}, - {"undefined result", 404, ``}, - {"policy errors", 200, `{"errors": ["conflicting replica-set-preferences"]}`}, - } - - for _, tc := range tests { - - serve := func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(tc.statusCode) - if len(tc.body) > 0 { - w.Write([]byte(tc.body)) - } - } - - controller, err := newControllerWithTestServer(serve, true) - - if err != nil { - t.Errorf("%v: Unexpected error while creating test admission controller/server: %v", tc.note, err) - continue - } - - obj := makeReplicaSet() - attrs := admission.NewAttributesRecord(obj, nil, obj.GroupVersionKind(), obj.Namespace, obj.Name, api.Resource("replicasets").WithVersion("version"), "", admission.Create, &user.DefaultInfo{}) - err = controller.Admit(attrs) - if err == nil { - t.Errorf("%v: Expected admission controller to fail closed", tc.note) - } - - } -} - -func TestAdmitRetries(t *testing.T) { - var numQueries int - - controller, err := newControllerWithTestServer(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(500) - numQueries++ - }, true) - - if err != nil { - t.Fatalf("Unexpected error while creating test admission controller/server: %v", err) - } - - err = controller.Admit(makeAdmissionRecord(makeReplicaSet())) - - if err == nil { - t.Fatalf("Expected admission controller to fail closed") - } - - if numQueries <= 1 { - t.Fatalf("Expected multiple queries/retries but got (numQueries): %v", numQueries) - } -} - -func TestAdmitSuccessWithAnnotationMerge(t *testing.T) { - controller, err := newControllerWithTestServer(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(` - { - "annotations": { - "foo": "bar-2" - } - } - `)) - }, true) - if err != nil { - t.Fatalf("Unexpected error while creating test admission controller/server: %v", err) - } - - obj := makeReplicaSet() - obj.Annotations = map[string]string{} - obj.Annotations["foo"] = "bar" - obj.Annotations["bar"] = "baz" - - attrs := admission.NewAttributesRecord(obj, nil, obj.GroupVersionKind(), obj.Namespace, obj.Name, api.Resource("replicasets").WithVersion("version"), "", admission.Create, &user.DefaultInfo{}) - err = controller.Admit(attrs) - if err != nil { - t.Fatalf("Unexpected error from admission controller: %v", err) - } - - annotations := attrs.GetObject().(*extensionsv1.ReplicaSet).Annotations - expected := map[string]string{ - "foo": "bar-2", - "bar": "baz", - } - - if !reflect.DeepEqual(annotations, expected) { - t.Fatalf("Expected annotations to be %v but got: %v", expected, annotations) - } -} - -func newControllerWithTestServer(f func(w http.ResponseWriter, r *http.Request), policiesExist bool) (*admissionController, error) { - server, err := newTestServer(f) - if err != nil { - return nil, err - } - - kubeConfigFile, err := makeKubeConfigFile(server.URL, "/some/path/to/decision") - if err != nil { - return nil, err - } - - defer os.Remove(kubeConfigFile) - - configFile, err := makeAdmissionControlConfigFile(kubeConfigFile) - if err != nil { - return nil, err - } - - defer os.Remove(configFile) - - file, err := os.Open(configFile) - if err != nil { - return nil, err - } - defer file.Close() - - controller, err := newAdmissionController(file) - if err != nil { - return nil, err - } - - mockClient := &fake.Clientset{} - - var items []api.ConfigMap - - if policiesExist { - items = append(items, api.ConfigMap{}) - } - - mockClient.AddReactor("list", "configmaps", func(action core.Action) (bool, runtime.Object, error) { - if action.GetNamespace() == policyConfigMapNamespace { - return true, &api.ConfigMapList{Items: items}, nil - } - return true, nil, nil - }) - - controller.SetInternalKubeClientSet(mockClient) - - return controller, nil -} - -func newTestServer(f func(w http.ResponseWriter, r *http.Request)) (*httptest.Server, error) { - server := httptest.NewUnstartedServer(http.HandlerFunc(f)) - server.Start() - return server, nil -} - -func makeAdmissionControlConfigFile(kubeConfigFile string) (string, error) { - tempfile, err := ioutil.TempFile("", "") - if err != nil { - return "", err - } - - p := tempfile.Name() - - configFileTmpl := ` -kubeconfig: {{ .KubeConfigFile }} -retryBackoff: {{ .RetryBackoff }} -` - type configFileTemplateInput struct { - KubeConfigFile string - RetryBackoff int - } - - input := configFileTemplateInput{ - KubeConfigFile: kubeConfigFile, - RetryBackoff: 1, - } - - tmpl, err := template.New("scheduling-policy-config").Parse(configFileTmpl) - if err != nil { - return "", err - } - - if err := tmpl.Execute(tempfile, input); err != nil { - return "", err - } - - return p, nil -} - -func makeKubeConfigFile(baseURL, path string) (string, error) { - tempfile, err := ioutil.TempFile("", "") - if err != nil { - return "", err - } - - p := tempfile.Name() - - kubeConfigTmpl := ` -clusters: - - name: test - cluster: - server: {{ .BaseURL }}{{ .Path }} -users: - - name: alice - user: - token: deadbeef -contexts: - - name: default - context: - cluster: test - user: alice -current-context: default` - - type kubeConfigTemplateInput struct { - BaseURL string - Path string - } - - input := kubeConfigTemplateInput{ - BaseURL: baseURL, - Path: path, - } - - tmpl, err := template.New("kubeconfig").Parse(kubeConfigTmpl) - if err != nil { - return "", err - } - - if err := tmpl.Execute(tempfile, input); err != nil { - return "", err - } - - return p, nil -} - -func makeAdmissionRecord(obj *extensionsv1.ReplicaSet) admission.Attributes { - return admission.NewAttributesRecord(obj, nil, obj.GroupVersionKind(), obj.Namespace, obj.Name, api.Resource("replicasets").WithVersion("version"), "", admission.Create, &user.DefaultInfo{}) -} - -func makeReplicaSet() *extensionsv1.ReplicaSet { - return &extensionsv1.ReplicaSet{ - TypeMeta: metav1.TypeMeta{ - Kind: "ReplicaSet", - APIVersion: "extensions/v1beta1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "myapp", - }, - Spec: extensionsv1.ReplicaSetSpec{}, - } -} diff --git a/federation/plugin/pkg/admission/schedulingpolicy/merge.go b/federation/plugin/pkg/admission/schedulingpolicy/merge.go deleted file mode 100644 index 69c06e80b6..0000000000 --- a/federation/plugin/pkg/admission/schedulingpolicy/merge.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package schedulingpolicy - -import ( - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/runtime" -) - -// mergeAnnotations updates obj so that the provided annotations supersede the -// existing annotations. -func mergeAnnotations(obj runtime.Object, annotations map[string]string) error { - if len(annotations) == 0 { - return nil - } - - accessor, err := meta.Accessor(obj) - if err != nil { - return err - } - - orig := accessor.GetAnnotations() - for k := range orig { - if _, ok := annotations[k]; !ok { - annotations[k] = orig[k] - } - } - - accessor.SetAnnotations(annotations) - return nil -} diff --git a/federation/plugin/pkg/admission/schedulingpolicy/merge_test.go b/federation/plugin/pkg/admission/schedulingpolicy/merge_test.go deleted file mode 100644 index 55493978b5..0000000000 --- a/federation/plugin/pkg/admission/schedulingpolicy/merge_test.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package schedulingpolicy - -import ( - "encoding/json" - "reflect" - "testing" - - "k8s.io/api/core/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func TestMergeAnnotations(t *testing.T) { - tests := []struct { - note string - input *v1.Pod - annotations string - expected string - }{ - {"nil annotations", &v1.Pod{}, `{"foo": "bar"}`, `{"foo": "bar"}`}, - {"empty annotations", &v1.Pod{ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{}}}, `{"foo": "bar"}`, `{"foo": "bar"}`}, - {"existing annotation", &v1.Pod{ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{"foo": "baz"}}}, `{"foo": "bar"}`, `{"foo": "bar"}`}, - {"different annotation", &v1.Pod{ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{"baz": "qux"}}}, `{"foo": "bar"}`, `{"baz": "qux", "foo": "bar"}`}, - } - - for _, tc := range tests { - - annotations := map[string]string{} - - if err := json.Unmarshal([]byte(tc.annotations), &annotations); err != nil { - panic(err) - } - - expected := map[string]string{} - - if err := json.Unmarshal([]byte(tc.expected), &expected); err != nil { - panic(err) - } - - err := mergeAnnotations(tc.input, annotations) - if err != nil { - t.Errorf("Unexpected error: %v", err) - } - - if !reflect.DeepEqual(tc.input.ObjectMeta.Annotations, expected) { - t.Errorf("%v: Expected annotations to equal %v but got: %v", tc.note, expected, tc.input.ObjectMeta.Annotations) - } - } - -} diff --git a/federation/plugin/pkg/admission/schedulingpolicy/query.go b/federation/plugin/pkg/admission/schedulingpolicy/query.go deleted file mode 100644 index f0fb32c089..0000000000 --- a/federation/plugin/pkg/admission/schedulingpolicy/query.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package schedulingpolicy - -import ( - "bytes" - "encoding/json" - "fmt" - "strings" - "time" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apiserver/pkg/util/webhook" - "k8s.io/client-go/rest" - "k8s.io/kubernetes/pkg/api/legacyscheme" -) - -// policyUndefinedError represents an undefined response from the policy -// engine. This typically means the relevant policy has not been loaded into -// the engine. -type policyUndefinedError struct{} - -func (policyUndefinedError) Error() string { - return "policy decision is undefined" -} - -// policyEngineQuery represents a single query against the policy engine. -type policyEngineQuery struct { - client *rest.RESTClient - retryBackoff time.Duration - obj runtime.Object - gvk schema.GroupVersionKind -} - -// newPolicyEngineQuery returns a policyEngineQuery that can be executed. -func newPolicyEngineQuery(client *rest.RESTClient, retryBackoff time.Duration, obj runtime.Object, gvk schema.GroupVersionKind) *policyEngineQuery { - return &policyEngineQuery{ - client: client, - retryBackoff: retryBackoff, - obj: obj, - gvk: gvk, - } -} - -// Do returns the result of the policy engine query. If the policy decision is -// undefined or an unknown error occurs, err is non-nil. Otherwise, result is -// non-nil and contains the result of policy evaluation. -func (query *policyEngineQuery) Do() (decision *policyDecision, err error) { - - bs, err := query.encode() - if err != nil { - return nil, err - } - - var result rest.Result - - err = webhook.WithExponentialBackoff(query.retryBackoff, func() error { - result = query.client.Post(). - Body(bs). - Do() - return result.Error() - }) - - if err != nil { - if errors.IsNotFound(err) { - return nil, policyUndefinedError{} - } - return nil, err - } - - return decodeResult(result) -} - -// encode returns the encoded version of the query's runtime.Object. -func (query *policyEngineQuery) encode() ([]byte, error) { - - var info runtime.SerializerInfo - infos := legacyscheme.Codecs.SupportedMediaTypes() - - for i := range infos { - if infos[i].MediaType == "application/json" { - info = infos[i] - } - } - - if info.Serializer == nil { - return nil, fmt.Errorf("serialization not supported") - } - - codec := legacyscheme.Codecs.EncoderForVersion(info.Serializer, query.gvk.GroupVersion()) - - var buf bytes.Buffer - if err := codec.Encode(query.obj, &buf); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -// policyDecision represents a response from the policy engine. -type policyDecision struct { - Errors []string `json:"errors,omitempty"` - Annotations map[string]string `json:"annotations,omitempty"` -} - -// Error returns an error if the policy raised an error. -func (d *policyDecision) Error() error { - if len(d.Errors) == 0 { - return nil - } - return fmt.Errorf("reason(s): %v", strings.Join(d.Errors, "; ")) -} - -func decodeResult(result rest.Result) (*policyDecision, error) { - - bs, err := result.Raw() - if err != nil { - return nil, err - } - - buf := bytes.NewBuffer(bs) - var decision policyDecision - - if err := json.NewDecoder(buf).Decode(&decision); err != nil { - return nil, err - } - - return &decision, nil -} diff --git a/federation/registry/cluster/BUILD b/federation/registry/cluster/BUILD deleted file mode 100644 index d5bdbadb4f..0000000000 --- a/federation/registry/cluster/BUILD +++ /dev/null @@ -1,67 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = [ - "registry.go", - "strategy.go", - ], - importpath = "k8s.io/kubernetes/federation/registry/cluster", - deps = [ - "//federation/apis/federation:go_default_library", - "//federation/apis/federation/validation:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/fields:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", - "//vendor/k8s.io/apiserver/pkg/endpoints/request:go_default_library", - "//vendor/k8s.io/apiserver/pkg/registry/generic:go_default_library", - "//vendor/k8s.io/apiserver/pkg/registry/rest:go_default_library", - "//vendor/k8s.io/apiserver/pkg/storage:go_default_library", - "//vendor/k8s.io/apiserver/pkg/storage/names:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["strategy_test.go"], - importpath = "k8s.io/kubernetes/federation/registry/cluster", - library = ":go_default_library", - deps = [ - "//federation/apis/federation:go_default_library", - "//pkg/api:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//pkg/api/testapi:go_default_library", - "//pkg/api/testing:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/fields:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", - "//vendor/k8s.io/apiserver/pkg/endpoints/request:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/registry/cluster/etcd:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/registry/cluster/etcd/BUILD b/federation/registry/cluster/etcd/BUILD deleted file mode 100644 index 36c78f95e5..0000000000 --- a/federation/registry/cluster/etcd/BUILD +++ /dev/null @@ -1,53 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = ["etcd.go"], - importpath = "k8s.io/kubernetes/federation/registry/cluster/etcd", - deps = [ - "//federation/apis/federation:go_default_library", - "//federation/registry/cluster:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/apiserver/pkg/endpoints/request:go_default_library", - "//vendor/k8s.io/apiserver/pkg/registry/generic:go_default_library", - "//vendor/k8s.io/apiserver/pkg/registry/generic/registry:go_default_library", - "//vendor/k8s.io/apiserver/pkg/registry/rest:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["etcd_test.go"], - importpath = "k8s.io/kubernetes/federation/registry/cluster/etcd", - library = ":go_default_library", - deps = [ - "//federation/apis/federation:go_default_library", - "//pkg/api:go_default_library", - "//pkg/registry/registrytest:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/fields:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/apiserver/pkg/registry/generic:go_default_library", - "//vendor/k8s.io/apiserver/pkg/storage/etcd/testing:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/registry/cluster/etcd/etcd.go b/federation/registry/cluster/etcd/etcd.go deleted file mode 100644 index 082de25292..0000000000 --- a/federation/registry/cluster/etcd/etcd.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2016 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 etcd - -import ( - "k8s.io/apimachinery/pkg/runtime" - genericapirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/registry/generic" - genericregistry "k8s.io/apiserver/pkg/registry/generic/registry" - "k8s.io/apiserver/pkg/registry/rest" - "k8s.io/kubernetes/federation/apis/federation" - "k8s.io/kubernetes/federation/registry/cluster" -) - -type REST struct { - *genericregistry.Store -} - -type StatusREST struct { - store *genericregistry.Store -} - -func (r *StatusREST) New() runtime.Object { - return &federation.Cluster{} -} - -// Update alters the status subset of an object. -func (r *StatusREST) Update(ctx genericapirequest.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) { - return r.store.Update(ctx, name, objInfo) -} - -// NewREST returns a RESTStorage object that will work against clusters. -func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) { - store := &genericregistry.Store{ - NewFunc: func() runtime.Object { return &federation.Cluster{} }, - NewListFunc: func() runtime.Object { return &federation.ClusterList{} }, - PredicateFunc: cluster.MatchCluster, - DefaultQualifiedResource: federation.Resource("clusters"), - - CreateStrategy: cluster.Strategy, - UpdateStrategy: cluster.Strategy, - DeleteStrategy: cluster.Strategy, - ReturnDeletedObject: true, - } - options := &generic.StoreOptions{RESTOptions: optsGetter, AttrFunc: cluster.GetAttrs} - if err := store.CompleteWithOptions(options); err != nil { - panic(err) // TODO: Propagate error up - } - - statusStore := *store - statusStore.UpdateStrategy = cluster.StatusStrategy - - return &REST{store}, &StatusREST{store: &statusStore} -} diff --git a/federation/registry/cluster/etcd/etcd_test.go b/federation/registry/cluster/etcd/etcd_test.go deleted file mode 100644 index f263f3f9c3..0000000000 --- a/federation/registry/cluster/etcd/etcd_test.go +++ /dev/null @@ -1,146 +0,0 @@ -/* -Copyright 2016 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 etcd - -import ( - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apiserver/pkg/registry/generic" - etcdtesting "k8s.io/apiserver/pkg/storage/etcd/testing" - "k8s.io/kubernetes/federation/apis/federation" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/registry/registrytest" -) - -func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) { - storageConfig, server := registrytest.NewEtcdStorage(t, federation.GroupName) - restOptions := generic.RESTOptions{ - StorageConfig: storageConfig, - Decorator: generic.UndecoratedStorage, - DeleteCollectionWorkers: 1, - ResourcePrefix: "clusters", - } - storage, _ := NewREST(restOptions) - return storage, server -} - -func validNewCluster() *federation.Cluster { - return &federation.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - Labels: map[string]string{ - "name": "foo", - }, - }, - Spec: federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: "localhost:8888", - }, - }, - }, - Status: federation.ClusterStatus{ - Conditions: []federation.ClusterCondition{ - {Type: federation.ClusterReady, Status: api.ConditionFalse}, - }, - }, - } -} - -func TestCreate(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - test := registrytest.New(t, storage.Store).ClusterScope() - cluster := validNewCluster() - cluster.ObjectMeta = metav1.ObjectMeta{GenerateName: "foo"} - test.TestCreate( - cluster, - &federation.Cluster{ - ObjectMeta: metav1.ObjectMeta{Name: "-a123-a_"}, - }, - ) -} - -func TestUpdate(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - test := registrytest.New(t, storage.Store).ClusterScope() - test.TestUpdate( - // valid - validNewCluster(), - // updateFunc - func(obj runtime.Object) runtime.Object { - object := obj.(*federation.Cluster) - object.Spec.SecretRef = &api.LocalObjectReference{ - Name: "bar", - } - return object - }, - ) -} - -func TestDelete(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - test := registrytest.New(t, storage.Store).ClusterScope().ReturnDeletedObject() - test.TestDelete(validNewCluster()) -} - -func TestGet(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - test := registrytest.New(t, storage.Store).ClusterScope() - test.TestGet(validNewCluster()) -} - -func TestList(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - test := registrytest.New(t, storage.Store).ClusterScope() - test.TestList(validNewCluster()) -} - -func TestWatch(t *testing.T) { - storage, server := newStorage(t) - defer server.Terminate(t) - test := registrytest.New(t, storage.Store).ClusterScope() - test.TestWatch( - validNewCluster(), - // matching labels - []labels.Set{ - {"name": "foo"}, - }, - // not matching labels - []labels.Set{ - {"name": "bar"}, - {"foo": "bar"}, - }, - // matching fields - []fields.Set{ - {"metadata.name": "foo"}, - }, - // not matching fields - []fields.Set{ - {"metadata.name": "bar"}, - }, - ) -} diff --git a/federation/registry/cluster/registry.go b/federation/registry/cluster/registry.go deleted file mode 100644 index eca1cf7a18..0000000000 --- a/federation/registry/cluster/registry.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2016 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 cluster - -import ( - metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/watch" - genericapirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/registry/rest" - "k8s.io/kubernetes/federation/apis/federation" -) - -// Registry is an interface implemented by things that know how to store Cluster objects. -type Registry interface { - ListClusters(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*federation.ClusterList, error) - WatchCluster(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) - GetCluster(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*federation.Cluster, error) - CreateCluster(ctx genericapirequest.Context, cluster *federation.Cluster) error - UpdateCluster(ctx genericapirequest.Context, cluster *federation.Cluster) error - DeleteCluster(ctx genericapirequest.Context, name string) error -} - -// storage puts strong typing around storage calls -type storage struct { - rest.StandardStorage -} - -// NewRegistry returns a new Registry interface for the given Storage. Any mismatched -// types will panic. -func NewRegistry(s rest.StandardStorage) Registry { - return &storage{s} -} - -func (s *storage) ListClusters(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (*federation.ClusterList, error) { - obj, err := s.List(ctx, options) - if err != nil { - return nil, err - } - return obj.(*federation.ClusterList), nil -} - -func (s *storage) WatchCluster(ctx genericapirequest.Context, options *metainternalversion.ListOptions) (watch.Interface, error) { - return s.Watch(ctx, options) -} - -func (s *storage) GetCluster(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (*federation.Cluster, error) { - obj, err := s.Get(ctx, name, options) - if err != nil { - return nil, err - } - return obj.(*federation.Cluster), nil -} - -func (s *storage) CreateCluster(ctx genericapirequest.Context, cluster *federation.Cluster) error { - _, err := s.Create(ctx, cluster, false) - return err -} - -func (s *storage) UpdateCluster(ctx genericapirequest.Context, cluster *federation.Cluster) error { - _, _, err := s.Update(ctx, cluster.Name, rest.DefaultUpdatedObjectInfo(cluster)) - return err -} - -func (s *storage) DeleteCluster(ctx genericapirequest.Context, name string) error { - _, _, err := s.Delete(ctx, name, nil) - return err -} diff --git a/federation/registry/cluster/strategy.go b/federation/registry/cluster/strategy.go deleted file mode 100644 index eae24dd620..0000000000 --- a/federation/registry/cluster/strategy.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -Copyright 2016 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 cluster - -import ( - "fmt" - - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - genericapirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/apiserver/pkg/registry/generic" - apistorage "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/names" - "k8s.io/kubernetes/federation/apis/federation" - "k8s.io/kubernetes/federation/apis/federation/validation" - "k8s.io/kubernetes/pkg/api/legacyscheme" -) - -type clusterStrategy struct { - runtime.ObjectTyper - names.NameGenerator -} - -var Strategy = clusterStrategy{legacyscheme.Scheme, names.SimpleNameGenerator} - -func (clusterStrategy) NamespaceScoped() bool { - return false -} - -func ClusterToSelectableFields(cluster *federation.Cluster) fields.Set { - return generic.ObjectMetaFieldsSet(&cluster.ObjectMeta, false) -} - -// GetAttrs returns labels and fields of a given object for filtering purposes. -func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, bool, error) { - cluster, ok := obj.(*federation.Cluster) - if !ok { - return nil, nil, false, fmt.Errorf("given object is not a cluster.") - } - return labels.Set(cluster.ObjectMeta.Labels), ClusterToSelectableFields(cluster), cluster.Initializers != nil, nil -} - -func MatchCluster(label labels.Selector, field fields.Selector) apistorage.SelectionPredicate { - return apistorage.SelectionPredicate{ - Label: label, - Field: field, - GetAttrs: GetAttrs, - } -} - -// PrepareForCreate clears fields that are not allowed to be set by end users on creation. -func (clusterStrategy) PrepareForCreate(ctx genericapirequest.Context, obj runtime.Object) { - cluster := obj.(*federation.Cluster) - cluster.Status = federation.ClusterStatus{} -} - -// Validate validates a new cluster. -func (clusterStrategy) Validate(ctx genericapirequest.Context, obj runtime.Object) field.ErrorList { - cluster := obj.(*federation.Cluster) - return validation.ValidateCluster(cluster) -} - -// Canonicalize normalizes the object after validation. -func (clusterStrategy) Canonicalize(obj runtime.Object) { -} - -// AllowCreateOnUpdate is false for cluster. -func (clusterStrategy) AllowCreateOnUpdate() bool { - return false -} - -// PrepareForUpdate clears fields that are not allowed to be set by end users on update. -func (clusterStrategy) PrepareForUpdate(ctx genericapirequest.Context, obj, old runtime.Object) { - cluster := obj.(*federation.Cluster) - oldCluster := old.(*federation.Cluster) - cluster.Status = oldCluster.Status -} - -// ValidateUpdate is the default update validation for an end user. -func (clusterStrategy) ValidateUpdate(ctx genericapirequest.Context, obj, old runtime.Object) field.ErrorList { - return validation.ValidateClusterUpdate(obj.(*federation.Cluster), old.(*federation.Cluster)) -} -func (clusterStrategy) AllowUnconditionalUpdate() bool { - return true -} - -type clusterStatusStrategy struct { - clusterStrategy -} - -var StatusStrategy = clusterStatusStrategy{Strategy} - -func (clusterStatusStrategy) PrepareForCreate(ctx genericapirequest.Context, obj runtime.Object) { - _ = obj.(*federation.Cluster) -} -func (clusterStatusStrategy) PrepareForUpdate(ctx genericapirequest.Context, obj, old runtime.Object) { - cluster := obj.(*federation.Cluster) - oldCluster := old.(*federation.Cluster) - cluster.Spec = oldCluster.Spec -} - -// ValidateUpdate is the default update validation for an end user. -func (clusterStatusStrategy) ValidateUpdate(ctx genericapirequest.Context, obj, old runtime.Object) field.ErrorList { - return validation.ValidateClusterStatusUpdate(obj.(*federation.Cluster), old.(*federation.Cluster)) -} diff --git a/federation/registry/cluster/strategy_test.go b/federation/registry/cluster/strategy_test.go deleted file mode 100644 index 4da96f800b..0000000000 --- a/federation/registry/cluster/strategy_test.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright 2016 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 cluster - -import ( - "testing" - - "reflect" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - genericapirequest "k8s.io/apiserver/pkg/endpoints/request" - "k8s.io/kubernetes/federation/apis/federation" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/legacyscheme" - apitesting "k8s.io/kubernetes/pkg/api/testing" - - // install all api groups for testing - _ "k8s.io/kubernetes/pkg/api/testapi" -) - -func validNewCluster() *federation.Cluster { - return &federation.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - ResourceVersion: "4", - Labels: map[string]string{ - "name": "foo", - }, - }, - Spec: federation.ClusterSpec{ - ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: "localhost:8888", - }, - }, - }, - Status: federation.ClusterStatus{ - Conditions: []federation.ClusterCondition{ - {Type: federation.ClusterReady, Status: api.ConditionTrue}, - }, - }, - } -} - -func invalidNewCluster() *federation.Cluster { - // Create a cluster with empty ServerAddressByClientCIDRs (which is a required field). - return &federation.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo2", - ResourceVersion: "5", - }, - Status: federation.ClusterStatus{ - Conditions: []federation.ClusterCondition{ - {Type: federation.ClusterReady, Status: api.ConditionFalse}, - }, - }, - } -} - -func TestClusterStrategy(t *testing.T) { - ctx := genericapirequest.NewDefaultContext() - if Strategy.NamespaceScoped() { - t.Errorf("Cluster should not be namespace scoped") - } - if Strategy.AllowCreateOnUpdate() { - t.Errorf("Cluster should not allow create on update") - } - - cluster := validNewCluster() - Strategy.PrepareForCreate(ctx, cluster) - if len(cluster.Status.Conditions) != 0 { - t.Errorf("Cluster should not allow setting conditions on create") - } - errs := Strategy.Validate(ctx, cluster) - if len(errs) != 0 { - t.Errorf("Unexpected error validating %v", errs) - } - - invalidCluster := invalidNewCluster() - Strategy.PrepareForUpdate(ctx, invalidCluster, cluster) - if reflect.DeepEqual(invalidCluster.Spec, cluster.Spec) || - !reflect.DeepEqual(invalidCluster.Status, cluster.Status) { - t.Error("Only spec is expected being changed") - } - errs = Strategy.ValidateUpdate(ctx, invalidCluster, cluster) - if len(errs) == 0 { - t.Errorf("Expected a validation error") - } - if cluster.ResourceVersion != "4" { - t.Errorf("Incoming resource version on update should not be mutated") - } -} - -func TestClusterStatusStrategy(t *testing.T) { - ctx := genericapirequest.NewDefaultContext() - if StatusStrategy.NamespaceScoped() { - t.Errorf("Cluster should not be namespace scoped") - } - if StatusStrategy.AllowCreateOnUpdate() { - t.Errorf("Cluster should not allow create on update") - } - - cluster := validNewCluster() - invalidCluster := invalidNewCluster() - StatusStrategy.PrepareForUpdate(ctx, cluster, invalidCluster) - if !reflect.DeepEqual(invalidCluster.Spec, cluster.Spec) || - reflect.DeepEqual(invalidCluster.Status, cluster.Status) { - t.Logf("== cluster.Spec: %v\n", cluster.Spec) - t.Logf("== cluster.Status: %v\n", cluster.Status) - t.Logf("== invalidCluster.Spec: %v\n", cluster.Spec) - t.Logf("== invalidCluster.Spec: %v\n", cluster.Status) - t.Error("Only spec is expected being changed") - } - errs := Strategy.ValidateUpdate(ctx, invalidCluster, cluster) - if len(errs) == 0 { - t.Errorf("Expected a validation error") - } - if cluster.ResourceVersion != "4" { - t.Errorf("Incoming resource version on update should not be mutated") - } -} - -func TestMatchCluster(t *testing.T) { - testFieldMap := map[bool][]fields.Set{ - true: { - {"metadata.name": "foo"}, - }, - false: { - {"foo": "bar"}, - }, - } - - for expectedResult, fieldSet := range testFieldMap { - for _, field := range fieldSet { - m := MatchCluster(labels.Everything(), field.AsSelector()) - _, matchesSingle := m.MatchesSingle() - if e, a := expectedResult, matchesSingle; e != a { - t.Errorf("%+v: expected %v, got %v", fieldSet, e, a) - } - } - } -} - -func TestSelectableFieldLabelConversions(t *testing.T) { - apitesting.TestSelectableFieldLabelConversionsOfKind(t, - legacyscheme.Registry.GroupOrDie(federation.GroupName).GroupVersion.String(), - "Cluster", - ClusterToSelectableFields(&federation.Cluster{}), - nil, - ) -} diff --git a/federation/test/e2e/BUILD b/federation/test/e2e/BUILD deleted file mode 100644 index fc2ea68a05..0000000000 --- a/federation/test/e2e/BUILD +++ /dev/null @@ -1,70 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "apiserver.go", - "authn.go", - "crud.go", - "event.go", - "ingress.go", - "job.go", - "namespace.go", - "replicaset.go", - "service.go", - "upgrade.go", - "util.go", - ], - importpath = "k8s.io/kubernetes/federation/test/e2e", - deps = [ - "//federation/apis/federation:go_default_library", - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//federation/client/clientset_generated/federation_clientset/typed/core/v1:go_default_library", - "//federation/pkg/federatedtypes:go_default_library", - "//federation/pkg/federation-controller/util:go_default_library", - "//federation/test/e2e/framework:go_default_library", - "//federation/test/e2e/upgrades:go_default_library", - "//pkg/cloudprovider:go_default_library", - "//test/e2e/chaosmonkey:go_default_library", - "//test/e2e/common:go_default_library", - "//test/e2e/framework:go_default_library", - "//vendor/github.com/onsi/ginkgo:go_default_library", - "//vendor/github.com/onsi/gomega:go_default_library", - "//vendor/k8s.io/api/batch/v1:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/rand:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/uuid:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/k8s.io/apiserver/pkg/storage/names:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/test/e2e/framework:all-srcs", - "//federation/test/e2e/upgrades:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/test/e2e/OWNERS b/federation/test/e2e/OWNERS deleted file mode 100644 index b60580337e..0000000000 --- a/federation/test/e2e/OWNERS +++ /dev/null @@ -1,16 +0,0 @@ -reviewers: - - colhom - - csbell - - irfanurrehman - - madhusudancs - - mwielgus - - nikhiljindal - - quinton-hoole - - shashidharatd -approvers: - - csbell - - madhusudancs - - mwielgus - - nikhiljindal - - quinton-hoole - - shashidharatd diff --git a/federation/test/e2e/README.md b/federation/test/e2e/README.md deleted file mode 100644 index ff69219ac5..0000000000 --- a/federation/test/e2e/README.md +++ /dev/null @@ -1 +0,0 @@ -See [e2e-tests](https://git.k8s.io/community/contributors/devel/e2e-tests.md#federation-e2e-tests) diff --git a/federation/test/e2e/apiserver.go b/federation/test/e2e/apiserver.go deleted file mode 100644 index f46a34de3a..0000000000 --- a/federation/test/e2e/apiserver.go +++ /dev/null @@ -1,122 +0,0 @@ -/* -Copyright 2015 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 e2e - -import ( - "fmt" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - fedframework "k8s.io/kubernetes/federation/test/e2e/framework" - "k8s.io/kubernetes/test/e2e/framework" -) - -// Create/delete cluster api objects -var _ = framework.KubeDescribe("Federation apiserver [Feature:Federation]", func() { - f := fedframework.NewDefaultFederatedFramework("federation-cluster") - testClusterPrefix := "test" - - Describe("Cluster objects [Serial]", func() { - AfterEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - // Delete registered clusters. - // This is if a test failed, it should not affect other tests. - clusterList, err := f.FederationClientset.Federation().Clusters().List(metav1.ListOptions{LabelSelector: "prefix=" + testClusterPrefix}) - Expect(err).NotTo(HaveOccurred()) - for _, cluster := range clusterList.Items { - err := f.FederationClientset.Federation().Clusters().Delete(cluster.Name, &metav1.DeleteOptions{}) - Expect(err).NotTo(HaveOccurred()) - } - }) - - It("should be created and deleted successfully", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - contexts := f.GetUnderlyingFederatedContexts() - - By(fmt.Sprintf("Creating %d cluster objects", len(contexts))) - for _, context := range contexts { - createClusterObjectOrFail(f, &context, testClusterPrefix) - } - - By(fmt.Sprintf("Checking that %d clusters are ready", len(contexts))) - for _, context := range contexts { - fedframework.ClusterIsReadyOrFail(f, context.Name) - } - framework.Logf("%d clusters are Ready", len(contexts)) - - // Verify that deletion works. - framework.Logf("Deleting %d clusters", len(contexts)) - for _, context := range contexts { - clusterName := testClusterPrefix + context.Name - framework.Logf("Deleting cluster object: %s (%s, secret: %s)", clusterName, context.Cluster.Cluster.Server, context.Name) - err := f.FederationClientset.Federation().Clusters().Delete(clusterName, &metav1.DeleteOptions{}) - framework.ExpectNoError(err, fmt.Sprintf("unexpected error in deleting cluster %s: %+v", clusterName, err)) - framework.Logf("Successfully deleted cluster object: %s (%s, secret: %s)", clusterName, context.Cluster.Cluster.Server, context.Name) - } - - // There should not be any remaining cluster. - framework.Logf("Verifying that zero test clusters remain") - clusterList, err := f.FederationClientset.Federation().Clusters().List(metav1.ListOptions{LabelSelector: "prefix=" + testClusterPrefix}) - Expect(err).NotTo(HaveOccurred()) - if len(clusterList.Items) != 0 { - framework.Failf("there should not have been any remaining clusters. Found: %+v", clusterList) - } - framework.Logf("Verified that zero clusters remain") - }) - }) - - Describe("Admission control [NoCluster]", func() { - AfterEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - }) - - It("should not be able to create resources if namespace does not exist", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - // Creating a service in a non-existing namespace should fail. - svcNamespace := "federation-admission-test-ns" - svcName := "myns" - clientset := f.FederationClientset - framework.Logf("Trying to create service %s in namespace %s, expect to get error", svcName, svcNamespace) - if _, err := clientset.Core().Services(svcNamespace).Create(newService(svcName, svcNamespace)); err == nil { - framework.Failf("Expected to get an error while creating a service in a non-existing namespace") - } - - // Note: We have other tests that verify that we can create resources in existing namespaces, so we dont test it again here. - }) - }) -}) - -func newService(name, namespace string) *v1.Service { - return &v1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - }, - Spec: v1.ServiceSpec{ - Ports: []v1.ServicePort{ - { - Port: 80, - }, - }, - }, - } -} diff --git a/federation/test/e2e/authn.go b/federation/test/e2e/authn.go deleted file mode 100644 index bf8f94dbbd..0000000000 --- a/federation/test/e2e/authn.go +++ /dev/null @@ -1,207 +0,0 @@ -/* -Copyright 2016 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 e2e - -import ( - "fmt" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - fedframework "k8s.io/kubernetes/federation/test/e2e/framework" - "k8s.io/kubernetes/test/e2e/framework" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -// TODO: These tests should be integration tests rather than e2e tests, when the -// integration test harness is ready. -var _ = framework.KubeDescribe("[Feature:Federation]", func() { - f := fedframework.NewDefaultFederatedFramework("federation-apiserver-authn") - - var _ = Describe("Federation API server authentication [NoCluster]", func() { - BeforeEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - }) - - It("should accept cluster resources when the client has certificate authentication credentials", func() { - fcs, err := federationClientSetWithCert() - framework.ExpectNoError(err) - - nsName := f.FederationNamespace.Name - svc := createServiceOrFail(fcs, nsName, FederatedServiceName) - deleteServiceOrFail(f.FederationClientset, nsName, svc.Name, nil) - }) - - It("should accept cluster resources when the client has HTTP Basic authentication credentials", func() { - fcs, err := federationClientSetWithBasicAuth(true /* valid */) - framework.ExpectNoError(err) - - nsName := f.FederationNamespace.Name - svc, err := createService(fcs, nsName, FederatedServiceName) - Expect(err).NotTo(HaveOccurred()) - deleteServiceOrFail(fcs, nsName, svc.Name, nil) - }) - - It("should accept cluster resources when the client has token authentication credentials", func() { - fcs, err := federationClientSetWithToken(true /* valid */) - framework.ExpectNoError(err) - - nsName := f.FederationNamespace.Name - svc, err := createService(fcs, nsName, FederatedServiceName) - Expect(err).NotTo(HaveOccurred()) - deleteServiceOrFail(fcs, nsName, svc.Name, nil) - }) - - It("should not accept cluster resources when the client has no authentication credentials", func() { - fcs, err := unauthenticatedFederationClientSet() - framework.ExpectNoError(err) - - nsName := f.FederationNamespace.Name - _, err = createService(fcs, nsName, FederatedServiceName) - Expect(errors.IsUnauthorized(err)).To(BeTrue()) - }) - - // TODO: Add a test for invalid certificate credentials. The certificate is validated for - // correct format, so it cannot contain random noise. - - It("should not accept cluster resources when the client has invalid HTTP Basic authentication credentials", func() { - fcs, err := federationClientSetWithBasicAuth(false /* invalid */) - framework.ExpectNoError(err) - - nsName := f.FederationNamespace.Name - _, err = createService(fcs, nsName, FederatedServiceName) - Expect(errors.IsUnauthorized(err)).To(BeTrue()) - }) - - It("should not accept cluster resources when the client has invalid token authentication credentials", func() { - fcs, err := federationClientSetWithToken(false /* invalid */) - framework.ExpectNoError(err) - - nsName := f.FederationNamespace.Name - _, err = createService(fcs, nsName, FederatedServiceName) - Expect(errors.IsUnauthorized(err)).To(BeTrue()) - }) - - }) -}) - -// unauthenticatedFederationClientSet returns a Federation Clientset configured with -// no authentication credentials. -func unauthenticatedFederationClientSet() (*federation_clientset.Clientset, error) { - config, err := fedframework.LoadFederatedConfig(&clientcmd.ConfigOverrides{}) - if err != nil { - return nil, err - } - config.Insecure = true - config.CAData = []byte{} - config.CertData = []byte{} - config.KeyData = []byte{} - config.BearerToken = "" - - c, err := federation_clientset.NewForConfig(config) - if err != nil { - return nil, fmt.Errorf("error creating federation clientset: %v", err) - } - - return c, nil -} - -// federationClientSetWithCert returns a Federation Clientset configured with -// certificate authentication credentials. -func federationClientSetWithCert() (*federation_clientset.Clientset, error) { - config, err := fedframework.LoadFederatedConfig(&clientcmd.ConfigOverrides{}) - if err != nil { - return nil, err - } - - config.BearerToken = "" - - c, err := federation_clientset.NewForConfig(config) - if err != nil { - return nil, fmt.Errorf("error creating federation clientset: %v", err) - } - - return c, nil -} - -// federationClientSetWithBasicAuth returns a Federation Clientset configured with -// HTTP Basic authentication credentials. -func federationClientSetWithBasicAuth(valid bool) (*federation_clientset.Clientset, error) { - config, err := fedframework.LoadFederatedConfig(&clientcmd.ConfigOverrides{}) - if err != nil { - return nil, err - } - - config.Insecure = true - config.CAData = []byte{} - config.CertData = []byte{} - config.KeyData = []byte{} - config.BearerToken = "" - - if !valid { - config.Username = "" - config.Password = "" - } else { - // This is a hacky approach to getting the basic auth credentials, but since - // the token and the username/password cannot live in the same AuthInfo object, - // and because we do not want to store basic auth credentials with token and - // certificate credentials for security reasons, we must dig it out by hand. - c, err := framework.RestclientConfig(framework.TestContext.FederatedKubeContext) - if err != nil { - return nil, err - } - if authInfo, ok := c.AuthInfos[fmt.Sprintf("%s-basic-auth", framework.TestContext.FederatedKubeContext)]; ok { - config.Username = authInfo.Username - config.Password = authInfo.Password - } - } - - c, err := federation_clientset.NewForConfig(config) - if err != nil { - return nil, fmt.Errorf("error creating federation clientset: %v", err) - } - - return c, nil -} - -// federationClientSetWithToken returns a Federation Clientset configured with -// token authentication credentials. -func federationClientSetWithToken(valid bool) (*federation_clientset.Clientset, error) { - config, err := fedframework.LoadFederatedConfig(&clientcmd.ConfigOverrides{}) - if err != nil { - return nil, err - } - config.Insecure = true - config.CAData = []byte{} - config.CertData = []byte{} - config.KeyData = []byte{} - config.Username = "" - config.Password = "" - - if !valid { - config.BearerToken = "invalid" - } - - c, err := federation_clientset.NewForConfig(config) - if err != nil { - return nil, fmt.Errorf("error creating federation clientset: %v", err) - } - - return c, nil -} diff --git a/federation/test/e2e/crud.go b/federation/test/e2e/crud.go deleted file mode 100644 index a7b3a94b4d..0000000000 --- a/federation/test/e2e/crud.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package e2e - -import ( - "fmt" - - . "github.com/onsi/ginkgo" - - kubeclientset "k8s.io/client-go/kubernetes" - "k8s.io/kubernetes/federation/pkg/federatedtypes" - fedframework "k8s.io/kubernetes/federation/test/e2e/framework" - "k8s.io/kubernetes/test/e2e/framework" -) - -var _ = framework.KubeDescribe("Federated types [Feature:Federation][Experimental] ", func() { - var clusterClients []kubeclientset.Interface - - f := fedframework.NewDefaultFederatedFramework("federated-types") - - fedTypes := federatedtypes.FederatedTypes() - for name := range fedTypes { - fedType := fedTypes[name] - Describe(fmt.Sprintf("Federated %q resources", name), func() { - It("should be created, read, updated and deleted successfully", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - // Load clients only if not skipping to avoid doing - // unnecessary work. Assume clients can be shared - // across tests. - if clusterClients == nil { - clusterClients = f.GetClusterClients() - } - adapter := fedType.AdapterFactory(f.FederationClientset, f.FederationConfig, nil) - crudTester := fedframework.NewFederatedTypeCRUDTester(adapter, clusterClients) - obj := adapter.NewTestObject(f.FederationNamespace.Name) - crudTester.CheckLifecycle(obj) - }) - }) - } -}) diff --git a/federation/test/e2e/event.go b/federation/test/e2e/event.go deleted file mode 100644 index 00328c5b71..0000000000 --- a/federation/test/e2e/event.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright 2016 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 e2e - -import ( - "fmt" - - . "github.com/onsi/ginkgo" - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - fedframework "k8s.io/kubernetes/federation/test/e2e/framework" - "k8s.io/kubernetes/test/e2e/framework" - - . "github.com/onsi/gomega" -) - -const ( - FederationEventName = "federation-event" -) - -// Create/delete event api objects. -var _ = framework.KubeDescribe("Federation events [Feature:Federation]", func() { - f := fedframework.NewDefaultFederatedFramework("federation-event") - - Describe("Event objects [NoCluster]", func() { - AfterEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - nsName := f.FederationNamespace.Name - // Delete registered events. - eventList, err := f.FederationClientset.Core().Events(nsName).List(metav1.ListOptions{}) - Expect(err).NotTo(HaveOccurred()) - for _, event := range eventList.Items { - err := f.FederationClientset.Core().Events(nsName).Delete(event.Name, &metav1.DeleteOptions{}) - Expect(err).NotTo(HaveOccurred()) - } - }) - - It("should be created and deleted successfully", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - nsName := f.FederationNamespace.Name - event := createEventOrFail(f.FederationClientset, nsName) - By(fmt.Sprintf("Creation of event %q in namespace %q succeeded. Deleting event.", event.Name, nsName)) - // Cleanup - err := f.FederationClientset.Core().Events(nsName).Delete(event.Name, &metav1.DeleteOptions{}) - framework.ExpectNoError(err, "Error deleting event %q in namespace %q", event.Name, event.Namespace) - By(fmt.Sprintf("Deletion of event %q in namespace %q succeeded.", event.Name, nsName)) - }) - - }) -}) - -func createEventOrFail(clientset *federation_clientset.Clientset, namespace string) *v1.Event { - if clientset == nil || len(namespace) == 0 { - Fail(fmt.Sprintf("Internal error: invalid parameters passed to createEventOrFail: clientset: %v, namespace: %v", clientset, namespace)) - } - By(fmt.Sprintf("Creating federated event %q in namespace %q", FederationEventName, namespace)) - - event := &v1.Event{ - ObjectMeta: metav1.ObjectMeta{ - Name: FederationEventName, - Namespace: namespace, - }, - InvolvedObject: v1.ObjectReference{ - Kind: "Pod", - Name: "pod-name", - Namespace: namespace, - UID: "C934D34AFB20242", - APIVersion: "version", - }, - Source: v1.EventSource{ - Component: "kubelet", - Host: "kublet.node1", - }, - Count: 1, - Type: v1.EventTypeNormal, - } - - _, err := clientset.Core().Events(namespace).Create(event) - framework.ExpectNoError(err, "Creating event %q in namespace %q", event.Name, namespace) - By(fmt.Sprintf("Successfully created federated event %q in namespace %q", FederationEventName, namespace)) - return event -} diff --git a/federation/test/e2e/framework/BUILD b/federation/test/e2e/framework/BUILD deleted file mode 100644 index 88e6547e4c..0000000000 --- a/federation/test/e2e/framework/BUILD +++ /dev/null @@ -1,51 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "cluster.go", - "crudtester.go", - "framework.go", - "util.go", - ], - importpath = "k8s.io/kubernetes/federation/test/e2e/framework", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//federation/pkg/federatedtypes:go_default_library", - "//federation/pkg/federatedtypes/crudtester:go_default_library", - "//federation/pkg/federation-controller/util:go_default_library", - "//pkg/api/legacyscheme:go_default_library", - "//pkg/api/validation:go_default_library", - "//test/e2e/framework:go_default_library", - "//vendor/github.com/onsi/ginkgo:go_default_library", - "//vendor/github.com/onsi/gomega:go_default_library", - "//vendor/gopkg.in/yaml.v2:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/validation:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/test/e2e/framework/cluster.go b/federation/test/e2e/framework/cluster.go deleted file mode 100644 index 8d879a2c24..0000000000 --- a/federation/test/e2e/framework/cluster.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package framework - -import ( - "fmt" - "strings" - "time" - - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" - kubeclientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - "k8s.io/kubernetes/federation/pkg/federation-controller/util" - "k8s.io/kubernetes/test/e2e/framework" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -const federatedClustersWaitTimeout = 1 * time.Minute - -// ClusterSlice is a slice of clusters -type ClusterSlice []*Cluster - -// Cluster keeps track of the name and client of a cluster in the federation -type Cluster struct { - Name string - *kubeclientset.Clientset -} - -// registeredClustersFromConfig configures clientsets for registered clusters from the e2e kubeconfig -func registeredClustersFromConfig(f *Framework) ClusterSlice { - contexts := f.GetUnderlyingFederatedContexts() - - By("Obtaining a list of all the clusters") - clusterList := waitForAllRegisteredClusters(f, len(contexts)) - - framework.Logf("Checking that %d clusters are Ready", len(contexts)) - for _, context := range contexts { - ClusterIsReadyOrFail(f, context.Name) - - } - framework.Logf("%d clusters are Ready", len(contexts)) - - clusters := ClusterSlice{} - for i, c := range clusterList.Items { - framework.Logf("Creating a clientset for the cluster %s", c.Name) - Expect(framework.TestContext.KubeConfig).ToNot(Equal(""), "KubeConfig must be specified to load clusters' client config") - config := restConfigFromContext(c, i) - clusters = append(clusters, &Cluster{ - Name: c.Name, - Clientset: clientsetFromConfig(f, config, c.Spec.ServerAddressByClientCIDRs[0].ServerAddress), - }) - - } - waitForNamespaceInFederatedClusters(clusters, f.FederationNamespace.Name) - return clusters -} - -// waitForAllRegisteredClusters waits for all clusters defined in e2e context to be created -// return ClusterList until the listed cluster items equals clusterCount -func waitForAllRegisteredClusters(f *Framework, clusterCount int) *federationapi.ClusterList { - var clusterList *federationapi.ClusterList - if err := wait.PollImmediate(framework.Poll, federatedClustersWaitTimeout, func() (bool, error) { - var err error - clusterList, err = f.FederationClientset.Federation().Clusters().List(metav1.ListOptions{}) - if err != nil { - return false, err - } - framework.Logf("%d clusters registered, waiting for %d", len(clusterList.Items), clusterCount) - if len(clusterList.Items) == clusterCount { - return true, nil - } - return false, nil - }); err != nil { - framework.Failf("Failed to list registered clusters: %+v", err) - } - return clusterList -} - -func restConfigFromContext(c federationapi.Cluster, i int) *restclient.Config { - kubecfg, err := clientcmd.LoadFromFile(framework.TestContext.KubeConfig) - framework.ExpectNoError(err, "error loading KubeConfig: %v", err) - - ccfg := clientcmd.NewNonInteractiveClientConfig(*kubecfg, c.Name, &clientcmd.ConfigOverrides{}, clientcmd.NewDefaultClientConfigLoadingRules()) - cfg, err := ccfg.ClientConfig() - framework.ExpectNoError(err, "Error creating client config in cluster #%d (%q)", i, c.Name) - return cfg -} - -func clientsetFromConfig(f *Framework, cfg *restclient.Config, host string) *kubeclientset.Clientset { - cfg.Host = host - cfg.QPS = f.Framework.Options.ClientQPS - cfg.Burst = f.Framework.Options.ClientBurst - return kubeclientset.NewForConfigOrDie(restclient.AddUserAgent(cfg, "federation-e2e")) -} - -// waitForNamespaceInFederatedClusters waits for the federated namespace to be created in federated clusters -func waitForNamespaceInFederatedClusters(clusters ClusterSlice, nsName string) { - for _, c := range clusters { - name := c.Name - By(fmt.Sprintf("Waiting for namespace %q to be created in cluster %q", nsName, name)) - err := wait.PollImmediate(framework.Poll, FederatedDefaultTestTimeout, func() (bool, error) { - _, err := c.Clientset.CoreV1().Namespaces().Get(nsName, metav1.GetOptions{}) - if errors.IsNotFound(err) { - return false, nil - } else if err != nil { - framework.Logf("An error occurred waiting for namespace %q to be created in cluster %q: %v", nsName, name, err) - return false, nil - } - By(fmt.Sprintf("Namespace %q exists in cluster %q", nsName, name)) - return true, nil - }) - framework.ExpectNoError(err, "Failed to verify federated namespace %q creation in cluster %q", nsName, name) - } -} - -// ClusterIsReadyOrFail checks whether the named cluster is ready -func ClusterIsReadyOrFail(f *Framework, clusterName string) { - By(fmt.Sprintf("Checking readiness of cluster %q", clusterName)) - err := wait.PollImmediate(framework.Poll, FederatedDefaultTestTimeout, func() (bool, error) { - c, err := f.FederationClientset.Federation().Clusters().Get(clusterName, metav1.GetOptions{}) - if err != nil { - return false, err - } - for _, condition := range c.Status.Conditions { - if condition.Type == federationapi.ClusterReady && condition.Status == v1.ConditionTrue { - return true, nil - } - } - return false, nil - }) - framework.ExpectNoError(err, fmt.Sprintf("Unexpected error in verifying if cluster %q is ready: %+v", clusterName, err)) - framework.Logf("Cluster %s is Ready", clusterName) -} - -// Cache the cluster config to avoid having to retrieve it for each test -type clusterConfig struct { - name string - host string - config []byte -} - -var cachedClusterConfigs []*clusterConfig - -// registeredClustersFromSecrets configures clientsets for cluster access from secrets in the host cluster -func registeredClustersFromSecrets(f *Framework) ClusterSlice { - if cachedClusterConfigs == nil { - cachedClusterConfigs = clusterConfigFromSecrets(f) - } - - clusters := ClusterSlice{} - for _, clusterConf := range cachedClusterConfigs { - restConfig := restConfigForCluster(clusterConf) - clientset := clientsetFromConfig(f, restConfig, clusterConf.host) - clusters = append(clusters, &Cluster{ - Name: clusterConf.name, - Clientset: clientset, - }) - } - - waitForNamespaceInFederatedClusters(clusters, f.FederationNamespace.Name) - - return clusters -} - -// clusterConfigFromSecrets retrieves cluster configuration from -// secrets in the host cluster -func clusterConfigFromSecrets(f *Framework) []*clusterConfig { - By("Obtaining a list of registered clusters") - clusterList, err := f.FederationClientset.Federation().Clusters().List(metav1.ListOptions{}) - framework.ExpectNoError(err, fmt.Sprintf("Error retrieving list of federated clusters: %+v", err)) - if len(clusterList.Items) == 0 { - framework.Failf("No registered clusters found") - } - - clusterConfigs := []*clusterConfig{} - for _, c := range clusterList.Items { - ClusterIsReadyOrFail(f, c.Name) - config := clusterConfigFromSecret(f, c.Name, c.Spec.SecretRef.Name) - clusterConfigs = append(clusterConfigs, &clusterConfig{ - name: c.Name, - host: c.Spec.ServerAddressByClientCIDRs[0].ServerAddress, - config: config, - }) - } - - return clusterConfigs -} - -// clusterConfigFromSecret retrieves configuration for a accessing a -// cluster from a secret in the host cluster -func clusterConfigFromSecret(f *Framework, clusterName string, secretName string) []byte { - By(fmt.Sprintf("Loading configuration for cluster %q", clusterName)) - namespace := framework.FederationSystemNamespace() - secret, err := f.Framework.ClientSet.Core().Secrets(namespace).Get(secretName, metav1.GetOptions{}) - framework.ExpectNoError(err, fmt.Sprintf("Error loading config secret \"%s/%s\" for cluster %q: %+v", namespace, secretName, clusterName, err)) - - config, ok := secret.Data[util.KubeconfigSecretDataKey] - if !ok || len(config) == 0 { - framework.Failf("Secret \"%s/%s\" for cluster %q has no value for key %q", namespace, secretName, clusterName, util.KubeconfigSecretDataKey) - } - - return config -} - -// restConfigForCluster creates a rest client config for the given cluster config -func restConfigForCluster(clusterConf *clusterConfig) *restclient.Config { - cfg, err := clientcmd.Load(clusterConf.config) - framework.ExpectNoError(err, fmt.Sprintf("Error loading configuration for cluster %q: %+v", clusterConf.name, err)) - - restConfig, err := clientcmd.NewDefaultClientConfig(*cfg, &clientcmd.ConfigOverrides{}).ClientConfig() - framework.ExpectNoError(err, fmt.Sprintf("Error creating client for cluster %q: %+v", clusterConf.name, err)) - return restConfig -} - -func GetZoneFromClusterName(clusterName string) string { - // Ref: https://github.com/kubernetes/kubernetes/blob/master/cluster/kube-util.sh#L55 - prefix := "federation-e2e-" + framework.TestContext.Provider + "-" - return strings.TrimPrefix(clusterName, prefix) -} diff --git a/federation/test/e2e/framework/crudtester.go b/federation/test/e2e/framework/crudtester.go deleted file mode 100644 index 0512f6354c..0000000000 --- a/federation/test/e2e/framework/crudtester.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package framework - -import ( - . "github.com/onsi/ginkgo" - kubeclientset "k8s.io/client-go/kubernetes" - "k8s.io/kubernetes/federation/pkg/federatedtypes" - "k8s.io/kubernetes/federation/pkg/federatedtypes/crudtester" - "k8s.io/kubernetes/test/e2e/framework" -) - -// Adapt the methods to log/fail in e2e to the interface expected by CRUDHelper -type e2eTestLogger struct{} - -func (e2eTestLogger) Fatal(msg string) { - Fail(msg) -} - -func (e2eTestLogger) Fatalf(format string, args ...interface{}) { - framework.Failf(format, args...) -} - -func (e2eTestLogger) Logf(format string, args ...interface{}) { - framework.Logf(format, args...) -} - -func NewFederatedTypeCRUDTester(adapter federatedtypes.FederatedTypeAdapter, clusterClients []kubeclientset.Interface) *crudtester.FederatedTypeCRUDTester { - return crudtester.NewFederatedTypeCRUDTester(&e2eTestLogger{}, adapter, clusterClients, framework.Poll, FederatedDefaultTestTimeout) -} diff --git a/federation/test/e2e/framework/framework.go b/federation/test/e2e/framework/framework.go deleted file mode 100644 index 1ddc3a7a55..0000000000 --- a/federation/test/e2e/framework/framework.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright 2015 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 framework - -import ( - "fmt" - "io/ioutil" - "strings" - "time" - - "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" - kubeclientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/test/e2e/framework" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - yaml "gopkg.in/yaml.v2" -) - -// Framework extends e2e Framework and adds federation specific fields -type Framework struct { - *framework.Framework - - // To make sure that this framework cleans up after itself, no matter what, - // we install a Cleanup action before each test and clear it after. If we - // should abort, the AfterSuite hook should run all Cleanup actions. - cleanupHandle framework.CleanupActionHandle - - FederationConfig *restclient.Config - - FederationClientset *federation_clientset.Clientset - - FederationNamespace *v1.Namespace -} - -func NewDefaultFederatedFramework(baseName string) *Framework { - f := &Framework{} - - // Register the federation cleanup before initializing the default - // e2e framework to ensure it gets called before the default - // framework's cleanup. - AfterEach(f.FederationAfterEach) - - f.Framework = framework.NewDefaultFramework(baseName) - f.Framework.SkipNamespaceCreation = true - - // Register the federation setup after initializing the default - // e2e framework to ensure it gets called after the default - // framework's setup. - BeforeEach(f.FederationBeforeEach) - - return f -} - -// FederationBeforeEach checks for federation apiserver is ready and makes a namespace. -func (f *Framework) FederationBeforeEach() { - // The fact that we need this feels like a bug in ginkgo. - // https://github.com/onsi/ginkgo/issues/222 - f.cleanupHandle = framework.AddCleanupAction(f.FederationAfterEach) - - if f.FederationConfig == nil { - By("Reading the federation configuration") - var err error - f.FederationConfig, err = LoadFederatedConfig(&clientcmd.ConfigOverrides{}) - Expect(err).NotTo(HaveOccurred()) - } - if f.FederationClientset == nil { - By("Creating a release 1.5 federation Clientset") - var err error - f.FederationClientset, err = LoadFederationClientset(f.FederationConfig) - Expect(err).NotTo(HaveOccurred()) - } - By("Waiting for federation-apiserver to be ready") - err := WaitForFederationApiserverReady(f.FederationClientset) - Expect(err).NotTo(HaveOccurred()) - By("federation-apiserver is ready") - - By("Creating a federation namespace") - ns, err := f.createFederationNamespace(f.BaseName) - Expect(err).NotTo(HaveOccurred()) - f.FederationNamespace = ns - By(fmt.Sprintf("Created federation namespace %s", ns.Name)) -} - -func (f *Framework) deleteFederationNs() { - ns := f.FederationNamespace - By(fmt.Sprintf("Destroying federation namespace %q for this suite.", ns.Name)) - timeout := 5 * time.Minute - if f.NamespaceDeletionTimeout != 0 { - timeout = f.NamespaceDeletionTimeout - } - - clientset := f.FederationClientset - // First delete the namespace from federation apiserver. - // Also delete the corresponding namespaces from underlying clusters. - orphanDependents := false - if err := clientset.Core().Namespaces().Delete(ns.Name, &metav1.DeleteOptions{OrphanDependents: &orphanDependents}); err != nil { - framework.Failf("Error while deleting federation namespace %s: %s", ns.Name, err) - } - // Verify that it got deleted. - err := wait.PollImmediate(5*time.Second, timeout, func() (bool, error) { - if _, err := clientset.Core().Namespaces().Get(ns.Name, metav1.GetOptions{}); err != nil { - if apierrors.IsNotFound(err) { - return true, nil - } - framework.Logf("Error while waiting for namespace to be terminated: %v", err) - return false, nil - } - return false, nil - }) - if err != nil { - if !apierrors.IsNotFound(err) { - framework.Failf("Couldn't delete ns %q: %s", ns.Name, err) - } else { - framework.Logf("Namespace %v was already deleted", ns.Name) - } - } -} - -// FederationAfterEach deletes the namespace, after reading its events. -func (f *Framework) FederationAfterEach() { - framework.RemoveCleanupAction(f.cleanupHandle) - - // DeleteNamespace at the very end in defer, to avoid any - // expectation failures preventing deleting the namespace. - defer func() { - // Whether to delete namespace is determined by 3 factors: delete-namespace flag, delete-namespace-on-failure flag and the test result - // if delete-namespace set to false, namespace will always be preserved. - // if delete-namespace is true and delete-namespace-on-failure is false, namespace will be preserved if test failed. - if framework.TestContext.DeleteNamespace && (framework.TestContext.DeleteNamespaceOnFailure || !CurrentGinkgoTestDescription().Failed) { - // Delete the federation namespace. - f.deleteFederationNs() - } - - // Paranoia-- prevent reuse! - f.FederationNamespace = nil - - if f.FederationClientset == nil { - framework.Logf("Warning: framework is marked federated, but has no federation 1.5 clientset") - return - } - }() - - // Print events if the test failed. - if CurrentGinkgoTestDescription().Failed && framework.TestContext.DumpLogsOnFailure { - // Dump federation events in federation namespace. - framework.DumpEventsInNamespace(func(opts metav1.ListOptions, ns string) (*v1.EventList, error) { - return f.FederationClientset.Core().Events(ns).List(opts) - }, f.FederationNamespace.Name) - } -} - -func (f *Framework) createFederationNamespace(baseName string) (*v1.Namespace, error) { - clientset := f.FederationClientset - namespaceObj := &v1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: fmt.Sprintf("e2e-tests-%v-", baseName), - }, - } - // Be robust about making the namespace creation call. - var got *v1.Namespace - if err := wait.PollImmediate(framework.Poll, framework.SingleCallTimeout, func() (bool, error) { - var err error - got, err = clientset.Core().Namespaces().Create(namespaceObj) - if err != nil { - framework.Logf("Unexpected error while creating namespace: %v", err) - return false, nil - } - return true, nil - }); err != nil { - return nil, err - } - return got, nil -} - -type E2EContext struct { - // Raw context name, - RawName string `yaml:"rawName"` - // A valid dns subdomain which can be used as the name of kubernetes resources. - Name string `yaml:"name"` - Cluster *framework.KubeCluster `yaml:"cluster"` - User *framework.KubeUser `yaml:"user"` -} - -func (f *Framework) GetUnderlyingFederatedContexts() []E2EContext { - kubeconfig := framework.KubeConfig{} - configBytes, err := ioutil.ReadFile(framework.TestContext.KubeConfig) - framework.ExpectNoError(err) - err = yaml.Unmarshal(configBytes, &kubeconfig) - framework.ExpectNoError(err) - - e2eContexts := []E2EContext{} - for _, context := range kubeconfig.Contexts { - if strings.HasPrefix(context.Name, "federation") && context.Name != framework.TestContext.FederatedKubeContext { - user := kubeconfig.FindUser(context.Context.User) - if user == nil { - framework.Failf("Could not find user for context %+v", context) - } - - cluster := kubeconfig.FindCluster(context.Context.Cluster) - if cluster == nil { - framework.Failf("Could not find cluster for context %+v", context) - } - - dnsSubdomainName, err := GetValidDNSSubdomainName(context.Name) - if err != nil { - framework.Failf("Could not convert context name %s to a valid dns subdomain name, error: %s", context.Name, err) - } - e2eContexts = append(e2eContexts, E2EContext{ - RawName: context.Name, - Name: dnsSubdomainName, - Cluster: cluster, - User: user, - }) - } - } - - return e2eContexts -} - -func (f *Framework) GetRegisteredClusters() ClusterSlice { - if framework.TestContext.FederationConfigFromCluster { - return registeredClustersFromSecrets(f) - } else { - return registeredClustersFromConfig(f) - } -} - -func (f *Framework) GetClusterClients() []kubeclientset.Interface { - clusters := f.GetRegisteredClusters() - var clusterClients []kubeclientset.Interface - for _, c := range clusters { - clusterClients = append(clusterClients, c.Clientset) - } - return clusterClients -} diff --git a/federation/test/e2e/framework/util.go b/federation/test/e2e/framework/util.go deleted file mode 100644 index 0d6a003e3e..0000000000 --- a/federation/test/e2e/framework/util.go +++ /dev/null @@ -1,150 +0,0 @@ -/* -Copyright 2014 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 framework - -import ( - "fmt" - "os" - "path" - "regexp" - "strings" - "time" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - validationutil "k8s.io/apimachinery/pkg/util/validation" - "k8s.io/apimachinery/pkg/util/wait" - clientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "k8s.io/kubernetes/pkg/api/validation" - "k8s.io/kubernetes/test/e2e/framework" -) - -const FederatedDefaultTestTimeout = 5 * time.Minute - -// Detects whether the federation namespace exists in the underlying cluster -func SkipUnlessFederated(c clientset.Interface) { - federationNS := framework.FederationSystemNamespace() - - _, err := c.Core().Namespaces().Get(federationNS, metav1.GetOptions{}) - if err != nil { - if apierrors.IsNotFound(err) { - framework.Skipf("Could not find federation namespace %s: skipping federated test", federationNS) - } else { - framework.Failf("Unexpected error getting namespace: %v", err) - } - } -} - -// WaitForFederationApiserverReady waits for the federation apiserver to be ready. -// It tests the readiness by sending a GET request and expecting a non error response. -func WaitForFederationApiserverReady(c *federation_clientset.Clientset) error { - return wait.PollImmediate(time.Second, 1*time.Minute, func() (bool, error) { - _, err := c.Federation().Clusters().List(metav1.ListOptions{}) - if err != nil { - return false, nil - } - return true, nil - }) -} - -func LoadFederationClientset(config *restclient.Config) (*federation_clientset.Clientset, error) { - c, err := federation_clientset.NewForConfig(config) - if err != nil { - return nil, fmt.Errorf("error creating federation clientset: %v", err.Error()) - } - return c, nil -} - -func LoadFederatedConfig(overrides *clientcmd.ConfigOverrides) (*restclient.Config, error) { - c, err := framework.RestclientConfig(framework.TestContext.FederatedKubeContext) - if err != nil { - return nil, fmt.Errorf("error creating federation client config: %v", err.Error()) - } - cfg, err := clientcmd.NewDefaultClientConfig(*c, &clientcmd.ConfigOverrides{}).ClientConfig() - if cfg != nil { - //TODO(colhom): this is only here because https://github.com/kubernetes/kubernetes/issues/25422 - cfg.NegotiatedSerializer = legacyscheme.Codecs - } - if err != nil { - return cfg, fmt.Errorf("error creating federation default client config: %v", err.Error()) - } - return cfg, nil -} - -// GetValidDNSSubdomainName massages the given name to be a valid dns subdomain name. -// Most resources (such as secrets, clusters) require the names to be valid dns subdomain. -// This is a generic function (not specific to federation). Should be moved to a more generic location if others want to use it. -func GetValidDNSSubdomainName(name string) (string, error) { - // "_" are not allowed. Replace them by "-". - name = regexp.MustCompile("_").ReplaceAllLiteralString(name, "-") - maxLength := validationutil.DNS1123SubdomainMaxLength - if len(name) > maxLength { - name = name[0 : maxLength-1] - } - // Verify that name now passes the validation. - if errors := validation.NameIsDNSSubdomain(name, false); len(errors) != 0 { - return "", fmt.Errorf("errors in converting name to a valid DNS subdomain %s", errors) - } - return name, nil -} - -func FederationControlPlaneUpgrade(version string) error { - version = "v" + version - _, _, err := framework.RunCmd(path.Join(framework.TestContext.RepoRoot, "federation/cluster/upgrade.sh"), version) - return err -} - -func CheckFederationVersion(c federation_clientset.Interface, want string) error { - framework.Logf("Checking federation version") - v, err := c.Discovery().ServerVersion() - if err != nil { - return fmt.Errorf("CheckFederationVersion() couldn't get the master version: %v", err) - } - // We do prefix trimming and then matching because: - // want looks like: 0.19.3-815-g50e67d4 - // got looks like: v0.19.3-815-g50e67d4034e858-dirty - got := strings.TrimPrefix(v.GitVersion, "v") - if !strings.HasPrefix(got, want) { - return fmt.Errorf("federation had apiserver version %s which does not start with %s", - got, want) - } - framework.Logf("Federation is at version %s", want) - return nil -} - -func MasterUpgrade(context, version string) error { - switch framework.TestContext.Provider { - case "gce": - return masterUpgradeGCE(context, version) - default: - return fmt.Errorf("MasterUpgrade() is not implemented for provider %s", framework.TestContext.Provider) - } -} - -func masterUpgradeGCE(context, rawVersion string) error { - version := "v" + rawVersion - // TODO: this breaks if we want to upgrade 2 clusters in same zone. use alternate methods in future to get zone of a cluster - zone := strings.TrimPrefix(context, "federation-e2e-"+framework.TestContext.Provider+"-") - - env := append(os.Environ(), "KUBE_CONTEXT="+context, "ZONE="+zone) - _, _, err := framework.RunCmdEnv(env, path.Join(framework.TestContext.RepoRoot, "cluster/gce/upgrade.sh"), "-M", version) - return err -} diff --git a/federation/test/e2e/ingress.go b/federation/test/e2e/ingress.go deleted file mode 100644 index 9ae324fc7a..0000000000 --- a/federation/test/e2e/ingress.go +++ /dev/null @@ -1,638 +0,0 @@ -/* -Copyright 2016 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 e2e - -import ( - "crypto/tls" - "fmt" - "net/http" - "os" - "reflect" - "strconv" - "strings" - "time" - - "k8s.io/api/core/v1" - "k8s.io/api/extensions/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" - utilnet "k8s.io/apimachinery/pkg/util/net" - "k8s.io/apimachinery/pkg/util/wait" - kubeclientset "k8s.io/client-go/kubernetes" - fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/federation/pkg/federation-controller/util" - - fedframework "k8s.io/kubernetes/federation/test/e2e/framework" - "k8s.io/kubernetes/test/e2e/framework" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -const ( - MaxRetriesOnFederatedApiserver = 3 - FederatedIngressTimeout = 15 * time.Minute - FederatedIngressDeleteTimeout = 2 * time.Minute - FederatedIngressName = "federated-ingress" - FederatedIngressServiceName = "federated-ingress-service" - FederatedIngressTLSSecretName = "federated-ingress-tls-secret" - FederatedIngressServicePodName = "federated-ingress-service-test-pod" - FederatedIngressHost = "test-f8n.k8s.io." - - FederatedSecretTimeout = 60 * time.Second - - // TLS Certificate and Key for the ingress resource - // Generated using: - // $ openssl req -nodes -x509 -newkey rsa:2048 -keyout fedingtestkey.pem -out fedingtestcrt.pem -days 2485 - // 2485 days is an arbitrary large number chosen below int32 seconds. - FederatedIngressTLSCrt = `-----BEGIN CERTIFICATE----- -MIIDaTCCAlGgAwIBAgIJANwsCbwxm9pyMA0GCSqGSIb3DQEBCwUAMEoxCzAJBgNV -BAYTAlVTMRMwEQYDVQQIDApTb21lLVN0YXRlMQswCQYDVQQKDAJOQTEZMBcGA1UE -AwwQdGVzdC1mOG4uazhzLmlvLjAgFw0xNjEyMTYwNjA1NDRaGA8yMDg1MDEwMzA2 -MDU0NFowSjELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxCzAJBgNV -BAoMAk5BMRkwFwYDVQQDDBB0ZXN0LWY4bi5rOHMuaW8uMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEAmsHYnLhqSeO1Q6SEjaiPiLUQV8tyGfttwNQiOT5u -ULz6ZWYA40m/1hhla9KH9sJZ515Iq+jTtiVH0rUjryT96SjxitLCAZlxVwQ63B50 -aZF2T2OPSzvrmN+J6VGcRIq0N8fUeyp2WTIEdWlpQ7DTmDNArQqFSIvJndkLow3d -hec7O+PErnvZQQC9zqa23rGndDzlgDJ4HJGAQNm3uYVh5WHv+wziP67T/82bEGgO -A6EdDPWzpYxzAA1wsqz9lX5jitlbKdI56698fPR2KRelySf7OXVvZCS4/ED1lF4k -b7fQgtBhAWe1BkuAMUl7vdRjMps7nkxmBSuxBkVQ7sb5AwIDAQABo1AwTjAdBgNV -HQ4EFgQUjf53O/W/iE2mxuJkNjZGUfjJ9RUwHwYDVR0jBBgwFoAUjf53O/W/iE2m -xuJkNjZGUfjJ9RUwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEABE7B -bAiORDBA3qE5lh6JCs/lEfz93E/gOhD9oDnm9SRND4kjy7qeGxk4Wzsd/Vr+R2mi -EZ40d4MA/mCCPnYsNQoEXMFc8IvwAbzkhh2gqTNgG0/Ks0A1mIPQNpvUcSetS4IV -732DvB3nSnFtlzf6afw+V1Vf5ydRNuM/c9GEOOHSz+rs+9M364d+wNaFD64M72ol -iDMAdtcrhOqkQi0lUING904jlJcyYM5oVNCCtme4F8nkIX9bxP/9Ea6VhDGPeJiX -tVwZuudkoEbrFlEYbyLrbVeVa9oTf4Jn66iz49/+th+bUtEoTt9gk9Cul5TFgfzx -EscdahceC7afheq6zg== ------END CERTIFICATE-----` - - FederatedIngressTLSKey = `-----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCawdicuGpJ47VD -pISNqI+ItRBXy3IZ+23A1CI5Pm5QvPplZgDjSb/WGGVr0of2wlnnXkir6NO2JUfS -tSOvJP3pKPGK0sIBmXFXBDrcHnRpkXZPY49LO+uY34npUZxEirQ3x9R7KnZZMgR1 -aWlDsNOYM0CtCoVIi8md2QujDd2F5zs748Sue9lBAL3Oprbesad0POWAMngckYBA -2be5hWHlYe/7DOI/rtP/zZsQaA4DoR0M9bOljHMADXCyrP2VfmOK2Vsp0jnrr3x8 -9HYpF6XJJ/s5dW9kJLj8QPWUXiRvt9CC0GEBZ7UGS4AxSXu91GMymzueTGYFK7EG -RVDuxvkDAgMBAAECggEAYrXGPqB6W0r88XpceibL9rzXAcjorJ3s8ZPdiHnDz4fa -hxa69j6yOBMzjcSpqMFqquM+ozhM4d+BomqbqjmEI1ZUSuIHkRGYc5JlIMXkJvn7 -ZsPwQGKl8cqTotjFPgrizLmPVEhPWLFImsNzuxNsw6XdWQJe5VkUbrRkccqEQ8Wt -xwq/SlRercIMnRVLOOESq8EyjOY4yDgOdIifq9K9xiI8W6nMiPs0X5AcIJoTMbCe -cX0zUqW317awDWWP8u2GswwDDm4qPeWnXOrDkDx8Eo0dWJbmxw9su0XrM6KMvEMe -2a/Fy/enr5Cc6/jgsh3gO5sa8dJ1Cu+wexcoEbez8QKBgQDMXlXJu/C7djke94s3 -vGxati7AGO95bBQHW+cPuN4l0rfPZ8YuUAWD4csW4BOlUPAOukreD/SKdanigR3N -FqVPeI8rXd5kzy8/lPIOGuSkkVEpKsAJ7prFbSUVKjVPYQk2dsOEeR0r7pr2FxC9 -SBhVS/LgmPYh++iny9D0aU23hQKBgQDB2t55OE+00vgoauUc10LEY+J6tiwXuNm7 -43JtrH5ET4N+TJ2BOUl5f88TY/3QuTu6vYwlxjyn+LFuWQNhShX6lFMjt5zqPTdw -ZPDA+9B6a45cV3YjXjRsYidpWj0D2lJgy0DbucC4f3eIhNGyFUbAQB9npKDzOeUh -7Z+p/Grg5wKBgGUnVCLzySWgUImJUPkXZDJJ9j3SmcVpv0gdLvLTN/FUqPIZlTgb -F3+9ZL4/zrmGpCtF/gSHtSxLLPkVm2CFkvEQ5Rw76/XNrr8zw9NDcGQcISXVKRRB -a43IhhBBwf02NE8m3YNWRyAVi9G+fOSTKKgfXWnZjAoqG2/iK9ytum/ZAoGAYlP8 -KIxxkYy5Jvchg4GEck0f4ZJpxxaSCoWR0yN9YHTcg8Gk2pkONbyocnNzmN17+HqQ -jdCBj8nLZedsmXqUr2dwzFskEoQ+jJoGrDyOQKoxqZELcWElQhx/VSbacAvbYRF3 -snwDzxGItgx4uNWl73oW8+FDalvhZ1Y6eGR6ad0CgYEAtlNa92Fbvd3r9O2mdyWe -D2SXNMi45+wsNafX2sdkyb+qNN6qZXC9ylUl9h0zdky88JNgtAOgxIaRIdEZajnD -/Zq17sTNtgpm53x16gOAgD8M+/wmBZxA+/IKfFCubuV77MbQoPfcjT5wBMRnFQnY -Ks7c+dzaRlgDKZ6v/L/8iZU= ------END PRIVATE KEY-----` -) - -const ( - // timeout on a single http request. - reqTimeout = 10 * time.Second -) - -var _ = framework.KubeDescribe("Federated ingresses [Feature:Federation]", func() { - f := fedframework.NewDefaultFederatedFramework("federated-ingress") - - // Create/delete ingress api objects - // Validate federation apiserver, does not rely on underlying clusters or federation ingress controller. - Describe("Federated Ingresses [NoCluster]", func() { - AfterEach(func() { - nsName := f.FederationNamespace.Name - // Delete all ingresses. - deleteAllIngressesOrFail(f.FederationClientset, nsName) - }) - - It("should be created and deleted successfully", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - framework.SkipUnlessProviderIs("gce", "gke") // TODO: Federated ingress is not yet supported on non-GCP platforms. - nsName := f.FederationNamespace.Name - ingress := createIngressOrFail(f.FederationClientset, nsName, FederatedIngressServiceName, FederatedIngressTLSSecretName) - By(fmt.Sprintf("Creation of ingress %q in namespace %q succeeded. Deleting ingress.", ingress.Name, nsName)) - // Cleanup - err := f.FederationClientset.Extensions().Ingresses(nsName).Delete(ingress.Name, &metav1.DeleteOptions{}) - framework.ExpectNoError(err, "Error deleting ingress %q in namespace %q", ingress.Name, ingress.Namespace) - By(fmt.Sprintf("Deletion of ingress %q in namespace %q succeeded.", ingress.Name, nsName)) - }) - }) - - // e2e cases for federation ingress controller - var _ = Describe("Federated Ingresses [Slow]", func() { - var ( - clusters fedframework.ClusterSlice - federationName, ns string - jig *federationTestJig - service *v1.Service - secret *v1.Secret - ) - - // register clusters in federation apiserver - BeforeEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - framework.SkipUnlessProviderIs("gce", "gke") // TODO: Federated ingress is not yet supported on non-GCP platforms. - if federationName = os.Getenv("FEDERATION_NAME"); federationName == "" { - federationName = DefaultFederationName - } - jig = newFederationTestJig(f.FederationClientset) - clusters = f.GetRegisteredClusters() - ns = f.FederationNamespace.Name - // create backend service - service = createLBServiceOrFail(f.FederationClientset, ns, FederatedIngressServiceName, clusters) - // create the TLS secret - secret = createTLSSecretOrFail(f.FederationClientset, ns, FederatedIngressTLSSecretName) - // wait for services objects sync - waitForServiceShardsOrFail(ns, service, clusters) - // wait for TLS secret sync - waitForSecretShardsOrFail(ns, secret, clusters) - }) - - AfterEach(func() { - // Delete all ingresses. - deleteAllIngressesOrFail(f.FederationClientset, ns) - if secret != nil { - By("Deleting secret") - orphanDependents := false - deleteSecretOrFail(f.FederationClientset, ns, secret.Name, &orphanDependents) - secret = nil - } else { - By("No secret to delete. Secret is nil") - } - if service != nil { - By("Deleting service") - deleteServiceOrFail(f.FederationClientset, ns, service.Name, nil) - By("Cleanup service shards and provider resources") - cleanupServiceShardsAndProviderResources(ns, service, clusters) - service = nil - } else { - By("No service to delete. Service is nil") - } - }) - - It("should create and update matching ingresses in underlying clusters", func() { - ingress := createIngressOrFail(f.FederationClientset, ns, FederatedIngressServiceName, FederatedIngressTLSSecretName) - // wait for ingress shards being created - waitForIngressShardsOrFail(ns, ingress, clusters) - ingress = updateIngressOrFail(f.FederationClientset, ns) - waitForIngressShardsUpdatedOrFail(ns, ingress, clusters) - }) - - It("should be deleted from underlying clusters when OrphanDependents is false", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - orphanDependents := false - verifyCascadingDeletionForIngress(f.FederationClientset, clusters, &orphanDependents, ns) - By(fmt.Sprintf("Verified that ingresses were deleted from underlying clusters")) - }) - - It("should not be deleted from underlying clusters when OrphanDependents is true", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - orphanDependents := true - verifyCascadingDeletionForIngress(f.FederationClientset, clusters, &orphanDependents, ns) - By(fmt.Sprintf("Verified that ingresses were not deleted from underlying clusters")) - }) - - It("should not be deleted from underlying clusters when OrphanDependents is nil", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - verifyCascadingDeletionForIngress(f.FederationClientset, clusters, nil, ns) - By(fmt.Sprintf("Verified that ingresses were not deleted from underlying clusters")) - }) - - var _ = Describe("Ingress connectivity and DNS", func() { - - var backendPods BackendPodMap - - BeforeEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - // create backend pod - backendPods = createBackendPodsOrFail(clusters, ns, FederatedIngressServicePodName) - // create ingress object - jig.ing = createIngressOrFail(f.FederationClientset, ns, service.Name, FederatedIngressTLSSecretName) - // wait for ingress objects sync - waitForIngressShardsOrFail(ns, jig.ing, clusters) - By(fmt.Sprintf("Ingress created as %v", jig.ing.Name)) - }) - - AfterEach(func() { - deleteBackendPodsOrFail(clusters, backendPods) - backendPods = nil - - if jig.ing != nil { - By(fmt.Sprintf("Deleting ingress %v on all clusters", jig.ing.Name)) - orphanDependents := false - deleteIngressOrFail(f.FederationClientset, ns, jig.ing.Name, &orphanDependents) - jig.ing = nil - } else { - By("No ingress to delete. Ingress is nil") - } - }) - - PIt("should be able to discover a federated ingress service via DNS", func() { - // we are about the ingress name - svcDNSNames := []string{ - fmt.Sprintf("%s.%s", FederatedIngressServiceName, ns), - fmt.Sprintf("%s.%s.svc.cluster.local.", FederatedIngressServiceName, ns), - // TODO these two entries are not set yet - //fmt.Sprintf("%s.%s.%s", FederatedIngressServiceName, ns, federationName), - //fmt.Sprintf("%s.%s.%s.svc.cluster.local.", FederatedIngressServiceName, ns, federationName), - } - // check dns records in underlying cluster - for i, DNSName := range svcDNSNames { - discoverService(f, DNSName, true, "federated-ingress-e2e-discovery-pod-"+strconv.Itoa(i)) - } - // TODO check dns record in global dns server - }) - - It("should be able to connect to a federated ingress via its load balancer", func() { - By(fmt.Sprintf("Waiting for Federated Ingress on %v", jig.ing.Name)) - // check the traffic on federation ingress - jig.waitForFederatedIngress() - }) - - }) - }) -}) - -// Deletes all Ingresses in the given namespace name. -func deleteAllIngressesOrFail(clientset *fedclientset.Clientset, nsName string) { - orphanDependents := false - err := clientset.Extensions().Ingresses(nsName).DeleteCollection(&metav1.DeleteOptions{OrphanDependents: &orphanDependents}, metav1.ListOptions{}) - Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("Error in deleting ingresses in namespace: %s", nsName)) -} - -// equivalent returns true if the two ingress spec are equivalent. -func equivalentIngress(federatedIngress, clusterIngress v1beta1.Ingress) bool { - return reflect.DeepEqual(clusterIngress.Spec, federatedIngress.Spec) -} - -// verifyCascadingDeletionForIngress verifies that ingresses are deleted from -// underlying clusters when orphan dependents is false and they are not deleted -// when orphan dependents is true. -func verifyCascadingDeletionForIngress(clientset *fedclientset.Clientset, clusters fedframework.ClusterSlice, orphanDependents *bool, nsName string) { - ingress := createIngressOrFail(clientset, nsName, FederatedIngressServiceName, FederatedIngressTLSSecretName) - ingressName := ingress.Name - // Check subclusters if the ingress was created there. - By(fmt.Sprintf("Waiting for ingress %s to be created in all underlying clusters", ingressName)) - waitForIngressShardsOrFail(nsName, ingress, clusters) - - By(fmt.Sprintf("Deleting ingress %s", ingressName)) - deleteIngressOrFail(clientset, nsName, ingressName, orphanDependents) - - By(fmt.Sprintf("Verifying ingresses %s in underlying clusters", ingressName)) - errMessages := []string{} - // ingress should be present in underlying clusters unless orphanDependents is false. - shouldExist := orphanDependents == nil || *orphanDependents == true - for _, cluster := range clusters { - clusterName := cluster.Name - _, err := cluster.Extensions().Ingresses(nsName).Get(ingressName, metav1.GetOptions{}) - if shouldExist && errors.IsNotFound(err) { - errMessages = append(errMessages, fmt.Sprintf("unexpected NotFound error for ingress %s in cluster %s, expected ingress to exist", ingressName, clusterName)) - } else if !shouldExist && !errors.IsNotFound(err) { - errMessages = append(errMessages, fmt.Sprintf("expected NotFound error for ingress %s in cluster %s, got error: %v", ingressName, clusterName, err)) - } - } - if len(errMessages) != 0 { - framework.Failf("%s", strings.Join(errMessages, "; ")) - } -} - -// waitForIngressOrFail waits until a ingress is either present or absent in the cluster specified by clientset. -// If the condition is not met within timout, it fails the calling test. -func waitForIngressOrFail(clientset *kubeclientset.Clientset, namespace string, ingress *v1beta1.Ingress, present bool, timeout time.Duration) { - By(fmt.Sprintf("Fetching a federated ingress shard of ingress %q in namespace %q from cluster", ingress.Name, namespace)) - var clusterIngress *v1beta1.Ingress - err := wait.PollImmediate(framework.Poll, timeout, func() (bool, error) { - var err error - clusterIngress, err = clientset.ExtensionsV1beta1().Ingresses(namespace).Get(ingress.Name, metav1.GetOptions{}) - if (!present) && errors.IsNotFound(err) { // We want it gone, and it's gone. - By(fmt.Sprintf("Success: shard of federated ingress %q in namespace %q in cluster is absent", ingress.Name, namespace)) - return true, nil // Success - } - if present && err == nil { // We want it present, and the Get succeeded, so we're all good. - By(fmt.Sprintf("Success: shard of federated ingress %q in namespace %q in cluster is present", ingress.Name, namespace)) - return true, nil // Success - } - By(fmt.Sprintf("Ingress %q in namespace %q in cluster. Found: %v, waiting for Found: %v, trying again in %s (err=%v)", ingress.Name, namespace, clusterIngress != nil && err == nil, present, framework.Poll, err)) - return false, nil - }) - framework.ExpectNoError(err, "Failed to verify ingress %q in namespace %q in cluster: Present=%v", ingress.Name, namespace, present) - - if present && clusterIngress != nil { - Expect(equivalentIngress(*clusterIngress, *ingress)) - } -} - -// waitForIngressShardsOrFail waits for the ingress to appear in all clusters -func waitForIngressShardsOrFail(namespace string, ingress *v1beta1.Ingress, clusters fedframework.ClusterSlice) { - framework.Logf("Waiting for ingress %q in %d clusters", ingress.Name, len(clusters)) - for _, c := range clusters { - waitForIngressOrFail(c.Clientset, namespace, ingress, true, FederatedIngressTimeout) - } -} - -// waitForIngressShardsUpdatedOrFail waits for the ingress to be updated in all clusters -func waitForIngressShardsUpdatedOrFail(namespace string, ingress *v1beta1.Ingress, clusters fedframework.ClusterSlice) { - framework.Logf("Waiting for ingress %q in %d clusters", ingress.Name, len(clusters)) - for _, c := range clusters { - waitForIngressUpdateOrFail(c.Clientset, namespace, ingress, FederatedIngressTimeout) - } -} - -// waitForIngressUpdateOrFail waits until a ingress is updated in the specified cluster with same spec of federated ingress. -// If the condition is not met within timeout, it fails the calling test. -func waitForIngressUpdateOrFail(clientset *kubeclientset.Clientset, namespace string, ingress *v1beta1.Ingress, timeout time.Duration) { - By(fmt.Sprintf("Fetching a federated ingress shard of ingress %q in namespace %q from cluster", ingress.Name, namespace)) - err := wait.PollImmediate(framework.Poll, timeout, func() (bool, error) { - clusterIngress, err := clientset.ExtensionsV1beta1().Ingresses(namespace).Get(ingress.Name, metav1.GetOptions{}) - if err == nil { // We want it present, and the Get succeeded, so we're all good. - if equivalentIngress(*clusterIngress, *ingress) { - By(fmt.Sprintf("Success: shard of federated ingress %q in namespace %q in cluster is updated", ingress.Name, namespace)) - return true, nil - } - By(fmt.Sprintf("Ingress %q in namespace %q in cluster, waiting for service being updated, trying again in %s (err=%v)", ingress.Name, namespace, framework.Poll, err)) - return false, nil - } - By(fmt.Sprintf("Ingress %q in namespace %q in cluster, waiting for service being updated, trying again in %s (err=%v)", ingress.Name, namespace, framework.Poll, err)) - return false, nil - }) - framework.ExpectNoError(err, "Failed to verify ingress %q in namespace %q in cluster", ingress.Name, namespace) -} - -// waitForIngressShardsGoneOrFail waits for the ingress to disappear in all clusters -func waitForIngressShardsGoneOrFail(namespace string, ingress *v1beta1.Ingress, clusters fedframework.ClusterSlice) { - framework.Logf("Waiting for ingress %q in %d clusters", ingress.Name, len(clusters)) - for _, c := range clusters { - waitForIngressOrFail(c.Clientset, namespace, ingress, false, FederatedIngressTimeout) - } -} - -func deleteIngressOrFail(clientset *fedclientset.Clientset, namespace string, ingressName string, orphanDependents *bool) { - if clientset == nil || len(namespace) == 0 || len(ingressName) == 0 { - Fail(fmt.Sprintf("Internal error: invalid parameters passed to deleteIngressOrFail: clientset: %v, namespace: %v, ingress: %v", clientset, namespace, ingressName)) - } - err := clientset.ExtensionsV1beta1().Ingresses(namespace).Delete(ingressName, &metav1.DeleteOptions{OrphanDependents: orphanDependents}) - framework.ExpectNoError(err, "Error deleting ingress %q from namespace %q", ingressName, namespace) - // Wait for the ingress to be deleted. - err = wait.Poll(framework.Poll, FederatedIngressDeleteTimeout, func() (bool, error) { - _, err := clientset.Extensions().Ingresses(namespace).Get(ingressName, metav1.GetOptions{}) - if err != nil && errors.IsNotFound(err) { - return true, nil - } - return false, err - }) - if err != nil { - framework.Failf("Error in deleting ingress %s: %v", ingressName, err) - } -} - -// TODO: quinton: This is largely a cut 'n paste of the above. Yuck! Refactor as soon as we have a common interface implmented by both fedclientset.Clientset and kubeclientset.Clientset -func deleteClusterIngressOrFail(clusterName string, clientset *kubeclientset.Clientset, namespace string, ingressName string) { - if clientset == nil || len(namespace) == 0 || len(ingressName) == 0 { - Fail(fmt.Sprintf("Internal error: invalid parameters passed to deleteClusterIngressOrFail: cluster: %q, clientset: %v, namespace: %v, ingress: %v", clusterName, clientset, namespace, ingressName)) - } - err := clientset.ExtensionsV1beta1().Ingresses(namespace).Delete(ingressName, metav1.NewDeleteOptions(0)) - framework.ExpectNoError(err, "Error deleting cluster ingress %q/%q from cluster %q", namespace, ingressName, clusterName) -} - -func createIngressOrFail(clientset *fedclientset.Clientset, namespace, serviceName, secretName string) *v1beta1.Ingress { - if clientset == nil || len(namespace) == 0 { - Fail(fmt.Sprintf("Internal error: invalid parameters passed to createIngressOrFail: clientset: %v, namespace: %v", clientset, namespace)) - } - By(fmt.Sprintf("Creating federated ingress %q in namespace %q", FederatedIngressName, namespace)) - - ingress := &v1beta1.Ingress{ - ObjectMeta: metav1.ObjectMeta{ - Name: FederatedIngressName, - }, - Spec: v1beta1.IngressSpec{ - Backend: &v1beta1.IngressBackend{ - ServiceName: serviceName, - ServicePort: intstr.FromInt(80), - }, - TLS: []v1beta1.IngressTLS{ - { - SecretName: secretName, - }, - }, - }, - } - - newIng, err := clientset.Extensions().Ingresses(namespace).Create(ingress) - framework.ExpectNoError(err, "Creating ingress %q in namespace %q", ingress.Name, namespace) - By(fmt.Sprintf("Successfully created federated ingress %q in namespace %q", FederatedIngressName, namespace)) - return newIng -} - -func updateIngressOrFail(clientset *fedclientset.Clientset, namespace string) (newIng *v1beta1.Ingress) { - var err error - if clientset == nil || len(namespace) == 0 { - Fail(fmt.Sprintf("Internal error: invalid parameters passed to createIngressOrFail: clientset: %v, namespace: %v", clientset, namespace)) - } - ingress := &v1beta1.Ingress{ - ObjectMeta: metav1.ObjectMeta{ - Name: FederatedIngressName, - }, - Spec: v1beta1.IngressSpec{ - Backend: &v1beta1.IngressBackend{ - ServiceName: "updated-testingress-service", - ServicePort: intstr.FromInt(80), - }, - }, - } - - err = waitForFederatedIngressExists(clientset, namespace, FederatedIngressName, FederatedIngressTimeout) - if err != nil { - framework.Failf("failed to get ingress %q: %v", FederatedIngressName, err) - } - for i := 0; i < MaxRetriesOnFederatedApiserver; i++ { - newIng, err = clientset.Extensions().Ingresses(namespace).Update(ingress) - if err == nil { - framework.DescribeIng(namespace) - return newIng - } - if !errors.IsConflict(err) && !errors.IsServerTimeout(err) { - framework.Failf("failed to update ingress %q: %v", FederatedIngressName, err) - } - } - framework.Failf("too many retries updating ingress %q", FederatedIngressName) - return nil -} - -func (j *federationTestJig) waitForFederatedIngress() { - // Wait for the loadbalancer IP. - address, err := waitForFederatedIngressAddress(j.client, j.ing.Namespace, j.ing.Name, framework.LoadBalancerPollTimeout) - if err != nil { - framework.Failf("Ingress failed to acquire an IP address within %v", framework.LoadBalancerPollTimeout) - } - j.address = address - framework.Logf("Found address %v for ingress %v", j.address, j.ing.Name) - - client := &http.Client{ - // This is mostly `http.DefaultTransport` except for the - // `TLSClientConfig`. - Transport: utilnet.SetTransportDefaults(&http.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - }, - }), - Timeout: reqTimeout, - } - - // Verify that simple GET works. - route := fmt.Sprintf("https://%v", address) - framework.Logf("Testing route %v with simple GET", route) - framework.ExpectNoError(framework.PollURL(route, FederatedIngressHost, framework.LoadBalancerPollTimeout, framework.LoadBalancerPollInterval, client, false)) -} - -func createTLSSecretOrFail(clientset *fedclientset.Clientset, namespace, secretName string) *v1.Secret { - if clientset == nil || len(namespace) == 0 { - framework.Logf("Internal error: invalid parameters passed to createTLSSecretOrFail: clientset: %v, namespace: %v", clientset, namespace) - } - secret := &v1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: secretName, - }, - Type: v1.SecretTypeOpaque, - Data: map[string][]byte{ - "tls.crt": []byte(FederatedIngressTLSCrt), - "tls.key": []byte(FederatedIngressTLSKey), - }, - } - By(fmt.Sprintf("Creating federated secret %q in namespace %q", secretName, namespace)) - newSecret, err := clientset.Core().Secrets(namespace).Create(secret) - framework.ExpectNoError(err, "creating secret %q in namespace %q", secret.Name, namespace) - return newSecret -} - -type federationTestJig struct { - // TODO add TLS check later - rootCAs map[string][]byte - address string - ing *v1beta1.Ingress - client *fedclientset.Clientset -} - -func newFederationTestJig(c *fedclientset.Clientset) *federationTestJig { - return &federationTestJig{client: c, rootCAs: map[string][]byte{}} -} - -// WaitForFederatedIngressAddress waits for the Ingress to acquire an address. -func waitForFederatedIngressAddress(c *fedclientset.Clientset, ns, ingName string, timeout time.Duration) (string, error) { - var address string - err := wait.PollImmediate(10*time.Second, timeout, func() (bool, error) { - ipOrNameList, err := getFederatedIngressAddress(c, ns, ingName) - if err != nil || len(ipOrNameList) == 0 { - framework.Logf("Waiting for Ingress %v to acquire IP, error %v", ingName, err) - return false, nil - } - address = ipOrNameList[0] - return true, nil - }) - return address, err -} - -// waitForFederatedIngressExists waits for the Ingress object exists. -func waitForFederatedIngressExists(c *fedclientset.Clientset, ns, ingName string, timeout time.Duration) error { - err := wait.PollImmediate(10*time.Second, timeout, func() (bool, error) { - _, err := c.Extensions().Ingresses(ns).Get(ingName, metav1.GetOptions{}) - if err != nil { - framework.Logf("Waiting for Ingress %v, error %v", ingName, err) - return false, nil - } - return true, nil - }) - return err -} - -// getFederatedIngressAddress returns the ips/hostnames associated with the Ingress. -func getFederatedIngressAddress(client *fedclientset.Clientset, ns, name string) ([]string, error) { - ing, err := client.Extensions().Ingresses(ns).Get(name, metav1.GetOptions{}) - if err != nil { - return nil, err - } - addresses := []string{} - for _, a := range ing.Status.LoadBalancer.Ingress { - if a.IP != "" { - addresses = append(addresses, a.IP) - } - if a.Hostname != "" { - addresses = append(addresses, a.Hostname) - } - } - return addresses, nil -} - -func waitForSecretShardsOrFail(nsName string, secret *v1.Secret, clusters fedframework.ClusterSlice) { - framework.Logf("Waiting for secret %q in %d clusters", secret.Name, len(clusters)) - for _, c := range clusters { - waitForSecretOrFail(c.Clientset, nsName, secret, true, FederatedSecretTimeout) - } -} - -func waitForSecretOrFail(clientset *kubeclientset.Clientset, nsName string, secret *v1.Secret, present bool, timeout time.Duration) { - By(fmt.Sprintf("Fetching a federated secret shard of secret %q in namespace %q from cluster", secret.Name, nsName)) - var clusterSecret *v1.Secret - err := wait.PollImmediate(framework.Poll, timeout, func() (bool, error) { - var err error - clusterSecret, err = clientset.CoreV1().Secrets(nsName).Get(secret.Name, metav1.GetOptions{}) - if (!present) && errors.IsNotFound(err) { // We want it gone, and it's gone. - By(fmt.Sprintf("Success: shard of federated secret %q in namespace %q in cluster is absent", secret.Name, nsName)) - return true, nil // Success - } - if present && err == nil { // We want it present, and the Get succeeded, so we're all good. - By(fmt.Sprintf("Success: shard of federated secret %q in namespace %q in cluster is present", secret.Name, nsName)) - return true, nil // Success - } - By(fmt.Sprintf("Secret %q in namespace %q in cluster. Found: %v, waiting for Found: %v, trying again in %s (err=%v)", secret.Name, nsName, clusterSecret != nil && err == nil, present, framework.Poll, err)) - return false, nil - }) - framework.ExpectNoError(err, "Failed to verify secret %q in namespace %q in cluster: Present=%v", secret.Name, nsName, present) - - if present && clusterSecret != nil { - Expect(util.SecretEquivalent(*clusterSecret, *secret)) - } -} - -func deleteSecretOrFail(clientset *fedclientset.Clientset, nsName string, secretName string, orphanDependents *bool) { - By(fmt.Sprintf("Deleting secret %q in namespace %q", secretName, nsName)) - err := clientset.Core().Secrets(nsName).Delete(secretName, &metav1.DeleteOptions{OrphanDependents: orphanDependents}) - if err != nil && !errors.IsNotFound(err) { - framework.ExpectNoError(err, "Error deleting secret %q in namespace %q", secretName, nsName) - } - - // Wait for the secret to be deleted. - err = wait.Poll(5*time.Second, wait.ForeverTestTimeout, func() (bool, error) { - _, err := clientset.Core().Secrets(nsName).Get(secretName, metav1.GetOptions{}) - if err != nil && errors.IsNotFound(err) { - return true, nil - } - return false, err - }) - if err != nil { - framework.Failf("Error in deleting secret %s: %v", secretName, err) - } -} diff --git a/federation/test/e2e/job.go b/federation/test/e2e/job.go deleted file mode 100644 index 5c2214dd38..0000000000 --- a/federation/test/e2e/job.go +++ /dev/null @@ -1,290 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package e2e - -import ( - "fmt" - "strings" - "time" - - batchv1 "k8s.io/api/batch/v1" - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" - fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - fedutil "k8s.io/kubernetes/federation/pkg/federation-controller/util" - fedframework "k8s.io/kubernetes/federation/test/e2e/framework" - "k8s.io/kubernetes/test/e2e/framework" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/apimachinery/pkg/api/errors" -) - -const ( - FederationJobName = "federation-job" -) - -var _ = framework.KubeDescribe("Federation jobs [Feature:Federation]", func() { - - f := fedframework.NewDefaultFederatedFramework("federation-job") - - Describe("Job objects [NoCluster]", func() { - AfterEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - // Delete all jobs. - nsName := f.FederationNamespace.Name - deleteAllJobsOrFail(f.FederationClientset, nsName) - }) - - It("should be created and deleted successfully", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - nsName := f.FederationNamespace.Name - job := createJobOrFail(f.FederationClientset, nsName) - By(fmt.Sprintf("Creation of job %q in namespace %q succeeded. Deleting job.", job.Name, nsName)) - // Cleanup - err := f.FederationClientset.Batch().Jobs(nsName).Delete(job.Name, &metav1.DeleteOptions{}) - framework.ExpectNoError(err, "Error deleting job %q in namespace %q", job.Name, job.Namespace) - By(fmt.Sprintf("Deletion of job %q in namespace %q succeeded.", job.Name, nsName)) - }) - - }) - - // e2e cases for federated job controller - Describe("Federated Job", func() { - var ( - clusters fedframework.ClusterSlice - ) - BeforeEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - clusters = f.GetRegisteredClusters() - }) - - AfterEach(func() { - nsName := f.FederationNamespace.Name - deleteAllJobsOrFail(f.FederationClientset, nsName) - }) - - It("should create and update matching jobs in underlying clusters", func() { - nsName := f.FederationNamespace.Name - job := createJobOrFail(f.FederationClientset, nsName) - defer func() { - // cleanup. deletion of jobs is not supported for underlying clusters - By(fmt.Sprintf("Deleting job %q/%q", nsName, job.Name)) - waitForJobOrFail(f.FederationClientset, nsName, job.Name, clusters) - f.FederationClientset.Batch().Jobs(nsName).Delete(job.Name, &metav1.DeleteOptions{}) - }() - - waitForJobOrFail(f.FederationClientset, nsName, job.Name, clusters) - By(fmt.Sprintf("Successfuly created and synced job %q/%q to clusters", nsName, job.Name)) - }) - - It("should be deleted from underlying clusters when OrphanDependents is false", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - nsName := f.FederationNamespace.Name - orphanDependents := false - verifyCascadingDeletionForJob(f.FederationClientset, clusters, &orphanDependents, nsName) - By(fmt.Sprintf("Verified that jobs were deleted from underlying clusters")) - }) - - It("should not be deleted from underlying clusters when OrphanDependents is true", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - nsName := f.FederationNamespace.Name - orphanDependents := true - verifyCascadingDeletionForJob(f.FederationClientset, clusters, &orphanDependents, nsName) - By(fmt.Sprintf("Verified that jobs were not deleted from underlying clusters")) - }) - - It("should not be deleted from underlying clusters when OrphanDependents is nil", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - nsName := f.FederationNamespace.Name - verifyCascadingDeletionForJob(f.FederationClientset, clusters, nil, nsName) - By(fmt.Sprintf("Verified that jobs were not deleted from underlying clusters")) - }) - - }) -}) - -// deleteAllJobsOrFail deletes all jobs in the given namespace name. -func deleteAllJobsOrFail(clientset *fedclientset.Clientset, nsName string) { - jobList, err := clientset.Batch().Jobs(nsName).List(metav1.ListOptions{}) - Expect(err).NotTo(HaveOccurred()) - orphanDependents := false - for _, job := range jobList.Items { - deleteJobOrFail(clientset, nsName, job.Name, &orphanDependents) - } -} - -// verifyCascadingDeletionForJob verifies that job are deleted -// from underlying clusters when orphan dependents is false and they are not -// deleted when orphan dependents is true. -func verifyCascadingDeletionForJob(clientset *fedclientset.Clientset, clusters fedframework.ClusterSlice, orphanDependents *bool, nsName string) { - job := createJobOrFail(clientset, nsName) - jobName := job.Name - // Check subclusters if the job was created there. - By(fmt.Sprintf("Waiting for job %s to be created in all underlying clusters", jobName)) - err := wait.Poll(5*time.Second, 2*time.Minute, func() (bool, error) { - for _, cluster := range clusters { - _, err := cluster.Batch().Jobs(nsName).Get(jobName, metav1.GetOptions{}) - if err != nil && errors.IsNotFound(err) { - return false, nil - } - if err != nil { - return false, err - } - } - return true, nil - }) - framework.ExpectNoError(err, "Not all jobs created") - - By(fmt.Sprintf("Deleting job %s", jobName)) - deleteJobOrFail(clientset, nsName, jobName, orphanDependents) - - By(fmt.Sprintf("Verifying job %s in underlying clusters", jobName)) - errMessages := []string{} - // job should be present in underlying clusters unless orphanDependents is false. - shouldExist := orphanDependents == nil || *orphanDependents == true - for _, cluster := range clusters { - clusterName := cluster.Name - _, err := cluster.Batch().Jobs(nsName).Get(jobName, metav1.GetOptions{}) - if shouldExist && errors.IsNotFound(err) { - errMessages = append(errMessages, fmt.Sprintf("unexpected NotFound error for job %s in cluster %s, expected job to exist", jobName, clusterName)) - } else if !shouldExist && !errors.IsNotFound(err) { - errMessages = append(errMessages, fmt.Sprintf("expected NotFound error for job %s in cluster %s, got error: %v", jobName, clusterName, err)) - } - } - if len(errMessages) != 0 { - framework.Failf("%s", strings.Join(errMessages, "; ")) - } -} - -func waitForJobOrFail(c *fedclientset.Clientset, namespace string, jobName string, clusters fedframework.ClusterSlice) { - err := waitForJob(c, namespace, jobName, clusters) - framework.ExpectNoError(err, "Failed to verify job %q/%q, err: %v", namespace, jobName, err) -} - -func waitForJob(c *fedclientset.Clientset, namespace string, jobName string, clusters fedframework.ClusterSlice) error { - err := wait.Poll(10*time.Second, fedframework.FederatedDefaultTestTimeout, func() (bool, error) { - fjob, err := c.Batch().Jobs(namespace).Get(jobName, metav1.GetOptions{}) - if err != nil { - return false, err - } - succeeded := int32(0) - for _, cluster := range clusters { - job, err := cluster.Batch().Jobs(namespace).Get(jobName, metav1.GetOptions{}) - if err != nil && !errors.IsNotFound(err) { - By(fmt.Sprintf("Failed getting job: %q/%q/%q, err: %v", cluster.Name, namespace, jobName, err)) - return false, err - } - if err == nil { - if !verifyJob(fjob, job) { - By(fmt.Sprintf("Job meta or spec not match for cluster %q:\n federation: %v\n cluster: %v", cluster.Name, fjob, job)) - return false, nil - } - succeeded += job.Status.Succeeded - } - } - if succeeded == fjob.Status.Succeeded && - (fjob.Spec.Completions != nil && succeeded == *fjob.Spec.Completions) { - return true, nil - } - By(fmt.Sprintf("Job statuses not match, federation succeeded: %v/%v, clusters succeeded: %v\n", - fjob.Status.Succeeded, func(p *int32) int32 { - if p != nil { - return *p - } else { - return -1 - } - }(fjob.Spec.Completions), succeeded)) - return false, nil - }) - - return err -} - -func verifyJob(fedJob, localJob *batchv1.Job) bool { - localJob = localJob.DeepCopy() - localJob.Spec.ManualSelector = fedJob.Spec.ManualSelector - localJob.Spec.Completions = fedJob.Spec.Completions - localJob.Spec.Parallelism = fedJob.Spec.Parallelism - localJob.Spec.BackoffLimit = fedJob.Spec.BackoffLimit - return fedutil.ObjectMetaAndSpecEquivalent(fedJob, localJob) -} - -func createJobOrFail(clientset *fedclientset.Clientset, namespace string) *batchv1.Job { - if clientset == nil || len(namespace) == 0 { - Fail(fmt.Sprintf("Internal error: invalid parameters passed to createJobOrFail: clientset: %v, namespace: %v", clientset, namespace)) - } - By(fmt.Sprintf("Creating federation job %q in namespace %q", FederationJobName, namespace)) - - job := newJobForFed(namespace, FederationJobName, 5, 5) - - _, err := clientset.Batch().Jobs(namespace).Create(job) - framework.ExpectNoError(err, "Creating job %q in namespace %q", job.Name, namespace) - By(fmt.Sprintf("Successfully created federation job %q in namespace %q", FederationJobName, namespace)) - return job -} - -func deleteJobOrFail(clientset *fedclientset.Clientset, nsName string, jobName string, orphanDependents *bool) { - By(fmt.Sprintf("Deleting job %q in namespace %q", jobName, nsName)) - err := clientset.Batch().Jobs(nsName).Delete(jobName, &metav1.DeleteOptions{OrphanDependents: orphanDependents}) - if err != nil && !errors.IsNotFound(err) { - framework.ExpectNoError(err, "Error deleting job %q in namespace %q", jobName, nsName) - } - - // Wait for the job to be deleted. - err = wait.Poll(10*time.Second, fedframework.FederatedDefaultTestTimeout, func() (bool, error) { - _, err := clientset.Batch().Jobs(nsName).Get(jobName, metav1.GetOptions{}) - if err != nil && errors.IsNotFound(err) { - return true, nil - } - return false, err - }) - if err != nil { - framework.Failf("Error in deleting job %s: %v", jobName, err) - } -} - -func newJobForFed(namespace string, name string, completions int32, parallelism int32) *batchv1.Job { - return &batchv1.Job{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - }, - Spec: batchv1.JobSpec{ - Parallelism: ¶llelism, - Completions: &completions, - Template: v1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{"name": "fjob"}, - }, - Spec: v1.PodSpec{ - Containers: []v1.Container{ - { - Name: "sleep", - Image: "busybox", - Command: []string{"sleep", "1"}, - }, - }, - RestartPolicy: v1.RestartPolicyNever, - }, - }, - }, - } -} diff --git a/federation/test/e2e/namespace.go b/federation/test/e2e/namespace.go deleted file mode 100644 index f92db2cf3a..0000000000 --- a/federation/test/e2e/namespace.go +++ /dev/null @@ -1,236 +0,0 @@ -/* -Copyright 2016 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 e2e - -import ( - "fmt" - "strings" - "time" - - "k8s.io/api/core/v1" - "k8s.io/api/extensions/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apiserver/pkg/storage/names" - clientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/core/v1" - fedframework "k8s.io/kubernetes/federation/test/e2e/framework" - "k8s.io/kubernetes/test/e2e/framework" - - . "github.com/onsi/ginkgo" -) - -const ( - eventNamePrefix = "e2e-namespace-test-event-" - namespacePrefix = "e2e-namespace-test-" - replicaSetNamePrefix = "e2e-namespace-test-rs-" -) - -// Create/delete ingress api objects -var _ = framework.KubeDescribe("Federation namespace [Feature:Federation]", func() { - f := fedframework.NewDefaultFederatedFramework("federation-namespace") - - Describe("Namespace objects", func() { - var clusters fedframework.ClusterSlice - - var nsName string - - BeforeEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - clusters = f.GetRegisteredClusters() - }) - - AfterEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - deleteNamespace(nil, nsName, - f.FederationClientset.Core().Namespaces().Get, - f.FederationClientset.Core().Namespaces().Delete) - for _, cluster := range clusters { - deleteNamespace(nil, nsName, - cluster.CoreV1().Namespaces().Get, - cluster.CoreV1().Namespaces().Delete) - } - }) - - // See https://github.com/kubernetes/kubernetes/issues/38225 - It("deletes replicasets in the namespace when the namespace is deleted", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - nsName = createNamespace(f.FederationClientset.Core().Namespaces()) - rsName := names.SimpleNameGenerator.GenerateName(replicaSetNamePrefix) - replicaCount := int32(2) - rs := &v1beta1.ReplicaSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: rsName, - Namespace: nsName, - }, - Spec: v1beta1.ReplicaSetSpec{ - Replicas: &replicaCount, - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{"name": "myrs"}, - }, - Template: v1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{"name": "myrs"}, - }, - Spec: v1.PodSpec{ - Containers: []v1.Container{ - { - Name: "nginx", - Image: "nginx", - }, - }, - }, - }, - }, - } - - By(fmt.Sprintf("Creating replicaset %s in namespace %s", rsName, nsName)) - _, err := f.FederationClientset.Extensions().ReplicaSets(nsName).Create(rs) - if err != nil { - framework.Failf("Failed to create replicaset %v in namespace %s, err: %s", rs, nsName, err) - } - - By(fmt.Sprintf("Deleting namespace %s", nsName)) - deleteNamespace(nil, nsName, - f.FederationClientset.Core().Namespaces().Get, - f.FederationClientset.Core().Namespaces().Delete) - - By(fmt.Sprintf("Verify that replicaset %s was deleted as well", rsName)) - - waitForReplicaSetToBeDeletedOrFail(f.FederationClientset, nsName, rsName) - }) - - It("all resources in the namespace should be deleted when namespace is deleted", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - nsName = createNamespace(f.FederationClientset.Core().Namespaces()) - - // Create resources in the namespace. - event := v1.Event{ - ObjectMeta: metav1.ObjectMeta{ - Name: names.SimpleNameGenerator.GenerateName(eventNamePrefix), - Namespace: nsName, - }, - InvolvedObject: v1.ObjectReference{ - Kind: "Pod", - Namespace: nsName, - Name: "sample-pod", - }, - } - By(fmt.Sprintf("Creating event %s in namespace %s", event.Name, nsName)) - _, err := f.FederationClientset.Core().Events(nsName).Create(&event) - if err != nil { - framework.Failf("Failed to create event %v in namespace %s, err: %s", event, nsName, err) - } - - By(fmt.Sprintf("Deleting namespace %s", nsName)) - deleteNamespace(nil, nsName, - f.FederationClientset.Core().Namespaces().Get, - f.FederationClientset.Core().Namespaces().Delete) - - By(fmt.Sprintf("Verify that event %s was deleted as well", event.Name)) - latestEvent, err := f.FederationClientset.Core().Events(nsName).Get(event.Name, metav1.GetOptions{}) - if !errors.IsNotFound(err) { - framework.Failf("Event %s should have been deleted. Found: %v", event.Name, latestEvent) - } - By(fmt.Sprintf("Verified that deletion succeeded")) - }) - }) -}) - -// verifyNsCascadingDeletion verifies that namespaces are deleted from -// underlying clusters when orphan dependents is false and they are not -// deleted when orphan dependents is true. -func verifyNsCascadingDeletion(nsClient clientset.NamespaceInterface, clusters fedframework.ClusterSlice, orphanDependents *bool) string { - nsName := createNamespace(nsClient) - // Check subclusters if the namespace was created there. - By(fmt.Sprintf("Waiting for namespace %s to be created in all underlying clusters", nsName)) - err := wait.Poll(5*time.Second, 2*time.Minute, func() (bool, error) { - for _, cluster := range clusters { - _, err := cluster.CoreV1().Namespaces().Get(nsName, metav1.GetOptions{}) - if err != nil && !errors.IsNotFound(err) { - return false, err - } - if err != nil { - return false, nil - } - } - return true, nil - }) - framework.ExpectNoError(err, "Not all namespaces created") - - By(fmt.Sprintf("Deleting namespace %s", nsName)) - deleteNamespace(orphanDependents, nsName, nsClient.Get, nsClient.Delete) - - By(fmt.Sprintf("Verifying namespaces %s in underlying clusters", nsName)) - errMessages := []string{} - // namespace should be present in underlying clusters unless orphanDependents is false. - shouldExist := orphanDependents == nil || *orphanDependents == true - for _, cluster := range clusters { - clusterName := cluster.Name - _, err := cluster.CoreV1().Namespaces().Get(nsName, metav1.GetOptions{}) - if shouldExist && errors.IsNotFound(err) { - errMessages = append(errMessages, fmt.Sprintf("unexpected NotFound error for namespace %s in cluster %s, expected namespace to exist", nsName, clusterName)) - } else if !shouldExist && !errors.IsNotFound(err) { - errMessages = append(errMessages, fmt.Sprintf("expected NotFound error for namespace %s in cluster %s, got error: %v", nsName, clusterName, err)) - } - } - if len(errMessages) != 0 { - framework.Failf("%s", strings.Join(errMessages, "; ")) - } - return nsName -} - -func createNamespace(nsClient clientset.NamespaceInterface) string { - ns := v1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - Name: names.SimpleNameGenerator.GenerateName(namespacePrefix), - }, - } - By(fmt.Sprintf("Creating namespace %s", ns.Name)) - _, err := nsClient.Create(&ns) - framework.ExpectNoError(err, "Failed to create namespace %s", ns.Name) - By(fmt.Sprintf("Created namespace %s", ns.Name)) - return ns.Name -} - -func deleteNamespace(orphanDependents *bool, namespace string, getter func(name string, options metav1.GetOptions) (*v1.Namespace, error), deleter func(string, *metav1.DeleteOptions) error) { - By(fmt.Sprintf("Deleting namespace: %s", namespace)) - err := deleter(namespace, &metav1.DeleteOptions{OrphanDependents: orphanDependents}) - if errors.IsNotFound(err) { - return - } else if err != nil { - framework.Failf("Failed to set %s for deletion: %v", namespace, err) - } - waitForNamespaceDeletion(namespace, getter) -} - -func waitForNamespaceDeletion(namespace string, getter func(name string, options metav1.GetOptions) (*v1.Namespace, error)) { - err := wait.Poll(5*time.Second, 2*time.Minute, func() (bool, error) { - _, err := getter(namespace, metav1.GetOptions{}) - if errors.IsNotFound(err) { - return true, nil - } else if err != nil { - return false, err - } - return false, nil - }) - if err != nil { - framework.Failf("Namespaces not deleted: %v", err) - } -} diff --git a/federation/test/e2e/replicaset.go b/federation/test/e2e/replicaset.go deleted file mode 100644 index 7a307fb95f..0000000000 --- a/federation/test/e2e/replicaset.go +++ /dev/null @@ -1,461 +0,0 @@ -/* -Copyright 2016 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 e2e - -import ( - "encoding/json" - "fmt" - "reflect" - "time" - - "k8s.io/api/core/v1" - "k8s.io/api/extensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" - fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - fedutil "k8s.io/kubernetes/federation/pkg/federation-controller/util" - fedframework "k8s.io/kubernetes/federation/test/e2e/framework" - "k8s.io/kubernetes/test/e2e/framework" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/util/uuid" - "k8s.io/kubernetes/federation/apis/federation" - federatedtypes "k8s.io/kubernetes/federation/pkg/federatedtypes" -) - -const ( - FederationReplicaSetPrefix = "federation-replicaset-" -) - -// Create/delete replicaset api objects -var _ = framework.KubeDescribe("Federated ReplicaSet [Feature:Federation]", func() { - f := fedframework.NewDefaultFederatedFramework("federation-replicaset") - - Describe("ReplicaSet objects [NoCluster]", func() { - AfterEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - // Delete all replicasets. - nsName := f.FederationNamespace.Name - deleteAllReplicaSetsOrFail(f.FederationClientset, nsName) - }) - - It("should be created and deleted successfully", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - nsName := f.FederationNamespace.Name - rs := createReplicaSetOrFail(f.FederationClientset, newReplicaSet(nsName, FederationReplicaSetPrefix, 5, nil)) - By(fmt.Sprintf("Creation of replicaset %q in namespace %q succeeded. Deleting replicaset.", rs.Name, nsName)) - // Cleanup - err := f.FederationClientset.Extensions().ReplicaSets(nsName).Delete(rs.Name, &metav1.DeleteOptions{}) - framework.ExpectNoError(err, "Error deleting replicaset %q in namespace %q", rs.Name, rs.Namespace) - By(fmt.Sprintf("Deletion of replicaset %q in namespace %q succeeded.", rs.Name, nsName)) - }) - - }) - - // e2e cases for federated replicaset controller - Describe("Features", func() { - var ( - clusters fedframework.ClusterSlice - ) - - BeforeEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - clusters = f.GetRegisteredClusters() - }) - - // e2e cases for federated replicaset controller - Describe("Preferences", func() { - var ( - rs *v1beta1.ReplicaSet - ) - - AfterEach(func() { - // Delete all replicasets. - nsName := f.FederationNamespace.Name - if rs != nil { - orphanDependents := false - By(fmt.Sprintf("Deleting replicaset \"%s/%s\"", nsName, rs.Name)) - deleteReplicaSetOrFail(f.FederationClientset, nsName, rs.Name, &orphanDependents) - rs = nil - } - }) - - It("should create replicasets with weight preference", func() { - pref, replicas, expect := generateFedRSPrefsWithWeight(clusters) - rs = createAndUpdateFedRSWithPref(f.FederationClientset, f.FederationNamespace.Name, clusters, pref, replicas, expect) - }) - - It("should create replicasets with min replicas preference", func() { - pref, replicas, expect := generateFedRSPrefsWithMin(clusters) - rs = createAndUpdateFedRSWithPref(f.FederationClientset, f.FederationNamespace.Name, clusters, pref, replicas, expect) - }) - - It("should create replicasets with max replicas preference", func() { - pref, replicas, expect := generateFedRSPrefsWithMax(clusters) - rs = createAndUpdateFedRSWithPref(f.FederationClientset, f.FederationNamespace.Name, clusters, pref, replicas, expect) - }) - - // test for rebalancing - PIt("should create replicasets and rebalance them", func() { - nsName := f.FederationNamespace.Name - pref1, pref2, replicas, expect1, expect2 := generateFedRSPrefsForRebalancing(clusters) - - By("Testing replicaset rebalancing") - framework.Logf("Replicas: %d", replicas) - framework.Logf("Preference 1: %#v", pref1) - framework.Logf("Preference 2: %#v", pref2) - - rs = newReplicaSet(nsName, FederationReplicaSetPrefix, replicas, pref1) - rs = createReplicaSetOrFail(f.FederationClientset, rs) - waitForReplicaSetOrFail(f.FederationClientset, nsName, rs.Name, clusters, expect1) - By(fmt.Sprintf("Successfully created and synced replicaset \"%s/%s\" (%v/%v) to clusters", nsName, rs.Name, rs.Status.Replicas, *rs.Spec.Replicas)) - - rs = newReplicaSetWithName(nsName, rs.Name, replicas, pref2) - updateReplicaSetOrFail(f.FederationClientset, rs) - waitForReplicaSetOrFail(f.FederationClientset, nsName, rs.Name, clusters, expect1) - By(fmt.Sprintf("Successfully updated and synced replicaset \"%s/%s\" (%v/%v) to clusters", nsName, rs.Name, rs.Status.Replicas, *rs.Spec.Replicas)) - - pref2 = updateFedRSPrefsRebalance(pref2, true) - rs = newReplicaSetWithName(nsName, rs.Name, replicas, pref2) - updateReplicaSetOrFail(f.FederationClientset, rs) - waitForReplicaSetOrFail(f.FederationClientset, nsName, rs.Name, clusters, expect2) - By(fmt.Sprintf("Successfully updated and synced replicaset \"%s/%s\" (%v/%v) to clusters", nsName, rs.Name, rs.Status.Replicas, *rs.Spec.Replicas)) - }) - }) - }) -}) - -func createAndWaitForReplicasetOrFail(clientset *fedclientset.Clientset, nsName string, clusters fedframework.ClusterSlice) *v1beta1.ReplicaSet { - rs := createReplicaSetOrFail(clientset, newReplicaSet(nsName, FederationReplicaSetPrefix, 5, nil)) - // Check subclusters if the replicaSet was created there. - By(fmt.Sprintf("Waiting for replica sets %s to be created in all underlying clusters", rs.Name)) - err := wait.Poll(5*time.Second, 2*time.Minute, func() (bool, error) { - for _, cluster := range clusters { - _, err := cluster.Extensions().ReplicaSets(nsName).Get(rs.Name, metav1.GetOptions{}) - if err != nil && errors.IsNotFound(err) { - return false, nil - } - if err != nil { - return false, err - } - } - return true, nil - }) - framework.ExpectNoError(err, "Not all replica sets created") - return rs -} - -func createAndUpdateFedRSWithPref(clientset *fedclientset.Clientset, nsName string, clusters fedframework.ClusterSlice, pref *federation.ReplicaAllocationPreferences, replicas int32, expect map[string]int32) *v1beta1.ReplicaSet { - framework.Logf("Replicas: %d, Preference: %#v", replicas, pref) - rs := newReplicaSet(nsName, FederationReplicaSetPrefix, replicas, pref) - rs = createReplicaSetOrFail(clientset, rs) - - waitForReplicaSetOrFail(clientset, nsName, rs.Name, clusters, expect) - By(fmt.Sprintf("Successfully created and synced replicaset \"%s/%s\" (%v/%v) to clusters", nsName, rs.Name, rs.Status.Replicas, *rs.Spec.Replicas)) - - rs = newReplicaSetWithName(nsName, rs.Name, 0, pref) - updateReplicaSetOrFail(clientset, rs) - waitForReplicaSetOrFail(clientset, nsName, rs.Name, clusters, nil) - By(fmt.Sprintf("Successfully updated and synced replicaset \"%s/%s\" (%v/%v) to clusters", nsName, rs.Name, rs.Status.Replicas, *rs.Spec.Replicas)) - - rs = newReplicaSetWithName(nsName, rs.Name, replicas, pref) - updateReplicaSetOrFail(clientset, rs) - waitForReplicaSetOrFail(clientset, nsName, rs.Name, clusters, expect) - By(fmt.Sprintf("Successfully updated and synced replicaset \"%s/%s\" (%v/%v) to clusters", nsName, rs.Name, rs.Status.Replicas, *rs.Spec.Replicas)) - - return rs -} - -// deleteAllReplicaSetsOrFail deletes all replicasets in the given namespace name. -func deleteAllReplicaSetsOrFail(clientset *fedclientset.Clientset, nsName string) { - replicasetList, err := clientset.Extensions().ReplicaSets(nsName).List(metav1.ListOptions{}) - Expect(err).NotTo(HaveOccurred()) - orphanDependents := false - for _, replicaset := range replicasetList.Items { - deleteReplicaSetOrFail(clientset, nsName, replicaset.Name, &orphanDependents) - } -} - -func generateFedRSPrefsWithWeight(clusters fedframework.ClusterSlice) (pref *federation.ReplicaAllocationPreferences, replicas int32, expect map[string]int32) { - By("Generating replicaset preferences with weights") - clusterNames := extractClusterNames(clusters) - pref = &federation.ReplicaAllocationPreferences{ - Clusters: map[string]federation.ClusterPreferences{}, - } - replicas = 0 - expect = map[string]int32{} - - for i, clusterName := range clusterNames { - if i != 0 { // do not set weight for cluster[0] thus it should have no replicas scheduled - pref.Clusters[clusterName] = federation.ClusterPreferences{ - Weight: int64(i), - } - replicas += int32(i) - expect[clusterName] = int32(i) - } - } - return -} - -func generateFedRSPrefsWithMin(clusters fedframework.ClusterSlice) (pref *federation.ReplicaAllocationPreferences, replicas int32, expect map[string]int32) { - By("Generating replicaset preferences with min replicas") - clusterNames := extractClusterNames(clusters) - pref = &federation.ReplicaAllocationPreferences{ - Clusters: map[string]federation.ClusterPreferences{ - clusterNames[0]: {Weight: 100}, - }, - } - replicas = 0 - expect = map[string]int32{} - - for i, clusterName := range clusterNames { - if i != 0 { // do not set weight and minReplicas for cluster[0] thus it should have no replicas scheduled - pref.Clusters[clusterName] = federation.ClusterPreferences{ - Weight: int64(1), - MinReplicas: int64(i + 2), - } - replicas += int32(i + 2) - expect[clusterName] = int32(i + 2) - } - } - // the extra replica goes to cluster[0] which has the highest weight - replicas += 1 - expect[clusterNames[0]] = 1 - return -} - -func generateFedRSPrefsWithMax(clusters fedframework.ClusterSlice) (pref *federation.ReplicaAllocationPreferences, replicas int32, expect map[string]int32) { - By("Generating replicaset preferences with max replicas") - clusterNames := extractClusterNames(clusters) - pref = &federation.ReplicaAllocationPreferences{ - Clusters: map[string]federation.ClusterPreferences{ - clusterNames[0]: {Weight: 1}, - }, - } - replicas = 0 - expect = map[string]int32{} - - for i, clusterName := range clusterNames { - if i != 0 { // do not set maxReplicas for cluster[0] thus replicas exceeds the total maxReplicas turned to cluster[0] - maxReplicas := int64(i) - pref.Clusters[clusterName] = federation.ClusterPreferences{ - Weight: int64(100), - MaxReplicas: &maxReplicas, - } - replicas += int32(i) - expect[clusterName] = int32(i) - } - } - // extra replicas go to cluster[0] although it has the lowest weight as others hit the MaxReplicas - replicas += 5 - expect[clusterNames[0]] = 5 - return -} - -func updateFedRSPrefsRebalance(pref *federation.ReplicaAllocationPreferences, rebalance bool) *federation.ReplicaAllocationPreferences { - pref.Rebalance = rebalance - return pref -} - -func generateFedRSPrefsForRebalancing(clusters fedframework.ClusterSlice) (pref1, pref2 *federation.ReplicaAllocationPreferences, replicas int32, expect1, expect2 map[string]int32) { - By("Generating replicaset for rebalancing") - clusterNames := extractClusterNames(clusters) - replicas = 3 - - pref1 = &federation.ReplicaAllocationPreferences{ - Clusters: map[string]federation.ClusterPreferences{ - clusterNames[0]: {Weight: 1}, - clusterNames[1]: {Weight: 2}, - }, - } - expect1 = map[string]int32{ - clusterNames[0]: 1, - clusterNames[1]: 2, - } - pref2 = &federation.ReplicaAllocationPreferences{ - Clusters: map[string]federation.ClusterPreferences{ - clusterNames[0]: {Weight: 2}, - clusterNames[1]: {Weight: 1}, - }, - } - expect2 = map[string]int32{ - clusterNames[0]: 2, - clusterNames[1]: 1, - } - return -} - -func waitForReplicaSetOrFail(c *fedclientset.Clientset, namespace string, replicaSetName string, clusters fedframework.ClusterSlice, expect map[string]int32) { - err := waitForReplicaSet(c, namespace, replicaSetName, clusters, expect) - framework.ExpectNoError(err, "Failed to verify replica set \"%s/%s\", err: %v", namespace, replicaSetName, err) -} - -func waitForReplicaSet(c *fedclientset.Clientset, namespace string, replicaSetName string, clusters fedframework.ClusterSlice, expect map[string]int32) error { - framework.Logf("waitForReplicaSet: %s/%s; clusters: %v; expect: %v", namespace, replicaSetName, clusters, expect) - err := wait.Poll(10*time.Second, fedframework.FederatedDefaultTestTimeout, func() (bool, error) { - frs, err := c.ExtensionsV1beta1().ReplicaSets(namespace).Get(replicaSetName, metav1.GetOptions{}) - if err != nil { - return false, err - } - specReplicas, statusReplicas := int32(0), int32(0) - for _, cluster := range clusters { - // TODO: switch to use AppsV1beta2 ReplicaSet when apps/v1beta2 is enabled by default - rs, err := cluster.ExtensionsV1beta1().ReplicaSets(namespace).Get(replicaSetName, metav1.GetOptions{}) - if err != nil && !errors.IsNotFound(err) { - framework.Logf("Failed getting replicaset: \"%s/%s/%s\", err: %v", cluster.Name, namespace, replicaSetName, err) - return false, err - } - if errors.IsNotFound(err) { - if expect != nil && expect[cluster.Name] > 0 { - framework.Logf("Replicaset \"%s/%s/%s\" with replica count %d does not exist", cluster.Name, namespace, replicaSetName, expect[cluster.Name]) - return false, nil - } - } else { - if !equivalentReplicaSet(frs, rs) { - framework.Logf("Replicaset meta or spec does not match for cluster %q:\n federation: %v\n cluster: %v", cluster.Name, frs, rs) - return false, nil - } - if expect != nil && *rs.Spec.Replicas < expect[cluster.Name] { - framework.Logf("Replicas do not match for \"%s/%s/%s\": expected: >= %v, actual: %v", cluster.Name, namespace, replicaSetName, expect[cluster.Name], *rs.Spec.Replicas) - return false, nil - } - specReplicas += *rs.Spec.Replicas - statusReplicas += rs.Status.Replicas - } - } - if *frs.Spec.Replicas == 0 && frs.Status.Replicas != 0 { - framework.Logf("ReplicaSet \"%s/%s\" with zero replicas should match the status as no overflow happens: expected: 0, actual: %v", namespace, replicaSetName, frs.Status.Replicas) - return false, nil - } - if statusReplicas == frs.Status.Replicas && specReplicas >= *frs.Spec.Replicas { - return true, nil - } - framework.Logf("Replicas do not match, federation replicas: %v/%v, cluster replicas: %v/%v", frs.Status.Replicas, *frs.Spec.Replicas, statusReplicas, specReplicas) - return false, nil - }) - - return err -} - -func equivalentReplicaSet(fedReplicaSet, localReplicaSet *v1beta1.ReplicaSet) bool { - localReplicaSetSpec := localReplicaSet.Spec - localReplicaSetSpec.Replicas = fedReplicaSet.Spec.Replicas - return fedutil.ObjectMetaEquivalent(fedReplicaSet.ObjectMeta, localReplicaSet.ObjectMeta) && - reflect.DeepEqual(fedReplicaSet.Spec, localReplicaSetSpec) -} - -func createReplicaSetOrFail(clientset *fedclientset.Clientset, replicaset *v1beta1.ReplicaSet) *v1beta1.ReplicaSet { - namespace := replicaset.Namespace - if clientset == nil || len(namespace) == 0 { - Fail(fmt.Sprintf("Internal error: invalid parameters passed to createReplicaSetOrFail: clientset: %v, namespace: %v", clientset, namespace)) - } - By(fmt.Sprintf("Creating federation replicaset %q in namespace %q", replicaset.Name, namespace)) - - newRS, err := clientset.Extensions().ReplicaSets(namespace).Create(replicaset) - framework.ExpectNoError(err, "Creating replicaset %q in namespace %q", replicaset.Name, namespace) - By(fmt.Sprintf("Successfully created federation replicaset %q in namespace %q", newRS.Name, namespace)) - return newRS -} - -func deleteReplicaSetOrFail(clientset *fedclientset.Clientset, nsName string, replicaSetName string, orphanDependents *bool) { - By(fmt.Sprintf("Deleting replica set %q in namespace %q", replicaSetName, nsName)) - err := clientset.Extensions().ReplicaSets(nsName).Delete(replicaSetName, &metav1.DeleteOptions{OrphanDependents: orphanDependents}) - if err != nil && !errors.IsNotFound(err) { - framework.ExpectNoError(err, "Error deleting replica set %q in namespace %q", replicaSetName, nsName) - } - - waitForReplicaSetToBeDeletedOrFail(clientset, nsName, replicaSetName) -} - -func updateReplicaSetOrFail(clientset *fedclientset.Clientset, replicaset *v1beta1.ReplicaSet) *v1beta1.ReplicaSet { - namespace := replicaset.Namespace - if clientset == nil || len(namespace) == 0 { - Fail(fmt.Sprintf("Internal error: invalid parameters passed to updateReplicaSetOrFail: clientset: %v, namespace: %v", clientset, namespace)) - } - By(fmt.Sprintf("Updating federation replicaset %q in namespace %q", replicaset.Name, namespace)) - - newRS, err := clientset.ExtensionsV1beta1().ReplicaSets(namespace).Update(replicaset) - framework.ExpectNoError(err, "Updating replicaset %q in namespace %q", replicaset.Name, namespace) - By(fmt.Sprintf("Successfully updated federation replicaset %q in namespace %q", replicaset.Name, namespace)) - - return newRS -} - -func newReplicaSetObj(namespace string, replicas int32, pref *federation.ReplicaAllocationPreferences) *v1beta1.ReplicaSet { - // When the tests are run in parallel, replicasets from different tests can - // collide with each other. Prevent that by creating a unique label and - // label selector for each created replica set. - uuidString := string(uuid.NewUUID()) - rsLabel := fmt.Sprintf("myrs-%s", uuidString) - - rs := &v1beta1.ReplicaSet{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: namespace, - Annotations: map[string]string{}, - }, - Spec: v1beta1.ReplicaSetSpec{ - Replicas: &replicas, - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{"name": rsLabel}, - }, - Template: v1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{"name": rsLabel}, - }, - Spec: v1.PodSpec{ - Containers: []v1.Container{ - { - Name: "nginx", - Image: "nginx", - }, - }, - }, - }, - }, - } - if pref != nil { - prefBytes, _ := json.Marshal(pref) - prefString := string(prefBytes) - rs.Annotations[federatedtypes.FedReplicaSetPreferencesAnnotation] = prefString - } - return rs - -} - -func newReplicaSet(namespace string, prefix string, replicas int32, pref *federation.ReplicaAllocationPreferences) *v1beta1.ReplicaSet { - rs := newReplicaSetObj(namespace, replicas, pref) - rs.GenerateName = prefix - return rs -} - -func newReplicaSetWithName(namespace string, name string, replicas int32, pref *federation.ReplicaAllocationPreferences) *v1beta1.ReplicaSet { - rs := newReplicaSetObj(namespace, replicas, pref) - rs.Name = name - return rs -} - -func extractClusterNames(clusters fedframework.ClusterSlice) []string { - clusterNames := make([]string, 0, len(clusters)) - for _, cluster := range clusters { - clusterNames = append(clusterNames, cluster.Name) - } - return clusterNames -} diff --git a/federation/test/e2e/service.go b/federation/test/e2e/service.go deleted file mode 100644 index 5703e9be3d..0000000000 --- a/federation/test/e2e/service.go +++ /dev/null @@ -1,371 +0,0 @@ -/* -Copyright 2016 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 e2e - -import ( - "fmt" - "os" - "reflect" - "strconv" - "strings" - "time" - - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" - fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - fedframework "k8s.io/kubernetes/federation/test/e2e/framework" - "k8s.io/kubernetes/test/e2e/framework" - - . "github.com/onsi/ginkgo" -) - -const ( - FederatedServiceName = "federated-service" - FederatedServicePodName = "federated-service-test-pod" -) - -var FederatedServiceLabels = map[string]string{ - "foo": "bar", -} - -var _ = framework.KubeDescribe("Federated Services [Feature:Federation]", func() { - f := fedframework.NewDefaultFederatedFramework("federated-service") - var clusters fedframework.ClusterSlice - var federationName string - - var _ = Describe("Without Clusters [NoCluster]", func() { - BeforeEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - // Placeholder - }) - - AfterEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - }) - - It("should succeed when a service is created", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - nsName := f.FederationNamespace.Name - service := createServiceOrFail(f.FederationClientset, nsName, FederatedServiceName) - By(fmt.Sprintf("Creation of service %q in namespace %q succeeded. Deleting service.", service.Name, nsName)) - - // Cleanup - err := f.FederationClientset.CoreV1().Services(nsName).Delete(service.Name, &metav1.DeleteOptions{}) - framework.ExpectNoError(err, "Error deleting service %q in namespace %q", service.Name, service.Namespace) - By(fmt.Sprintf("Deletion of service %q in namespace %q succeeded.", service.Name, nsName)) - }) - }) - - var _ = Describe("with clusters", func() { - BeforeEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - // TODO: Federation API server should be able to answer this. - if federationName = os.Getenv("FEDERATION_NAME"); federationName == "" { - federationName = DefaultFederationName - } - - clusters = f.GetRegisteredClusters() - }) - - Describe("Federated Service", func() { - var ( - service *v1.Service - nsName string - ) - - BeforeEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - nsName = f.FederationNamespace.Name - }) - - AfterEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - if service != nil { - By(fmt.Sprintf("Deleting service shards and their provider resources in underlying clusters for service %q in namespace %q", service.Name, nsName)) - cleanupServiceShardsAndProviderResources(nsName, service, clusters) - service = nil - nsName = "" - } - }) - - It("should create and update matching services in underlying clusters", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - service = createServiceOrFail(f.FederationClientset, nsName, FederatedServiceName) - defer func() { // Cleanup - By(fmt.Sprintf("Deleting service %q in namespace %q", service.Name, nsName)) - err := f.FederationClientset.CoreV1().Services(nsName).Delete(service.Name, &metav1.DeleteOptions{}) - framework.ExpectNoError(err, "Error deleting service %q in namespace %q", service.Name, nsName) - }() - By(fmt.Sprintf("Wait for service shards to be created in all clusters for service \"%s/%s\"", nsName, service.Name)) - waitForServiceShardsOrFail(nsName, service, clusters) - framework.Logf("Successfully created and synced service \"%s/%s\" to all clusters", nsName, service.Name) - By(fmt.Sprintf("Update federated service \"%s/%s\"", nsName, service.Name)) - service = updateServiceOrFail(f.FederationClientset, nsName, FederatedServiceName) - waitForServiceShardsOrFail(nsName, service, clusters) - framework.Logf("Successfully updated and synced service \"%s/%s\" to clusters", nsName, service.Name) - }) - - It("should be deleted from underlying clusters when OrphanDependents is false", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - orphanDependents := false - verifyCascadingDeletionForService(f.FederationClientset, clusters, &orphanDependents, nsName) - By(fmt.Sprintf("Verified that services were deleted from underlying clusters")) - }) - - It("should not be deleted from underlying clusters when OrphanDependents is true", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - orphanDependents := true - verifyCascadingDeletionForService(f.FederationClientset, clusters, &orphanDependents, nsName) - By(fmt.Sprintf("Verified that services were not deleted from underlying clusters")) - }) - - It("should not be deleted from underlying clusters when OrphanDependents is nil", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - verifyCascadingDeletionForService(f.FederationClientset, clusters, nil, nsName) - By(fmt.Sprintf("Verified that services were not deleted from underlying clusters")) - }) - - It("should recreate service shard in underlying clusters when service shard is deleted", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - service = createServiceOrFail(f.FederationClientset, nsName, FederatedServiceName) - defer func() { - // Cleanup - By(fmt.Sprintf("Deleting service %q in namespace %q", service.Name, nsName)) - err := f.FederationClientset.CoreV1().Services(nsName).Delete(service.Name, &metav1.DeleteOptions{}) - framework.ExpectNoError(err, "Error deleting service %q in namespace %q", service.Name, nsName) - }() - By(fmt.Sprintf("Wait for service shards to be created in all clusters for service \"%s/%s\"", nsName, service.Name)) - waitForServiceShardsOrFail(nsName, service, clusters) - framework.Logf("Successfully created and synced service \"%s/%s\" to all clusters", nsName, service.Name) - - By(fmt.Sprintf("Deleting a service shard in one underlying cluster")) - primaryClusterName := clusters[0].Name - err := deleteServiceShard(clusters[0], nsName, FederatedServiceName) - framework.ExpectNoError(err, fmt.Sprintf("while deleting service shard %q in cluster %q", FederatedServiceName, primaryClusterName)) - - waitForServiceShardsOrFail(nsName, service, clusters) - framework.Logf("Successfully recreated service shard \"%s/%s\" in %q cluster", nsName, service.Name, primaryClusterName) - }) - }) - - var _ = Describe("DNS", func() { - - var ( - service *v1.Service - serviceShard *v1.Service - backendPods BackendPodMap - ) - - BeforeEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - nsName := f.FederationNamespace.Name - - backendPods = createBackendPodsOrFail(clusters, nsName, FederatedServicePodName) - - service = createLBServiceOrFail(f.FederationClientset, nsName, FederatedServiceName, clusters) - serviceShard := service.DeepCopy() - - waitForServiceShardsOrFail(nsName, serviceShard, clusters) - }) - - AfterEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - nsName := f.FederationNamespace.Name - deleteBackendPodsOrFail(clusters, backendPods) - backendPods = nil - - if service != nil { - deleteServiceOrFail(f.FederationClientset, nsName, service.Name, nil) - service = nil - } else { - By("No service to delete. Service is nil") - } - - if serviceShard != nil { - By(fmt.Sprintf("Deleting service shards and their provider resources in underlying clusters for service %q in namespace %q", serviceShard.Name, nsName)) - cleanupServiceShardsAndProviderResources(nsName, serviceShard, clusters) - serviceShard = nil - } else { - By("No service shards to delete. `serviceShard` is nil") - } - }) - - It("should be able to discover a federated service", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - nsName := f.FederationNamespace.Name - svcDNSNames := []string{ - FederatedServiceName, - fmt.Sprintf("%s.%s", FederatedServiceName, nsName), - fmt.Sprintf("%s.%s.svc.cluster.local.", FederatedServiceName, nsName), - fmt.Sprintf("%s.%s.%s", FederatedServiceName, nsName, federationName), - fmt.Sprintf("%s.%s.%s.svc.cluster.local.", FederatedServiceName, nsName, federationName), - } - // TODO(mml): This could be much faster. We can launch all the test - // pods, perhaps in the BeforeEach, and then just poll until we get - // successes/failures from them all. - for i, DNSName := range svcDNSNames { - discoverService(f, DNSName, true, "federated-service-e2e-discovery-pod-"+strconv.Itoa(i)) - } - By("Verified that DNS rules are working as expected") - - By("Deleting the service to verify that DNS rules still work") - err := f.FederationClientset.CoreV1().Services(nsName).Delete(FederatedServiceName, &metav1.DeleteOptions{}) - framework.ExpectNoError(err, "Error deleting service %q in namespace %q", service.Name, service.Namespace) - // Service is deleted, unset the test block-global service variable. - service = nil - - for i, DNSName := range svcDNSNames { - discoverService(f, DNSName, true, "federated-service-e2e-discovery-pod-"+strconv.Itoa(i)) - } - By("Verified that deleting the service does not affect DNS records") - }) - - Context("non-local federated service", func() { - BeforeEach(func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - // Delete the backend pod from the shard which is local to the discovery pod. - primaryCluster := clusters[0] - backendPod := backendPods[primaryCluster.Name] - deleteOneBackendPodOrFail(primaryCluster, backendPod) - - }) - - PIt("should be able to discover a non-local federated service", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - nsName := f.FederationNamespace.Name - svcDNSNames := []string{ - fmt.Sprintf("%s.%s.%s", FederatedServiceName, nsName, federationName), - fmt.Sprintf("%s.%s.%s.svc.cluster.local.", FederatedServiceName, nsName, federationName), - } - for i, name := range svcDNSNames { - discoverService(f, name, true, "federated-service-e2e-discovery-pod-"+strconv.Itoa(i)) - } - }) - - // TODO(mml): This currently takes 9 minutes. Consider reducing the - // TTL and/or running the pods in parallel. - Context("[Slow] missing local service", func() { - It("should never find DNS entries for a missing local service", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - - nsName := f.FederationNamespace.Name - localSvcDNSNames := []string{ - FederatedServiceName, - fmt.Sprintf("%s.%s", FederatedServiceName, nsName), - fmt.Sprintf("%s.%s.svc.cluster.local.", FederatedServiceName, nsName), - } - for i, name := range localSvcDNSNames { - discoverService(f, name, false, "federated-service-e2e-discovery-pod-"+strconv.Itoa(i)) - } - }) - }) - }) - }) - }) -}) - -// verifyCascadingDeletionForService verifies that services are deleted from -// underlying clusters when orphan dependents is false and they are not -// deleted when orphan dependents is true. -func verifyCascadingDeletionForService(clientset *fedclientset.Clientset, clusters fedframework.ClusterSlice, orphanDependents *bool, nsName string) { - service := createServiceOrFail(clientset, nsName, FederatedServiceName) - serviceName := service.Name - // Check subclusters if the service was created there. - By(fmt.Sprintf("Waiting for service %s to be created in all underlying clusters", serviceName)) - err := wait.Poll(5*time.Second, 2*time.Minute, func() (bool, error) { - for _, cluster := range clusters { - _, err := cluster.CoreV1().Services(nsName).Get(serviceName, metav1.GetOptions{}) - if err != nil { - if !errors.IsNotFound(err) { - return false, err - } - return false, nil - } - } - return true, nil - }) - framework.ExpectNoError(err, "Not all services created") - - By(fmt.Sprintf("Deleting service %s", serviceName)) - deleteServiceOrFail(clientset, nsName, serviceName, orphanDependents) - - By(fmt.Sprintf("Verifying services %s in underlying clusters", serviceName)) - errMessages := []string{} - // service should be present in underlying clusters unless orphanDependents is false. - shouldExist := orphanDependents == nil || *orphanDependents == true - for _, cluster := range clusters { - clusterName := cluster.Name - _, err := cluster.CoreV1().Services(nsName).Get(serviceName, metav1.GetOptions{}) - if shouldExist && errors.IsNotFound(err) { - errMessages = append(errMessages, fmt.Sprintf("unexpected NotFound error for service %s in cluster %s, expected service to exist", serviceName, clusterName)) - } else if !shouldExist && !errors.IsNotFound(err) { - errMessages = append(errMessages, fmt.Sprintf("expected NotFound error for service %s in cluster %s, got error: %v", serviceName, clusterName, err)) - } - } - if len(errMessages) != 0 { - framework.Failf("%s", strings.Join(errMessages, "; ")) - } -} - -func updateServiceOrFail(clientset *fedclientset.Clientset, namespace, name string) *v1.Service { - service, err := clientset.CoreV1().Services(namespace).Get(name, metav1.GetOptions{}) - framework.ExpectNoError(err, "Getting service %q in namespace %q", name, namespace) - service.Spec.Selector["name"] = "update-demo" - newService, err := clientset.CoreV1().Services(namespace).Update(service) - By(fmt.Sprintf("Successfully updated federated service %q in namespace %q", name, namespace)) - return newService -} - -func deleteServiceShard(c *fedframework.Cluster, namespace, service string) error { - err := c.Clientset.CoreV1().Services(namespace).Delete(service, &metav1.DeleteOptions{}) - if err != nil && !errors.IsNotFound(err) { - framework.Logf("Failed to delete service %q in namespace %q, in cluster %q", service, namespace, c.Name) - return err - } - By(fmt.Sprintf("Service %q in namespace %q in cluster %q deleted", service, namespace, c.Name)) - return nil -} - -// equivalent returns true if the two services are equivalent. Fields which are expected to differ between -// federated services and the underlying cluster services (e.g. ClusterIP, NodePort) are ignored. -func equivalent(federationService, clusterService v1.Service) bool { - clusterService.Spec.ClusterIP = federationService.Spec.ClusterIP - for i := range clusterService.Spec.Ports { - clusterService.Spec.Ports[i].NodePort = federationService.Spec.Ports[i].NodePort - } - - if federationService.Name != clusterService.Name || federationService.Namespace != clusterService.Namespace { - return false - } - if !reflect.DeepEqual(federationService.Labels, clusterService.Labels) && (len(federationService.Labels) != 0 || len(clusterService.Labels) != 0) { - return false - } - if !reflect.DeepEqual(federationService.Spec, clusterService.Spec) { - return false - } - return true -} diff --git a/federation/test/e2e/upgrade.go b/federation/test/e2e/upgrade.go deleted file mode 100644 index e760686210..0000000000 --- a/federation/test/e2e/upgrade.go +++ /dev/null @@ -1,139 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package e2e - -import ( - fedframework "k8s.io/kubernetes/federation/test/e2e/framework" - "k8s.io/kubernetes/federation/test/e2e/upgrades" - "k8s.io/kubernetes/test/e2e/chaosmonkey" - "k8s.io/kubernetes/test/e2e/framework" - - . "github.com/onsi/ginkgo" -) - -var upgradeTests = upgrades.SimpleUpgradeTests() - -var _ = framework.KubeDescribe("Upgrade [Feature:Upgrade]", func() { - f := fedframework.NewDefaultFederatedFramework("federation-upgrade") - - framework.KubeDescribe("Federation Control Plane upgrade", func() { - It("should maintain a functioning federation [Feature:FCPUpgrade]", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - cm := chaosmonkey.New(func() { - federationControlPlaneUpgrade(f) - }) - for _, t := range upgradeTests { - cm.RegisterInterface(&chaosMonkeyAdapter{ - test: t, - framework: f, - upgradeType: upgrades.FCPUpgrade, - }) - } - cm.Do() - }) - }) - - framework.KubeDescribe("Federated clusters upgrade", func() { - It("should maintain a functioning federation [Feature:FederatedClustersUpgrade]", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - cm := chaosmonkey.New(func() { - federatedClustersUpgrade(f) - }) - for _, t := range upgradeTests { - cm.RegisterInterface(&chaosMonkeyAdapter{ - test: t, - framework: f, - upgradeType: upgrades.FederatedClustersUpgrade, - }) - } - cm.Do() - }) - }) - - framework.KubeDescribe("FCP upgrade followed by federated clusters upgrade", func() { - It("should maintain a functioning federation [Feature:FCPUpgradeFollowedByFederatedClustersUpgrade]", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - cm := chaosmonkey.New(func() { - federationControlPlaneUpgrade(f) - federatedClustersUpgrade(f) - }) - for _, t := range upgradeTests { - cm.RegisterInterface(&chaosMonkeyAdapter{ - test: t, - framework: f, - upgradeType: upgrades.FCPUpgradeFollowedByFederatedClustersUpgrade, - }) - } - cm.Do() - }) - }) - - framework.KubeDescribe("Federated clusters upgrade followed by FCP upgrade", func() { - It("should maintain a functioning federation [Feature:FederatedClustersUpgradeFollowedByFCPUpgrade]", func() { - fedframework.SkipUnlessFederated(f.ClientSet) - cm := chaosmonkey.New(func() { - federatedClustersUpgrade(f) - federationControlPlaneUpgrade(f) - }) - for _, t := range upgradeTests { - cm.RegisterInterface(&chaosMonkeyAdapter{ - test: t, - framework: f, - upgradeType: upgrades.FederatedClustersUpgradeFollowedByFCPUpgrade, - }) - } - cm.Do() - }) - }) -}) - -type chaosMonkeyAdapter struct { - test upgrades.Test - framework *fedframework.Framework - upgradeType upgrades.FederationUpgradeType -} - -func (cma *chaosMonkeyAdapter) Setup() { - cma.test.Setup(cma.framework) -} - -func (cma *chaosMonkeyAdapter) Test(stopCh <-chan struct{}) { - cma.test.Test(cma.framework, stopCh, cma.upgradeType) -} - -func (cma *chaosMonkeyAdapter) Teardown() { - cma.test.Teardown(cma.framework) -} - -func federationControlPlaneUpgrade(f *fedframework.Framework) { - federationVersion, err := framework.RealVersion(framework.TestContext.FederationUpgradeTarget) - framework.ExpectNoError(err) - framework.ExpectNoError(fedframework.FederationControlPlaneUpgrade(federationVersion)) - framework.ExpectNoError(fedframework.CheckFederationVersion(f.FederationClientset, federationVersion)) -} - -func federatedClustersUpgrade(f *fedframework.Framework) { - k8sVersion, err := framework.RealVersion(framework.TestContext.UpgradeTarget) - framework.ExpectNoError(err) - clusters := f.GetRegisteredClusters() - for _, cluster := range clusters { - framework.ExpectNoError(fedframework.MasterUpgrade(cluster.Name, k8sVersion)) - framework.ExpectNoError(framework.CheckMasterVersion(cluster.Clientset, k8sVersion)) - - // TODO: Need to add Node upgrade. Add once this framework is stable - } -} diff --git a/federation/test/e2e/upgrades/BUILD b/federation/test/e2e/upgrades/BUILD deleted file mode 100644 index 0907ed8587..0000000000 --- a/federation/test/e2e/upgrades/BUILD +++ /dev/null @@ -1,35 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "simple.go", - "upgrade.go", - ], - importpath = "k8s.io/kubernetes/federation/test/e2e/upgrades", - deps = [ - "//federation/pkg/federatedtypes:go_default_library", - "//federation/pkg/federatedtypes/crudtester:go_default_library", - "//federation/test/e2e/framework:go_default_library", - "//vendor/github.com/onsi/ginkgo:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/test/e2e/upgrades/simple.go b/federation/test/e2e/upgrades/simple.go deleted file mode 100644 index 880b6edced..0000000000 --- a/federation/test/e2e/upgrades/simple.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package upgrades - -import ( - "fmt" - - pkgruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/kubernetes/federation/pkg/federatedtypes" - crudtester "k8s.io/kubernetes/federation/pkg/federatedtypes/crudtester" - fedframework "k8s.io/kubernetes/federation/test/e2e/framework" - - . "github.com/onsi/ginkgo" -) - -// SimpleUpgradeTest validates that a federated resource remains -// propagated before and after a control plane upgrade -type SimpleUpgradeTest struct { - kind string - adapterFactory federatedtypes.AdapterFactory - crudTester *crudtester.FederatedTypeCRUDTester - obj pkgruntime.Object -} - -// Setup creates a resource and validates its propagation to member clusters -func (ut *SimpleUpgradeTest) Setup(f *fedframework.Framework) { - adapter := ut.adapterFactory(f.FederationClientset, f.FederationConfig, nil) - clients := f.GetClusterClients() - ut.crudTester = fedframework.NewFederatedTypeCRUDTester(adapter, clients) - - By(fmt.Sprintf("Creating a resource of kind %q and validating propagation to member clusters", ut.kind)) - obj := adapter.NewTestObject(f.Namespace.Name) - ut.obj = ut.crudTester.CheckCreate(obj) -} - -// Test validates that a resource remains propagated post-upgrade -func (ut *SimpleUpgradeTest) Test(f *fedframework.Framework, done <-chan struct{}, upgrade FederationUpgradeType) { - <-done - By(fmt.Sprintf("Validating that a resource of kind %q remains propagated to member clusters after upgrade", ut.kind)) - ut.crudTester.CheckPropagation(ut.obj) -} - -// Teardown cleans up remaining resources -func (ut *SimpleUpgradeTest) Teardown(f *fedframework.Framework) { - // Rely on the namespace deletion to clean up everything -} - -// SimpleUpgradeTests collects simple upgrade tests for registered federated types -func SimpleUpgradeTests() []Test { - tests := []Test{} - for kind, fedType := range federatedtypes.FederatedTypes() { - tests = append(tests, &SimpleUpgradeTest{ - kind: kind, - adapterFactory: fedType.AdapterFactory, - }) - } - return tests -} diff --git a/federation/test/e2e/upgrades/upgrade.go b/federation/test/e2e/upgrades/upgrade.go deleted file mode 100644 index e2c9bb911d..0000000000 --- a/federation/test/e2e/upgrades/upgrade.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package upgrades provides a framework for testing Kubernetes federation -// features before, during, and after different types of upgrades. -package upgrades - -import fedframework "k8s.io/kubernetes/federation/test/e2e/framework" - -// FederationUpgradeType represents different types of federation upgrades. -type FederationUpgradeType int - -const ( - // FCPUpgrade indicates that federation control plane is being upgraded. - FCPUpgrade FederationUpgradeType = iota - - // FederatedClustersUpgrade indicates that federated clusters are being upgraded. - FederatedClustersUpgrade - - // FCPUpgradeFollowedByFederatedClustersUpgrade indicates that federation control plane is upgraded - // followed by federated clusters upgrade. - FCPUpgradeFollowedByFederatedClustersUpgrade - - // FederatedClustersUpgradeFollowedByFCPUpgrade indicates that federated clusters are upgraded - // followed by federation control plane upgrade. - FederatedClustersUpgradeFollowedByFCPUpgrade -) - -// Test is an interface for federation upgrade tests. -type Test interface { - // Setup should create and verify whatever objects need to - // exist before the upgrade disruption starts. - Setup(f *fedframework.Framework) - - // Test will run during the upgrade. When the upgrade is - // complete, done will be closed and final validation can - // begin. - Test(f *fedframework.Framework, done <-chan struct{}, upgrade FederationUpgradeType) - - // TearDown should clean up any objects that are created that - // aren't already cleaned up by the framework. - Teardown(f *fedframework.Framework) -} diff --git a/federation/test/e2e/util.go b/federation/test/e2e/util.go deleted file mode 100644 index 972227d261..0000000000 --- a/federation/test/e2e/util.go +++ /dev/null @@ -1,512 +0,0 @@ -/* -Copyright 2016 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 e2e - -import ( - "fmt" - "time" - - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/apimachinery/pkg/util/rand" - "k8s.io/apimachinery/pkg/util/wait" - kubeclientset "k8s.io/client-go/kubernetes" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - fedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - fedframework "k8s.io/kubernetes/federation/test/e2e/framework" - "k8s.io/kubernetes/pkg/cloudprovider" - "k8s.io/kubernetes/test/e2e/common" - "k8s.io/kubernetes/test/e2e/framework" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var ( - DefaultFederationName = "e2e-federation" - // We use this to decide how long to wait for our DNS probes to succeed. - DNSTTL = 180 * time.Second // TODO: make k8s.io/kubernetes/federation/pkg/federation-controller/service.minDnsTtl exported, and import it here. -) - -const ( - // [30000, 32767] is the allowed default service nodeport range and our - // tests just use the defaults. - FederatedSvcNodePortFirst = 30000 - FederatedSvcNodePortLast = 32767 -) - -var FederationSuite common.Suite - -func createClusterObjectOrFail(f *fedframework.Framework, context *fedframework.E2EContext, clusterNamePrefix string) { - clusterName := clusterNamePrefix + context.Name - framework.Logf("Creating cluster object: %s (%s, secret: %s)", clusterName, context.Cluster.Cluster.Server, context.Name) - cluster := federationapi.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: clusterName, - }, - Spec: federationapi.ClusterSpec{ - ServerAddressByClientCIDRs: []federationapi.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: context.Cluster.Cluster.Server, - }, - }, - SecretRef: &v1.LocalObjectReference{ - // Note: Name must correlate with federation build script secret name, - // which currently matches the cluster name. - // See federation/cluster/common.sh:132 - Name: context.Name, - }, - }, - } - if clusterNamePrefix != "" { - cluster.Labels = map[string]string{"prefix": clusterNamePrefix} - } - _, err := f.FederationClientset.Federation().Clusters().Create(&cluster) - framework.ExpectNoError(err, fmt.Sprintf("creating cluster: %+v", err)) - framework.Logf("Successfully created cluster object: %s (%s, secret: %s)", clusterName, context.Cluster.Cluster.Server, context.Name) -} - -// waitForServiceOrFail waits until a service is either present or absent in the cluster specified by clientset. -// If the condition is not met within timout, it fails the calling test. -func waitForServiceOrFail(clientset *kubeclientset.Clientset, namespace string, service *v1.Service, present bool, timeout time.Duration) { - By(fmt.Sprintf("Fetching a federated service shard of service %q in namespace %q from cluster", service.Name, namespace)) - err := wait.PollImmediate(framework.Poll, timeout, func() (bool, error) { - clusterService, err := clientset.CoreV1().Services(namespace).Get(service.Name, metav1.GetOptions{}) - if (!present) && errors.IsNotFound(err) { // We want it gone, and it's gone. - By(fmt.Sprintf("Success: shard of federated service %q in namespace %q in cluster is absent", service.Name, namespace)) - return true, nil // Success - } - if present && err == nil { // We want it present, and the Get succeeded, so we're all good. - if equivalent(*clusterService, *service) { - By(fmt.Sprintf("Success: shard of federated service %q in namespace %q in cluster is present", service.Name, namespace)) - return true, nil // Success - } - return false, nil - } - By(fmt.Sprintf("Service %q in namespace %q in cluster. Found: %v, waiting for Found: %v, trying again in %s (err=%v)", service.Name, namespace, clusterService != nil && err == nil, present, framework.Poll, err)) - return false, nil - }) - framework.ExpectNoError(err, "Failed to verify service %q in namespace %q in cluster: Present=%v", service.Name, namespace, present) -} - -// waitForServiceShardsOrFail waits for the service to appear in all clusters -func waitForServiceShardsOrFail(namespace string, service *v1.Service, clusters fedframework.ClusterSlice) { - framework.Logf("Waiting for service %q in %d clusters", service.Name, len(clusters)) - for _, c := range clusters { - waitForServiceOrFail(c.Clientset, namespace, service, true, fedframework.FederatedDefaultTestTimeout) - } -} - -func createService(clientset *fedclientset.Clientset, namespace, name string) (*v1.Service, error) { - if clientset == nil || len(namespace) == 0 { - return nil, fmt.Errorf("Internal error: invalid parameters passed to createService: clientset: %v, namespace: %v", clientset, namespace) - } - By(fmt.Sprintf("Creating federated service %q in namespace %q", name, namespace)) - - service := &v1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - }, - Spec: v1.ServiceSpec{ - Selector: FederatedServiceLabels, - Type: v1.ServiceTypeClusterIP, - Ports: []v1.ServicePort{ - { - Name: "http", - Protocol: v1.ProtocolTCP, - Port: 80, - TargetPort: intstr.FromInt(8080), - }, - }, - SessionAffinity: v1.ServiceAffinityNone, - }, - } - - By(fmt.Sprintf("Trying to create service %q in namespace %q", service.Name, namespace)) - return clientset.CoreV1().Services(namespace).Create(service) -} - -func createLBService(clientset *fedclientset.Clientset, namespace, name string, clusters fedframework.ClusterSlice) (*v1.Service, error) { - if clientset == nil || len(namespace) == 0 { - return nil, fmt.Errorf("Internal error: invalid parameters passed to createService: clientset: %v, namespace: %v", clientset, namespace) - } - By(fmt.Sprintf("Creating federated service (type: load balancer) %q in namespace %q", name, namespace)) - - // Tests can be run in parallel, so we need a different nodePort for - // each test. - // we add in a array all the "available" ports - availablePorts := make([]int32, FederatedSvcNodePortLast-FederatedSvcNodePortFirst) - for i := range availablePorts { - availablePorts[i] = int32(FederatedSvcNodePortFirst + i) - } - - var err error - var service *v1.Service - retry := 10 // the function should retry the service creation on different port only 10 time. - - // until the availablePort list is not empty, lets try to create the service - for len(availablePorts) > 0 && retry > 0 { - // select the Id of an available port - i := rand.Intn(len(availablePorts)) - - By(fmt.Sprintf("try creating federated service %q in namespace %q with nodePort %d", name, namespace, availablePorts[i])) - - service, err = createServiceWithNodePort(clientset, namespace, name, availablePorts[i]) - if err == nil { - // check if service have been created properly in all clusters. - // if the service is not present in one of the clusters, we should cleanup all services - if err = checkServicesCreation(namespace, name, clusters); err == nil { - // everything was created properly so returns the federated service. - return service, nil - } - } - - // in case of error, cleanup everything - if service != nil { - if err = deleteService(clientset, namespace, name, nil); err != nil { - framework.ExpectNoError(err, "Deleting service %q after a partial createService() error", service.Name) - return nil, err - } - - cleanupServiceShardsAndProviderResources(namespace, service, clusters) - } - - // creation failed, lets try with another port - // first remove from the availablePorts the port with which the creation failed - availablePorts = append(availablePorts[:i], availablePorts[i+1:]...) - retry-- - } - - return nil, err -} - -func createServiceWithNodePort(clientset *fedclientset.Clientset, namespace, name string, nodePort int32) (*v1.Service, error) { - service := &v1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - }, - Spec: v1.ServiceSpec{ - Selector: FederatedServiceLabels, - Type: v1.ServiceTypeLoadBalancer, - Ports: []v1.ServicePort{ - { - Name: "http", - Protocol: v1.ProtocolTCP, - Port: 80, - TargetPort: intstr.FromInt(8080), - NodePort: nodePort, - }, - }, - SessionAffinity: v1.ServiceAffinityNone, - }, - } - - By(fmt.Sprintf("Trying to create service %q in namespace %q", service.Name, namespace)) - return clientset.CoreV1().Services(namespace).Create(service) -} - -// checkServicesCreation checks if the service have been created successfuly in all the clusters. -// if the service is not present in at least one of the clusters, this function returns an error. -func checkServicesCreation(namespace, serviceName string, clusters fedframework.ClusterSlice) error { - framework.Logf("check if service %q have been created in %d clusters", serviceName, len(clusters)) - for _, cluster := range clusters { - name := cluster.Name - err := wait.PollImmediate(framework.Poll, fedframework.FederatedDefaultTestTimeout, func() (bool, error) { - var err error - _, err = cluster.Clientset.CoreV1().Services(namespace).Get(serviceName, metav1.GetOptions{}) - if err != nil && !errors.IsNotFound(err) { - // Get failed with an error, try again. - framework.Logf("Failed to find service %q in namespace %q, in cluster %q: %v. Trying again in %s", serviceName, namespace, name, err, framework.Poll) - return false, err - } else if errors.IsNotFound(err) { - framework.Logf("Service %q in namespace %q in cluster %q not found. Trying again in %s", serviceName, namespace, name, framework.Poll) - return false, nil - } - By(fmt.Sprintf("Service %q in namespace %q in cluster %q found", serviceName, namespace, name)) - return true, nil - }) - if err != nil { - return err - } - } - return nil -} - -func createServiceOrFail(clientset *fedclientset.Clientset, namespace, name string) *v1.Service { - service, err := createService(clientset, namespace, name) - framework.ExpectNoError(err, "Creating service %q in namespace %q", service.Name, namespace) - By(fmt.Sprintf("Successfully created federated service %q in namespace %q", name, namespace)) - return service -} - -func createLBServiceOrFail(clientset *fedclientset.Clientset, namespace, name string, clusters fedframework.ClusterSlice) *v1.Service { - service, err := createLBService(clientset, namespace, name, clusters) - framework.ExpectNoError(err, "Creating service %q in namespace %q", service.Name, namespace) - By(fmt.Sprintf("Successfully created federated service (type: load balancer) %q in namespace %q", name, namespace)) - return service -} - -func deleteServiceOrFail(clientset *fedclientset.Clientset, namespace string, serviceName string, orphanDependents *bool) { - if clientset == nil || len(namespace) == 0 || len(serviceName) == 0 { - Fail(fmt.Sprintf("Internal error: invalid parameters passed to deleteServiceOrFail: clientset: %v, namespace: %v, service: %v", clientset, namespace, serviceName)) - } - framework.Logf("Deleting service %q in namespace %v", serviceName, namespace) - - err := deleteService(clientset, namespace, serviceName, orphanDependents) - if err != nil { - framework.ExpectNoError(err, "Error deleting service %q from namespace %q", serviceName, namespace) - } -} - -func deleteService(clientset *fedclientset.Clientset, namespace string, serviceName string, orphanDependents *bool) error { - err := clientset.CoreV1().Services(namespace).Delete(serviceName, &metav1.DeleteOptions{OrphanDependents: orphanDependents}) - if err != nil { - return err - } - // Wait for the service to be deleted. - err = wait.Poll(5*time.Second, fedframework.FederatedDefaultTestTimeout, func() (bool, error) { - _, err := clientset.Core().Services(namespace).Get(serviceName, metav1.GetOptions{}) - if err != nil && errors.IsNotFound(err) { - return true, nil - } - return false, err - }) - return err -} - -func cleanupServiceShardsAndProviderResources(namespace string, service *v1.Service, clusters fedframework.ClusterSlice) { - framework.Logf("Deleting service %q in %d clusters", service.Name, len(clusters)) - for _, c := range clusters { - name := c.Name - var cSvc *v1.Service - - err := wait.PollImmediate(framework.Poll, fedframework.FederatedDefaultTestTimeout, func() (bool, error) { - var err error - cSvc, err = c.Clientset.CoreV1().Services(namespace).Get(service.Name, metav1.GetOptions{}) - if err != nil && !errors.IsNotFound(err) { - // Get failed with an error, try again. - framework.Logf("Failed to find service %q in namespace %q, in cluster %q: %v. Trying again in %s", service.Name, namespace, name, err, framework.Poll) - return false, nil - } else if errors.IsNotFound(err) { - cSvc = nil - By(fmt.Sprintf("Service %q in namespace %q in cluster %q not found", service.Name, namespace, name)) - return true, err - } - By(fmt.Sprintf("Service %q in namespace %q in cluster %q found", service.Name, namespace, name)) - return true, err - }) - - if err != nil || cSvc == nil { - By(fmt.Sprintf("Failed to find service %q in namespace %q, in cluster %q in %s", service.Name, namespace, name, fedframework.FederatedDefaultTestTimeout)) - continue - } - - if cSvc.Spec.Type == v1.ServiceTypeLoadBalancer { - // In federation tests, e2e zone names are used to derive federation member cluster names - zone := fedframework.GetZoneFromClusterName(name) - serviceLBName := cloudprovider.GetLoadBalancerName(cSvc) - framework.Logf("cleaning cloud provider resource for service %q in namespace %q, in cluster %q", service.Name, namespace, name) - framework.CleanupServiceResources(c.Clientset, serviceLBName, zone) - } - - err = cleanupServiceShard(c.Clientset, name, namespace, cSvc, fedframework.FederatedDefaultTestTimeout) - if err != nil { - framework.Logf("Failed to delete service %q in namespace %q, in cluster %q: %v", service.Name, namespace, name, err) - } - } -} - -func cleanupServiceShard(clientset *kubeclientset.Clientset, clusterName, namespace string, service *v1.Service, timeout time.Duration) error { - err := wait.PollImmediate(framework.Poll, timeout, func() (bool, error) { - err := clientset.CoreV1().Services(namespace).Delete(service.Name, &metav1.DeleteOptions{}) - if err != nil && !errors.IsNotFound(err) { - // Deletion failed with an error, try again. - framework.Logf("Failed to delete service %q in namespace %q, in cluster %q", service.Name, namespace, clusterName) - return false, nil - } - By(fmt.Sprintf("Service %q in namespace %q in cluster %q deleted", service.Name, namespace, clusterName)) - return true, nil - }) - return err -} - -func podExitCodeDetector(f *fedframework.Framework, name, namespace string, code int32) func() error { - // If we ever get any container logs, stash them here. - logs := "" - - logerr := func(err error) error { - if err == nil { - return nil - } - if logs == "" { - return err - } - return fmt.Errorf("%s (%v)", logs, err) - } - - return func() error { - pod, err := f.ClientSet.Core().Pods(namespace).Get(name, metav1.GetOptions{}) - if err != nil { - return logerr(err) - } - if len(pod.Status.ContainerStatuses) < 1 { - return logerr(fmt.Errorf("no container statuses")) - } - - // Best effort attempt to grab pod logs for debugging - logs, err = framework.GetPodLogs(f.ClientSet, namespace, name, pod.Spec.Containers[0].Name) - if err != nil { - framework.Logf("Cannot fetch pod logs: %v", err) - } - - status := pod.Status.ContainerStatuses[0] - if status.State.Terminated == nil { - return logerr(fmt.Errorf("container is not in terminated state")) - } - if status.State.Terminated.ExitCode == code { - return nil - } - - return logerr(fmt.Errorf("exited %d", status.State.Terminated.ExitCode)) - } -} - -func discoverService(f *fedframework.Framework, name string, exists bool, podName string) { - command := []string{"sh", "-c", fmt.Sprintf("until nslookup '%s'; do sleep 10; done", name)} - By(fmt.Sprintf("Looking up %q", name)) - - pod := &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: podName, - }, - Spec: v1.PodSpec{ - Containers: []v1.Container{ - { - Name: "federated-service-discovery-container", - Image: "busybox", - Command: command, - }, - }, - RestartPolicy: v1.RestartPolicyOnFailure, - }, - } - - nsName := f.FederationNamespace.Name - By(fmt.Sprintf("Creating pod %q in namespace %q", pod.Name, nsName)) - _, err := f.ClientSet.Core().Pods(nsName).Create(pod) - framework.ExpectNoError(err, "Trying to create pod to run %q", command) - By(fmt.Sprintf("Successfully created pod %q in namespace %q", pod.Name, nsName)) - defer func() { - By(fmt.Sprintf("Deleting pod %q from namespace %q", podName, nsName)) - err := f.ClientSet.Core().Pods(nsName).Delete(podName, metav1.NewDeleteOptions(0)) - framework.ExpectNoError(err, "Deleting pod %q from namespace %q", podName, nsName) - By(fmt.Sprintf("Deleted pod %q from namespace %q", podName, nsName)) - }() - - if exists { - // TODO(mml): Eventually check the IP address is correct, too. - Eventually(podExitCodeDetector(f, podName, nsName, 0), 3*DNSTTL, time.Second*2). - Should(BeNil(), "%q should exit 0, but it never did", command) - } else { - Eventually(podExitCodeDetector(f, podName, nsName, 0), 3*DNSTTL, time.Second*2). - ShouldNot(BeNil(), "%q should eventually not exit 0, but it always did", command) - } -} - -// BackendPodMap maps a cluster name to a backend pod created in that cluster -type BackendPodMap map[string]*v1.Pod - -// createBackendPodsOrFail creates one pod in each cluster, and returns the created pods. If creation of any pod fails, -// the test fails (possibly with a partially created set of pods). No retries are attempted. -func createBackendPodsOrFail(clusters fedframework.ClusterSlice, namespace string, name string) BackendPodMap { - pod := &v1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - // Namespace: namespace, - Labels: FederatedServiceLabels, - }, - Spec: v1.PodSpec{ - Containers: []v1.Container{ - { - Name: name, - Image: "gcr.io/google_containers/echoserver:1.6", - }, - }, - RestartPolicy: v1.RestartPolicyAlways, - }, - } - podMap := make(BackendPodMap) - for _, c := range clusters { - name := c.Name - By(fmt.Sprintf("Creating pod %q in namespace %q in cluster %q", pod.Name, namespace, name)) - createdPod, err := c.Clientset.CoreV1().Pods(namespace).Create(pod) - framework.ExpectNoError(err, "Creating pod %q in namespace %q in cluster %q", name, namespace, name) - By(fmt.Sprintf("Successfully created pod %q in namespace %q in cluster %q: %v", pod.Name, namespace, name, *createdPod)) - podMap[name] = createdPod - } - return podMap -} - -// deleteOneBackendPodOrFail deletes exactly one backend pod which must not be nil -// The test fails if there are any errors. -func deleteOneBackendPodOrFail(c *fedframework.Cluster, pod *v1.Pod) { - Expect(pod).ToNot(BeNil()) - err := c.Clientset.CoreV1().Pods(pod.Namespace).Delete(pod.Name, metav1.NewDeleteOptions(0)) - msgFmt := fmt.Sprintf("Deleting Pod %q in namespace %q in cluster %q %%v", pod.Name, pod.Namespace, c.Name) - if errors.IsNotFound(err) { - framework.Logf(msgFmt, "does not exist. No need to delete it.") - return - } - framework.ExpectNoError(err, msgFmt, "") - framework.Logf(msgFmt, "was deleted") -} - -// deleteBackendPodsOrFail deletes one pod from each cluster that has one. -// If deletion of any pod fails, the test fails (possibly with a partially deleted set of pods). No retries are attempted. -func deleteBackendPodsOrFail(clusters fedframework.ClusterSlice, backendPods BackendPodMap) { - if backendPods == nil { - return - } - for _, c := range clusters { - if pod, ok := backendPods[c.Name]; ok { - deleteOneBackendPodOrFail(c, pod) - } else { - By(fmt.Sprintf("No backend pod to delete for cluster %q", c.Name)) - } - } -} - -// waitForReplicatSetToBeDeletedOrFail waits for the named ReplicaSet in namespace to be deleted. -// If the deletion fails, the enclosing test fails. -func waitForReplicaSetToBeDeletedOrFail(clientset *fedclientset.Clientset, namespace string, replicaSet string) { - err := wait.Poll(5*time.Second, fedframework.FederatedDefaultTestTimeout, func() (bool, error) { - _, err := clientset.Extensions().ReplicaSets(namespace).Get(replicaSet, metav1.GetOptions{}) - if err != nil && errors.IsNotFound(err) { - return true, nil - } - return false, err - }) - - if err != nil { - framework.Failf("Error in deleting replica set %s: %v", replicaSet, err) - } -} diff --git a/federation/test/integration/BUILD b/federation/test/integration/BUILD deleted file mode 100644 index c6e7fcc929..0000000000 --- a/federation/test/integration/BUILD +++ /dev/null @@ -1,50 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_test", -) - -go_test( - name = "go_default_test", - size = "large", - srcs = [ - "api_test.go", - "crud_test.go", - "main_test.go", - ], - importpath = "k8s.io/kubernetes/federation/test/integration", - tags = ["integration"], - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/pkg/federatedtypes:go_default_library", - "//federation/pkg/federatedtypes/crudtester:go_default_library", - "//federation/test/integration/framework:go_default_library", - "//test/integration/framework:go_default_library", - "//vendor/github.com/pborman/uuid:go_default_library", - "//vendor/github.com/stretchr/testify/assert:go_default_library", - "//vendor/k8s.io/api/autoscaling/v1:go_default_library", - "//vendor/k8s.io/api/batch/v1:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/api/extensions/v1beta1: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", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [ - ":package-srcs", - "//federation/test/integration/framework:all-srcs", - ], - tags = ["automanaged"], -) diff --git a/federation/test/integration/OWNERS b/federation/test/integration/OWNERS deleted file mode 100644 index 9c31922034..0000000000 --- a/federation/test/integration/OWNERS +++ /dev/null @@ -1,16 +0,0 @@ -reviewers: - - colhom - - csbell - - irfanurrehman - - madhusudancs - - marun - - mwielgus - - nikhiljindal - - quinton-hoole - - shashidharatd -approvers: - - csbell - - madhusudancs - - mwielgus - - nikhiljindal - - quinton-hoole diff --git a/federation/test/integration/api_test.go b/federation/test/integration/api_test.go deleted file mode 100644 index b53311e0bb..0000000000 --- a/federation/test/integration/api_test.go +++ /dev/null @@ -1,417 +0,0 @@ -/* -Copyright 2015 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 integration - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - - autoscaling_v1 "k8s.io/api/autoscaling/v1" - batch_v1 "k8s.io/api/batch/v1" - "k8s.io/api/core/v1" - ext_v1b1 "k8s.io/api/extensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - fed_v1b1 "k8s.io/kubernetes/federation/apis/federation/v1beta1" - "k8s.io/kubernetes/federation/test/integration/framework" -) - -// List of group versions that are enabled by default. -var enabledGroupVersions = []schema.GroupVersion{ - fed_v1b1.SchemeGroupVersion, - ext_v1b1.SchemeGroupVersion, -} - -// List of group versions that are disabled by default. -var disabledGroupVersions = []schema.GroupVersion{ - batch_v1.SchemeGroupVersion, - autoscaling_v1.SchemeGroupVersion, -} - -type apiTestFunc func(t *testing.T, host string, expectedGroupVersions []schema.GroupVersion) - -func testFederationAPI(t *testing.T, runtimeConfig string, expectedGroupVersions []schema.GroupVersion) { - f := &framework.FederationAPIFixture{} - if runtimeConfig == "" { - f.SetUp(t) - } else { - runOptions := framework.GetRunOptions() - runOptions.APIEnablement.RuntimeConfig.Set(runtimeConfig) - f.SetUpWithRunOptions(t, runOptions) - } - defer f.TearDown(t) - - testCases := map[string]apiTestFunc{ - "swaggerSpec": testSwaggerSpec, - "support": testSupport, - "apiGroupList": testAPIGroupList, - "apiGroup": testAPIGroup, - "apiResourceList": testAPIResourceList, - } - for testName, testFunc := range testCases { - t.Run(testName, func(t *testing.T) { - testFunc(t, f.Host, expectedGroupVersions) - }) - } -} - -// Verifies that only default APIs are enabled when no runtime config is set. -func TestDefaultRun(t *testing.T) { - testFederationAPI(t, "", enabledGroupVersions) -} - -// Verifies that all APIs are enabled when runtime config is set to all. -func TestRunWithRuntimeConfigAll(t *testing.T) { - expectedGroupVersions := enabledGroupVersions - expectedGroupVersions = append(enabledGroupVersions, disabledGroupVersions...) - testFederationAPI(t, "api/all=true", expectedGroupVersions) -} - -func readResponse(serverURL string) ([]byte, error) { - response, err := http.Get(serverURL) - if err != nil { - return nil, fmt.Errorf("Error in fetching %s: %v", serverURL, err) - } - defer response.Body.Close() - if response.StatusCode != http.StatusOK { - return nil, fmt.Errorf("unexpected status: %d for URL: %s, expected status: %d", response.StatusCode, serverURL, http.StatusOK) - } - contents, err := ioutil.ReadAll(response.Body) - if err != nil { - return nil, fmt.Errorf("Error reading response from %s: %v", serverURL, err) - } - return contents, nil -} - -func testSwaggerSpec(t *testing.T, host string, expectedGroupVersions []schema.GroupVersion) { - serverURL := host + "/swaggerapi" - _, err := readResponse(serverURL) - if err != nil { - t.Fatalf("%v", err) - } -} - -func testSupport(t *testing.T, host string, expectedGroupVersions []schema.GroupVersion) { - serverURL := host + "/version" - _, err := readResponse(serverURL) - if err != nil { - t.Fatalf("%v", err) - } -} - -func findGroup(groups []metav1.APIGroup, groupName string) *metav1.APIGroup { - for _, group := range groups { - if group.Name == groupName { - return &group - } - } - return nil -} - -func testAPIGroupList(t *testing.T, host string, expectedGroupVersions []schema.GroupVersion) { - groupVersionForDiscoveryMap := make(map[string]metav1.GroupVersionForDiscovery) - for _, groupVersion := range expectedGroupVersions { - groupVersionForDiscoveryMap[groupVersion.Group] = metav1.GroupVersionForDiscovery{ - GroupVersion: groupVersion.String(), - Version: groupVersion.Version, - } - } - - serverURL := host + "/apis" - contents, err := readResponse(serverURL) - if err != nil { - t.Fatalf("%v", err) - } - var apiGroupList metav1.APIGroupList - err = json.Unmarshal(contents, &apiGroupList) - if err != nil { - t.Fatalf("Error in unmarshalling response from server %s: %v", serverURL, err) - } - - assert.Equal(t, len(apiGroupList.Groups), len(expectedGroupVersions), "expected: %v, actual: %v", expectedGroupVersions, apiGroupList.Groups) - for _, groupVersion := range expectedGroupVersions { - found := findGroup(apiGroupList.Groups, groupVersion.Group) - assert.NotNil(t, found) - assert.Equal(t, groupVersion.Group, found.Name) - assert.Equal(t, 1, len(found.Versions)) - groupVersionForDiscovery := groupVersionForDiscoveryMap[groupVersion.Group] - assert.Equal(t, groupVersionForDiscovery, found.Versions[0]) - assert.Equal(t, groupVersionForDiscovery, found.PreferredVersion) - } -} - -func testAPIGroup(t *testing.T, host string, expectedGroupVersions []schema.GroupVersion) { - for _, groupVersion := range expectedGroupVersions { - serverURL := host + "/apis/" + groupVersion.Group - contents, err := readResponse(serverURL) - if err != nil { - t.Fatalf("%v", err) - } - var apiGroup metav1.APIGroup - err = json.Unmarshal(contents, &apiGroup) - if err != nil { - t.Fatalf("Error in unmarshalling response from server %s: %v", serverURL, err) - } - // empty APIVersion for extensions group - if groupVersion.Group == "extensions" { - assert.Equal(t, "", apiGroup.APIVersion) - } else { - assert.Equal(t, "v1", apiGroup.APIVersion) - } - assert.Equal(t, apiGroup.Name, groupVersion.Group) - assert.Equal(t, 1, len(apiGroup.Versions)) - assert.Equal(t, groupVersion.String(), apiGroup.Versions[0].GroupVersion) - assert.Equal(t, groupVersion.Version, apiGroup.Versions[0].Version) - assert.Equal(t, apiGroup.PreferredVersion, apiGroup.Versions[0]) - } - - testCoreAPIGroup(t, host) -} - -func testCoreAPIGroup(t *testing.T, host string) { - serverURL := host + "/api" - contents, err := readResponse(serverURL) - if err != nil { - t.Fatalf("%v", err) - } - var apiVersions metav1.APIVersions - err = json.Unmarshal(contents, &apiVersions) - if err != nil { - t.Fatalf("Error in unmarshalling response from server %s: %v", serverURL, err) - } - assert.Equal(t, 1, len(apiVersions.Versions)) - assert.Equal(t, "v1", apiVersions.Versions[0]) - assert.NotEmpty(t, apiVersions.ServerAddressByClientCIDRs) -} - -func findResource(resources []metav1.APIResource, resourceName string) *metav1.APIResource { - for _, resource := range resources { - if resource.Name == resourceName { - return &resource - } - } - return nil -} - -func testAPIResourceList(t *testing.T, host string, expectedGroupVersions []schema.GroupVersion) { - testFederationResourceList(t, host) - testCoreResourceList(t, host) - testExtensionsResourceList(t, host) - if contains(expectedGroupVersions, batch_v1.SchemeGroupVersion) { - testBatchResourceList(t, host) - } - if contains(expectedGroupVersions, autoscaling_v1.SchemeGroupVersion) { - testAutoscalingResourceList(t, host) - } -} - -func contains(gvs []schema.GroupVersion, requiredGV schema.GroupVersion) bool { - for _, gv := range gvs { - if gv.String() == requiredGV.String() { - return true - } - } - return false -} - -func testFederationResourceList(t *testing.T, host string) { - serverURL := host + "/apis/" + fed_v1b1.SchemeGroupVersion.String() - contents, err := readResponse(serverURL) - if err != nil { - t.Fatalf("%v", err) - } - var apiResourceList metav1.APIResourceList - err = json.Unmarshal(contents, &apiResourceList) - if err != nil { - t.Fatalf("Error in unmarshalling response from server %s: %v", serverURL, err) - } - assert.Equal(t, "v1", apiResourceList.APIVersion) - assert.Equal(t, fed_v1b1.SchemeGroupVersion.String(), apiResourceList.GroupVersion) - // Assert that there are exactly 2 resources. - assert.Equal(t, 2, len(apiResourceList.APIResources)) - - found := findResource(apiResourceList.APIResources, "clusters") - assert.NotNil(t, found) - assert.False(t, found.Namespaced) - found = findResource(apiResourceList.APIResources, "clusters/status") - assert.NotNil(t, found) - assert.False(t, found.Namespaced) -} - -func testCoreResourceList(t *testing.T, host string) { - serverURL := host + "/api/" + v1.SchemeGroupVersion.String() - contents, err := readResponse(serverURL) - if err != nil { - t.Fatalf("%v", err) - } - var apiResourceList metav1.APIResourceList - err = json.Unmarshal(contents, &apiResourceList) - if err != nil { - t.Fatalf("Error in unmarshalling response from server %s: %v", serverURL, err) - } - assert.Equal(t, "", apiResourceList.APIVersion) - assert.Equal(t, v1.SchemeGroupVersion.String(), apiResourceList.GroupVersion) - assert.Equal(t, 8, len(apiResourceList.APIResources), "ResourceList: %v", apiResourceList.APIResources) - - // Verify services. - found := findResource(apiResourceList.APIResources, "services") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - found = findResource(apiResourceList.APIResources, "services/status") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - - // Verify namespaces. - found = findResource(apiResourceList.APIResources, "namespaces") - assert.NotNil(t, found) - assert.False(t, found.Namespaced) - found = findResource(apiResourceList.APIResources, "namespaces/status") - assert.NotNil(t, found) - assert.False(t, found.Namespaced) - found = findResource(apiResourceList.APIResources, "namespaces/finalize") - assert.NotNil(t, found) - assert.False(t, found.Namespaced) - - // Verify events. - found = findResource(apiResourceList.APIResources, "events") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - - // Verify secrets. - found = findResource(apiResourceList.APIResources, "secrets") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - - // Verify config maps. - found = findResource(apiResourceList.APIResources, "configmaps") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) -} - -func testExtensionsResourceList(t *testing.T, host string) { - serverURL := host + "/apis/" + ext_v1b1.SchemeGroupVersion.String() - contents, err := readResponse(serverURL) - if err != nil { - t.Fatalf("%v", err) - } - var apiResourceList metav1.APIResourceList - err = json.Unmarshal(contents, &apiResourceList) - if err != nil { - t.Fatalf("Error in unmarshalling response from server %s: %v", serverURL, err) - } - // empty APIVersion for extensions group - assert.Equal(t, "", apiResourceList.APIVersion) - assert.Equal(t, ext_v1b1.SchemeGroupVersion.String(), apiResourceList.GroupVersion) - // Assert that there are exactly 11 resources. - assert.Equal(t, 11, len(apiResourceList.APIResources)) - - // Verify replicasets. - found := findResource(apiResourceList.APIResources, "replicasets") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - found = findResource(apiResourceList.APIResources, "replicasets/status") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - found = findResource(apiResourceList.APIResources, "replicasets/scale") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - - // Verify ingress. - found = findResource(apiResourceList.APIResources, "ingresses") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - found = findResource(apiResourceList.APIResources, "ingresses/status") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - - // Verify daemonsets. - found = findResource(apiResourceList.APIResources, "daemonsets") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - found = findResource(apiResourceList.APIResources, "daemonsets/status") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - - // Verify deployments. - found = findResource(apiResourceList.APIResources, "deployments") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - found = findResource(apiResourceList.APIResources, "deployments/status") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - found = findResource(apiResourceList.APIResources, "deployments/scale") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - found = findResource(apiResourceList.APIResources, "deployments/rollback") -} - -func testBatchResourceList(t *testing.T, host string) { - serverURL := host + "/apis/" + batch_v1.SchemeGroupVersion.String() - contents, err := readResponse(serverURL) - if err != nil { - t.Fatalf("%v", err) - } - var apiResourceList metav1.APIResourceList - err = json.Unmarshal(contents, &apiResourceList) - if err != nil { - t.Fatalf("Error in unmarshalling response from server %s: %v", serverURL, err) - } - // empty APIVersion for extensions group - assert.Equal(t, "v1", apiResourceList.APIVersion) - assert.Equal(t, batch_v1.SchemeGroupVersion.String(), apiResourceList.GroupVersion) - // Assert that there are exactly this number of resources. - assert.Equal(t, 2, len(apiResourceList.APIResources)) - - // Verify jobs - found := findResource(apiResourceList.APIResources, "jobs") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - found = findResource(apiResourceList.APIResources, "jobs/status") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) -} - -func testAutoscalingResourceList(t *testing.T, host string) { - serverURL := host + "/apis/" + autoscaling_v1.SchemeGroupVersion.String() - contents, err := readResponse(serverURL) - if err != nil { - t.Fatalf("%v", err) - } - var apiResourceList metav1.APIResourceList - err = json.Unmarshal(contents, &apiResourceList) - if err != nil { - t.Fatalf("Error in unmarshalling response from server %s: %v", serverURL, err) - } - // empty APIVersion for extensions group - assert.Equal(t, "v1", apiResourceList.APIVersion) - assert.Equal(t, autoscaling_v1.SchemeGroupVersion.String(), apiResourceList.GroupVersion) - // Assert that there are exactly this number of resources. - assert.Equal(t, 2, len(apiResourceList.APIResources)) - - // Verify hpa - found := findResource(apiResourceList.APIResources, "horizontalpodautoscalers") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) - found = findResource(apiResourceList.APIResources, "horizontalpodautoscalers/status") - assert.NotNil(t, found) - assert.True(t, found.Namespaced) -} diff --git a/federation/test/integration/crud_test.go b/federation/test/integration/crud_test.go deleted file mode 100644 index cd56c09d18..0000000000 --- a/federation/test/integration/crud_test.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package integration - -import ( - "fmt" - "testing" - - "github.com/pborman/uuid" - - pkgruntime "k8s.io/apimachinery/pkg/runtime" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - "k8s.io/kubernetes/federation/pkg/federatedtypes" - "k8s.io/kubernetes/federation/pkg/federatedtypes/crudtester" - "k8s.io/kubernetes/federation/test/integration/framework" -) - -// TestFederationCRUD validates create/read/update/delete operations for federated resource types. -func TestFederationCRUD(t *testing.T) { - fedFixture := framework.FederationFixture{DesiredClusterCount: 2} - fedFixture.SetUp(t) - defer fedFixture.TearDown(t) - - federatedTypes := federatedtypes.FederatedTypes() - for kind, fedType := range federatedTypes { - t.Run(kind, func(t *testing.T) { - fixture, crudTester, obj, _ := initCRUDTest(t, &fedFixture, fedType.AdapterFactory, kind) - defer fixture.TearDown(t) - - crudTester.CheckLifecycle(obj) - }) - } - - // The following tests target a single type since the underlying logic is common across all types. - kind := federatedtypes.SecretKind - adapterFactory := federatedtypes.NewSecretAdapter - - // Validate deletion handling where orphanDependents is true or nil - orphanedDependents := true - testCases := map[string]*bool{ - "Resource should not be deleted from underlying clusters when OrphanDependents is true": &orphanedDependents, - "Resource should not be deleted from underlying clusters when OrphanDependents is nil": nil, - } - for testName, orphanDependents := range testCases { - t.Run(testName, func(t *testing.T) { - fixture, crudTester, obj, _ := initCRUDTest(t, &fedFixture, adapterFactory, kind) - defer fixture.TearDown(t) - - updatedObj := crudTester.CheckCreate(obj) - crudTester.CheckDelete(updatedObj, orphanDependents) - }) - } - - t.Run("Resource should be propagated to a newly added cluster", func(t *testing.T) { - fixture, crudTester, obj, _ := initCRUDTest(t, &fedFixture, adapterFactory, kind) - defer fixture.TearDown(t) - - updatedObj := crudTester.CheckCreate(obj) - // Start a new cluster and validate that the resource is propagated to it. - fedFixture.StartCluster(t) - // Check propagation to the new cluster by providing the updated set of clients - objectExpected := true - crudTester.CheckPropagationForClients(updatedObj, fedFixture.ClusterClients, objectExpected) - }) - - t.Run("Resource should only be propagated to the cluster with a matching selector", func(t *testing.T) { - fixture, crudTester, obj, adapter := initCRUDTest(t, &fedFixture, adapterFactory, kind) - defer fixture.TearDown(t) - - // Set an annotation to specify that the object is isolated to cluster 1. - federatedtypes.SetAnnotation(adapter, obj, federationapi.FederationClusterSelectorAnnotation, `[{"key": "cluster", "operator": "==", "values": ["1"]}]`) - - updatedObj := crudTester.Create(obj) - - // Check propagation to the first cluster - objectExpected := true - crudTester.CheckPropagationForClients(updatedObj, fedFixture.ClusterClients[0:1], objectExpected) - - // Verify the object is not sent to the second cluster - objectExpected = false - crudTester.CheckPropagationForClients(updatedObj, fedFixture.ClusterClients[1:2], objectExpected) - - }) -} - -// initCRUDTest initializes common elements of a crud test -func initCRUDTest(t *testing.T, fedFixture *framework.FederationFixture, adapterFactory federatedtypes.AdapterFactory, kind string) ( - *framework.ControllerFixture, *crudtester.FederatedTypeCRUDTester, pkgruntime.Object, federatedtypes.FederatedTypeAdapter) { - config := fedFixture.APIFixture.NewConfig() - fixture := framework.NewControllerFixture(t, kind, adapterFactory, config) - - client := fedFixture.APIFixture.NewClient(fmt.Sprintf("crud-test-%s", kind)) - adapter := adapterFactory(client, config, nil) - - crudTester := framework.NewFederatedTypeCRUDTester(t, adapter, fedFixture.ClusterClients) - - obj := adapter.NewTestObject(uuid.New()) - - return fixture, crudTester, obj, adapter -} diff --git a/federation/test/integration/framework/BUILD b/federation/test/integration/framework/BUILD deleted file mode 100644 index 4f69621282..0000000000 --- a/federation/test/integration/framework/BUILD +++ /dev/null @@ -1,49 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", -) - -go_library( - name = "go_default_library", - srcs = [ - "api.go", - "controller.go", - "crudtester.go", - "federation.go", - "util.go", - ], - importpath = "k8s.io/kubernetes/federation/test/integration/framework", - deps = [ - "//federation/apis/federation/v1beta1:go_default_library", - "//federation/client/clientset_generated/federation_clientset:go_default_library", - "//federation/cmd/federation-apiserver/app:go_default_library", - "//federation/cmd/federation-apiserver/app/options:go_default_library", - "//federation/pkg/federatedtypes:go_default_library", - "//federation/pkg/federatedtypes/crudtester:go_default_library", - "//federation/pkg/federation-controller/cluster:go_default_library", - "//federation/pkg/federation-controller/sync:go_default_library", - "//pkg/master:go_default_library", - "//test/e2e_node/services:go_default_library", - "//test/integration/framework:go_default_library", - "//vendor/github.com/pborman/uuid:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/rest:go_default_library", - ], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/federation/test/integration/framework/api.go b/federation/test/integration/framework/api.go deleted file mode 100644 index f1d79cd56d..0000000000 --- a/federation/test/integration/framework/api.go +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package framework - -import ( - "fmt" - "net/http" - "testing" - - "github.com/pborman/uuid" - - "k8s.io/apimachinery/pkg/util/wait" - restclient "k8s.io/client-go/rest" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - "k8s.io/kubernetes/federation/cmd/federation-apiserver/app" - "k8s.io/kubernetes/federation/cmd/federation-apiserver/app/options" - "k8s.io/kubernetes/test/integration/framework" -) - -const apiNoun = "federation apiserver" - -// GetRunOptions returns the default run options that can be used to run a test federation apiserver. -func GetRunOptions() *options.ServerRunOptions { - r := options.NewServerRunOptions() - r.Etcd.StorageConfig.ServerList = []string{framework.GetEtcdURL()} - // Use a unique prefix to ensure isolation from other tests using the same etcd instance - r.Etcd.StorageConfig.Prefix = uuid.New() - // Disable secure serving - r.SecureServing.BindPort = 0 - return r -} - -// FederationAPIFixture manages a federation api server -type FederationAPIFixture struct { - Host string - stopChan chan struct{} -} - -// SetUp runs federation apiserver with default run options. -func (f *FederationAPIFixture) SetUp(t *testing.T) { - f.SetUpWithRunOptions(t, GetRunOptions()) -} - -// SetUpWithRunOptions runs federation apiserver with the given run options. -// Uses default run options if runOptions is nil. -func (f *FederationAPIFixture) SetUpWithRunOptions(t *testing.T, runOptions *options.ServerRunOptions) { - if f.stopChan != nil { - t.Fatal("SetUp() already called") - } - defer TearDownOnPanic(t, f) - - f.stopChan = make(chan struct{}) - - err := startServer(t, runOptions, f.stopChan) - if err != nil { - t.Fatal(err) - } - - f.Host = fmt.Sprintf("http://%s:%d", runOptions.InsecureServing.BindAddress, runOptions.InsecureServing.BindPort) - - err = waitForServer(t, f.Host) - if err != nil { - t.Fatal(err) - } -} - -func (f *FederationAPIFixture) TearDown(t *testing.T) { - if f.stopChan != nil { - close(f.stopChan) - f.stopChan = nil - } -} - -func (f *FederationAPIFixture) NewConfig() *restclient.Config { - return &restclient.Config{Host: f.Host} -} - -func (f *FederationAPIFixture) NewClient(userAgent string) federationclientset.Interface { - config := f.NewConfig() - restclient.AddUserAgent(config, userAgent) - return federationclientset.NewForConfigOrDie(config) -} - -func startServer(t *testing.T, runOptions *options.ServerRunOptions, stopChan <-chan struct{}) error { - err := wait.PollImmediate(DefaultWaitInterval, wait.ForeverTestTimeout, func() (bool, error) { - port, err := framework.FindFreeLocalPort() - if err != nil { - t.Logf("Error allocating an ephemeral port: %v", err) - return false, nil - } - - runOptions.InsecureServing.BindPort = port - err = app.NonBlockingRun(runOptions, stopChan) - if err != nil { - t.Logf("Error starting the %s: %v", apiNoun, err) - return false, nil - } - return true, nil - }) - if err != nil { - return fmt.Errorf("Timed out waiting for the %s: %v", apiNoun, err) - } - return nil -} - -func waitForServer(t *testing.T, host string) error { - err := wait.PollImmediate(DefaultWaitInterval, wait.ForeverTestTimeout, func() (bool, error) { - _, err := http.Get(host) - if err != nil { - t.Logf("Error when trying to contact the API: %v", err) - return false, nil - } - return true, nil - }) - if err != nil { - return fmt.Errorf("Timed out waiting for the %s: %v", apiNoun, err) - } - return nil -} diff --git a/federation/test/integration/framework/controller.go b/federation/test/integration/framework/controller.go deleted file mode 100644 index 2c5e925b1d..0000000000 --- a/federation/test/integration/framework/controller.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package framework - -import ( - "testing" - - restclient "k8s.io/client-go/rest" - "k8s.io/kubernetes/federation/pkg/federatedtypes" - synccontroller "k8s.io/kubernetes/federation/pkg/federation-controller/sync" -) - -// ControllerFixture manages a federation controller for testing. -type ControllerFixture struct { - stopChan chan struct{} -} - -// NewControllerFixture initializes a new controller fixture -func NewControllerFixture(t *testing.T, kind string, adapterFactory federatedtypes.AdapterFactory, config *restclient.Config) *ControllerFixture { - f := &ControllerFixture{ - stopChan: make(chan struct{}), - } - synccontroller.StartFederationSyncController(kind, adapterFactory, config, f.stopChan, true, nil) - return f -} - -func (f *ControllerFixture) TearDown(t *testing.T) { - close(f.stopChan) -} diff --git a/federation/test/integration/framework/crudtester.go b/federation/test/integration/framework/crudtester.go deleted file mode 100644 index db02d48793..0000000000 --- a/federation/test/integration/framework/crudtester.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package framework - -import ( - "testing" - - "k8s.io/apimachinery/pkg/util/wait" - clientset "k8s.io/client-go/kubernetes" - "k8s.io/kubernetes/federation/pkg/federatedtypes" - "k8s.io/kubernetes/federation/pkg/federatedtypes/crudtester" -) - -type IntegrationLogger struct { - t *testing.T -} - -func (l *IntegrationLogger) Logf(format string, args ...interface{}) { - l.t.Logf(format, args...) -} - -func (l *IntegrationLogger) Fatalf(format string, args ...interface{}) { - l.t.Fatalf(format, args...) -} - -func (l *IntegrationLogger) Fatal(msg string) { - l.t.Fatal(msg) -} - -func NewFederatedTypeCRUDTester(t *testing.T, adapter federatedtypes.FederatedTypeAdapter, clusterClients []clientset.Interface) *crudtester.FederatedTypeCRUDTester { - logger := &IntegrationLogger{t} - return crudtester.NewFederatedTypeCRUDTester(logger, adapter, clusterClients, DefaultWaitInterval, wait.ForeverTestTimeout) -} diff --git a/federation/test/integration/framework/federation.go b/federation/test/integration/framework/federation.go deleted file mode 100644 index c1ee1bee85..0000000000 --- a/federation/test/integration/framework/federation.go +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package framework - -import ( - "fmt" - "testing" - "time" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clientset "k8s.io/client-go/kubernetes" - federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1" - federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" - clustercontroller "k8s.io/kubernetes/federation/pkg/federation-controller/cluster" - "k8s.io/kubernetes/pkg/master" - "k8s.io/kubernetes/test/e2e_node/services" - "k8s.io/kubernetes/test/integration/framework" -) - -type MemberCluster struct { - CloseFn framework.CloseFunc - Config *master.Config - Client clientset.Interface - Host string - namespaceController *services.NamespaceController -} - -// FederationFixture manages a federation api server and a set of member clusters -type FederationFixture struct { - APIFixture *FederationAPIFixture - DesiredClusterCount int - Clusters []*MemberCluster - - ClusterClients []clientset.Interface - ClusterController *clustercontroller.ClusterController - fedClient federationclientset.Interface - stopChan chan struct{} -} - -func (f *FederationFixture) SetUp(t *testing.T) { - if f.APIFixture != nil { - t.Fatal("Fixture already started") - } - if f.DesiredClusterCount < 1 { - f.DesiredClusterCount = 1 - } - defer TearDownOnPanic(t, f) - - t.Logf("Starting a federation of %d clusters", f.DesiredClusterCount) - - f.APIFixture = &FederationAPIFixture{} - runOptions := GetRunOptions() - // Enable all apis features for test. - runOptions.APIEnablement.RuntimeConfig.Set("api/all=true") - f.APIFixture.SetUpWithRunOptions(t, runOptions) - - f.stopChan = make(chan struct{}) - monitorPeriod := 1 * time.Second - clustercontroller.StartClusterController(f.APIFixture.NewConfig(), f.stopChan, monitorPeriod) - - f.fedClient = f.APIFixture.NewClient("federation-fixture") - for i := 0; i < f.DesiredClusterCount; i++ { - f.StartCluster(t) - } -} - -func (f *FederationFixture) StartCluster(t *testing.T) { - config := framework.NewMasterConfig() - _, _, closeFn := framework.RunAMaster(config) - host := config.GenericConfig.LoopbackClientConfig.Host - - clusterClient := clientset.NewForConfigOrDie(config.GenericConfig.LoopbackClientConfig) - f.ClusterClients = append(f.ClusterClients, clusterClient) - memberCluster := &MemberCluster{ - CloseFn: closeFn, - Config: config, - Client: clusterClient, - Host: host, - namespaceController: services.NewNamespaceController(host), - } - f.Clusters = append(f.Clusters, memberCluster) - err := memberCluster.namespaceController.Start() - if err != nil { - t.Fatal(err) - } - - clusterId := len(f.ClusterClients) - - t.Logf("Federated cluster %d serving on %s", clusterId, host) - - cluster := &federationapi.Cluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("cluster-%d", clusterId), - Labels: map[string]string{"cluster": fmt.Sprintf("%d", clusterId)}, - }, - Spec: federationapi.ClusterSpec{ - ServerAddressByClientCIDRs: []federationapi.ServerAddressByClientCIDR{ - { - ClientCIDR: "0.0.0.0/0", - ServerAddress: host, - }, - }, - // Use insecure access - SecretRef: nil, - }, - } - f.fedClient.FederationV1beta1().Clusters().Create(cluster) -} - -func (f *FederationFixture) TearDown(t *testing.T) { - if f.stopChan != nil { - close(f.stopChan) - f.stopChan = nil - } - for _, cluster := range f.Clusters { - // Need to close controllers with active connections to the - // cluster api before stopping the api or the connections will - // hang until tcp timeout. - cluster.namespaceController.Stop() - cluster.CloseFn() - } - f.Clusters = nil - if f.APIFixture != nil { - f.APIFixture.TearDown(t) - f.APIFixture = nil - } -} diff --git a/federation/test/integration/framework/util.go b/federation/test/integration/framework/util.go deleted file mode 100644 index 6ce72607a6..0000000000 --- a/federation/test/integration/framework/util.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package framework - -import ( - "testing" - "time" -) - -const ( - DefaultWaitInterval = 50 * time.Millisecond -) - -// SetUp is likely to be fixture-specific, but TearDown needs to be -// consistent to enable TearDownOnPanic. -type TestFixture interface { - TearDown(t *testing.T) -} - -// TearDownOnPanic can be used to ensure cleanup on setup failure. -func TearDownOnPanic(t *testing.T, f TestFixture) { - if r := recover(); r != nil { - f.TearDown(t) - panic(r) - } -} diff --git a/federation/test/integration/main_test.go b/federation/test/integration/main_test.go deleted file mode 100644 index 0a64b7565e..0000000000 --- a/federation/test/integration/main_test.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package integration - -import ( - "testing" - - "k8s.io/kubernetes/test/integration/framework" -) - -func TestMain(m *testing.M) { - framework.EtcdMain(m.Run) -}