Merge branch 'master' into master

This commit is contained in:
Jared Allard 2018-11-16 23:03:38 -08:00 committed by GitHub
commit 19f9d2f4d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4460 changed files with 309101 additions and 96290 deletions

1
.bazelrc Normal file
View File

@ -0,0 +1 @@
import %workspace%/tools/bazel.rc

View File

@ -1,35 +0,0 @@
Thanks for submitting an issue! Please fill in as much of the template below as
you can.
------------- BUG REPORT TEMPLATE --------------------
1. What `kops` version are you running? The command `kops version`, will display
this information.
2. What Kubernetes version are you running? `kubectl version` will print the
version if a cluster is running or provide the Kubernetes version specified as
a `kops` flag.
3. What cloud provider are you using?
4. What commands did you run? What is the simplest way to reproduce this issue?
5. What happened after the commands executed?
6. What did you expect to happen?
7. Please provide your cluster manifest. Execute
`kops get --name my.example.com -oyaml` to display your cluster manifest.
You may want to remove your cluster name and other sensitive information.
8. Please run the commands with most verbose logging by adding the `-v 10` flag.
Paste the logs into this report, or in a gist and provide the gist link here.
9. Anything else do we need to know?
------------- FEATURE REQUEST TEMPLATE --------------------
1. Describe IN DETAIL the feature/behavior/change you would like to see.
2. Feel free to provide a design supporting your feature request.

29
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,29 @@
---
name: Bug report
about: Create a report to help us improve
---
**1. What `kops` version are you running? The command `kops version`, will display
this information.**
**2. What Kubernetes version are you running? `kubectl version` will print the
version if a cluster is running or provide the Kubernetes version specified as
a `kops` flag.**
**3. What cloud provider are you using?**
**4. What commands did you run? What is the simplest way to reproduce this issue?**
**5. What happened after the commands executed?**
**6. What did you expect to happen?**
**7. Please provide your cluster manifest. Execute
`kops get --name my.example.com -o yaml` to display your cluster manifest.
You may want to remove your cluster name and other sensitive information.**
**8. Please run the commands with most verbose logging by adding the `-v 10` flag.
Paste the logs into this report, or in a gist and provide the gist link here.**
**9. Anything else do we need to know?**

View File

@ -0,0 +1,8 @@
---
name: Feature Request
about: Help us identify features you need
---
**1. Describe IN DETAIL the feature/behavior/change you would like to see.**
**2. Feel free to provide a design supporting your feature request.**

View File

@ -0,0 +1,24 @@
<!--
Thanks for contributing to kubernetes/kops! Here are some tips for you:
1. If this is your first time, read our contributor guidelines:
https://git.k8s.io/kops/CONTRIBUTING.md
2. Also, you'll probably want to checkout our development documentation:
https://git.k8s.io/kops/docs/development
3. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
4. Finally, make sure all verifications and tests pass by running:
```
make pr
```
-->
**What this PR does / why we need it**:
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
**Special notes for your reviewer**:

8
.gitignore vendored
View File

@ -1,3 +1,6 @@
# git mergetool
*.orig
# Go embed files?
*.go-e
@ -81,3 +84,8 @@ default.etcd
# Ignore awesome_bot markdown links check output
ab-results-*.json
# Ignore documentation site
site
addons/prometheus-operator/tmp # cloned git repo

View File

@ -9,7 +9,7 @@ assets:
githubName: kops-linux-amd64
- source: .build/dist/linux/amd64/kops.sha1
githubName: kops-linux-amd64-sha1
# - source: .build/dist/windows/amd64/kops.exe
# githubName: kops-windows-amd64
# - source: .build/dist/windows/amd64/kops.exe.sha1
# githubName: kops-windows-amd64-sha1
- source: .build/dist/windows/amd64/kops.exe
githubName: kops-windows-amd64
- source: .build/dist/windows/amd64/kops.exe.sha1
githubName: kops-windows-amd64-sha1

View File

@ -3,12 +3,12 @@ os:
- linux
- osx
go:
- 1.8
- 1.9
# 1.8 & 1.9 are now best-effort; we recommend 1.10; k8s apimachinery relies on 1.10
# - 1.8
# - 1.9
- "1.10"
go_import_path: k8s.io/kops
script:
- make ci
- hack/verify-apimachinery.sh

View File

@ -1,8 +1,10 @@
# gazelle:prefix k8s.io/kops
load("@bazel_gazelle//:def.bzl", "gazelle")
package(default_visibility = ["//visibility:public"])
load("@io_bazel_rules_go//go:def.bzl", "gazelle", "go_library", "go_prefix")
go_prefix("k8s.io/kops")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
gazelle(
name = "gazelle",

View File

@ -24,7 +24,7 @@ Follow either of the two links above to access the appropriate CLA and instructi
### Adding dependencies
If your patch depends on new packages, follow the [instructions to add a dependency](/docs/development/dependencies.md).
If your patch depends on new packages, follow the [instructions to add a dependency](/docs/development/vendoring.md#adding-a-dependency-to-the-vendor-directory).
## Bug reporting

927
Gopkg.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,14 @@ required = [
# Needed for docs generation
"k8s.io/code-generator/cmd/openapi-gen",
"github.com/kubernetes-incubator/apiserver-builder/cmd/apiserver-boot",
"github.com/kubernetes-incubator/apiserver-builder/cmd/apiregister-gen",
"github.com/kubernetes-incubator/reference-docs/gen-apidocs",
# Needed for bazel generation / verification
"github.com/bazelbuild/bazel-gazelle/cmd/gazelle",
# Needed for spell checking
"github.com/client9/misspell/cmd/misspell",
]
[prune]
@ -25,11 +32,14 @@ required = [
unused-packages = false
non-go = false
[[override]]
name = "github.com/bazelbuild/bazel-gazelle"
version = "0.14.0"
# aws-sdk-go is one of our critical dependencies
[[override]]
name = "github.com/aws/aws-sdk-go"
revision = "bff41fb23b7550368282029f6478819d6a99ae0f"
#version = "v1.12.79"
version = "v1.13.60"
# We need this for our build
[[override]]
@ -39,34 +49,34 @@ required = [
# Core kubernetes components
[[override]]
name = "k8s.io/code-generator"
version = "kubernetes-1.10.1"
version = "kubernetes-1.11.3"
[[override]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.10.1"
version = "kubernetes-1.11.3"
[[override]]
name = "k8s.io/api"
version = "kubernetes-1.10.1"
version = "kubernetes-1.11.3"
[[override]]
name = "k8s.io/utils"
revision = "258e2a2fa64568210fbd6267cf1d8fd87c3cb86e" # Latest as of 1.10.1
revision = "cd34563cd63c2bd7c6fe88a73c4dcf34ed8a67cb" # Latest
[[override]]
name = "k8s.io/kube-openapi"
revision = "f442ecb314a3679150c272e2b9713d8deed5955d" # Latest as of 1.10.1
revision = "91cfa479c814065e420cee7ed227db0f63a5854e" # version specified in 1.11.3
[[override]]
name = "k8s.io/client-go"
revision = "23781f4d6632d88e869066eaebb743857aa1ef9b" # 1.10.0 (no 1.10.1)
version = "kubernetes-1.11.3"
[[override]]
name = "k8s.io/apiserver"
version = "kubernetes-1.10.1"
version = "kubernetes-1.11.3"
[[override]]
name = "k8s.io/metrics"
version = "kubernetes-1.10.1"
version = "kubernetes-1.11.3"
[[override]]
name = "k8s.io/apiextensions-apiserver"
version = "kubernetes-1.10.1"
version = "kubernetes-1.11.3"
[[override]]
name = "k8s.io/kubernetes"
version = "v1.10.1"
version = "v1.11.3"
# Needed for docs generation
[[override]]
@ -86,13 +96,22 @@ required = [
revision = "d8c773c4cba11b11539e3d45f93daeaa5dcf1fa1"
[[override]]
name = "github.com/spf13/cobra"
revision = "6644d46b81fa1831979c4cded0106e774e0ef0ab"
revision = "c439c4fa093711d42e1b01acb1235b52004753c1"
[[override]]
name = "golang.org/x/crypto"
revision = "81e90905daefcd6fd217b62423c0908922eadb30"
revision = "49796115aa4b964c318aad4f3084fdb41e9aa067"
[[override]]
name = "github.com/go-openapi/analysis"
revision = "b44dc874b601d9e4e2f6e19140e794ba24bead3b"
[[override]]
name = "github.com/go-openapi/spec"
revision = "1de3e0542de65ad8d75452a595886fdd0befb363"
[[override]]
name = "github.com/go-openapi/loads"
revision = "a80dea3052f00e5f032e860dd7355cd0cc67e24d"
[[override]]
name = "github.com/go-openapi/strfmt"
revision = "d65c7fdb29eca313476e529628176fe17e58c488"
[[override]]
name = "github.com/go-openapi/swag"
revision = "f3f9494671f93fcff853e3c6e9e948b3eb71e590"
@ -124,15 +143,12 @@ required = [
[[override]]
name = "github.com/renstrom/dedent"
revision = "020d11c3b9c0c7a3c2efcc8e5cf5b9ef7bcea21f"
[[override]]
name = "github.com/gophercloud/gophercloud"
revision = "6da026c32e2d622cc242d32984259c77237aefe1"
[[override]]
name = "gopkg.in/warnings.v0"
revision = "8a331561fe74dadba6edfc59f3be66c22c3b065d"
[[override]]
name = "github.com/json-iterator/go"
revision = "13f86432b882000a51c6e610c620974462691a97"
revision = "f2b4162afba35581b6d4a50d3b8f34e33c144682"
[[override]]
name = "github.com/PuerkitoBio/purell"
revision = "8a290539e2e8629dbc4e6bad948158f790ec31f4"
@ -147,7 +163,7 @@ required = [
revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75"
[[override]]
name = "google.golang.org/api"
revision = "7f657476956314fee258816aaf81c0ff65cf8bee"
revision = "8e296ef260056b6323d10727db40512dac6d92d5"
# UNKNOWN dep github.com/petar/GoLLRB
[[override]]
name = "github.com/Microsoft/go-winio"
@ -160,7 +176,7 @@ required = [
revision = "ca53cad383cad2479bbba7f7a1a05797ec1386e4"
[[override]]
name = "github.com/vmware/govmomi"
revision = "0f82f03a2bbf14037d2331cf02f1d4157bbef6cc"
revision = "e70dd44f80baf671099254d675eb278529038234"
[[override]]
name = "github.com/coreos/go-systemd"
revision = "48702e0da86bd25e76cfef347e2adeb434a0d0a6"
@ -225,7 +241,7 @@ required = [
revision = "19f72df4d05d31cbe1c56bfc8045c96babff6c7e"
[[override]]
name = "github.com/Azure/go-autorest"
revision = "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab"
revision = "1ff28809256a84bb6966640ff3d0371af82ccba4"
[[override]]
name = "golang.org/x/net"
revision = "1c05540f6879653db88113bc4a2b70aec4bd491f"
@ -240,7 +256,7 @@ required = [
revision = "20b71e5b60d756d3d2f80def009790325acc2b23"
[[override]]
name = "github.com/google/cadvisor"
revision = "2e02d28350c5fbbad9cfb7e5a1733468b75ab3f9"
revision = "de723a090f4dd5390dc7c2acee37ba9c62f0cc09"
[[override]]
name = "gopkg.in/inf.v0"
revision = "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4"
@ -271,16 +287,19 @@ required = [
revision = "e31f36ffc91a2ba9ddb72a4b6a607ff9b3d3cb63"
[[override]]
name = "github.com/pelletier/go-toml"
revision = "0049ab3dc4c4c70a9eee23087437b69c0dde2130"
revision = "16398bac157da96aa88f98a2df640c7f32af1da2"
[[override]]
name = "github.com/google/gofuzz"
revision = "44d81051d367757e1c7c6a5a86423ece9afcf63c"
[[override]]
name = "github.com/golang/protobuf"
revision = "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265"
[[override]]
name = "github.com/jonboulle/clockwork"
revision = "72f9bd7c4e0c2a40055ab3d0f09654f730cce982"
[[override]]
name = "github.com/go-openapi/errors"
revision = "d24ebc2075bad502fac3a8ae27aa6dd58e1952dc"
[[override]]
name = "github.com/go-openapi/jsonpointer"
revision = "46af16f9f7b149af66e5d1bd010e3574dc06de98"
@ -289,7 +308,7 @@ required = [
revision = "e7e903064f5e9eb5da98208bae10b475d4db0f8c"
[[override]]
name = "github.com/spf13/pflag"
revision = "4c012f6dcd9546820e378d0bdda4d8fc772cdfea"
revision = "583c0c0531f06d5278b7d917446061adc344b5cd"
[[override]]
name = "github.com/jmespath/go-jmespath"
revision = "0b12d6b521d83fc7f755e7cfc1b1fbdd35a01a74"
@ -351,7 +370,21 @@ required = [
[[override]]
name = "vbom.ml/util"
revision = "db5cfe13f5cc80a4990d98e2e1b0707a4d1a5394"
[[override]]
name = "github.com/client9/misspell"
revision = "9ce5d979ffdaca6385988d7ad1079a33ec942d20"
[[override]]
name = "github.com/stretchr/testify"
revision = "c679ae2cc0cb27ec3293fea7e254e47386f05d69"
[[override]]
name = "github.com/asaskevich/govalidator"
revision = "593d64559f7600f29581a3ee42177f5dbded27a9"
[[override]]
name = "github.com/evanphx/json-patch"
revision = "94e38aa1586e8a6c8a75770bddf5ff84c48a106b"
[[override]]
name = "github.com/pmezard/go-difflib"
revision = "d8ed2627bdf02c080bf22230dbb337003b7aba2d"
# These are our dependencies, with the versions we previously locked to with submodules
@ -405,6 +438,7 @@ required = [
revision = "1f158d31de55abf9f97bbaa0a260e2b8023a3785"
# We have some newer versions than kubernetes/kubernetes godeps
[[override]]
name = "github.com/satori/go.uuid"
@ -416,9 +450,12 @@ required = [
name = "golang.org/x/tools"
revision = "2382e3994d48b1d22acc2c86bcad0a2aff028e32"
[[override]]
# The older version specified in k8s.io/kubernetes Godeps breaks go dep
# The older version (c6fed...) specified in k8s.io/kubernetes Godeps breaks go dep
name = "github.com/chai2010/gettext-go"
revision = "bf70f2a70fb1b1f36d90d671a72795984eab0fcb"
[[override]]
name = "gopkg.in/square/go-jose.v2"
revision = "76dd09796242edb5b897103a75df2645c028c960"
[[override]]
name = "github.com/gophercloud/gophercloud"
revision = "f29afc2cceca860199ee88cd355a4d0a37b3fad2"

180
Makefile
View File

@ -18,9 +18,9 @@ S3_BUCKET?=s3://must-override/
GCS_LOCATION?=gs://must-override
GCS_URL=$(GCS_LOCATION:gs://%=https://storage.googleapis.com/%)
LATEST_FILE?=latest-ci.txt
GOPATH_1ST=$(shell go env | grep GOPATH | cut -f 2 -d \")
GOPATH_1ST:=$(shell go env | grep GOPATH | cut -f 2 -d \")
UNIQUE:=$(shell date +%s)
GOVERSION=1.9.3
GOVERSION=1.10.3
BUILD=$(GOPATH_1ST)/src/k8s.io/kops/.build
LOCAL=$(BUILD)/local
BINDATA_TARGETS=upup/models/bindata.go
@ -38,27 +38,28 @@ BAZELIMAGES=$(BAZELDIST)/images
BAZELUPLOAD=$(BAZELBUILD)/upload
UID:=$(shell id -u)
GID:=$(shell id -g)
TESTABLE_PACKAGES:=$(shell egrep -v "k8s.io/kops/cloudmock|k8s.io/kops/vendor" hack/.packages)
TESTABLE_PACKAGES:=$(shell egrep -v "k8s.io/kops/vendor" hack/.packages)
# We need to ignore clientsets because of kubernetes/kubernetes#60584
GOVETABLE_PACKAGES:=$(shell egrep -v "k8s.io/kops/cloudmock|k8s.io/kops/vendor|clientset/fake" hack/.packages)
GOVETABLE_PACKAGES:=$(shell egrep -v "k8s.io/kops/vendor|clientset/fake" hack/.packages)
BAZEL_OPTIONS?=
API_OPTIONS?=
GCFLAGS?=
# See http://stackoverflow.com/questions/18136918/how-to-get-current-relative-directory-of-your-makefile
MAKEDIR:=$(strip $(shell dirname "$(realpath $(lastword $(MAKEFILE_LIST)))"))
# Unexport environment variables that can affect tests and are not used in builds
unexport AWS_ACCESS_KEY_ID AWS_PROFILE AWS_REGION AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN CNI_VERSION_URL DNS_IGNORE_NS_CHECK DNSCONTROLLER_IMAGE DO_ACCESS_TOKEN GOOGLE_APPLICATION_CREDENTIALS
unexport AWS_ACCESS_KEY_ID AWS_REGION AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN CNI_VERSION_URL DNS_IGNORE_NS_CHECK DNSCONTROLLER_IMAGE DO_ACCESS_TOKEN GOOGLE_APPLICATION_CREDENTIALS
unexport KOPS_BASE_URL KOPS_CLUSTER_NAME KOPS_RUN_OBSOLETE_VERSION KOPS_STATE_STORE KOPS_STATE_S3_ACL KUBE_API_VERSIONS NODEUP_URL OPENSTACK_CREDENTIAL_FILE PROTOKUBE_IMAGE SKIP_PACKAGE_UPDATE
unexport SKIP_REGION_CHECK S3_ACCESS_KEY_ID S3_ENDPOINT S3_REGION S3_SECRET_ACCESS_KEY VSPHERE_USERNAME VSPHERE_PASSWORD
# Keep in sync with upup/models/cloudup/resources/addons/dns-controller/
DNS_CONTROLLER_TAG=1.9.0
DNS_CONTROLLER_TAG=1.11.0-alpha.1
# Keep in sync with logic in get_workspace_status
# Update variables in tools/get_workplace_status.sh for the bazel build
KOPS_RELEASE_VERSION = 1.9.0
KOPS_CI_VERSION = 1.9.1-alpha.1
# TODO: just invoke tools/get_workspace_status.sh?
KOPS_RELEASE_VERSION:=$(shell grep 'KOPS_RELEASE_VERSION\s*=' version.go | awk '{print $$3}' | sed -e 's_"__g')
KOPS_CI_VERSION:=$(shell grep 'KOPS_CI_VERSION\s*=' version.go | awk '{print $$3}' | sed -e 's_"__g')
# kops local location
KOPS = ${LOCAL}/kops
@ -97,8 +98,12 @@ KOPS_SERVER_TAG := $(subst +,-,${VERSION})
GO15VENDOREXPERIMENT=1
export GO15VENDOREXPERIMENT
COMPILERVERSION := $(shell go version | cut -d' ' -f3 | tr -d '\n')
ifneq (,$(findstring go1.10,$(COMPILERVERSION)))
COMPILERVERSION := $(shell go version | cut -d' ' -f3 | sed 's/go//g' | tr -d '\n')
COMPILER_VER_MAJOR := $(shell echo $(COMPILERVERSION) | cut -f1 -d.)
COMPILER_VER_MINOR := $(shell echo $(COMPILERVERSION) | cut -f2 -d.)
COMPILER_GT_1_10 := $(shell [ $(COMPILER_VER_MAJOR) -gt 1 -o \( $(COMPILER_VER_MAJOR) -eq 1 -a $(COMPILER_VER_MINOR) -ge 10 \) ] && echo true)
ifeq ($(COMPILER_GT_1_10), true)
LDFLAGS := -ldflags=all=
else
LDFLAGS := -ldflags=
@ -117,9 +122,14 @@ ifndef SHASUMCMD
$(error "Neither sha1sum nor shasum command is available")
endif
# Set compiler flags to allow binary debugging
ifdef DEBUGGABLE
GCFLAGS=-gcflags "all=-N -l"
endif
.PHONY: kops-install # Install kops to local $GOPATH/bin
kops-install: gobindata-tool ${BINDATA_TARGETS}
go install ${EXTRA_BUILDFLAGS} ${LDFLAGS}"-X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA} ${EXTRA_LDFLAGS}" k8s.io/kops/cmd/kops/
go install ${GCFLAGS} ${EXTRA_BUILDFLAGS} ${LDFLAGS}"-X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA} ${EXTRA_LDFLAGS}" k8s.io/kops/cmd/kops/
.PHONY: channels-install # Install channels to local $GOPATH/bin
channels-install: ${CHANNELS}
@ -170,11 +180,11 @@ kops: ${KOPS}
.PHONY: ${KOPS}
${KOPS}: ${BINDATA_TARGETS}
go build ${EXTRA_BUILDFLAGS} ${LDFLAGS}"-X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA} ${EXTRA_LDFLAGS}" -o $@ k8s.io/kops/cmd/kops/
go build ${GCFLAGS} ${EXTRA_BUILDFLAGS} ${LDFLAGS}"-X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA} ${EXTRA_LDFLAGS}" -o $@ k8s.io/kops/cmd/kops/
${GOBINDATA}:
mkdir -p ${LOCAL}
go build ${EXTRA_BUILDFLAGS} ${LDFLAGS}"${EXTRA_LDFLAGS}" -o $@ k8s.io/kops/vendor/github.com/jteeuwen/go-bindata/go-bindata
go build ${GCFLAGS} ${EXTRA_BUILDFLAGS} ${LDFLAGS}"${EXTRA_LDFLAGS}" -o $@ k8s.io/kops/vendor/github.com/jteeuwen/go-bindata/go-bindata
.PHONY: gobindata-tool
gobindata-tool: ${GOBINDATA}
@ -188,25 +198,30 @@ upup/models/bindata.go: ${GOBINDATA} ${UPUP_MODELS_BINDATA_SOURCES}
# Build in a docker container with golang 1.X
# Used to test we have not broken 1.X
# 1.8 is preferred, 1.9 is coming soon so we have a target for it
# 1.10 is the default for k8s 1.11. Others are best-effort
.PHONY: check-builds-in-go18
check-builds-in-go18:
docker run -v ${GOPATH_1ST}/src/k8s.io/kops:/go/src/k8s.io/kops golang:1.8 make -C /go/src/k8s.io/kops ci
# Note we only check that kops builds; we know the tests don't compile because of type aliasing in uber zap
docker run -v ${GOPATH_1ST}/src/k8s.io/kops:/go/src/k8s.io/kops golang:1.8 make -C /go/src/k8s.io/kops kops
.PHONY: check-builds-in-go19
check-builds-in-go19:
docker run -v ${GOPATH_1ST}/src/k8s.io/kops:/go/src/k8s.io/kops golang:1.9 make -C /go/src/k8s.io/kops ci
.PHONY: check-builds-in-go110
check-builds-in-go110:
docker run -v ${GOPATH_1ST}/src/k8s.io/kops:/go/src/k8s.io/kops golang:1.10 make -C /go/src/k8s.io/kops ci
.PHONY: codegen
codegen: kops-gobindata
go install k8s.io/kops/upup/tools/generators/...
PATH=${GOPATH_1ST}/bin:${PATH} go generate k8s.io/kops/upup/pkg/fi/cloudup/awstasks
PATH=${GOPATH_1ST}/bin:${PATH} go generate k8s.io/kops/upup/pkg/fi/cloudup/gcetasks
PATH=${GOPATH_1ST}/bin:${PATH} go generate k8s.io/kops/upup/pkg/fi/cloudup/dotasks
PATH=${GOPATH_1ST}/bin:${PATH} go generate k8s.io/kops/upup/pkg/fi/cloudup/openstacktasks
PATH=${GOPATH_1ST}/bin:${PATH} go generate k8s.io/kops/upup/pkg/fi/assettasks
PATH=${GOPATH_1ST}/bin:${PATH} go generate k8s.io/kops/upup/pkg/fi/fitasks
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/awstasks
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/gcetasks
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/dotasks
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/openstacktasks
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/alitasks
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/assettasks
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/fitasks
.PHONY: protobuf
protobuf:
@ -223,7 +238,7 @@ test: ${BINDATA_TARGETS} # Run tests locally
.PHONY: ${DIST}/linux/amd64/nodeup
${DIST}/linux/amd64/nodeup: ${BINDATA_TARGETS}
mkdir -p ${DIST}
GOOS=linux GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/nodeup
GOOS=linux GOARCH=amd64 go build ${GCFLAGS} -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/nodeup
.PHONY: crossbuild-nodeup
crossbuild-nodeup: ${DIST}/linux/amd64/nodeup
@ -237,17 +252,17 @@ crossbuild-nodeup-in-docker:
.PHONY: ${DIST}/darwin/amd64/kops
${DIST}/darwin/amd64/kops: ${BINDATA_TARGETS}
mkdir -p ${DIST}
GOOS=darwin GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops
GOOS=darwin GOARCH=amd64 go build ${GCFLAGS} -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops
.PHONY: ${DIST}/linux/amd64/kops
${DIST}/linux/amd64/kops: ${BINDATA_TARGETS}
mkdir -p ${DIST}
GOOS=linux GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops
GOOS=linux GOARCH=amd64 go build ${GCFLAGS} -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops
.PHONY: ${DIST}/windows/amd64/kops.exe
${DIST}/windows/amd64/kops.exe: ${BINDATA_TARGETS}
mkdir -p ${DIST}
GOOS=windows GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops
GOOS=windows GOARCH=amd64 go build ${GCFLAGS} -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops
.PHONY: crossbuild
@ -312,11 +327,13 @@ vsphere-version-dist: nodeup-dist protokube-export
upload: version-dist # Upload kops to S3
aws s3 sync --acl public-read ${UPLOAD}/ ${S3_BUCKET}
# gcs-upload builds kops and uploads to GCS
.PHONY: gcs-upload
gcs-upload: version-dist # Upload kops to GCS
gcs-upload: bazel-version-dist
@echo "== Uploading kops =="
gsutil -h "Cache-Control:private, max-age=0, no-transform" -m cp -n -r ${UPLOAD}/kops/* ${GCS_LOCATION}
gsutil -h "Cache-Control:private, max-age=0, no-transform" -m cp -n -r ${BAZELUPLOAD}/kops/* ${GCS_LOCATION}
# gcs-publish-ci is the entry point for CI testing
# In CI testing, always upload the CI version.
.PHONY: gcs-publish-ci
gcs-publish-ci: VERSION := ${KOPS_CI_VERSION}+${GITSHA}
@ -324,8 +341,8 @@ gcs-publish-ci: PROTOKUBE_TAG := $(subst +,-,${VERSION})
gcs-publish-ci: gcs-upload
echo "VERSION: ${VERSION}"
echo "PROTOKUBE_TAG: ${PROTOKUBE_TAG}"
echo "${GCS_URL}/${VERSION}" > ${UPLOAD}/${LATEST_FILE}
gsutil -h "Cache-Control:private, max-age=0, no-transform" cp ${UPLOAD}/${LATEST_FILE} ${GCS_LOCATION}
echo "${GCS_URL}/${VERSION}" > ${BAZELUPLOAD}/${LATEST_FILE}
gsutil -h "Cache-Control:private, max-age=0, no-transform" cp ${BAZELUPLOAD}/${LATEST_FILE} ${GCS_LOCATION}
.PHONY: gen-cli-docs
gen-cli-docs: ${KOPS} # Regenerate CLI docs
@ -367,7 +384,7 @@ push-aws-run: push
.PHONY: ${PROTOKUBE}
${PROTOKUBE}:
go build -o $@ -tags 'peer_name_alternative peer_name_hash' k8s.io/kops/protokube/cmd/protokube
go build ${GCFLAGS} -o $@ -tags 'peer_name_alternative peer_name_hash' k8s.io/kops/protokube/cmd/protokube
.PHONY: protokube
protokube: ${PROTOKUBE}
@ -403,7 +420,7 @@ nodeup: ${NODEUP}
.PHONY: ${NODEUP}
${NODEUP}: ${BINDATA_TARGETS}
go build ${EXTRA_BUILDFLAGS} ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" -o $@ k8s.io/kops/cmd/nodeup
go build ${GCFLAGS} ${EXTRA_BUILDFLAGS} ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" -o $@ k8s.io/kops/cmd/nodeup
.PHONY: nodeup-dist
nodeup-dist:
@ -417,7 +434,7 @@ nodeup-dist:
.PHONY: dns-controller-gocode
dns-controller-gocode:
go install -tags 'peer_name_alternative peer_name_hash' ${LDFLAGS}"${EXTRA_LDFLAGS} -X main.BuildVersion=${DNS_CONTROLLER_TAG}" k8s.io/kops/dns-controller/cmd/dns-controller
go install ${GCFLAGS} -tags 'peer_name_alternative peer_name_hash' ${LDFLAGS}"${EXTRA_LDFLAGS} -X main.BuildVersion=${DNS_CONTROLLER_TAG}" k8s.io/kops/dns-controller/cmd/dns-controller
.PHONY: dns-controller-builder-image
dns-controller-builder-image:
@ -447,12 +464,31 @@ utils-dist:
# --------------------------------------------------
# development targets
.PHONY: dep-prereqs
dep-prereqs:
(which hg > /dev/null) || (echo "dep requires that mercurial is installed"; exit 1)
(which dep > /dev/null) || (echo "dep-ensure requires that dep is installed"; exit 1)
(which bazel > /dev/null) || (echo "dep-ensure requires that bazel is installed"; exit 1)
.PHONY: dep-ensure
dep-ensure:
dep-ensure: dep-prereqs
dep ensure -v
# Switch weavemesh to use peer_name_hash - bazel rule-go doesn't support build tags yet
rm vendor/github.com/weaveworks/mesh/peer_name_mac.go
sed -i -e 's/peer_name_hash/!peer_name_mac/g' vendor/github.com/weaveworks/mesh/peer_name_hash.go
# Remove all bazel build files that were vendored and regenerate (we assume they are go-gettable)
find vendor/ -name "BUILD" -delete
find vendor/ -name "BUILD.bazel" -delete
bazel run //:gazelle -- -proto disable
# Remove recursive symlinks that really confuse bazel
rm -rf vendor/github.com/coreos/etcd/cmd/
rm -rf vendor/github.com/jteeuwen/go-bindata/testdata/
# Remove depenencies that dep just can't figure out
rm -rf vendor/k8s.io/code-generator/cmd/set-gen/
rm -rf vendor/k8s.io/code-generator/cmd/go-to-protobuf/
rm -rf vendor/k8s.io/code-generator/cmd/import-boss/
rm -rf vendor/github.com/docker/docker/contrib/
make bazel-gazelle
.PHONY: gofmt
gofmt:
@ -498,6 +534,11 @@ verify-gofmt:
verify-packages: ${BINDATA_TARGETS}
hack/verify-packages.sh
# find release notes, remove PR titles and output the rest to .build, then run misspell on all files
.PHONY: verify-misspelling
verify-misspelling:
hack/verify-spelling.sh
.PHONY: verify-gendocs
verify-gendocs: ${KOPS}
@TMP_DOCS="$$(mktemp -d)"; \
@ -518,9 +559,14 @@ verify-bazel:
# verify-package has to be after verify-gendoc, because with .gitignore for federation bindata
# it bombs in travis. verify-gendoc generates the bindata file.
.PHONY: ci
ci: govet verify-gofmt verify-boilerplate verify-bazel nodeup examples test | verify-gendocs verify-packages
ci: govet verify-gofmt verify-boilerplate verify-bazel verify-misspelling nodeup examples test | verify-gendocs verify-packages verify-apimachinery
echo "Done!"
.PHONY: pr
pr:
@echo "Test passed!"
@echo "Feel free to open your pr at https://github.com/kubernetes/kops/compare"
# --------------------------------------------------
# channel tool
@ -529,7 +575,7 @@ channels: ${CHANNELS}
.PHONY: ${CHANNELS}
${CHANNELS}:
go build ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"-X k8s.io/kops.Version=${VERSION} ${EXTRA_LDFLAGS}" k8s.io/kops/channels/cmd/channels
go build ${GCFLAGS} ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"-X k8s.io/kops.Version=${VERSION} ${EXTRA_LDFLAGS}" k8s.io/kops/channels/cmd/channels
# --------------------------------------------------
# release tasks
@ -579,20 +625,23 @@ apimachinery-codegen:
${GOPATH}/bin/client-gen ${API_OPTIONS} --clientset-name="clientset" --input-base k8s.io/kops/pkg/apis/ --input="kops/,kops/v1alpha1,kops/v1alpha2" --clientset-path k8s.io/kops/pkg/client/clientset_generated/ \
--go-header-file "hack/boilerplate/boilerplate.go.txt"
.PHONY: verify-apimachinery
verify-apimachinery:
hack/verify-apimachinery.sh
# -----------------------------------------------------
# kops-server
.PHONY: kops-server-docker-compile
kops-server-docker-compile:
GOOS=linux GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o ${DIST}/linux/amd64/kops-server ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops-server.Version=${VERSION} -X k8s.io/kops-server.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops-server
GOOS=linux GOARCH=amd64 go build ${GCFLAGS} -a ${EXTRA_BUILDFLAGS} -o ${DIST}/linux/amd64/kops-server ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops-server.Version=${VERSION} -X k8s.io/kops-server.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops-server
.PHONY: kops-server-build
kops-server-build:
# Compile the API binary in linux, and copy to local filesystem
docker pull golang:${GOVERSION}
docker run --name=kops-server-build-${UNIQUE} -e STATIC_BUILD=yes -e VERSION=${VERSION} -v ${GOPATH}/src:/go/src -v ${MAKEDIR}:/go/src/k8s.io/kops golang:${GOVERSION} make -C /go/src/k8s.io/kops/ kops-server-docker-compile
docker cp kops-server-build-${UNIQUE}:/go/.build .
docker cp kops-server-build-${UNIQUE}:/go/src/k8s.io/kops/.build .
docker build -t ${DOCKER_REGISTRY}/kops-server:${KOPS_SERVER_TAG} -f images/kops-server/Dockerfile .
.PHONY: kops-server-push
@ -616,37 +665,42 @@ bazel-build-cli:
.PHONY: bazel-crossbuild-kops
bazel-crossbuild-kops:
bazel build --features=pure --experimental_platforms=@io_bazel_rules_go//go/toolchain:darwin_amd64 //cmd/kops/...
bazel build --features=pure --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //cmd/kops/...
bazel build --features=pure --experimental_platforms=@io_bazel_rules_go//go/toolchain:windows_amd64 //cmd/kops/...
bazel build --features=pure --platforms=@io_bazel_rules_go//go/toolchain:darwin_amd64 //cmd/kops/...
bazel build --features=pure --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //cmd/kops/...
bazel build --features=pure --platforms=@io_bazel_rules_go//go/toolchain:windows_amd64 //cmd/kops/...
.PHONY: bazel-crossbuild-nodeup
bazel-crossbuild-nodeup:
bazel build --features=pure --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //cmd/nodeup/...
bazel build --features=pure --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //cmd/nodeup/...
.PHONY: bazel-crossbuild-protokube
bazel-crossbuild-protokube:
bazel build --features=pure --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //protokube/...
bazel build --features=pure --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //protokube/...
.PHONY: bazel-crossbuild-dns-controller
bazel-crossbuild-dns-controller:
bazel build --features=pure --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //dns-controller/...
bazel build --features=pure --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //dns-controller/...
.PHONY: bazel-crossbuild-dns-controller-image
bazel-crossbuild-dns-controller-image:
bazel build --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //images:dns-controller.tar
bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //images:dns-controller.tar
.PHONY: bazel-crossbuild-protokube-image
bazel-crossbuild-protokube-image:
bazel build --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //images:protokube.tar
bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //images:protokube.tar
.PHONY: bazel-crossbuild-kube-discovery-image
bazel-crossbuild-kube-discovery-image:
bazel build --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //images:kube-discovery.tar
bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //images:kube-discovery.tar
.PHONY: bazel-crossbuild-node-authorizer-image
bazel-crossbuild-node-authorizer-image:
bazel build --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //images:node-authorizer.tar
.PHONY: bazel-push
# Will always push a linux-based build up to the server
bazel-push: bazel-crossbuild-nodeup
ssh ${TARGET} touch /tmp/nodeup
ssh ${TARGET} chmod +w /tmp/nodeup
scp -C bazel-bin/cmd/nodeup/linux_amd64_pure_stripped/nodeup ${TARGET}:/tmp/
@ -658,11 +712,12 @@ bazel-push-gce-run: bazel-push
# -t is for CentOS http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password
.PHONY: bazel-push-aws-run
bazel-push-aws-run: bazel-push
ssh ${TARGET} chmod +x /tmp/nodeup
ssh -t ${TARGET} sudo SKIP_PACKAGE_UPDATE=1 /tmp/nodeup --conf=/var/cache/kubernetes-install/kube_env.yaml --v=8
.PHONY: bazel-gazelle
bazel-gazelle:
bazel run //:gazelle -- -proto disable
hack/update-bazel.sh
.PHONY: check-markdown-links
check-markdown-links:
@ -671,7 +726,7 @@ check-markdown-links:
-e LANG=en_US.UTF-8 \
-e LANGUAGE=en_US.UTF-8 \
rubygem/awesome_bot --allow-dupe --allow-redirect \
$(shell find $$PWD -name "*.md" -mindepth 1 -printf '%P\n' | grep -v vendor | grep -v _vendor | grep -v Changelog.md)
$(shell find $$PWD -name "*.md" -mindepth 1 -printf '%P\n' | grep -v vendor | grep -v Changelog.md)
#-----------------------------------------------------------
# kube-discovery
@ -682,10 +737,16 @@ push-kube-discovery:
docker tag bazel/kube-discovery/images:kube-discovery ${DOCKER_REGISTRY}/kube-discovery:${DOCKER_TAG}
docker push ${DOCKER_REGISTRY}/kube-discovery:${DOCKER_TAG}
.PHONY: push-node-authorizer
push-node-authorizer:
bazel run //node-authorizer/images:node-authorizer
docker tag bazel/node-authorizer/images:node-authorizer ${DOCKER_REGISTRY}/node-authorizer:${DOCKER_TAG}
docker push ${DOCKER_REGISTRY}/node-authorizer:${DOCKER_TAG}
.PHONY: bazel-protokube-export
bazel-protokube-export:
mkdir -p ${BAZELIMAGES}
bazel build --action_env=PROTOKUBE_TAG=${PROTOKUBE_TAG} --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //images:protokube.tar
bazel build --action_env=PROTOKUBE_TAG=${PROTOKUBE_TAG} --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //images:protokube.tar
cp bazel-bin/images/protokube.tar ${BAZELIMAGES}/protokube.tar
gzip --force --fast ${BAZELIMAGES}/protokube.tar
(${SHASUMCMD} ${BAZELIMAGES}/protokube.tar.gz | cut -d' ' -f1) > ${BAZELIMAGES}/protokube.tar.gz.sha1
@ -711,3 +772,20 @@ bazel-version-dist: bazel-crossbuild-nodeup bazel-crossbuild-kops bazel-protokub
.PHONY: bazel-upload
bazel-upload: bazel-version-dist # Upload kops to S3
aws s3 sync --acl public-read ${BAZELUPLOAD}/ ${S3_BUCKET}
#-----------------------------------------------------------
# static html documentation
.PHONY: live-docs
live-docs:
@docker run --rm -it -p 3000:3000 -v ${PWD}:/docs aledbf/mkdocs:0.1
.PHONY: build-docs
build-docs:
@docker run --rm -it -v ${PWD}:/docs aledbf/mkdocs:0.1 build
.PHONY: update-machine-types
update-machine-types: #Update machine_types.go
go build -o hack/machine_types/machine_types ${KOPS_ROOT}/hack/machine_types/machine_types.go
hack/machine_types/machine_types --out upup/pkg/fi/cloudup/awsup/machine_types.go
go fmt upup/pkg/fi/cloudup/awsup/machine_types.go

4
OWNERS
View File

@ -5,6 +5,8 @@ approvers:
- geojaz
- kashifsaadat
- gambol99
reviewers:
- mikesplain
reviewers:
- robinpercy
- chrisz100
- rdrgmnzs

View File

@ -30,7 +30,7 @@ en alpha, y otras plataformas planeadas.
## Lanzando un anfitrión de Kubernetes cluster en AWS o GCE
Para reproducir exactamente el demo anterior, visualizalo en el [tutorial](/docs/aws.md) para
Para reproducir exactamente el demo anterior, visualizalo en el [tutorial](/docs/aws.md) para
lanzar un anfitrión de Kubernetes cluster en AWS.
Para instalar un Kubernetes cluster en GCE por fabor siga esta [guide](/docs/tutorial/gce.md).
@ -67,25 +67,26 @@ kops está destinado a ser compatible con versiones anteriores. Siempre es reco
utilize la última versión de kops.
Una excepción, en lo que respecta a la compatibilidad, kops soporta el equivalente a
un número de versión menor de Kubernetes. Una versión menor es el segundo dígito en el
un número de versión menor de Kubernetes. Una versión menor es el segundo dígito en el
número de versión. la versión de kops 1.8.0 tiene una versión menor de 8. La numeración
sigue la especificación de versión semántica, MAJOR.MINOR.PATCH.
Por ejemplo kops, 1.8.0 no soporta Kubernetes 1.9.2, pero kops 1.9.0
soporta Kubernetes 1.9.2 y versiones anteriores de Kubernetes. Sólo cuando coincide la versión
soporta Kubernetes 1.9.2 y versiones anteriores de Kubernetes. Sólo cuando coincide la versión
menor de kops, La versión menor de kubernetes hace que kops soporte oficialmente
el lanzamiento de kubernetes. kops no impide que un usuario instale versiones
el lanzamiento de kubernetes. kops no impide que un usuario instale versiones
no coincidentes de K8, pero las versiones de Kubernetes siempre requieren kops para instalar
versiones de componentes como docker, probado contra la versión
versiones de componentes como docker, probado contra la versión
particular de Kubernetes.
#### Compatibilidad Matrix
#### Compatibilidad Matrix
| kops version | k8s 1.5.x | k8s 1.6.x | k8s 1.7.x | k8s 1.8.x |
|--------------|-----------|-----------|-----------|-----------|
| 1.8.x | Y | Y | Y | Y |
| 1.7.x | Y | Y | Y | N |
| 1.6.x | Y | Y | N | N |
| kops version | k8s 1.5.x | k8s 1.6.x | k8s 1.7.x | k8s 1.8.x | k8s 1.9.x |
|--------------|-----------|-----------|-----------|-----------|-----------|
| 1.9.x | Y | Y | Y | Y | Y |
| 1.8.x | Y | Y | Y | Y | N |
| 1.7.x | Y | Y | Y | N | N |
| 1.6.x | Y | Y | N | N | N |
Utilice la última versión de kops para todas las versiones de Kubernetes, con la advertencia de que las versiones más altas de Kubernetes no cuentan con el respaldo _oficial_ de kops.
@ -124,18 +125,18 @@ sudo mv kops-linux-amd64 /usr/local/bin/kops
## Historial de Versiones
visualize el [releases](https://github.com/kubernetes/kops/releases) para más
visualize el [releases](https://github.com/kubernetes/kops/releases) para más
información sobre cambios entre lanzamientos.
## Involucrarse y Contribuir
¿Estás interesado en contribuir con kops? Nosotros, los mantenedores y la comunidad,
nos encantaría sus sugerencias, contribuciones y ayuda.
Tenemos una guía de inicio rápido en [adding a feature](/docs/development/adding_a_feature.md). Además, se
nos encantaría sus sugerencias, contribuciones y ayuda.
Tenemos una guía de inicio rápido en [adding a feature](/docs/development/adding_a_feature.md). Además, se
puede contactar a los mantenedores en cualquier momento para obtener más información sobre
cómo involucrarse.
Con el interés de involucrar a más personas con kops, estamos comenzando a
Con el interés de involucrar a más personas con kops, estamos comenzando a
etiquetar los problemas con `good-starter-issue`. Por lo general, se trata de problemas que tienen
un alcance menor, pero que son buenas maneras de familiarizarse con la base de código.

View File

@ -1,3 +1,5 @@
<img src="/docs/img/logo.jpg" width="500px" alt="kops logo">
# kops - Kubernetes Operations
[![Build Status](https://travis-ci.org/kubernetes/kops.svg?branch=master)](https://travis-ci.org/kubernetes/kops) [![Go Report Card](https://goreportcard.com/badge/k8s.io/kops)](https://goreportcard.com/report/k8s.io/kops) [![GoDoc Widget]][GoDoc]
@ -82,12 +84,13 @@ Kubernetes version.
#### Compatibility Matrix
| kops version | k8s 1.5.x | k8s 1.6.x | k8s 1.7.x | k8s 1.8.x | k8s 1.9.x |
|--------------------|-----------|-----------|-----------|-----------|-----------|
| 1.9.x (unreleased) | Y | Y | Y | Y | Y |
| 1.8.x | Y | Y | Y | Y | N |
| 1.7.x | Y | Y | Y | N | N |
| 1.6.x | Y | Y | N | N | N |
| kops version | k8s 1.5.x | k8s 1.6.x | k8s 1.7.x | k8s 1.8.x | k8s 1.9.x | k8s 1.10.x |
|--------------|-----------|-----------|-----------|-----------|-----------|------------|
| 1.10.x | Y | Y | Y | Y | Y | Y |
| 1.9.x | Y | Y | Y | Y | Y | N |
| 1.8.x | Y | Y | Y | Y | N | N |
| 1.7.x | Y | Y | Y | N | N | N |
| 1.6.x | Y | Y | N | N | N | N |
Use the latest version of kops for all releases of Kubernetes, with the caveat
that higher versions of Kubernetes are not _officially_ supported by kops.
@ -176,33 +179,33 @@ https://github.com/kubernetes/test-infra/blob/master/commands.md).
## Office Hours
Kops maintainers set aside one hour every other week for **public** office hours. Office hours are hosted on a [zoom video chat](https://zoom.us/my/k8ssigaws) on Fridays at [5 pm UTC/12 noon ET/9 am US Pacific](http://www.worldtimebuddy.com/?pl=1&lid=100,5,8,12), on odd week numbered weeks. We strive to get to know and help developers either working on `kops` or interested in getting to know more about the project.
Kops maintainers set aside one hour every other week for **public** office hours. This time is used to gather with community members interested in kops. This session is open to both developers and users.
Office hours are hosted on a [zoom video chat](https://zoom.us/my/k8ssigaws) on Fridays at [12 noon (Eastern Time)/9 am (Pacific Time)](http://www.worldtimebuddy.com/?pl=1&lid=100,5,8,12) during weeks with odd "numbers". To check this weeks' number, run: `date +%V`. If the response is odd, join us on Friday for office hours!
### Office Hours Topics
We do maintain an [agenda](https://docs.google.com/document/d/12QkyL0FkNbWPcLFxxRGSPt_tNPBHbmni3YLY-lHny7E/edit) and stick to it as much as possible. If you want to hold the floor, put your item in this doc. Bullet/note form is fine. Even if your topic gets in late, we do our best to cover it.
Our office hours call is recorded, but the tone tends to be casual. First-timers are always welcome. Typical areas of discussion can include:
- Contributors with a feature proposal seeking feedback, assistance, etc
- Members planning for what we want to get done for the next release
- Strategizing for larger initiatives, such as those that involve more than one sig or potentially more moving pieces
- Help wanted requests
- Demonstrations of cool stuff. PoCs. Fresh ideas. Show us how you use kops to go beyond the norm- help us define the future!
Office hours are designed for ALL of those contributing to kops or the community. Contributions are not limited to those who commit source code. There are so many important ways to be involved-
- helping in the slack channels
- triaging/writing issues
- thinking about the topics raised at office hours and forming and advocating for your good ideas forming opinions
- testing pre-(and official) releases
Although not exhaustive, the above activities are extremely important to our continued success and are all worth contributions. If you want to talk about kops and you have doubt, just come.
### Open Office Hours Topics
Include but not limited to:
- Help and guide to those who attend, who are interested in contributing.
- Discuss the current state of the kops project, including releases.
- Strategize about how to move `kops` forward.
- Collaborate about open and upcoming PRs.
- Present demos.
This time is focused on developers, although we will never turn a courteous participant away. Please swing by, even if you've never actually installed kops.
We encourage you to reach out **beforehand** if you plan on attending. You're welcome to join any session, and please feel free to add an item to the [agenda](https://docs.google.com/document/d/12QkyL0FkNbWPcLFxxRGSPt_tNPBHbmni3YLY-lHny7E/edit) where we track notes from office hours.
Office hours are hosted on [Zoom](https://zoom.us/my/k8ssigaws) video conference, held on Fridays at [5 pm UTC/12 noon ET/9 am US Pacific](http://www.worldtimebuddy.com/?pl=1&lid=100,5,8,12) every other odd numbered week.
You can check your week number using:
```bash
date +%V
```
The maintainers and other community members are generally available on the [kubernetes slack](https://github.com/kubernetes/community/blob/master/communication.md#social-media) in [#kops](https://kubernetes.slack.com/messages/kops/), so come find and chat with us about how kops can be better for you!
### Other Ways to Communicate with the Contributors
Please check in with us in the [#kops-users](https://kubernetes.slack.com/messages/kops-users/) or [#kops-dev](https://kubernetes.slack.com/messages/kops-dev/) channel. Often-times, a well crafted question or potential bug report in slack will catch the attention of the right folks and help quickly get the ship righted.
## GitHub Issues

15
SECURITY_CONTACTS Normal file
View File

@ -0,0 +1,15 @@
# Defined below are the security contacts for this repo.
#
# They are the contact point for the Product Security Team to reach out
# to for triaging and handling of incoming issues.
#
# The below names agree to abide by the
# [Embargo Policy](https://github.com/kubernetes/sig-release/blob/master/security-release-process-documentation/security-release-process.md#embargo-policy)
# and will be removed and replaced if they violate that agreement.
#
# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE
# INSTRUCTIONS AT https://kubernetes.io/security/
justinsb
chrislovecnm
geojaz

View File

@ -3,14 +3,14 @@
http_archive(
name = "io_bazel_rules_go",
url = "https://github.com/bazelbuild/rules_go/releases/download/0.11.0/rules_go-0.11.0.tar.gz",
sha256 = "f70c35a8c779bb92f7521ecb5a1c6604e9c3edd431e50b6376d7497abc8ad3c1",
url = "https://github.com/bazelbuild/rules_go/releases/download/0.14.1/rules_go-0.14.1.tar.gz",
sha256 = "ee0e3b346388c447f13009d789c8bf2d7bae4643ac70bd7997ded0ad09b2fff7",
)
http_archive(
name = "bazel_gazelle",
url = "https://github.com/bazelbuild/bazel-gazelle/releases/download/0.11.0/bazel-gazelle-0.11.0.tar.gz",
sha256 = "92a3c59734dad2ef85dc731dbcb2bc23c4568cded79d4b87ebccd787eb89e8d0",
url = "https://github.com/bazelbuild/bazel-gazelle/releases/download/0.14.0/bazel-gazelle-0.14.0.tar.gz",
sha256 = "c0a5739d12c6d05b6c1ad56f2200cb0b57c5a70e03ebd2f7b87ce88cabf09c7b",
)
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
@ -18,7 +18,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_too
go_rules_dependencies()
go_register_toolchains(
go_version = "1.9.3",
go_version = "1.10.3",
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
@ -45,10 +45,10 @@ container_repositories()
container_pull(
name = "debian_hyperkube_base_amd64",
# 'tag' is also supported, but digest is encouraged for reproducibility.
digest = "sha256:fc1b461367730660ac5a40c1eb2d1b23221829acf8a892981c12361383b3742b",
digest = "sha256:cc782ed16599000ca4c85d47ec6264753747ae1e77520894dca84b104a7621e2",
registry = "k8s.gcr.io",
repository = "debian-hyperkube-base-amd64",
tag = "0.8",
tag = "0.10",
)
git_repository(

View File

@ -1,13 +0,0 @@
include $(GOROOT)/src/Make.inc
TARG=bitbucket.org/ww/goautoneg
GOFILES=autoneg.go
include $(GOROOT)/src/Make.pkg
format:
gofmt -w *.go
docs:
gomake clean
godoc ${TARG} > README.txt

View File

@ -1,67 +0,0 @@
PACKAGE
package goautoneg
import "bitbucket.org/ww/goautoneg"
HTTP Content-Type Autonegotiation.
The functions in this package implement the behaviour specified in
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Copyright (c) 2011, Open Knowledge Foundation Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
Neither the name of the Open Knowledge Foundation Ltd. nor the
names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FUNCTIONS
func Negotiate(header string, alternatives []string) (content_type string)
Negotiate the most appropriate content_type given the accept header
and a list of alternatives.
func ParseAccept(header string) (accept []Accept)
Parse an Accept Header string returning a sorted list
of clauses
TYPES
type Accept struct {
Type, SubType string
Q float32
Params map[string]string
}
Structure to represent a clause in an HTTP Accept Header
SUBDIRECTORIES
.hg

View File

@ -1,162 +0,0 @@
/*
HTTP Content-Type Autonegotiation.
The functions in this package implement the behaviour specified in
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Copyright (c) 2011, Open Knowledge Foundation Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
Neither the name of the Open Knowledge Foundation Ltd. nor the
names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package goautoneg
import (
"sort"
"strconv"
"strings"
)
// Structure to represent a clause in an HTTP Accept Header
type Accept struct {
Type, SubType string
Q float64
Params map[string]string
}
// For internal use, so that we can use the sort interface
type accept_slice []Accept
func (accept accept_slice) Len() int {
slice := []Accept(accept)
return len(slice)
}
func (accept accept_slice) Less(i, j int) bool {
slice := []Accept(accept)
ai, aj := slice[i], slice[j]
if ai.Q > aj.Q {
return true
}
if ai.Type != "*" && aj.Type == "*" {
return true
}
if ai.SubType != "*" && aj.SubType == "*" {
return true
}
return false
}
func (accept accept_slice) Swap(i, j int) {
slice := []Accept(accept)
slice[i], slice[j] = slice[j], slice[i]
}
// Parse an Accept Header string returning a sorted list
// of clauses
func ParseAccept(header string) (accept []Accept) {
parts := strings.Split(header, ",")
accept = make([]Accept, 0, len(parts))
for _, part := range parts {
part := strings.Trim(part, " ")
a := Accept{}
a.Params = make(map[string]string)
a.Q = 1.0
mrp := strings.Split(part, ";")
media_range := mrp[0]
sp := strings.Split(media_range, "/")
a.Type = strings.Trim(sp[0], " ")
switch {
case len(sp) == 1 && a.Type == "*":
a.SubType = "*"
case len(sp) == 2:
a.SubType = strings.Trim(sp[1], " ")
default:
continue
}
if len(mrp) == 1 {
accept = append(accept, a)
continue
}
for _, param := range mrp[1:] {
sp := strings.SplitN(param, "=", 2)
if len(sp) != 2 {
continue
}
token := strings.Trim(sp[0], " ")
if token == "q" {
a.Q, _ = strconv.ParseFloat(sp[1], 32)
} else {
a.Params[token] = strings.Trim(sp[1], " ")
}
}
accept = append(accept, a)
}
slice := accept_slice(accept)
sort.Sort(slice)
return
}
// Negotiate the most appropriate content_type given the accept header
// and a list of alternatives.
func Negotiate(header string, alternatives []string) (content_type string) {
asp := make([][]string, 0, len(alternatives))
for _, ctype := range alternatives {
asp = append(asp, strings.SplitN(ctype, "/", 2))
}
for _, clause := range ParseAccept(header) {
for i, ctsp := range asp {
if clause.Type == ctsp[0] && clause.SubType == ctsp[1] {
content_type = alternatives[i]
return
}
if clause.Type == ctsp[0] && clause.SubType == "*" {
content_type = alternatives[i]
return
}
if clause.Type == "*" && clause.SubType == "*" {
content_type = alternatives[i]
return
}
}
}
return
}

View File

@ -1,33 +0,0 @@
package goautoneg
import (
"testing"
)
var chrome = "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"
func TestParseAccept(t *testing.T) {
alternatives := []string{"text/html", "image/png"}
content_type := Negotiate(chrome, alternatives)
if content_type != "image/png" {
t.Errorf("got %s expected image/png", content_type)
}
alternatives = []string{"text/html", "text/plain", "text/n3"}
content_type = Negotiate(chrome, alternatives)
if content_type != "text/html" {
t.Errorf("got %s expected text/html", content_type)
}
alternatives = []string{"text/n3", "text/plain"}
content_type = Negotiate(chrome, alternatives)
if content_type != "text/plain" {
t.Errorf("got %s expected text/plain", content_type)
}
alternatives = []string{"text/n3", "application/rdf+xml"}
content_type = Negotiate(chrome, alternatives)
if content_type != "text/n3" {
t.Errorf("got %s expected text/n3", content_type)
}
}

View File

@ -6,12 +6,13 @@ Note that you likely want to change `AWS_REGION` and `GROUP_NAME`, and probably
```bash
CLOUD_PROVIDER=aws
IMAGE=k8s.gcr.io/cluster-autoscaler:v1.1.0
IMAGE=k8s.gcr.io/cluster-autoscaler:v1.2.2
MIN_NODES=1
MAX_NODES=5
AWS_REGION=us-east-1
# For AWS GROUP_NAME should be the name of ASG as seen on AWS console
GROUP_NAME="nodes.k8s.example.com"
SSL_CERT_PATH="/etc/ssl/certs/ca-certificates.crt" # (/etc/ssl/certs for gce)
SSL_CERT_PATH="/etc/ssl/certs/ca-certificates.crt" # (/etc/ssl/certs for gce, /etc/ssl/certs/ca-bundle.crt for RHEL7.X)
addon=cluster-autoscaler.yml
wget -O ${addon} https://raw.githubusercontent.com/kubernetes/kops/master/addons/cluster-autoscaler/v1.8.0.yaml
@ -26,3 +27,11 @@ sed -i -e "s@{{SSL_CERT_PATH}}@${SSL_CERT_PATH}@g" "${addon}"
kubectl apply -f ${addon}
```
An enhanced script which also adds the IAM policies is included here [cluster-autoscaler.sh](cluster-autoscaler.sh)
Question: Which ASG group should be autoscaled?
Answer: By default, kops creates a "nodes" instancegroup and a corresponding ASG group which will have a name such as "nodes.$CLUSTER_NAME", visible in the AWS Console. That ASG is a good choice to begin with. Optionally, you may also create a new instancegroup "kops create ig _newgroupname_", and configure that instead. Set the maxSize of the kops instancesgroup, and update the cluster so the maxSize propagates to the ASG.
Question: The cluster-autoscaler [documentation](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/cloudprovider/aws) mentions an IAM Policy. Which IAM Role should the Policy be attached to?
Answer: Kops creates two Roles, nodes.$CLUSTER_NAME and masters.$CLUSTER_NAME. Currently the example scripts run the autoscaler process on the k8s master node, so the IAM Policy should be assigned to masters.$CLUSTER_NAME (substituting that variable for your actual cluster name).

View File

@ -0,0 +1,106 @@
#!/bin/bash
# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT 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 all the variables in this section
CLUSTER_NAME="myfirstcluster.k8s.local"
CLOUD_PROVIDER=aws
IMAGE=k8s.gcr.io/cluster-autoscaler:v1.1.0
MIN_NODES=2
MAX_NODES=20
AWS_REGION=us-east-1
INSTANCE_GROUP_NAME="nodes"
ASG_NAME="${INSTANCE_GROUP_NAME}.${CLUSTER_NAME}" #ASG_NAME should be the name of ASG as seen on AWS console.
IAM_ROLE="masters.${CLUSTER_NAME}" #Where will the cluster-autoscaler process run? Currently on the master node.
SSL_CERT_PATH="/etc/ssl/certs/ca-certificates.crt" #(/etc/ssl/certs for gce, /etc/ssl/certs/ca-bundle.crt for RHEL7.X)
#KOPS_STATE_STORE="s3://___" #KOPS_STATE_STORE might already be set as an environment variable, in which case it doesn't have to be changed.
#Best-effort install script prerequisites, otherwise they will need to be installed manually.
if [[ -f /usr/bin/apt-get && ! -f /usr/bin/jq ]]
then
sudo apt-get update
sudo apt-get install -y jq
fi
if [[ -f /bin/yum && ! -f /bin/jq ]]
then
echo "This may fail if epel cannot be installed. In that case, correct/install epel and retry."
sudo yum install -y epel-release
sudo yum install -y jq || exit
fi
echo "7⃣ Set up Autoscaling"
echo " First, we need to update the minSize and maxSize attributes for the kops instancegroup."
echo " The next command will open the instancegroup config in your default editor, please save and exit the file once you're done…"
sleep 1
kops edit ig $INSTANCE_GROUP_NAME --state ${KOPS_STATE_STORE} --name ${CLUSTER_NAME}
echo " Running kops update cluster --yes"
kops update cluster --yes --state ${KOPS_STATE_STORE} --name ${CLUSTER_NAME}
printf "\n"
printf " a) Creating IAM policy to allow aws-cluster-autoscaler access to AWS autoscaling groups…\n"
cat > asg-policy.json << EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeTags",
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup"
],
"Resource": "*"
}
]
}
EOF
ASG_POLICY_NAME=aws-cluster-autoscaler
unset TESTOUTPUT
TESTOUTPUT=$(aws iam list-policies --output json | jq -r '.Policies[] | select(.PolicyName == "aws-cluster-autoscaler") | .Arn')
if [[ $? -eq 0 && -n "$TESTOUTPUT" ]]
then
printf " ✅ Policy already exists\n"
ASG_POLICY_ARN=$TESTOUTPUT
else
printf " ✅ Policy does not yet exist, creating now.\n"
ASG_POLICY=$(aws iam create-policy --policy-name $ASG_POLICY_NAME --policy-document file://asg-policy.json --output json)
ASG_POLICY_ARN=$(echo $ASG_POLICY | jq -r '.Policy.Arn')
printf " ✅ \n"
fi
printf " b) Attaching policy to IAM Role…\n"
aws iam attach-role-policy --policy-arn $ASG_POLICY_ARN --role-name $IAM_ROLE
printf " ✅ \n"
addon=cluster-autoscaler.yml
wget -O ${addon} https://raw.githubusercontent.com/kubernetes/kops/master/addons/cluster-autoscaler/v1.8.0.yaml
sed -i -e "s@{{CLOUD_PROVIDER}}@${CLOUD_PROVIDER}@g" "${addon}"
sed -i -e "s@{{IMAGE}}@${IMAGE}@g" "${addon}"
sed -i -e "s@{{MIN_NODES}}@${MIN_NODES}@g" "${addon}"
sed -i -e "s@{{MAX_NODES}}@${MAX_NODES}@g" "${addon}"
sed -i -e "s@{{GROUP_NAME}}@${ASG_NAME}@g" "${addon}"
sed -i -e "s@{{AWS_REGION}}@${AWS_REGION}@g" "${addon}"
sed -i -e "s@{{SSL_CERT_PATH}}@${SSL_CERT_PATH}@g" "${addon}"
kubectl apply -f ${addon}
printf "Done\n"

View File

@ -0,0 +1,171 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-addon: cluster-autoscaler.addons.k8s.io
k8s-app: cluster-autoscaler
name: cluster-autoscaler
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: cluster-autoscaler
labels:
k8s-addon: cluster-autoscaler.addons.k8s.io
k8s-app: cluster-autoscaler
rules:
- apiGroups: [""]
resources: ["events","endpoints"]
verbs: ["create", "patch"]
- apiGroups: [""]
resources: ["pods/eviction"]
verbs: ["create"]
- apiGroups: [""]
resources: ["pods/status"]
verbs: ["update"]
- apiGroups: [""]
resources: ["endpoints"]
resourceNames: ["cluster-autoscaler"]
verbs: ["get","update"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["watch","list","get","update"]
- apiGroups: [""]
resources: ["pods","services","replicationcontrollers","persistentvolumeclaims","persistentvolumes"]
verbs: ["watch","list","get"]
- apiGroups: ["extensions"]
resources: ["replicasets","daemonsets"]
verbs: ["watch","list","get"]
- apiGroups: ["policy"]
resources: ["poddisruptionbudgets"]
verbs: ["watch","list"]
- apiGroups: ["apps"]
resources: ["statefulsets"]
verbs: ["watch","list","get"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["watch","list","get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: cluster-autoscaler
namespace: kube-system
labels:
k8s-addon: cluster-autoscaler.addons.k8s.io
k8s-app: cluster-autoscaler
rules:
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["create"]
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["cluster-autoscaler-status"]
verbs: ["delete","get","update"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cluster-autoscaler
labels:
k8s-addon: cluster-autoscaler.addons.k8s.io
k8s-app: cluster-autoscaler
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-autoscaler
subjects:
- kind: ServiceAccount
name: cluster-autoscaler
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: cluster-autoscaler
namespace: kube-system
labels:
k8s-addon: cluster-autoscaler.addons.k8s.io
k8s-app: cluster-autoscaler
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: cluster-autoscaler
subjects:
- kind: ServiceAccount
name: cluster-autoscaler
namespace: kube-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: cluster-autoscaler
namespace: kube-system
labels:
app: cluster-autoscaler
spec:
replicas: 1
selector:
matchLabels:
app: cluster-autoscaler
template:
metadata:
labels:
k8s-addon: cluster-autoscaler.addons.k8s.io
app: cluster-autoscaler
annotations:
# For 1.6, we keep the old tolerations in case of a downgrade to 1.5
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"dedicated", "value":"master"}]'
prometheus.io/scrape: 'true'
prometheus.io/port: '8085'
spec:
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
nodeSelector:
kubernetes.io/role: master
serviceAccountName: cluster-autoscaler
containers:
- image: {{IMAGE}}
name: cluster-autoscaler
livenessProbe:
httpGet:
path: /health-check
port: 8085
readinessProbe:
httpGet:
path: /health-check
port: 8085
resources:
limits:
cpu: 100m
memory: 300Mi
requests:
cpu: 100m
memory: 300Mi
command:
- ./cluster-autoscaler
- --v=4
- --stderrthreshold=info
- --cloud-provider={{CLOUD_PROVIDER}}
- --skip-nodes-with-local-storage=false
- --nodes={{MIN_NODES}}:{{MAX_NODES}}:{{GROUP_NAME}}
env:
- name: AWS_REGION
value: {{AWS_REGION}}
volumeMounts:
- name: ssl-certs
mountPath: {{SSL_CERT_PATH}}
readOnly: true
imagePullPolicy: "Always"
volumes:
- name: ssl-certs
hostPath:
path: {{SSL_CERT_PATH}}
dnsPolicy: "Default"

View File

@ -1,4 +1,14 @@
## Deployment
### AWS
```
kubectl apply -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/ingress-nginx/v1.6.0.yaml
```
### GCE
```
kubectl apply -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/ingress-nginx/v1.6.0-gce.yaml
```
## Creating a simple ingress

View File

@ -194,7 +194,7 @@ spec:
terminationGracePeriodSeconds: 60
containers:
- name: default-http-backend
image: k8s.gcr.io/defaultbackend:1.3
image: k8s.gcr.io/defaultbackend:1.4
livenessProbe:
httpGet:
path: /healthz
@ -236,6 +236,8 @@ metadata:
labels:
k8s-addon: ingress-nginx.addons.k8s.io
spec:
# Forces nodes without Service endpoints to remove themselves from the list of nodes eligible. See https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-type-loadbalancer
externalTrafficPolicy: Local
type: LoadBalancer
selector:
app: ingress-nginx
@ -272,7 +274,7 @@ spec:
terminationGracePeriodSeconds: 60
serviceAccountName: nginx-ingress-controller
containers:
- image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.12.0
- image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.18.0
name: nginx-ingress-controller
imagePullPolicy: Always
ports:

View File

@ -194,7 +194,7 @@ spec:
terminationGracePeriodSeconds: 60
containers:
- name: default-http-backend
image: k8s.gcr.io/defaultbackend:1.3
image: k8s.gcr.io/defaultbackend:1.4
livenessProbe:
httpGet:
path: /healthz
@ -236,7 +236,10 @@ metadata:
labels:
k8s-addon: ingress-nginx.addons.k8s.io
annotations:
# Enable PROXY protocol
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: '*'
# Increase the ELB idle timeout to avoid issues with WebSockets or Server-Sent Events.
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '3600'
spec:
type: LoadBalancer
selector:
@ -274,7 +277,7 @@ spec:
terminationGracePeriodSeconds: 60
serviceAccountName: nginx-ingress-controller
containers:
- image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.12.0
- image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.18.0
name: nginx-ingress-controller
imagePullPolicy: Always
ports:

View File

@ -3,7 +3,7 @@
[Kube AWS Ingress Controller](https://github.com/zalando-incubator/kubernetes-on-aws)
creates AWS Application Load Balancer (ALB) that is used to terminate TLS connections and use
[AWS Certificate Manager (ACM)](https://aws.amazon.com/certificate-manager/) or
[AWS Identity and Access Management (IAM)](http://docs.aws.amazon.com/IAM/latest/APIReference/Welcome.html)
[AWS Identity and Access Management (IAM)](https://docs.aws.amazon.com/IAM/latest/APIReference/Welcome.html)
certificates. ALBs are used to route traffic to an Ingress http router for example
[skipper](https://github.com/zalando/skipper/), which routes
traffic to Kubernetes services and implements
@ -179,7 +179,20 @@ aws ec2 authorize-security-group-egress --group-id $sgidingress --protocol all -
aws ec2 authorize-security-group-ingress --group-id $sgidnode --protocol all --port -1 --source-group $sgidingress
aws ec2 create-tags --resources $sgidingress --tags '[{"Key": "kubernetes.io/cluster/id", "Value": "owned"}, {"Key": "kubernetes:application", "Value": "kube-ingress-aws-controller"}]'
```
If your cluster is running not in the default VPC then the commands for the creation of the security groups will look a little different:
```
VPC_ID=$(aws ec2 describe-security-groups --filters Name=group-name,Values=nodes.$KOPS_CLUSTER_NAME | jq '.["SecurityGroups"][0].VpcId' -r)
aws ec2 create-security-group --description ingress.$KOPS_CLUSTER_NAME --group-name ingress.$KOPS_CLUSTER_NAME --vpc-id $VPC_ID
aws ec2 describe-security-groups --filter Name=vpc-id,Values=$VPC_ID Name=group-name,Values=ingress.$KOPS_CLUSTER_NAME
sgidingress=$(aws ec2 describe-security-groups --filter Name=vpc-id,Values=$VPC_ID Name=group-name,Values=ingress.$KOPS_CLUSTER_NAME | jq '.["SecurityGroups"][0]["GroupId"]' -r)
sgidnode=$(aws ec2 describe-security-groups --filter Name=vpc-id,Values=$VPC_ID Name=group-name,Values=nodes.$KOPS_CLUSTER_NAME | jq '.["SecurityGroups"][0]["GroupId"]' -r)
aws ec2 authorize-security-group-ingress --group-id $sgidingress --protocol tcp --port 443 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-id $sgidingress --protocol tcp --port 80 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-egress --group-id $sgidingress --protocol all --port -1 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-id $sgidnode --protocol all --port -1 --source-group $sgidingress
aws ec2 create-tags --resources $sgidingress --tags Key="kubernetes.io/cluster/${KOPS_CLUSTER_NAME}",Value="owned" Key="kubernetes:application",Value="kube-ingress-aws-controller"
```
### AWS Certificate Manager (ACM)
To have TLS termination you can use AWS managed certificates. If you
@ -242,6 +255,11 @@ sed -i "s/<HOSTNAME2>/demo-green-blue.example.org/" v1.0.0.yaml
kubectl create -f v1.0.0.yaml
```
If your VPC-CIDR is different from 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, 127.0.0.1/8,fd00::/8 or ::1/128 you may
get a "Readiness probe failed: HTTP probe failed with statuscode: 404" from the skipper pods with the *latest* or
*v0.10.7* tag of skipper.
To prevent this, uncomment the "-whitelisted-healthcheck-cidr=<CIDR_BLOCK>" in v1.0.0.yaml and add your VPC-CIDR.
Check, if the installation was successful:
```

View File

@ -37,7 +37,7 @@ metadata:
spec:
selector:
matchLabels:
application: skipper-ingress
component: ingress
updateStrategy:
type: RollingUpdate
template:
@ -65,6 +65,7 @@ spec:
- "-experimental-upgrade"
- "-metrics-exp-decay-sample"
- "-kubernetes-https-redirect=true"
# - "-whitelisted-healthcheck-cidr=<CIDR_BLOCK>"
resources:
limits:
cpu: 200m
@ -195,7 +196,7 @@ spec:
http:
paths:
- backend:
serviceName: "demo-app-v1"
serviceName: "demo-app-v2"
servicePort: 80
---

View File

@ -45,4 +45,9 @@ spec:
kubernetesVersion: ">=1.8.0"
selector:
k8s-addon: kubernetes-dashboard.addons.k8s.io
manifest: v1.8.3.yaml
manifest: v1.8.3.yaml
- version: 1.10.0
kubernetesVersion: ">=1.10.0"
selector:
k8s-addon: kubernetes-dashboard.addons.k8s.io
manifest: v1.10.0.yaml

View File

@ -0,0 +1,167 @@
# 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.
# Configuration to deploy release version of the Dashboard UI compatible with
# Kubernetes 1.10.
#
# Example usage: kubectl create -f <this_file>
# ------------------- Dashboard Secret ------------------- #
apiVersion: v1
kind: Secret
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard-certs
namespace: kube-system
type: Opaque
---
# ------------------- Dashboard Service Account ------------------- #
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
---
# ------------------- Dashboard Role & Role Binding ------------------- #
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kubernetes-dashboard-minimal
namespace: kube-system
rules:
# Allow Dashboard to create 'kubernetes-dashboard-key-holder' secret.
- apiGroups: [""]
resources: ["secrets"]
verbs: ["create"]
# Allow Dashboard to create 'kubernetes-dashboard-settings' config map.
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["create"]
# Allow Dashboard to get, update and delete Dashboard exclusive secrets.
- apiGroups: [""]
resources: ["secrets"]
resourceNames: ["kubernetes-dashboard-key-holder", "kubernetes-dashboard-certs"]
verbs: ["get", "update", "delete"]
# Allow Dashboard to get and update 'kubernetes-dashboard-settings' config map.
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["kubernetes-dashboard-settings"]
verbs: ["get", "update"]
# Allow Dashboard to get metrics from heapster.
- apiGroups: [""]
resources: ["services"]
resourceNames: ["heapster"]
verbs: ["proxy"]
- apiGroups: [""]
resources: ["services/proxy"]
resourceNames: ["heapster", "http:heapster:", "https:heapster:"]
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: kubernetes-dashboard-minimal
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: kubernetes-dashboard-minimal
subjects:
- kind: ServiceAccount
name: kubernetes-dashboard
namespace: kube-system
---
# ------------------- Dashboard Deployment ------------------- #
kind: Deployment
apiVersion: apps/v1beta2
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
k8s-app: kubernetes-dashboard
template:
metadata:
labels:
k8s-app: kubernetes-dashboard
spec:
containers:
- name: kubernetes-dashboard
image: k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.0
ports:
- containerPort: 8443
protocol: TCP
args:
- --auto-generate-certificates
# Uncomment the following line to manually specify Kubernetes API server Host
# If not specified, Dashboard will attempt to auto discover the API server and connect
# to it. Uncomment only if the default does not work.
# - --apiserver-host=http://my-address:port
volumeMounts:
- name: kubernetes-dashboard-certs
mountPath: /certs
# Create on-disk volume to store exec logs
- mountPath: /tmp
name: tmp-volume
livenessProbe:
httpGet:
scheme: HTTPS
path: /
port: 8443
initialDelaySeconds: 30
timeoutSeconds: 30
volumes:
- name: kubernetes-dashboard-certs
secret:
secretName: kubernetes-dashboard-certs
- name: tmp-volume
emptyDir: {}
serviceAccountName: kubernetes-dashboard
# Comment the following tolerations if Dashboard must not be deployed on master
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
---
# ------------------- Dashboard Service ------------------- #
kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
spec:
ports:
- port: 443
targetPort: 8443
selector:
k8s-app: kubernetes-dashboard

View File

@ -13,3 +13,8 @@ spec:
k8s-addon: logging-elasticsearch.addons.k8s.io
manifest: v1.6.0.yaml
kubernetesVersion: ">=1.6.0" # RBAC v1beta1 is introduced as of v1.6.0
- version: 1.7.0
selector:
k8s-addon: logging-elasticsearch.addons.k8s.io
manifest: v1.7.0.yaml
kubernetesVersion: ">=1.6.0"

View File

@ -0,0 +1,284 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: elasticsearch-logging
namespace: kube-system
labels:
k8s-app: elasticsearch-logging
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: elasticsearch-logging
labels:
k8s-app: elasticsearch-logging
rules:
- apiGroups:
- ""
resources:
- "services"
- "namespaces"
- "endpoints"
verbs:
- "get"
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
namespace: kube-system
name: elasticsearch-logging
labels:
k8s-app: elasticsearch-logging
subjects:
- kind: ServiceAccount
name: elasticsearch-logging
namespace: kube-system
apiGroup: ""
roleRef:
kind: ClusterRole
name: elasticsearch-logging
apiGroup: ""
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: fluentd-es
namespace: kube-system
labels:
k8s-app: fluentd-es
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: fluentd-es
labels:
k8s-app: fluentd-es
rules:
- apiGroups:
- ""
resources:
- "namespaces"
- "pods"
verbs:
- "get"
- "watch"
- "list"
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: fluentd-es
labels:
k8s-app: fluentd-es
subjects:
- kind: ServiceAccount
name: fluentd-es
namespace: kube-system
apiGroup: ""
roleRef:
kind: ClusterRole
name: fluentd-es
apiGroup: ""
---
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: fluentd-es
namespace: kube-system
labels:
k8s-addon: logging-elasticsearch.addons.k8s.io
k8s-app: fluentd-es
kubernetes.io/cluster-service: "true"
version: v2.0.4
spec:
template:
metadata:
labels:
k8s-app: fluentd-es
kubernetes.io/cluster-service: "true"
version: v2.0.4
spec:
serviceAccountName: fluentd-es
containers:
- name: fluentd-es
image: k8s.gcr.io/fluentd-elasticsearch:1.22
command:
- '/bin/sh'
- '-c'
- '/usr/sbin/td-agent 2>&1 >> /var/log/fluentd.log'
resources:
limits:
memory: 200Mi
requests:
cpu: 100m
memory: 200Mi
volumeMounts:
- name: varlog
mountPath: /var/log
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
#nodeSelector:
# alpha.kubernetes.io/fluentd-ds-ready: "true"
terminationGracePeriodSeconds: 30
volumes:
- name: varlog
hostPath:
path: /var/log
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
---
apiVersion: v1
kind: Service
metadata:
name: elasticsearch-logging
namespace: kube-system
labels:
k8s-addon: logging-elasticsearch.addons.k8s.io
k8s-app: elasticsearch-logging
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "Elasticsearch"
spec:
ports:
- port: 9200
protocol: TCP
targetPort: db
selector:
k8s-app: elasticsearch-logging
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: elasticsearch-logging
namespace: kube-system
labels:
k8s-addon: logging-elasticsearch.addons.k8s.io
k8s-app: elasticsearch-logging
version: v1
kubernetes.io/cluster-service: "true"
spec:
serviceName: elasticsearch-logging
replicas: 2
template:
metadata:
labels:
k8s-app: elasticsearch-logging
version: v1
kubernetes.io/cluster-service: "true"
spec:
serviceAccountName: elasticsearch-logging
containers:
- image: k8s.gcr.io/elasticsearch:v5.6.4
name: elasticsearch-logging
resources:
# need more cpu upon initialization, therefore burstable class
limits:
cpu: 1000m
requests:
cpu: 100m
ports:
- containerPort: 9200
name: db
protocol: TCP
- containerPort: 9300
name: transport
protocol: TCP
volumeMounts:
- name: es-persistent-storage
mountPath: /data
env:
- name: "NAMESPACE"
valueFrom:
fieldRef:
fieldPath: metadata.namespace
volumeClaimTemplates:
- metadata:
name: es-persistent-storage
annotations:
volume.beta.kubernetes.io/storage-class: "default"
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 20Gi
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: kibana-logging
namespace: kube-system
labels:
k8s-addon: logging-elasticsearch.addons.k8s.io
k8s-app: kibana-logging
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
selector:
matchLabels:
k8s-app: kibana-logging
template:
metadata:
labels:
k8s-app: kibana-logging
spec:
containers:
- name: kibana-logging
image: docker.elastic.co/kibana/kibana:5.6.4
resources:
# keep request = limit to keep this container in guaranteed class
limits:
cpu: 100m
requests:
cpu: 100m
env:
- name: "ELASTICSEARCH_URL"
value: "http://elasticsearch-logging:9200"
- name: "SERVER_BASEPATH"
value: "/api/v1/proxy/namespaces/kube-system/services/kibana-logging"
- name: "XPACK_MONITORING_ENABLED"
value: "false"
- name: "XPACK_SECURITY_ENABLED"
value: "false"
ports:
- containerPort: 5601
name: ui
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: kibana-logging
namespace: kube-system
labels:
k8s-addon: logging-elasticsearch.addons.k8s.io
k8s-app: kibana-logging
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "Kibana"
spec:
ports:
- port: 5601
protocol: TCP
targetPort: ui
selector:
k8s-app: kibana-logging

View File

@ -42,6 +42,7 @@ rules:
resources:
- pods
- nodes
- nodes/stats
- namespaces
verbs:
- get

View File

@ -20,3 +20,8 @@ spec:
k8s-addon: monitoring-standalone.addons.k8s.io
manifest: v1.6.0.yaml
kubernetesVersion: ">=1.6.0"
- version: 1.11.0
selector:
k8s-addon: monitoring-standalone.addons.k8s.io
manifest: v1.11.0.yaml
kubernetesVersion: ">=1.11.0"

View File

@ -0,0 +1,160 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: heapster
namespace: kube-system
labels:
k8s-addon: monitoring-standalone.addons.k8s.io
k8s-app: heapster
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
version: v1.9.0
spec:
replicas: 1
selector:
matchLabels:
k8s-app: heapster
version: v1.9.0
template:
metadata:
labels:
k8s-app: heapster
version: v1.9.0
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
spec:
serviceAccountName: heapster
containers:
- image: k8s.gcr.io/heapster-amd64:v1.5.3
name: heapster
livenessProbe:
httpGet:
path: /healthz
port: 8082
scheme: HTTP
initialDelaySeconds: 180
timeoutSeconds: 5
resources:
# keep request = limit to keep this container in guaranteed class
limits:
cpu: 100m
memory: 300Mi
requests:
cpu: 100m
memory: 300Mi
command:
- /heapster
- --source=kubernetes.summary_api:''
- image: k8s.gcr.io/addon-resizer:1.8.3
name: heapster-nanny
resources:
limits:
cpu: 50m
memory: 100Mi
requests:
cpu: 50m
memory: 100Mi
env:
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
command:
- /pod_nanny
- --cpu=80m
- --extra-cpu=0.5m
- --memory=140Mi
- --extra-memory=4Mi
- --deployment=heapster
- --container=heapster
- --poll-period=300000
tolerations:
- key: "CriticalAddonsOnly"
operator: "Exists"
---
apiVersion: v1
kind: Service
metadata:
name: heapster
namespace: kube-system
labels:
k8s-addon: monitoring-standalone.addons.k8s.io
kubernetes.io/name: "Heapster"
kubernetes.io/cluster-service: "true"
spec:
ports:
- port: 80
targetPort: 8082
selector:
k8s-app: heapster
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: heapster
namespace: kube-system
labels:
k8s-addon: monitoring-standalone.addons.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: heapster
labels:
k8s-addon: monitoring-standalone.addons.k8s.io
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:heapster
subjects:
- kind: ServiceAccount
name: heapster
namespace: kube-system
---
# Heapster's pod_nanny monitors the heapster deployment & its pod(s), and scales
# the resources of the deployment if necessary.
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
name: system:pod-nanny
namespace: kube-system
labels:
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- apiGroups:
- "extensions"
resources:
- deployments
verbs:
- get
- update
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: heapster-binding
namespace: kube-system
labels:
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: system:pod-nanny
subjects:
- kind: ServiceAccount
name: heapster
namespace: kube-system

View File

@ -0,0 +1,18 @@
# Prometheus Operator Addon
[Prometheus Operator](https://coreos.com/operators/prometheus) creates/configures/manages Prometheus clusters atop Kubernetes. This addon deploy prometheus-operator and [kube-prometheus](https://github.com/coreos/prometheus-operator/blob/master/contrib/kube-prometheus/README.md) in a kops cluster.
## Usage
### Deploy To Cluster
```console
kubectl apply -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/prometheus-operator/v0.19.0.yaml
```
### Updating the addon
Run the script below.
```console
addons/prometheus-operator/sync-repo.sh "v0.19.0"
```

View File

@ -0,0 +1,9 @@
kind: Addons
metadata:
name: prometheus-operator
spec:
addons:
- version: 0.19.0
selector:
k8s-addon: prometheus-operator.addons.k8s.io
manifest: v0.19.0.yaml

View File

@ -0,0 +1,35 @@
#!/bin/bash
# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT 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
P_OPERATOR_VERSION=${1:-"v0.19.0"}
P_OPERATOR_ADDON_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd ${P_OPERATOR_ADDON_DIR}
git clone --depth 1 https://github.com/coreos/prometheus-operator/
cp prometheus-operator/bundle.yaml ${P_OPERATOR_VERSION}.yaml
mkdir tmp
cp prometheus-operator/contrib/kube-prometheus/manifests/* tmp
for i in `ls tmp`
do
echo "---" >> ${P_OPERATOR_VERSION}.yaml
cat tmp/$i >> ${P_OPERATOR_VERSION}.yaml
done
rm -rf ${P_OPERATOR_ADDON_DIR}/prometheus-operator ${P_OPERATOR_ADDON_DIR}/tmp/
cd -

File diff suppressed because it is too large Load Diff

View File

@ -4,38 +4,49 @@ spec:
- name: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2017-07-28
providerID: aws
kubernetesVersion: ">=1.4.0 <1.5.0"
- name: kope.io/k8s-1.5-debian-jessie-amd64-hvm-ebs-2018-03-11
- name: kope.io/k8s-1.5-debian-jessie-amd64-hvm-ebs-2018-08-17
providerID: aws
kubernetesVersion: ">=1.5.0 <1.6.0"
- name: kope.io/k8s-1.6-debian-jessie-amd64-hvm-ebs-2018-03-11
- name: kope.io/k8s-1.6-debian-jessie-amd64-hvm-ebs-2018-08-17
providerID: aws
kubernetesVersion: ">=1.6.0 <1.7.0"
- name: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2018-03-11
- name: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2018-08-17
providerID: aws
kubernetesVersion: ">=1.7.0 <1.8.0"
- name: kope.io/k8s-1.8-debian-jessie-amd64-hvm-ebs-2018-03-11
- name: kope.io/k8s-1.8-debian-jessie-amd64-hvm-ebs-2018-08-17
providerID: aws
kubernetesVersion: ">=1.8.0 <1.9.0"
- name: kope.io/k8s-1.9-debian-jessie-amd64-hvm-ebs-2018-03-11
- name: kope.io/k8s-1.9-debian-jessie-amd64-hvm-ebs-2018-08-17
providerID: aws
kubernetesVersion: ">=1.9.0 <1.10.0"
# Need stretch as default in 1.10 (for nvme)
# BUT... this is causing the submit queue to block, so back to jessie temporarily: https://github.com/kubernetes/kubernetes/issues/56763
- name: kope.io/k8s-1.9-debian-jessie-amd64-hvm-ebs-2018-03-11
- name: kope.io/k8s-1.10-debian-jessie-amd64-hvm-ebs-2018-08-17
providerID: aws
kubernetesVersion: ">=1.10.0"
kubernetesVersion: ">=1.10.0 <1.11.0"
# Stretch is the default for 1.11 (for nvme)
- name: kope.io/k8s-1.11-debian-stretch-amd64-hvm-ebs-2018-08-17
providerID: aws
kubernetesVersion: ">=1.11.0"
- providerID: gce
name: "cos-cloud/cos-stable-64-10176-62-0"
name: "cos-cloud/cos-stable-65-10323-99-0"
cluster:
kubernetesVersion: v1.5.8
networking:
kubenet: {}
kubernetesVersions:
- range: ">=1.12.0"
recommendedVersion: 1.12.1
requiredVersion: 1.12.0
- range: ">=1.11.0"
recommendedVersion: 1.11.3
requiredVersion: 1.11.0
- range: ">=1.10.0"
recommendedVersion: 1.10.8
requiredVersion: 1.10.0
- range: ">=1.9.0"
recommendedVersion: 1.9.6
recommendedVersion: 1.9.11
requiredVersion: 1.9.0
- range: ">=1.8.0"
recommendedVersion: 1.8.11
recommendedVersion: 1.8.15
requiredVersion: 1.8.0
- range: ">=1.7.0"
recommendedVersion: 1.7.16
@ -50,14 +61,26 @@ spec:
recommendedVersion: 1.4.12
requiredVersion: 1.4.2
kopsVersions:
- range: ">=1.12.0-alpha.1"
#recommendedVersion: "1.12.0"
#requiredVersion: 1.12.0
kubernetesVersion: 1.12.1
- range: ">=1.11.0-alpha.1"
#recommendedVersion: "1.11.0"
#requiredVersion: 1.11.0
kubernetesVersion: 1.11.3
- range: ">=1.10.0-alpha.1"
recommendedVersion: "1.10.0"
#requiredVersion: 1.10.0
kubernetesVersion: 1.10.8
- range: ">=1.9.0-alpha.1"
recommendedVersion: 1.9.0
recommendedVersion: 1.9.2
#requiredVersion: 1.9.0
kubernetesVersion: 1.9.6
kubernetesVersion: 1.9.11
- range: ">=1.8.0-alpha.1"
recommendedVersion: 1.8.1
requiredVersion: 1.7.1
kubernetesVersion: 1.8.11
kubernetesVersion: 1.8.15
- range: ">=1.7.0-alpha.1"
recommendedVersion: 1.8.1
requiredVersion: 1.7.1

View File

@ -5,8 +5,5 @@ go_library(
srcs = ["channel.go"],
importpath = "k8s.io/kops/channels/pkg/api",
visibility = ["//visibility:public"],
deps = [
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
],
deps = ["//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library"],
)

View File

@ -17,15 +17,13 @@ limitations under the License.
package api
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type Addons struct {
metav1.TypeMeta `json:",inline"`
// We use v1.ObjectMeta so we don't serialize everything, even though we are using the full api machinery here (yet!)
ObjectMeta v1.ObjectMeta `json:"metadata,omitempty"`
ObjectMeta metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AddonsSpec `json:"spec,omitempty"`
}

View File

@ -83,7 +83,7 @@ func Test_Replacement(t *testing.T) {
New *ChannelVersion
Replaces bool
}{
// With no id, update iff newer semver
// With no id, update if and only if newer semver
{
Old: &ChannelVersion{Version: s("1.0.0"), Id: ""},
New: &ChannelVersion{Version: s("1.0.0"), Id: ""},

View File

@ -120,9 +120,8 @@ func (c *ChannelVersion) replaces(existing *ChannelVersion) bool {
// Same version; check ids
if c.Id == existing.Id {
return false
} else {
glog.V(4).Infof("Channels had same version %q but different ids (%q vs %q); will replace", *c.Version, c.Id, existing.Id)
}
glog.V(4).Infof("Channels had same version %q but different ids (%q vs %q); will replace", *c.Version, c.Id, existing.Id)
}
}

View File

@ -4,41 +4,49 @@ spec:
- name: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2017-07-28
providerID: aws
kubernetesVersion: ">=1.4.0 <1.5.0"
- name: kope.io/k8s-1.5-debian-jessie-amd64-hvm-ebs-2018-02-08
- name: kope.io/k8s-1.5-debian-jessie-amd64-hvm-ebs-2018-08-17
providerID: aws
kubernetesVersion: ">=1.5.0 <1.6.0"
- name: kope.io/k8s-1.6-debian-jessie-amd64-hvm-ebs-2018-02-08
- name: kope.io/k8s-1.6-debian-jessie-amd64-hvm-ebs-2018-08-17
providerID: aws
kubernetesVersion: ">=1.6.0 <1.7.0"
- name: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2018-02-08
- name: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2018-08-17
providerID: aws
kubernetesVersion: ">=1.7.0 <1.8.0"
- name: kope.io/k8s-1.8-debian-jessie-amd64-hvm-ebs-2018-02-08
- name: kope.io/k8s-1.8-debian-jessie-amd64-hvm-ebs-2018-08-17
providerID: aws
kubernetesVersion: ">=1.8.0 <1.9.0"
- name: kope.io/k8s-1.8-debian-jessie-amd64-hvm-ebs-2018-02-08
- name: kope.io/k8s-1.9-debian-jessie-amd64-hvm-ebs-2018-08-17
providerID: aws
kubernetesVersion: ">=1.9.0 <1.10.0"
# Need stretch as default in 1.10 (for nvme)
# BUT... this is causing the submit queue to block, so back to jessie temporarily: https://github.com/kubernetes/kubernetes/issues/56763
- name: kope.io/k8s-1.8-debian-jessie-amd64-hvm-ebs-2018-02-08
- name: kope.io/k8s-1.10-debian-jessie-amd64-hvm-ebs-2018-08-17
providerID: aws
kubernetesVersion: ">=1.10.0"
kubernetesVersion: ">=1.10.0 <1.11.0"
# Stretch is the default for 1.11 (for nvme)
- name: kope.io/k8s-1.11-debian-stretch-amd64-hvm-ebs-2018-08-17
providerID: aws
kubernetesVersion: ">=1.11.0"
- providerID: gce
name: "cos-cloud/cos-stable-60-9592-90-0"
name: "cos-cloud/cos-stable-65-10323-99-0"
cluster:
kubernetesVersion: v1.5.8
networking:
kubenet: {}
kubernetesVersions:
- range: ">=1.11.0"
recommendedVersion: 1.11.2
requiredVersion: 1.11.0
- range: ">=1.10.0"
recommendedVersion: 1.10.6
requiredVersion: 1.10.0
- range: ">=1.9.0"
recommendedVersion: 1.9.3
recommendedVersion: 1.9.10
requiredVersion: 1.9.0
- range: ">=1.8.0"
recommendedVersion: 1.8.7
recommendedVersion: 1.8.15
requiredVersion: 1.8.0
- range: ">=1.7.0"
recommendedVersion: 1.7.12
recommendedVersion: 1.7.16
requiredVersion: 1.7.0
- range: ">=1.6.0"
recommendedVersion: 1.6.13
@ -50,18 +58,26 @@ spec:
recommendedVersion: 1.4.12
requiredVersion: 1.4.2
kopsVersions:
- range: ">=1.11.0-alpha.1"
#recommendedVersion: "1.10.0"
#requiredVersion: 1.10.0
kubernetesVersion: 1.11.2
- range: ">=1.10.0-alpha.1"
recommendedVersion: "1.10.0"
#requiredVersion: 1.10.0
kubernetesVersion: 1.10.6
- range: ">=1.9.0-alpha.1"
recommendedVersion: 1.9.0
recommendedVersion: 1.9.2
#requiredVersion: 1.9.0
kubernetesVersion: 1.9.3
kubernetesVersion: 1.9.10
- range: ">=1.8.0-alpha.1"
recommendedVersion: 1.8.1
requiredVersion: 1.7.1
kubernetesVersion: 1.8.7
kubernetesVersion: 1.8.15
- range: ">=1.7.0-alpha.1"
recommendedVersion: 1.8.1
requiredVersion: 1.7.1
kubernetesVersion: 1.7.12
kubernetesVersion: 1.7.16
- range: ">=1.6.0-alpha.1"
recommendedVersion: 1.8.1
requiredVersion: 1.7.1

View File

@ -95,6 +95,9 @@ func (m *MockAutoscaling) CreateLaunchConfiguration(request *autoscaling.CreateL
if m.LaunchConfigurations == nil {
m.LaunchConfigurations = make(map[string]*autoscaling.LaunchConfiguration)
}
if m.LaunchConfigurations[*lc.LaunchConfigurationName] != nil {
return nil, fmt.Errorf("duplicate LaunchConfigurationName %s", *lc.LaunchConfigurationName)
}
m.LaunchConfigurations[*lc.LaunchConfigurationName] = lc
return &autoscaling.CreateLaunchConfigurationOutput{}, nil

View File

@ -20,646 +20,502 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/autoscaling"
"github.com/golang/glog"
)
func (m *MockAutoscaling) AttachInstancesWithContext(aws.Context, *autoscaling.AttachInstancesInput, ...request.Option) (*autoscaling.AttachInstancesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) AttachInstancesRequest(*autoscaling.AttachInstancesInput) (*request.Request, *autoscaling.AttachInstancesOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) AttachLoadBalancerTargetGroups(*autoscaling.AttachLoadBalancerTargetGroupsInput) (*autoscaling.AttachLoadBalancerTargetGroupsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) AttachLoadBalancerTargetGroupsWithContext(aws.Context, *autoscaling.AttachLoadBalancerTargetGroupsInput, ...request.Option) (*autoscaling.AttachLoadBalancerTargetGroupsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) AttachLoadBalancerTargetGroupsRequest(*autoscaling.AttachLoadBalancerTargetGroupsInput) (*request.Request, *autoscaling.AttachLoadBalancerTargetGroupsOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) CompleteLifecycleAction(*autoscaling.CompleteLifecycleActionInput) (*autoscaling.CompleteLifecycleActionOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) CompleteLifecycleActionWithContext(aws.Context, *autoscaling.CompleteLifecycleActionInput, ...request.Option) (*autoscaling.CompleteLifecycleActionOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) CompleteLifecycleActionRequest(*autoscaling.CompleteLifecycleActionInput) (*request.Request, *autoscaling.CompleteLifecycleActionOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) CreateAutoScalingGroupWithContext(aws.Context, *autoscaling.CreateAutoScalingGroupInput, ...request.Option) (*autoscaling.CreateAutoScalingGroupOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) CreateAutoScalingGroupRequest(*autoscaling.CreateAutoScalingGroupInput) (*request.Request, *autoscaling.CreateAutoScalingGroupOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) CreateOrUpdateTags(*autoscaling.CreateOrUpdateTagsInput) (*autoscaling.CreateOrUpdateTagsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) CreateOrUpdateTagsWithContext(aws.Context, *autoscaling.CreateOrUpdateTagsInput, ...request.Option) (*autoscaling.CreateOrUpdateTagsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) CreateOrUpdateTagsRequest(*autoscaling.CreateOrUpdateTagsInput) (*request.Request, *autoscaling.CreateOrUpdateTagsOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeleteLifecycleHook(*autoscaling.DeleteLifecycleHookInput) (*autoscaling.DeleteLifecycleHookOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeleteLifecycleHookWithContext(aws.Context, *autoscaling.DeleteLifecycleHookInput, ...request.Option) (*autoscaling.DeleteLifecycleHookOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeleteLifecycleHookRequest(*autoscaling.DeleteLifecycleHookInput) (*request.Request, *autoscaling.DeleteLifecycleHookOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeleteNotificationConfiguration(*autoscaling.DeleteNotificationConfigurationInput) (*autoscaling.DeleteNotificationConfigurationOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeleteNotificationConfigurationWithContext(aws.Context, *autoscaling.DeleteNotificationConfigurationInput, ...request.Option) (*autoscaling.DeleteNotificationConfigurationOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeleteNotificationConfigurationRequest(*autoscaling.DeleteNotificationConfigurationInput) (*request.Request, *autoscaling.DeleteNotificationConfigurationOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeletePolicy(*autoscaling.DeletePolicyInput) (*autoscaling.DeletePolicyOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeletePolicyWithContext(aws.Context, *autoscaling.DeletePolicyInput, ...request.Option) (*autoscaling.DeletePolicyOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeletePolicyRequest(*autoscaling.DeletePolicyInput) (*request.Request, *autoscaling.DeletePolicyOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeleteScheduledAction(*autoscaling.DeleteScheduledActionInput) (*autoscaling.DeleteScheduledActionOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeleteScheduledActionWithContext(aws.Context, *autoscaling.DeleteScheduledActionInput, ...request.Option) (*autoscaling.DeleteScheduledActionOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeleteScheduledActionRequest(*autoscaling.DeleteScheduledActionInput) (*request.Request, *autoscaling.DeleteScheduledActionOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeleteTags(*autoscaling.DeleteTagsInput) (*autoscaling.DeleteTagsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeleteTagsWithContext(aws.Context, *autoscaling.DeleteTagsInput, ...request.Option) (*autoscaling.DeleteTagsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DeleteTagsRequest(*autoscaling.DeleteTagsInput) (*request.Request, *autoscaling.DeleteTagsOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeAccountLimits(*autoscaling.DescribeAccountLimitsInput) (*autoscaling.DescribeAccountLimitsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeAccountLimitsWithContext(aws.Context, *autoscaling.DescribeAccountLimitsInput, ...request.Option) (*autoscaling.DescribeAccountLimitsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeAccountLimitsRequest(*autoscaling.DescribeAccountLimitsInput) (*request.Request, *autoscaling.DescribeAccountLimitsOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeAdjustmentTypes(*autoscaling.DescribeAdjustmentTypesInput) (*autoscaling.DescribeAdjustmentTypesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeAdjustmentTypesWithContext(aws.Context, *autoscaling.DescribeAdjustmentTypesInput, ...request.Option) (*autoscaling.DescribeAdjustmentTypesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeAdjustmentTypesRequest(*autoscaling.DescribeAdjustmentTypesInput) (*request.Request, *autoscaling.DescribeAdjustmentTypesOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeAutoScalingInstances(*autoscaling.DescribeAutoScalingInstancesInput) (*autoscaling.DescribeAutoScalingInstancesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeAutoScalingInstancesWithContext(aws.Context, *autoscaling.DescribeAutoScalingInstancesInput, ...request.Option) (*autoscaling.DescribeAutoScalingInstancesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeAutoScalingInstancesRequest(*autoscaling.DescribeAutoScalingInstancesInput) (*request.Request, *autoscaling.DescribeAutoScalingInstancesOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeAutoScalingInstancesPages(*autoscaling.DescribeAutoScalingInstancesInput, func(*autoscaling.DescribeAutoScalingInstancesOutput, bool) bool) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeAutoScalingInstancesPagesWithContext(aws.Context, *autoscaling.DescribeAutoScalingInstancesInput, func(*autoscaling.DescribeAutoScalingInstancesOutput, bool) bool, ...request.Option) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeAutoScalingNotificationTypes(*autoscaling.DescribeAutoScalingNotificationTypesInput) (*autoscaling.DescribeAutoScalingNotificationTypesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeAutoScalingNotificationTypesWithContext(aws.Context, *autoscaling.DescribeAutoScalingNotificationTypesInput, ...request.Option) (*autoscaling.DescribeAutoScalingNotificationTypesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeAutoScalingNotificationTypesRequest(*autoscaling.DescribeAutoScalingNotificationTypesInput) (*request.Request, *autoscaling.DescribeAutoScalingNotificationTypesOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeLifecycleHookTypes(*autoscaling.DescribeLifecycleHookTypesInput) (*autoscaling.DescribeLifecycleHookTypesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeLifecycleHookTypesWithContext(aws.Context, *autoscaling.DescribeLifecycleHookTypesInput, ...request.Option) (*autoscaling.DescribeLifecycleHookTypesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeLifecycleHookTypesRequest(*autoscaling.DescribeLifecycleHookTypesInput) (*request.Request, *autoscaling.DescribeLifecycleHookTypesOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeLifecycleHooks(*autoscaling.DescribeLifecycleHooksInput) (*autoscaling.DescribeLifecycleHooksOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeLifecycleHooksWithContext(aws.Context, *autoscaling.DescribeLifecycleHooksInput, ...request.Option) (*autoscaling.DescribeLifecycleHooksOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeLifecycleHooksRequest(*autoscaling.DescribeLifecycleHooksInput) (*request.Request, *autoscaling.DescribeLifecycleHooksOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeLoadBalancerTargetGroups(*autoscaling.DescribeLoadBalancerTargetGroupsInput) (*autoscaling.DescribeLoadBalancerTargetGroupsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeLoadBalancerTargetGroupsWithContext(aws.Context, *autoscaling.DescribeLoadBalancerTargetGroupsInput, ...request.Option) (*autoscaling.DescribeLoadBalancerTargetGroupsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeLoadBalancerTargetGroupsRequest(*autoscaling.DescribeLoadBalancerTargetGroupsInput) (*request.Request, *autoscaling.DescribeLoadBalancerTargetGroupsOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeLoadBalancers(*autoscaling.DescribeLoadBalancersInput) (*autoscaling.DescribeLoadBalancersOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeLoadBalancersWithContext(aws.Context, *autoscaling.DescribeLoadBalancersInput, ...request.Option) (*autoscaling.DescribeLoadBalancersOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeLoadBalancersRequest(*autoscaling.DescribeLoadBalancersInput) (*request.Request, *autoscaling.DescribeLoadBalancersOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeMetricCollectionTypes(*autoscaling.DescribeMetricCollectionTypesInput) (*autoscaling.DescribeMetricCollectionTypesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeMetricCollectionTypesWithContext(aws.Context, *autoscaling.DescribeMetricCollectionTypesInput, ...request.Option) (*autoscaling.DescribeMetricCollectionTypesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeMetricCollectionTypesRequest(*autoscaling.DescribeMetricCollectionTypesInput) (*request.Request, *autoscaling.DescribeMetricCollectionTypesOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeNotificationConfigurations(*autoscaling.DescribeNotificationConfigurationsInput) (*autoscaling.DescribeNotificationConfigurationsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeNotificationConfigurationsWithContext(aws.Context, *autoscaling.DescribeNotificationConfigurationsInput, ...request.Option) (*autoscaling.DescribeNotificationConfigurationsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeNotificationConfigurationsRequest(*autoscaling.DescribeNotificationConfigurationsInput) (*request.Request, *autoscaling.DescribeNotificationConfigurationsOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeNotificationConfigurationsPages(*autoscaling.DescribeNotificationConfigurationsInput, func(*autoscaling.DescribeNotificationConfigurationsOutput, bool) bool) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeNotificationConfigurationsPagesWithContext(aws.Context, *autoscaling.DescribeNotificationConfigurationsInput, func(*autoscaling.DescribeNotificationConfigurationsOutput, bool) bool, ...request.Option) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribePolicies(*autoscaling.DescribePoliciesInput) (*autoscaling.DescribePoliciesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribePoliciesWithContext(aws.Context, *autoscaling.DescribePoliciesInput, ...request.Option) (*autoscaling.DescribePoliciesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribePoliciesRequest(*autoscaling.DescribePoliciesInput) (*request.Request, *autoscaling.DescribePoliciesOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribePoliciesPages(*autoscaling.DescribePoliciesInput, func(*autoscaling.DescribePoliciesOutput, bool) bool) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribePoliciesPagesWithContext(aws.Context, *autoscaling.DescribePoliciesInput, func(*autoscaling.DescribePoliciesOutput, bool) bool, ...request.Option) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeScalingActivities(*autoscaling.DescribeScalingActivitiesInput) (*autoscaling.DescribeScalingActivitiesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeScalingActivitiesWithContext(aws.Context, *autoscaling.DescribeScalingActivitiesInput, ...request.Option) (*autoscaling.DescribeScalingActivitiesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeScalingActivitiesRequest(*autoscaling.DescribeScalingActivitiesInput) (*request.Request, *autoscaling.DescribeScalingActivitiesOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeScalingActivitiesPages(*autoscaling.DescribeScalingActivitiesInput, func(*autoscaling.DescribeScalingActivitiesOutput, bool) bool) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeScalingActivitiesPagesWithContext(aws.Context, *autoscaling.DescribeScalingActivitiesInput, func(*autoscaling.DescribeScalingActivitiesOutput, bool) bool, ...request.Option) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeScalingProcessTypes(*autoscaling.DescribeScalingProcessTypesInput) (*autoscaling.DescribeScalingProcessTypesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeScalingProcessTypesWithContext(aws.Context, *autoscaling.DescribeScalingProcessTypesInput, ...request.Option) (*autoscaling.DescribeScalingProcessTypesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeScalingProcessTypesRequest(*autoscaling.DescribeScalingProcessTypesInput) (*request.Request, *autoscaling.DescribeScalingProcessTypesOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeScheduledActions(*autoscaling.DescribeScheduledActionsInput) (*autoscaling.DescribeScheduledActionsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeScheduledActionsWithContext(aws.Context, *autoscaling.DescribeScheduledActionsInput, ...request.Option) (*autoscaling.DescribeScheduledActionsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeScheduledActionsRequest(*autoscaling.DescribeScheduledActionsInput) (*request.Request, *autoscaling.DescribeScheduledActionsOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeScheduledActionsPages(*autoscaling.DescribeScheduledActionsInput, func(*autoscaling.DescribeScheduledActionsOutput, bool) bool) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeScheduledActionsPagesWithContext(aws.Context, *autoscaling.DescribeScheduledActionsInput, func(*autoscaling.DescribeScheduledActionsOutput, bool) bool, ...request.Option) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeTerminationPolicyTypes(*autoscaling.DescribeTerminationPolicyTypesInput) (*autoscaling.DescribeTerminationPolicyTypesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeTerminationPolicyTypesWithContext(aws.Context, *autoscaling.DescribeTerminationPolicyTypesInput, ...request.Option) (*autoscaling.DescribeTerminationPolicyTypesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DescribeTerminationPolicyTypesRequest(*autoscaling.DescribeTerminationPolicyTypesInput) (*request.Request, *autoscaling.DescribeTerminationPolicyTypesOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DetachInstances(*autoscaling.DetachInstancesInput) (*autoscaling.DetachInstancesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DetachInstancesWithContext(aws.Context, *autoscaling.DetachInstancesInput, ...request.Option) (*autoscaling.DetachInstancesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DetachInstancesRequest(*autoscaling.DetachInstancesInput) (*request.Request, *autoscaling.DetachInstancesOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DetachLoadBalancerTargetGroups(*autoscaling.DetachLoadBalancerTargetGroupsInput) (*autoscaling.DetachLoadBalancerTargetGroupsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DetachLoadBalancerTargetGroupsWithContext(aws.Context, *autoscaling.DetachLoadBalancerTargetGroupsInput, ...request.Option) (*autoscaling.DetachLoadBalancerTargetGroupsOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DetachLoadBalancerTargetGroupsRequest(*autoscaling.DetachLoadBalancerTargetGroupsInput) (*request.Request, *autoscaling.DetachLoadBalancerTargetGroupsOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DetachLoadBalancers(*autoscaling.DetachLoadBalancersInput) (*autoscaling.DetachLoadBalancersOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DetachLoadBalancersWithContext(aws.Context, *autoscaling.DetachLoadBalancersInput, ...request.Option) (*autoscaling.DetachLoadBalancersOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DetachLoadBalancersRequest(*autoscaling.DetachLoadBalancersInput) (*request.Request, *autoscaling.DetachLoadBalancersOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DisableMetricsCollection(*autoscaling.DisableMetricsCollectionInput) (*autoscaling.DisableMetricsCollectionOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DisableMetricsCollectionWithContext(aws.Context, *autoscaling.DisableMetricsCollectionInput, ...request.Option) (*autoscaling.DisableMetricsCollectionOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) DisableMetricsCollectionRequest(*autoscaling.DisableMetricsCollectionInput) (*request.Request, *autoscaling.DisableMetricsCollectionOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) EnableMetricsCollectionWithContext(aws.Context, *autoscaling.EnableMetricsCollectionInput, ...request.Option) (*autoscaling.EnableMetricsCollectionOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) EnableMetricsCollectionRequest(*autoscaling.EnableMetricsCollectionInput) (*request.Request, *autoscaling.EnableMetricsCollectionOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) EnterStandby(*autoscaling.EnterStandbyInput) (*autoscaling.EnterStandbyOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) EnterStandbyWithContext(aws.Context, *autoscaling.EnterStandbyInput, ...request.Option) (*autoscaling.EnterStandbyOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) EnterStandbyRequest(*autoscaling.EnterStandbyInput) (*request.Request, *autoscaling.EnterStandbyOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) ExecutePolicy(*autoscaling.ExecutePolicyInput) (*autoscaling.ExecutePolicyOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) ExecutePolicyWithContext(aws.Context, *autoscaling.ExecutePolicyInput, ...request.Option) (*autoscaling.ExecutePolicyOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) ExecutePolicyRequest(*autoscaling.ExecutePolicyInput) (*request.Request, *autoscaling.ExecutePolicyOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) ExitStandby(*autoscaling.ExitStandbyInput) (*autoscaling.ExitStandbyOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) ExitStandbyWithContext(aws.Context, *autoscaling.ExitStandbyInput, ...request.Option) (*autoscaling.ExitStandbyOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) ExitStandbyRequest(*autoscaling.ExitStandbyInput) (*request.Request, *autoscaling.ExitStandbyOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) PutLifecycleHook(*autoscaling.PutLifecycleHookInput) (*autoscaling.PutLifecycleHookOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) PutLifecycleHookWithContext(aws.Context, *autoscaling.PutLifecycleHookInput, ...request.Option) (*autoscaling.PutLifecycleHookOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) PutLifecycleHookRequest(*autoscaling.PutLifecycleHookInput) (*request.Request, *autoscaling.PutLifecycleHookOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) PutNotificationConfiguration(*autoscaling.PutNotificationConfigurationInput) (*autoscaling.PutNotificationConfigurationOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) PutNotificationConfigurationWithContext(aws.Context, *autoscaling.PutNotificationConfigurationInput, ...request.Option) (*autoscaling.PutNotificationConfigurationOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) PutNotificationConfigurationRequest(*autoscaling.PutNotificationConfigurationInput) (*request.Request, *autoscaling.PutNotificationConfigurationOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) PutScalingPolicy(*autoscaling.PutScalingPolicyInput) (*autoscaling.PutScalingPolicyOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) PutScalingPolicyWithContext(aws.Context, *autoscaling.PutScalingPolicyInput, ...request.Option) (*autoscaling.PutScalingPolicyOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) PutScalingPolicyRequest(*autoscaling.PutScalingPolicyInput) (*request.Request, *autoscaling.PutScalingPolicyOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) PutScheduledUpdateGroupAction(*autoscaling.PutScheduledUpdateGroupActionInput) (*autoscaling.PutScheduledUpdateGroupActionOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) PutScheduledUpdateGroupActionWithContext(aws.Context, *autoscaling.PutScheduledUpdateGroupActionInput, ...request.Option) (*autoscaling.PutScheduledUpdateGroupActionOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) PutScheduledUpdateGroupActionRequest(*autoscaling.PutScheduledUpdateGroupActionInput) (*request.Request, *autoscaling.PutScheduledUpdateGroupActionOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) RecordLifecycleActionHeartbeat(*autoscaling.RecordLifecycleActionHeartbeatInput) (*autoscaling.RecordLifecycleActionHeartbeatOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) RecordLifecycleActionHeartbeatWithContext(aws.Context, *autoscaling.RecordLifecycleActionHeartbeatInput, ...request.Option) (*autoscaling.RecordLifecycleActionHeartbeatOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) RecordLifecycleActionHeartbeatRequest(*autoscaling.RecordLifecycleActionHeartbeatInput) (*request.Request, *autoscaling.RecordLifecycleActionHeartbeatOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) ResumeProcesses(*autoscaling.ScalingProcessQuery) (*autoscaling.ResumeProcessesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) ResumeProcessesWithContext(aws.Context, *autoscaling.ScalingProcessQuery, ...request.Option) (*autoscaling.ResumeProcessesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) ResumeProcessesRequest(*autoscaling.ScalingProcessQuery) (*request.Request, *autoscaling.ResumeProcessesOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) SetDesiredCapacity(*autoscaling.SetDesiredCapacityInput) (*autoscaling.SetDesiredCapacityOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) SetDesiredCapacityWithContext(aws.Context, *autoscaling.SetDesiredCapacityInput, ...request.Option) (*autoscaling.SetDesiredCapacityOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) SetDesiredCapacityRequest(*autoscaling.SetDesiredCapacityInput) (*request.Request, *autoscaling.SetDesiredCapacityOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) SetInstanceHealth(*autoscaling.SetInstanceHealthInput) (*autoscaling.SetInstanceHealthOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) SetInstanceHealthWithContext(aws.Context, *autoscaling.SetInstanceHealthInput, ...request.Option) (*autoscaling.SetInstanceHealthOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) SetInstanceHealthRequest(*autoscaling.SetInstanceHealthInput) (*request.Request, *autoscaling.SetInstanceHealthOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) SetInstanceProtection(*autoscaling.SetInstanceProtectionInput) (*autoscaling.SetInstanceProtectionOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) SetInstanceProtectionWithContext(aws.Context, *autoscaling.SetInstanceProtectionInput, ...request.Option) (*autoscaling.SetInstanceProtectionOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) SetInstanceProtectionRequest(*autoscaling.SetInstanceProtectionInput) (*request.Request, *autoscaling.SetInstanceProtectionOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) SuspendProcesses(*autoscaling.ScalingProcessQuery) (*autoscaling.SuspendProcessesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) SuspendProcessesWithContext(aws.Context, *autoscaling.ScalingProcessQuery, ...request.Option) (*autoscaling.SuspendProcessesOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) SuspendProcessesRequest(*autoscaling.ScalingProcessQuery) (*request.Request, *autoscaling.SuspendProcessesOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) TerminateInstanceInAutoScalingGroupWithContext(aws.Context, *autoscaling.TerminateInstanceInAutoScalingGroupInput, ...request.Option) (*autoscaling.TerminateInstanceInAutoScalingGroupOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) TerminateInstanceInAutoScalingGroupRequest(*autoscaling.TerminateInstanceInAutoScalingGroupInput) (*request.Request, *autoscaling.TerminateInstanceInAutoScalingGroupOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) UpdateAutoScalingGroup(*autoscaling.UpdateAutoScalingGroupInput) (*autoscaling.UpdateAutoScalingGroupOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) UpdateAutoScalingGroupWithContext(aws.Context, *autoscaling.UpdateAutoScalingGroupInput, ...request.Option) (*autoscaling.UpdateAutoScalingGroupOutput, error) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) UpdateAutoScalingGroupRequest(*autoscaling.UpdateAutoScalingGroupInput) (*request.Request, *autoscaling.UpdateAutoScalingGroupOutput) {
glog.Fatalf("Not implemented")
return nil, nil
panic("Not implemented")
}
func (m *MockAutoscaling) WaitUntilGroupExists(*autoscaling.DescribeAutoScalingGroupsInput) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) WaitUntilGroupExistsWithContext(aws.Context, *autoscaling.DescribeAutoScalingGroupsInput, ...request.WaiterOption) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) WaitUntilGroupInService(*autoscaling.DescribeAutoScalingGroupsInput) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) WaitUntilGroupInServiceWithContext(aws.Context, *autoscaling.DescribeAutoScalingGroupsInput, ...request.WaiterOption) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) WaitUntilGroupNotExists(*autoscaling.DescribeAutoScalingGroupsInput) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}
func (m *MockAutoscaling) WaitUntilGroupNotExistsWithContext(aws.Context, *autoscaling.DescribeAutoScalingGroupsInput, ...request.WaiterOption) error {
glog.Fatalf("Not implemented")
return nil
panic("Not implemented")
}

View File

@ -29,12 +29,10 @@ import (
func (m *MockEC2) AllocateAddressRequest(*ec2.AllocateAddressInput) (*request.Request, *ec2.AllocateAddressOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AllocateAddressWithContext(aws.Context, *ec2.AllocateAddressInput, ...request.Option) (*ec2.AllocateAddressOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AllocateAddressWithId(request *ec2.AllocateAddressInput, id string) (*ec2.AllocateAddressOutput, error) {
@ -77,42 +75,34 @@ func (m *MockEC2) AllocateAddress(request *ec2.AllocateAddressInput) (*ec2.Alloc
func (m *MockEC2) AssignPrivateIpAddressesRequest(*ec2.AssignPrivateIpAddressesInput) (*request.Request, *ec2.AssignPrivateIpAddressesOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AssignPrivateIpAddressesWithContext(aws.Context, *ec2.AssignPrivateIpAddressesInput, ...request.Option) (*ec2.AssignPrivateIpAddressesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AssignPrivateIpAddresses(*ec2.AssignPrivateIpAddressesInput) (*ec2.AssignPrivateIpAddressesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AssociateAddressRequest(*ec2.AssociateAddressInput) (*request.Request, *ec2.AssociateAddressOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AssociateAddressWithContext(aws.Context, *ec2.AssociateAddressInput, ...request.Option) (*ec2.AssociateAddressOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AssociateAddress(*ec2.AssociateAddressInput) (*ec2.AssociateAddressOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeAddressesRequest(*ec2.DescribeAddressesInput) (*request.Request, *ec2.DescribeAddressesOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeAddressesWithContext(aws.Context, *ec2.DescribeAddressesInput, ...request.Option) (*ec2.DescribeAddressesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeAddresses(request *ec2.DescribeAddressesInput) (*ec2.DescribeAddressesOutput, error) {
@ -173,11 +163,9 @@ func (m *MockEC2) DescribeAddresses(request *ec2.DescribeAddressesInput) (*ec2.D
func (m *MockEC2) ReleaseAddressRequest(*ec2.ReleaseAddressInput) (*request.Request, *ec2.ReleaseAddressOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) ReleaseAddressWithContext(aws.Context, *ec2.ReleaseAddressInput, ...request.Option) (*ec2.ReleaseAddressOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) ReleaseAddress(request *ec2.ReleaseAddressInput) (*ec2.ReleaseAddressOutput, error) {
m.mutex.Lock()

View File

@ -26,6 +26,9 @@ import (
)
type MockEC2 struct {
// Stub out interface
ec2iface.EC2API
mutex sync.Mutex
addressNumber int

View File

@ -78,11 +78,9 @@ func (m *MockEC2) DescribeDhcpOptions(request *ec2.DescribeDhcpOptionsInput) (*e
func (m *MockEC2) DescribeDhcpOptionsWithContext(aws.Context, *ec2.DescribeDhcpOptionsInput, ...request.Option) (*ec2.DescribeDhcpOptionsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeDhcpOptionsRequest(*ec2.DescribeDhcpOptionsInput) (*request.Request, *ec2.DescribeDhcpOptionsOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AssociateDhcpOptions(request *ec2.AssociateDhcpOptionsInput) (*ec2.AssociateDhcpOptionsOutput, error) {
@ -112,11 +110,9 @@ func (m *MockEC2) AssociateDhcpOptions(request *ec2.AssociateDhcpOptionsInput) (
}
func (m *MockEC2) AssociateDhcpOptionsWithContext(aws.Context, *ec2.AssociateDhcpOptionsInput, ...request.Option) (*ec2.AssociateDhcpOptionsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AssociateDhcpOptionsRequest(*ec2.AssociateDhcpOptionsInput) (*request.Request, *ec2.AssociateDhcpOptionsOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateDhcpOptions(request *ec2.CreateDhcpOptionsInput) (*ec2.CreateDhcpOptionsOutput, error) {
@ -157,11 +153,9 @@ func (m *MockEC2) CreateDhcpOptions(request *ec2.CreateDhcpOptionsInput) (*ec2.C
}
func (m *MockEC2) CreateDhcpOptionsWithContext(aws.Context, *ec2.CreateDhcpOptionsInput, ...request.Option) (*ec2.CreateDhcpOptionsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateDhcpOptionsRequest(*ec2.CreateDhcpOptionsInput) (*request.Request, *ec2.CreateDhcpOptionsOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteDhcpOptions(request *ec2.DeleteDhcpOptionsInput) (*ec2.DeleteDhcpOptionsOutput, error) {
@ -182,9 +176,7 @@ func (m *MockEC2) DeleteDhcpOptions(request *ec2.DeleteDhcpOptionsInput) (*ec2.D
func (m *MockEC2) DeleteDhcpOptionsWithContext(aws.Context, *ec2.DeleteDhcpOptionsInput, ...request.Option) (*ec2.DeleteDhcpOptionsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteDhcpOptionsRequest(*ec2.DeleteDhcpOptionsInput) (*request.Request, *ec2.DeleteDhcpOptionsOutput) {
panic("Not implemented")
return nil, nil
}

View File

@ -28,23 +28,18 @@ import (
func (m *MockEC2) DescribeImageAttributeRequest(*ec2.DescribeImageAttributeInput) (*request.Request, *ec2.DescribeImageAttributeOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeImageAttributeWithContext(aws.Context, *ec2.DescribeImageAttributeInput, ...request.Option) (*ec2.DescribeImageAttributeOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeImageAttribute(*ec2.DescribeImageAttributeInput) (*ec2.DescribeImageAttributeOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeImagesRequest(*ec2.DescribeImagesInput) (*request.Request, *ec2.DescribeImagesOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeImagesWithContext(aws.Context, *ec2.DescribeImagesInput, ...request.Option) (*ec2.DescribeImagesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeImages(request *ec2.DescribeImagesInput) (*ec2.DescribeImagesOutput, error) {
@ -74,15 +69,12 @@ func (m *MockEC2) DescribeImages(request *ec2.DescribeImagesInput) (*ec2.Describ
}
func (m *MockEC2) DescribeImportImageTasksRequest(*ec2.DescribeImportImageTasksInput) (*request.Request, *ec2.DescribeImportImageTasksOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeImportImageTasksWithContext(aws.Context, *ec2.DescribeImportImageTasksInput, ...request.Option) (*ec2.DescribeImportImageTasksOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeImportImageTasks(*ec2.DescribeImportImageTasksInput) (*ec2.DescribeImportImageTasksOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) imageMatchesFilter(image *ec2.Image, filters []*ec2.Filter) (bool, error) {

View File

@ -30,11 +30,9 @@ func (m *MockEC2) DescribeInstances(*ec2.DescribeInstancesInput) (*ec2.DescribeI
func (m *MockEC2) DescribeInstancesWithContext(aws.Context, *ec2.DescribeInstancesInput, ...request.Option) (*ec2.DescribeInstancesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeInstancesRequest(*ec2.DescribeInstancesInput) (*request.Request, *ec2.DescribeInstancesOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeInstancesPages(request *ec2.DescribeInstancesInput, callback func(*ec2.DescribeInstancesOutput, bool) bool) error {
@ -50,5 +48,4 @@ func (m *MockEC2) DescribeInstancesPages(request *ec2.DescribeInstancesInput, ca
}
func (m *MockEC2) DescribeInstancesPagesWithContext(aws.Context, *ec2.DescribeInstancesInput, func(*ec2.DescribeInstancesOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
return nil
}

View File

@ -53,12 +53,10 @@ func (m *MockEC2) InternetGatewayIds() []string {
func (m *MockEC2) CreateInternetGatewayRequest(*ec2.CreateInternetGatewayInput) (*request.Request, *ec2.CreateInternetGatewayOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateInternetGatewayWithContext(aws.Context, *ec2.CreateInternetGatewayInput, ...request.Option) (*ec2.CreateInternetGatewayOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateInternetGateway(request *ec2.CreateInternetGatewayInput) (*ec2.CreateInternetGatewayOutput, error) {
@ -86,12 +84,10 @@ func (m *MockEC2) CreateInternetGateway(request *ec2.CreateInternetGatewayInput)
func (m *MockEC2) DescribeInternetGatewaysRequest(*ec2.DescribeInternetGatewaysInput) (*request.Request, *ec2.DescribeInternetGatewaysOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeInternetGatewaysWithContext(aws.Context, *ec2.DescribeInternetGatewaysInput, ...request.Option) (*ec2.DescribeInternetGatewaysOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeInternetGateways(request *ec2.DescribeInternetGatewaysInput) (*ec2.DescribeInternetGatewaysOutput, error) {
@ -179,11 +175,9 @@ func (m *MockEC2) AttachInternetGateway(request *ec2.AttachInternetGatewayInput)
func (m *MockEC2) AttachInternetGatewayWithContext(aws.Context, *ec2.AttachInternetGatewayInput, ...request.Option) (*ec2.AttachInternetGatewayOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AttachInternetGatewayRequest(*ec2.AttachInternetGatewayInput) (*request.Request, *ec2.AttachInternetGatewayOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DetachInternetGateway(request *ec2.DetachInternetGatewayInput) (*ec2.DetachInternetGatewayOutput, error) {
@ -216,11 +210,9 @@ func (m *MockEC2) DetachInternetGateway(request *ec2.DetachInternetGatewayInput)
func (m *MockEC2) DetachInternetGatewayWithContext(aws.Context, *ec2.DetachInternetGatewayInput, ...request.Option) (*ec2.DetachInternetGatewayOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DetachInternetGatewayRequest(*ec2.DetachInternetGatewayInput) (*request.Request, *ec2.DetachInternetGatewayOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteInternetGateway(request *ec2.DeleteInternetGatewayInput) (*ec2.DeleteInternetGatewayOutput, error) {
@ -241,9 +233,7 @@ func (m *MockEC2) DeleteInternetGateway(request *ec2.DeleteInternetGatewayInput)
func (m *MockEC2) DeleteInternetGatewayWithContext(aws.Context, *ec2.DeleteInternetGatewayInput, ...request.Option) (*ec2.DeleteInternetGatewayOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteInternetGatewayRequest(*ec2.DeleteInternetGatewayInput) (*request.Request, *ec2.DeleteInternetGatewayOutput) {
panic("Not implemented")
return nil, nil
}

View File

@ -32,14 +32,12 @@ func (m *MockEC2) DescribeKeyPairsRequest(*ec2.DescribeKeyPairsInput) (*request.
}
func (m *MockEC2) DescribeKeyPairsWithContext(aws.Context, *ec2.DescribeKeyPairsInput, ...request.Option) (*ec2.DescribeKeyPairsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) ImportKeyPairRequest(*ec2.ImportKeyPairInput) (*request.Request, *ec2.ImportKeyPairOutput) {
panic("MockEC2 ImportKeyPairRequest not implemented")
}
func (m *MockEC2) ImportKeyPairWithContext(aws.Context, *ec2.ImportKeyPairInput, ...request.Option) (*ec2.ImportKeyPairOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) ImportKeyPair(request *ec2.ImportKeyPairInput) (*ec2.ImportKeyPairOutput, error) {
m.mutex.Lock()
@ -71,7 +69,6 @@ func (m *MockEC2) CreateKeyPairRequest(*ec2.CreateKeyPairInput) (*request.Reques
}
func (m *MockEC2) CreateKeyPairWithContext(aws.Context, *ec2.CreateKeyPairInput, ...request.Option) (*ec2.CreateKeyPairOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateKeyPair(*ec2.CreateKeyPairInput) (*ec2.CreateKeyPairOutput, error) {
panic("MockEC2 CreateKeyPair not implemented")
@ -99,10 +96,17 @@ func (m *MockEC2) DescribeKeyPairs(request *ec2.DescribeKeyPairsInput) (*ec2.Des
allFiltersMatch = false
}
}
for _, filter := range request.Filters {
match := false
switch *filter.Name {
case "key-name":
for _, v := range filter.Values {
if aws.StringValue(keypair.KeyName) == aws.StringValue(v) {
match = true
}
}
default:
return nil, fmt.Errorf("unknown filter name: %q", *filter.Name)
}
@ -146,9 +150,7 @@ func (m *MockEC2) DeleteKeyPair(request *ec2.DeleteKeyPairInput) (*ec2.DeleteKey
func (m *MockEC2) DeleteKeyPairWithContext(aws.Context, *ec2.DeleteKeyPairInput, ...request.Option) (*ec2.DeleteKeyPairOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteKeyPairRequest(*ec2.DeleteKeyPairInput) (*request.Request, *ec2.DeleteKeyPairOutput) {
panic("Not implemented")
return nil, nil
}

View File

@ -94,16 +94,13 @@ func (m *MockEC2) WaitUntilNatGatewayAvailable(request *ec2.DescribeNatGatewaysI
}
func (m *MockEC2) WaitUntilNatGatewayAvailableWithContext(aws.Context, *ec2.DescribeNatGatewaysInput, ...request.WaiterOption) error {
panic("Not implemented")
return nil
}
func (m *MockEC2) CreateNatGatewayWithContext(aws.Context, *ec2.CreateNatGatewayInput, ...request.Option) (*ec2.CreateNatGatewayOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateNatGatewayRequest(*ec2.CreateNatGatewayInput) (*request.Request, *ec2.CreateNatGatewayOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeNatGateways(request *ec2.DescribeNatGatewaysInput) (*ec2.DescribeNatGatewaysOutput, error) {
@ -160,20 +157,16 @@ func (m *MockEC2) DescribeNatGateways(request *ec2.DescribeNatGatewaysInput) (*e
}
func (m *MockEC2) DescribeNatGatewaysWithContext(aws.Context, *ec2.DescribeNatGatewaysInput, ...request.Option) (*ec2.DescribeNatGatewaysOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeNatGatewaysRequest(*ec2.DescribeNatGatewaysInput) (*request.Request, *ec2.DescribeNatGatewaysOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeNatGatewaysPages(*ec2.DescribeNatGatewaysInput, func(*ec2.DescribeNatGatewaysOutput, bool) bool) error {
panic("Not implemented")
return nil
}
func (m *MockEC2) DescribeNatGatewaysPagesWithContext(aws.Context, *ec2.DescribeNatGatewaysInput, func(*ec2.DescribeNatGatewaysOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
return nil
}
func (m *MockEC2) DeleteNatGateway(request *ec2.DeleteNatGatewayInput) (*ec2.DeleteNatGatewayOutput, error) {
@ -194,9 +187,7 @@ func (m *MockEC2) DeleteNatGateway(request *ec2.DeleteNatGatewayInput) (*ec2.Del
func (m *MockEC2) DeleteNatGatewayWithContext(aws.Context, *ec2.DeleteNatGatewayInput, ...request.Option) (*ec2.DeleteNatGatewayOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteNatGatewayRequest(*ec2.DeleteNatGatewayInput) (*request.Request, *ec2.DeleteNatGatewayOutput) {
panic("Not implemented")
return nil, nil
}

View File

@ -41,12 +41,10 @@ func (m *MockEC2) AddRouteTable(rt *ec2.RouteTable) {
func (m *MockEC2) DescribeRouteTablesRequest(*ec2.DescribeRouteTablesInput) (*request.Request, *ec2.DescribeRouteTablesOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeRouteTablesWithContext(aws.Context, *ec2.DescribeRouteTablesInput, ...request.Option) (*ec2.DescribeRouteTablesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeRouteTables(request *ec2.DescribeRouteTablesInput) (*ec2.DescribeRouteTablesOutput, error) {
@ -139,11 +137,9 @@ func (m *MockEC2) CreateRouteTableWithId(request *ec2.CreateRouteTableInput, id
func (m *MockEC2) CreateRouteTableWithContext(aws.Context, *ec2.CreateRouteTableInput, ...request.Option) (*ec2.CreateRouteTableOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateRouteTableRequest(*ec2.CreateRouteTableInput) (*request.Request, *ec2.CreateRouteTableOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateRoute(request *ec2.CreateRouteInput) (*ec2.CreateRouteOutput, error) {
@ -177,11 +173,9 @@ func (m *MockEC2) CreateRoute(request *ec2.CreateRouteInput) (*ec2.CreateRouteOu
}
func (m *MockEC2) CreateRouteWithContext(aws.Context, *ec2.CreateRouteInput, ...request.Option) (*ec2.CreateRouteOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateRouteRequest(*ec2.CreateRouteInput) (*request.Request, *ec2.CreateRouteOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteRouteTable(request *ec2.DeleteRouteTableInput) (*ec2.DeleteRouteTableOutput, error) {
@ -201,9 +195,7 @@ func (m *MockEC2) DeleteRouteTable(request *ec2.DeleteRouteTableInput) (*ec2.Del
}
func (m *MockEC2) DeleteRouteTableWithContext(aws.Context, *ec2.DeleteRouteTableInput, ...request.Option) (*ec2.DeleteRouteTableOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteRouteTableRequest(*ec2.DeleteRouteTableInput) (*request.Request, *ec2.DeleteRouteTableOutput) {
panic("Not implemented")
return nil, nil
}

View File

@ -27,12 +27,10 @@ import (
func (m *MockEC2) CreateSecurityGroupRequest(*ec2.CreateSecurityGroupInput) (*request.Request, *ec2.CreateSecurityGroupOutput) {
panic("MockEC2 CreateSecurityGroupRequest not implemented")
return nil, nil
}
func (m *MockEC2) CreateSecurityGroupWithContext(aws.Context, *ec2.CreateSecurityGroupInput, ...request.Option) (*ec2.CreateSecurityGroupOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateSecurityGroup(request *ec2.CreateSecurityGroupInput) (*ec2.CreateSecurityGroupOutput, error) {
@ -63,12 +61,10 @@ func (m *MockEC2) CreateSecurityGroup(request *ec2.CreateSecurityGroupInput) (*e
func (m *MockEC2) DeleteSecurityGroupRequest(request *ec2.DeleteSecurityGroupInput) (*request.Request, *ec2.DeleteSecurityGroupOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteSecurityGroupWithContext(aws.Context, *ec2.DeleteSecurityGroupInput, ...request.Option) (*ec2.DeleteSecurityGroupOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteSecurityGroup(request *ec2.DeleteSecurityGroupInput) (*ec2.DeleteSecurityGroupOutput, error) {
@ -89,23 +85,18 @@ func (m *MockEC2) DeleteSecurityGroup(request *ec2.DeleteSecurityGroupInput) (*e
func (m *MockEC2) DescribeSecurityGroupReferencesRequest(*ec2.DescribeSecurityGroupReferencesInput) (*request.Request, *ec2.DescribeSecurityGroupReferencesOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeSecurityGroupReferencesWithContext(aws.Context, *ec2.DescribeSecurityGroupReferencesInput, ...request.Option) (*ec2.DescribeSecurityGroupReferencesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeSecurityGroupReferences(*ec2.DescribeSecurityGroupReferencesInput) (*ec2.DescribeSecurityGroupReferencesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeSecurityGroupsRequest(*ec2.DescribeSecurityGroupsInput) (*request.Request, *ec2.DescribeSecurityGroupsOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeSecurityGroupsWithContext(aws.Context, *ec2.DescribeSecurityGroupsInput, ...request.Option) (*ec2.DescribeSecurityGroupsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeSecurityGroups(request *ec2.DescribeSecurityGroupsInput) (*ec2.DescribeSecurityGroupsOutput, error) {
m.mutex.Lock()
@ -172,35 +163,27 @@ func (m *MockEC2) DescribeSecurityGroups(request *ec2.DescribeSecurityGroupsInpu
func (m *MockEC2) DescribeStaleSecurityGroupsRequest(*ec2.DescribeStaleSecurityGroupsInput) (*request.Request, *ec2.DescribeStaleSecurityGroupsOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeStaleSecurityGroupsWithContext(aws.Context, *ec2.DescribeStaleSecurityGroupsInput, ...request.Option) (*ec2.DescribeStaleSecurityGroupsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeStaleSecurityGroups(*ec2.DescribeStaleSecurityGroupsInput) (*ec2.DescribeStaleSecurityGroupsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) RevokeSecurityGroupEgressRequest(*ec2.RevokeSecurityGroupEgressInput) (*request.Request, *ec2.RevokeSecurityGroupEgressOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) RevokeSecurityGroupEgressWithContext(aws.Context, *ec2.RevokeSecurityGroupEgressInput, ...request.Option) (*ec2.RevokeSecurityGroupEgressOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) RevokeSecurityGroupEgress(*ec2.RevokeSecurityGroupEgressInput) (*ec2.RevokeSecurityGroupEgressOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) RevokeSecurityGroupIngressRequest(*ec2.RevokeSecurityGroupIngressInput) (*request.Request, *ec2.RevokeSecurityGroupIngressOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) RevokeSecurityGroupIngressWithContext(aws.Context, *ec2.RevokeSecurityGroupIngressInput, ...request.Option) (*ec2.RevokeSecurityGroupIngressOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) RevokeSecurityGroupIngress(request *ec2.RevokeSecurityGroupIngressInput) (*ec2.RevokeSecurityGroupIngressOutput, error) {
@ -233,11 +216,9 @@ func (m *MockEC2) RevokeSecurityGroupIngress(request *ec2.RevokeSecurityGroupIng
func (m *MockEC2) AuthorizeSecurityGroupEgressRequest(*ec2.AuthorizeSecurityGroupEgressInput) (*request.Request, *ec2.AuthorizeSecurityGroupEgressOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AuthorizeSecurityGroupEgressWithContext(aws.Context, *ec2.AuthorizeSecurityGroupEgressInput, ...request.Option) (*ec2.AuthorizeSecurityGroupEgressOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AuthorizeSecurityGroupEgress(request *ec2.AuthorizeSecurityGroupEgressInput) (*ec2.AuthorizeSecurityGroupEgressOutput, error) {
m.mutex.Lock()
@ -290,11 +271,9 @@ func (m *MockEC2) AuthorizeSecurityGroupEgress(request *ec2.AuthorizeSecurityGro
}
func (m *MockEC2) AuthorizeSecurityGroupIngressRequest(*ec2.AuthorizeSecurityGroupIngressInput) (*request.Request, *ec2.AuthorizeSecurityGroupIngressOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AuthorizeSecurityGroupIngressWithContext(aws.Context, *ec2.AuthorizeSecurityGroupIngressInput, ...request.Option) (*ec2.AuthorizeSecurityGroupIngressOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AuthorizeSecurityGroupIngress(request *ec2.AuthorizeSecurityGroupIngressInput) (*ec2.AuthorizeSecurityGroupIngressOutput, error) {
m.mutex.Lock()

View File

@ -57,12 +57,10 @@ func (m *MockEC2) SubnetIds() []string {
func (m *MockEC2) CreateSubnetRequest(*ec2.CreateSubnetInput) (*request.Request, *ec2.CreateSubnetOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateSubnetWithContext(aws.Context, *ec2.CreateSubnetInput, ...request.Option) (*ec2.CreateSubnetOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateSubnetWithId(request *ec2.CreateSubnetInput, id string) (*ec2.CreateSubnetOutput, error) {
@ -98,12 +96,10 @@ func (m *MockEC2) CreateSubnet(request *ec2.CreateSubnetInput) (*ec2.CreateSubne
func (m *MockEC2) DescribeSubnetsRequest(*ec2.DescribeSubnetsInput) (*request.Request, *ec2.DescribeSubnetsOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeSubnetsWithContext(aws.Context, *ec2.DescribeSubnetsInput, ...request.Option) (*ec2.DescribeSubnetsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeSubnets(request *ec2.DescribeSubnetsInput) (*ec2.DescribeSubnetsOutput, error) {
@ -209,11 +205,9 @@ func (m *MockEC2) AssociateRouteTable(request *ec2.AssociateRouteTableInput) (*e
}
func (m *MockEC2) AssociateRouteTableWithContext(aws.Context, *ec2.AssociateRouteTableInput, ...request.Option) (*ec2.AssociateRouteTableOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) AssociateRouteTableRequest(*ec2.AssociateRouteTableInput) (*request.Request, *ec2.AssociateRouteTableOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteSubnet(request *ec2.DeleteSubnetInput) (*ec2.DeleteSubnetOutput, error) {
@ -234,9 +228,7 @@ func (m *MockEC2) DeleteSubnet(request *ec2.DeleteSubnetInput) (*ec2.DeleteSubne
func (m *MockEC2) DeleteSubnetWithContext(aws.Context, *ec2.DeleteSubnetInput, ...request.Option) (*ec2.DeleteSubnetOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteSubnetRequest(*ec2.DeleteSubnetInput) (*request.Request, *ec2.DeleteSubnetOutput) {
panic("Not implemented")
return nil, nil
}

View File

@ -33,12 +33,10 @@ const ResourceTypeAddress = "elastic-ip"
func (m *MockEC2) CreateTagsRequest(*ec2.CreateTagsInput) (*request.Request, *ec2.CreateTagsOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateTagsWithContext(aws.Context, *ec2.CreateTagsInput, ...request.Option) (*ec2.CreateTagsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateTags(request *ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error) {
@ -92,12 +90,10 @@ func (m *MockEC2) addTag(resourceId string, tag *ec2.Tag) {
func (m *MockEC2) DescribeTagsRequest(*ec2.DescribeTagsInput) (*request.Request, *ec2.DescribeTagsOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeTagsWithContext(aws.Context, *ec2.DescribeTagsInput, ...request.Option) (*ec2.DescribeTagsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) hasTag(resourceType string, resourceId string, filter *ec2.Filter) bool {
@ -214,11 +210,9 @@ func (m *MockEC2) DescribeTags(request *ec2.DescribeTagsInput) (*ec2.DescribeTag
}
func (m *MockEC2) DescribeTagsPages(*ec2.DescribeTagsInput, func(*ec2.DescribeTagsOutput, bool) bool) error {
panic("Not implemented")
return nil
}
func (m *MockEC2) DescribeTagsPagesWithContext(aws.Context, *ec2.DescribeTagsInput, func(*ec2.DescribeTagsOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
return nil
}
// SortTags sorts the slice of tags by Key

File diff suppressed because it is too large Load Diff

View File

@ -77,52 +77,40 @@ func (m *MockEC2) CreateVolume(request *ec2.CreateVolumeInput) (*ec2.Volume, err
func (m *MockEC2) CreateVolumeWithContext(aws.Context, *ec2.CreateVolumeInput, ...request.Option) (*ec2.Volume, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateVolumeRequest(*ec2.CreateVolumeInput) (*request.Request, *ec2.Volume) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVolumeAttributeRequest(*ec2.DescribeVolumeAttributeInput) (*request.Request, *ec2.DescribeVolumeAttributeOutput) {
panic("MockEC2 DescribeVolumeAttributeRequest not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVolumeAttributeWithContext(aws.Context, *ec2.DescribeVolumeAttributeInput, ...request.Option) (*ec2.DescribeVolumeAttributeOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVolumeAttribute(*ec2.DescribeVolumeAttributeInput) (*ec2.DescribeVolumeAttributeOutput, error) {
panic("MockEC2 DescribeVolumeAttribute not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVolumeStatusRequest(*ec2.DescribeVolumeStatusInput) (*request.Request, *ec2.DescribeVolumeStatusOutput) {
panic("MockEC2 DescribeVolumeStatusRequest not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVolumeStatusWithContext(aws.Context, *ec2.DescribeVolumeStatusInput, ...request.Option) (*ec2.DescribeVolumeStatusOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVolumeStatus(*ec2.DescribeVolumeStatusInput) (*ec2.DescribeVolumeStatusOutput, error) {
panic("MockEC2 DescribeVolumeStatus not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVolumeStatusPages(*ec2.DescribeVolumeStatusInput, func(*ec2.DescribeVolumeStatusOutput, bool) bool) error {
panic("MockEC2 DescribeVolumeStatusPages not implemented")
return nil
}
func (m *MockEC2) DescribeVolumeStatusPagesWithContext(aws.Context, *ec2.DescribeVolumeStatusInput, func(*ec2.DescribeVolumeStatusOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
return nil
}
func (m *MockEC2) DescribeVolumesRequest(*ec2.DescribeVolumesInput) (*request.Request, *ec2.DescribeVolumesOutput) {
panic("MockEC2 DescribeVolumesRequest not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVolumesWithContext(aws.Context, *ec2.DescribeVolumesInput, ...request.Option) (*ec2.DescribeVolumesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVolumes(request *ec2.DescribeVolumesInput) (*ec2.DescribeVolumesOutput, error) {
m.mutex.Lock()
@ -186,20 +174,16 @@ func (m *MockEC2) DescribeVolumesPages(request *ec2.DescribeVolumesInput, callba
func (m *MockEC2) DescribeVolumesPagesWithContext(aws.Context, *ec2.DescribeVolumesInput, func(*ec2.DescribeVolumesOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
return nil
}
func (m *MockEC2) DescribeVolumesModifications(*ec2.DescribeVolumesModificationsInput) (*ec2.DescribeVolumesModificationsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVolumesModificationsWithContext(aws.Context, *ec2.DescribeVolumesModificationsInput, ...request.Option) (*ec2.DescribeVolumesModificationsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVolumesModificationsRequest(*ec2.DescribeVolumesModificationsInput) (*request.Request, *ec2.DescribeVolumesModificationsOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteVolume(request *ec2.DeleteVolumeInput) (*ec2.DeleteVolumeOutput, error) {
@ -220,9 +204,7 @@ func (m *MockEC2) DeleteVolume(request *ec2.DeleteVolumeInput) (*ec2.DeleteVolum
func (m *MockEC2) DeleteVolumeWithContext(aws.Context, *ec2.DeleteVolumeInput, ...request.Option) (*ec2.DeleteVolumeOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteVolumeRequest(*ec2.DeleteVolumeInput) (*request.Request, *ec2.DeleteVolumeOutput) {
panic("Not implemented")
return nil, nil
}

View File

@ -47,11 +47,9 @@ func (m *MockEC2) FindVpc(id string) *ec2.Vpc {
func (m *MockEC2) CreateVpcRequest(*ec2.CreateVpcInput) (*request.Request, *ec2.CreateVpcOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateVpcWithContext(aws.Context, *ec2.CreateVpcInput, ...request.Option) (*ec2.CreateVpcOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) CreateVpcWithId(request *ec2.CreateVpcInput, id string) (*ec2.CreateVpcOutput, error) {
m.mutex.Lock()
@ -94,12 +92,10 @@ func (m *MockEC2) CreateVpc(request *ec2.CreateVpcInput) (*ec2.CreateVpcOutput,
func (m *MockEC2) DescribeVpcsRequest(*ec2.DescribeVpcsInput) (*request.Request, *ec2.DescribeVpcsOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVpcsWithContext(aws.Context, *ec2.DescribeVpcsInput, ...request.Option) (*ec2.DescribeVpcsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVpcs(request *ec2.DescribeVpcsInput) (*ec2.DescribeVpcsOutput, error) {
@ -153,11 +149,9 @@ func (m *MockEC2) DescribeVpcs(request *ec2.DescribeVpcsInput) (*ec2.DescribeVpc
func (m *MockEC2) DescribeVpcAttributeRequest(*ec2.DescribeVpcAttributeInput) (*request.Request, *ec2.DescribeVpcAttributeOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVpcAttributeWithContext(aws.Context, *ec2.DescribeVpcAttributeInput, ...request.Option) (*ec2.DescribeVpcAttributeOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DescribeVpcAttribute(request *ec2.DescribeVpcAttributeInput) (*ec2.DescribeVpcAttributeOutput, error) {
m.mutex.Lock()
@ -205,11 +199,9 @@ func (m *MockEC2) ModifyVpcAttribute(request *ec2.ModifyVpcAttributeInput) (*ec2
}
func (m *MockEC2) ModifyVpcAttributeWithContext(aws.Context, *ec2.ModifyVpcAttributeInput, ...request.Option) (*ec2.ModifyVpcAttributeOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) ModifyVpcAttributeRequest(*ec2.ModifyVpcAttributeInput) (*request.Request, *ec2.ModifyVpcAttributeOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteVpc(request *ec2.DeleteVpcInput) (*ec2.DeleteVpcOutput, error) {
@ -230,9 +222,7 @@ func (m *MockEC2) DeleteVpc(request *ec2.DeleteVpcInput) (*ec2.DeleteVpcOutput,
func (m *MockEC2) DeleteVpcWithContext(aws.Context, *ec2.DeleteVpcInput, ...request.Option) (*ec2.DeleteVpcOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockEC2) DeleteVpcRequest(*ec2.DeleteVpcInput) (*request.Request, *ec2.DeleteVpcOutput) {
panic("Not implemented")
return nil, nil
}

View File

@ -0,0 +1,14 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["api.go"],
importpath = "k8s.io/kops/cloudmock/aws/mockelbv2",
visibility = ["//visibility:public"],
deps = [
"//vendor/github.com/aws/aws-sdk-go/aws:go_default_library",
"//vendor/github.com/aws/aws-sdk-go/service/elbv2:go_default_library",
"//vendor/github.com/aws/aws-sdk-go/service/elbv2/elbv2iface:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
],
)

View File

@ -0,0 +1,142 @@
/*
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 mockelbv2
import (
"sync"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/elbv2"
"github.com/aws/aws-sdk-go/service/elbv2/elbv2iface"
"github.com/golang/glog"
)
type MockELBV2 struct {
elbv2iface.ELBV2API
mutex sync.Mutex
LoadBalancers map[string]*loadBalancer
TargetGroups map[string]*targetGroup
}
type loadBalancer struct {
description elbv2.LoadBalancer
tags map[string]string
}
type targetGroup struct {
description elbv2.TargetGroup
tags map[string]string
}
func (m *MockELBV2) DescribeLoadBalancers(request *elbv2.DescribeLoadBalancersInput) (*elbv2.DescribeLoadBalancersOutput, error) {
m.mutex.Lock()
defer m.mutex.Unlock()
glog.V(2).Infof("DescribeLoadBalancers v2 %v", request)
if request.PageSize != nil {
glog.Warningf("PageSize not implemented")
}
if request.Marker != nil {
glog.Fatalf("Marker not implemented")
}
var elbs []*elbv2.LoadBalancer
for _, elb := range m.LoadBalancers {
match := false
if len(request.LoadBalancerArns) > 0 {
for _, name := range request.LoadBalancerArns {
if aws.StringValue(elb.description.LoadBalancerArn) == aws.StringValue(name) {
match = true
}
}
} else {
match = true
}
if match {
elbs = append(elbs, &elb.description)
}
}
return &elbv2.DescribeLoadBalancersOutput{
LoadBalancers: elbs,
}, nil
}
func (m *MockELBV2) DescribeLoadBalancersPages(request *elbv2.DescribeLoadBalancersInput, callback func(p *elbv2.DescribeLoadBalancersOutput, lastPage bool) (shouldContinue bool)) error {
// For the mock, we just send everything in one page
page, err := m.DescribeLoadBalancers(request)
if err != nil {
return err
}
callback(page, false)
return nil
}
func (m *MockELBV2) DescribeTargetGroups(request *elbv2.DescribeTargetGroupsInput) (*elbv2.DescribeTargetGroupsOutput, error) {
m.mutex.Lock()
defer m.mutex.Unlock()
glog.V(2).Infof("DescribeTargetGroups %v", request)
if request.PageSize != nil {
glog.Warningf("PageSize not implemented")
}
if request.Marker != nil {
glog.Fatalf("Marker not implemented")
}
var tgs []*elbv2.TargetGroup
for _, tg := range m.TargetGroups {
match := false
if len(request.TargetGroupArns) > 0 {
for _, name := range request.TargetGroupArns {
if aws.StringValue(tg.description.TargetGroupArn) == aws.StringValue(name) {
match = true
}
}
} else {
match = true
}
if match {
tgs = append(tgs, &tg.description)
}
}
return &elbv2.DescribeTargetGroupsOutput{
TargetGroups: tgs,
}, nil
}
func (m *MockELBV2) DescribeTargetGroupsPages(request *elbv2.DescribeTargetGroupsInput, callback func(p *elbv2.DescribeTargetGroupsOutput, lastPage bool) (shouldContinue bool)) error {
page, err := m.DescribeTargetGroups(request)
if err != nil {
return err
}
callback(page, false)
return nil
}

View File

@ -26,6 +26,9 @@ import (
)
type MockIAM struct {
// Mock out interface
iamiface.IAMAPI
mutex sync.Mutex
InstanceProfiles map[string]*iam.InstanceProfile
Roles map[string]*iam.Role

View File

@ -41,11 +41,9 @@ func (m *MockIAM) GetInstanceProfile(request *iam.GetInstanceProfileInput) (*iam
}
func (m *MockIAM) GetInstanceProfileWithContext(aws.Context, *iam.GetInstanceProfileInput, ...request.Option) (*iam.GetInstanceProfileOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) GetInstanceProfileRequest(*iam.GetInstanceProfileInput) (*request.Request, *iam.GetInstanceProfileOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) CreateInstanceProfile(request *iam.CreateInstanceProfileInput) (*iam.CreateInstanceProfileOutput, error) {
@ -68,7 +66,7 @@ func (m *MockIAM) CreateInstanceProfile(request *iam.CreateInstanceProfileInput)
// // CreateDate is a required field
// CreateDate *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
// // The stable and unique string identifying the instance profile. For more information
// // about IDs, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html)
// // about IDs, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
// // in the Using IAM guide.
// //
// // InstanceProfileId is a required field
@ -84,11 +82,9 @@ func (m *MockIAM) CreateInstanceProfile(request *iam.CreateInstanceProfileInput)
}
func (m *MockIAM) CreateInstanceProfileWithContext(aws.Context, *iam.CreateInstanceProfileInput, ...request.Option) (*iam.CreateInstanceProfileOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) CreateInstanceProfileRequest(*iam.CreateInstanceProfileInput) (*request.Request, *iam.CreateInstanceProfileOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) AddRoleToInstanceProfile(request *iam.AddRoleToInstanceProfileInput) (*iam.AddRoleToInstanceProfileOutput, error) {
m.mutex.Lock()
@ -112,12 +108,10 @@ func (m *MockIAM) AddRoleToInstanceProfile(request *iam.AddRoleToInstanceProfile
func (m *MockIAM) AddRoleToInstanceProfileWithContext(aws.Context, *iam.AddRoleToInstanceProfileInput, ...request.Option) (*iam.AddRoleToInstanceProfileOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) AddRoleToInstanceProfileRequest(*iam.AddRoleToInstanceProfileInput) (*request.Request, *iam.AddRoleToInstanceProfileOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) RemoveRoleFromInstanceProfile(request *iam.RemoveRoleFromInstanceProfileInput) (*iam.RemoveRoleFromInstanceProfileOutput, error) {
@ -151,11 +145,9 @@ func (m *MockIAM) RemoveRoleFromInstanceProfile(request *iam.RemoveRoleFromInsta
func (m *MockIAM) RemoveRoleFromInstanceProfileWithContext(aws.Context, *iam.RemoveRoleFromInstanceProfileInput, ...request.Option) (*iam.RemoveRoleFromInstanceProfileOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) RemoveRoleFromInstanceProfileRequest(*iam.RemoveRoleFromInstanceProfileInput) (*request.Request, *iam.RemoveRoleFromInstanceProfileOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) ListInstanceProfiles(request *iam.ListInstanceProfilesInput) (*iam.ListInstanceProfilesOutput, error) {
@ -184,12 +176,10 @@ func (m *MockIAM) ListInstanceProfiles(request *iam.ListInstanceProfilesInput) (
func (m *MockIAM) ListInstanceProfilesWithContext(aws.Context, *iam.ListInstanceProfilesInput, ...request.Option) (*iam.ListInstanceProfilesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) ListInstanceProfilesRequest(*iam.ListInstanceProfilesInput) (*request.Request, *iam.ListInstanceProfilesOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) ListInstanceProfilesPages(request *iam.ListInstanceProfilesInput, callback func(*iam.ListInstanceProfilesOutput, bool) bool) error {
@ -206,7 +196,6 @@ func (m *MockIAM) ListInstanceProfilesPages(request *iam.ListInstanceProfilesInp
func (m *MockIAM) ListInstanceProfilesPagesWithContext(aws.Context, *iam.ListInstanceProfilesInput, func(*iam.ListInstanceProfilesOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
return nil
}
func (m *MockIAM) DeleteInstanceProfile(request *iam.DeleteInstanceProfileInput) (*iam.DeleteInstanceProfileOutput, error) {
@ -227,9 +216,7 @@ func (m *MockIAM) DeleteInstanceProfile(request *iam.DeleteInstanceProfileInput)
func (m *MockIAM) DeleteInstanceProfileWithContext(aws.Context, *iam.DeleteInstanceProfileInput, ...request.Option) (*iam.DeleteInstanceProfileOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) DeleteInstanceProfileRequest(*iam.DeleteInstanceProfileInput) (*request.Request, *iam.DeleteInstanceProfileOutput) {
panic("Not implemented")
return nil, nil
}

View File

@ -42,12 +42,10 @@ func (m *MockIAM) GetRole(request *iam.GetRoleInput) (*iam.GetRoleOutput, error)
func (m *MockIAM) GetRoleWithContext(aws.Context, *iam.GetRoleInput, ...request.Option) (*iam.GetRoleOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) GetRoleRequest(*iam.GetRoleInput) (*request.Request, *iam.GetRoleOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) CreateRole(request *iam.CreateRoleInput) (*iam.CreateRoleOutput, error) {
@ -76,11 +74,9 @@ func (m *MockIAM) CreateRole(request *iam.CreateRoleInput) (*iam.CreateRoleOutpu
func (m *MockIAM) CreateRoleWithContext(aws.Context, *iam.CreateRoleInput, ...request.Option) (*iam.CreateRoleOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) CreateRoleRequest(*iam.CreateRoleInput) (*request.Request, *iam.CreateRoleOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) ListRoles(request *iam.ListRolesInput) (*iam.ListRolesOutput, error) {
@ -109,11 +105,9 @@ func (m *MockIAM) ListRoles(request *iam.ListRolesInput) (*iam.ListRolesOutput,
func (m *MockIAM) ListRolesWithContext(aws.Context, *iam.ListRolesInput, ...request.Option) (*iam.ListRolesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) ListRolesRequest(*iam.ListRolesInput) (*request.Request, *iam.ListRolesOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) ListRolesPages(request *iam.ListRolesInput, callback func(*iam.ListRolesOutput, bool) bool) error {
@ -130,7 +124,6 @@ func (m *MockIAM) ListRolesPages(request *iam.ListRolesInput, callback func(*iam
func (m *MockIAM) ListRolesPagesWithContext(aws.Context, *iam.ListRolesInput, func(*iam.ListRolesOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
return nil
}
func (m *MockIAM) DeleteRole(request *iam.DeleteRoleInput) (*iam.DeleteRoleOutput, error) {
@ -150,9 +143,7 @@ func (m *MockIAM) DeleteRole(request *iam.DeleteRoleInput) (*iam.DeleteRoleOutpu
}
func (m *MockIAM) DeleteRoleWithContext(aws.Context, *iam.DeleteRoleInput, ...request.Option) (*iam.DeleteRoleOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) DeleteRoleRequest(*iam.DeleteRoleInput) (*request.Request, *iam.DeleteRoleOutput) {
panic("Not implemented")
return nil, nil
}

View File

@ -57,11 +57,9 @@ func (m *MockIAM) GetRolePolicy(request *iam.GetRolePolicyInput) (*iam.GetRolePo
}
func (m *MockIAM) GetRolePolicyWithContext(aws.Context, *iam.GetRolePolicyInput, ...request.Option) (*iam.GetRolePolicyOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) GetRolePolicyRequest(*iam.GetRolePolicyInput) (*request.Request, *iam.GetRolePolicyOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) PutRolePolicy(request *iam.PutRolePolicyInput) (*iam.PutRolePolicyOutput, error) {
@ -94,11 +92,9 @@ func (m *MockIAM) PutRolePolicy(request *iam.PutRolePolicyInput) (*iam.PutRolePo
}
func (m *MockIAM) PutRolePolicyWithContext(aws.Context, *iam.PutRolePolicyInput, ...request.Option) (*iam.PutRolePolicyOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) PutRolePolicyRequest(*iam.PutRolePolicyInput) (*request.Request, *iam.PutRolePolicyOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) ListRolePolicies(request *iam.ListRolePoliciesInput) (*iam.ListRolePoliciesOutput, error) {
@ -127,12 +123,10 @@ func (m *MockIAM) ListRolePolicies(request *iam.ListRolePoliciesInput) (*iam.Lis
func (m *MockIAM) ListRolePoliciesWithContext(aws.Context, *iam.ListRolePoliciesInput, ...request.Option) (*iam.ListRolePoliciesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) ListRolePoliciesRequest(*iam.ListRolePoliciesInput) (*request.Request, *iam.ListRolePoliciesOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) ListRolePoliciesPages(request *iam.ListRolePoliciesInput, callback func(*iam.ListRolePoliciesOutput, bool) bool) error {
@ -149,7 +143,6 @@ func (m *MockIAM) ListRolePoliciesPages(request *iam.ListRolePoliciesInput, call
func (m *MockIAM) ListRolePoliciesPagesWithContext(aws.Context, *iam.ListRolePoliciesInput, func(*iam.ListRolePoliciesOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
return nil
}
func (m *MockIAM) DeleteRolePolicy(request *iam.DeleteRolePolicyInput) (*iam.DeleteRolePolicyOutput, error) {
@ -177,9 +170,7 @@ func (m *MockIAM) DeleteRolePolicy(request *iam.DeleteRolePolicyInput) (*iam.Del
func (m *MockIAM) DeleteRolePolicyWithContext(aws.Context, *iam.DeleteRolePolicyInput, ...request.Option) (*iam.DeleteRolePolicyOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockIAM) DeleteRolePolicyRequest(*iam.DeleteRolePolicyInput) (*request.Request, *iam.DeleteRolePolicyOutput) {
panic("Not implemented")
return nil, nil
}

File diff suppressed because it is too large Load Diff

View File

@ -27,22 +27,18 @@ import (
func (m *MockRoute53) ListResourceRecordSetsRequest(*route53.ListResourceRecordSetsInput) (*request.Request, *route53.ListResourceRecordSetsOutput) {
panic("MockRoute53 ListResourceRecordSetsRequest not implemented")
return nil, nil
}
func (m *MockRoute53) ListResourceRecordSetsWithContext(aws.Context, *route53.ListResourceRecordSetsInput, ...request.Option) (*route53.ListResourceRecordSetsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListResourceRecordSets(*route53.ListResourceRecordSetsInput) (*route53.ListResourceRecordSetsOutput, error) {
panic("MockRoute53 ListResourceRecordSets not implemented")
return nil, nil
}
func (m *MockRoute53) ListResourceRecordSetsPagesWithContext(aws.Context, *route53.ListResourceRecordSetsInput, func(*route53.ListResourceRecordSetsOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
return nil
}
func (m *MockRoute53) ListResourceRecordSetsPages(request *route53.ListResourceRecordSetsInput, callback func(*route53.ListResourceRecordSetsOutput, bool) bool) error {
@ -80,12 +76,10 @@ func (m *MockRoute53) ListResourceRecordSetsPages(request *route53.ListResourceR
func (m *MockRoute53) ChangeResourceRecordSetsRequest(*route53.ChangeResourceRecordSetsInput) (*request.Request, *route53.ChangeResourceRecordSetsOutput) {
panic("MockRoute53 ChangeResourceRecordSetsRequest not implemented")
return nil, nil
}
func (m *MockRoute53) ChangeResourceRecordSetsWithContext(aws.Context, *route53.ChangeResourceRecordSetsInput, ...request.Option) (*route53.ChangeResourceRecordSetsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ChangeResourceRecordSets(request *route53.ChangeResourceRecordSetsInput) (*route53.ChangeResourceRecordSetsOutput, error) {

View File

@ -24,668 +24,516 @@ import (
func (m *MockRoute53) AssociateVPCWithHostedZone(*route53.AssociateVPCWithHostedZoneInput) (*route53.AssociateVPCWithHostedZoneOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) AssociateVPCWithHostedZoneWithContext(aws.Context, *route53.AssociateVPCWithHostedZoneInput, ...request.Option) (*route53.AssociateVPCWithHostedZoneOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) AssociateVPCWithHostedZoneRequest(*route53.AssociateVPCWithHostedZoneInput) (*request.Request, *route53.AssociateVPCWithHostedZoneOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ChangeTagsForResource(*route53.ChangeTagsForResourceInput) (*route53.ChangeTagsForResourceOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ChangeTagsForResourceWithContext(aws.Context, *route53.ChangeTagsForResourceInput, ...request.Option) (*route53.ChangeTagsForResourceOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ChangeTagsForResourceRequest(*route53.ChangeTagsForResourceInput) (*request.Request, *route53.ChangeTagsForResourceOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateHealthCheck(*route53.CreateHealthCheckInput) (*route53.CreateHealthCheckOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateHealthCheckWithContext(aws.Context, *route53.CreateHealthCheckInput, ...request.Option) (*route53.CreateHealthCheckOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateHealthCheckRequest(*route53.CreateHealthCheckInput) (*request.Request, *route53.CreateHealthCheckOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateHostedZone(*route53.CreateHostedZoneInput) (*route53.CreateHostedZoneOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateHostedZoneWithContext(aws.Context, *route53.CreateHostedZoneInput, ...request.Option) (*route53.CreateHostedZoneOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateHostedZoneRequest(*route53.CreateHostedZoneInput) (*request.Request, *route53.CreateHostedZoneOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateReusableDelegationSet(*route53.CreateReusableDelegationSetInput) (*route53.CreateReusableDelegationSetOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateReusableDelegationSetWithContext(aws.Context, *route53.CreateReusableDelegationSetInput, ...request.Option) (*route53.CreateReusableDelegationSetOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateReusableDelegationSetRequest(*route53.CreateReusableDelegationSetInput) (*request.Request, *route53.CreateReusableDelegationSetOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateTrafficPolicy(*route53.CreateTrafficPolicyInput) (*route53.CreateTrafficPolicyOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateTrafficPolicyWithContext(aws.Context, *route53.CreateTrafficPolicyInput, ...request.Option) (*route53.CreateTrafficPolicyOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateTrafficPolicyRequest(*route53.CreateTrafficPolicyInput) (*request.Request, *route53.CreateTrafficPolicyOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateTrafficPolicyInstance(*route53.CreateTrafficPolicyInstanceInput) (*route53.CreateTrafficPolicyInstanceOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateTrafficPolicyInstanceWithContext(aws.Context, *route53.CreateTrafficPolicyInstanceInput, ...request.Option) (*route53.CreateTrafficPolicyInstanceOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateTrafficPolicyInstanceRequest(*route53.CreateTrafficPolicyInstanceInput) (*request.Request, *route53.CreateTrafficPolicyInstanceOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateTrafficPolicyVersion(*route53.CreateTrafficPolicyVersionInput) (*route53.CreateTrafficPolicyVersionOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateTrafficPolicyVersionWithContext(aws.Context, *route53.CreateTrafficPolicyVersionInput, ...request.Option) (*route53.CreateTrafficPolicyVersionOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateTrafficPolicyVersionRequest(*route53.CreateTrafficPolicyVersionInput) (*request.Request, *route53.CreateTrafficPolicyVersionOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateVPCAssociationAuthorization(*route53.CreateVPCAssociationAuthorizationInput) (*route53.CreateVPCAssociationAuthorizationOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateVPCAssociationAuthorizationWithContext(aws.Context, *route53.CreateVPCAssociationAuthorizationInput, ...request.Option) (*route53.CreateVPCAssociationAuthorizationOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateVPCAssociationAuthorizationRequest(*route53.CreateVPCAssociationAuthorizationInput) (*request.Request, *route53.CreateVPCAssociationAuthorizationOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteHealthCheck(*route53.DeleteHealthCheckInput) (*route53.DeleteHealthCheckOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteHealthCheckWithContext(aws.Context, *route53.DeleteHealthCheckInput, ...request.Option) (*route53.DeleteHealthCheckOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteHealthCheckRequest(*route53.DeleteHealthCheckInput) (*request.Request, *route53.DeleteHealthCheckOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteHostedZone(*route53.DeleteHostedZoneInput) (*route53.DeleteHostedZoneOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteHostedZoneWithContext(aws.Context, *route53.DeleteHostedZoneInput, ...request.Option) (*route53.DeleteHostedZoneOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteHostedZoneRequest(*route53.DeleteHostedZoneInput) (*request.Request, *route53.DeleteHostedZoneOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteReusableDelegationSet(*route53.DeleteReusableDelegationSetInput) (*route53.DeleteReusableDelegationSetOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteReusableDelegationSetWithContext(aws.Context, *route53.DeleteReusableDelegationSetInput, ...request.Option) (*route53.DeleteReusableDelegationSetOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteReusableDelegationSetRequest(*route53.DeleteReusableDelegationSetInput) (*request.Request, *route53.DeleteReusableDelegationSetOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteTrafficPolicy(*route53.DeleteTrafficPolicyInput) (*route53.DeleteTrafficPolicyOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteTrafficPolicyWithContext(aws.Context, *route53.DeleteTrafficPolicyInput, ...request.Option) (*route53.DeleteTrafficPolicyOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteTrafficPolicyRequest(*route53.DeleteTrafficPolicyInput) (*request.Request, *route53.DeleteTrafficPolicyOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteTrafficPolicyInstance(*route53.DeleteTrafficPolicyInstanceInput) (*route53.DeleteTrafficPolicyInstanceOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteTrafficPolicyInstanceWithContext(aws.Context, *route53.DeleteTrafficPolicyInstanceInput, ...request.Option) (*route53.DeleteTrafficPolicyInstanceOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteTrafficPolicyInstanceRequest(*route53.DeleteTrafficPolicyInstanceInput) (*request.Request, *route53.DeleteTrafficPolicyInstanceOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteVPCAssociationAuthorization(*route53.DeleteVPCAssociationAuthorizationInput) (*route53.DeleteVPCAssociationAuthorizationOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteVPCAssociationAuthorizationWithContext(aws.Context, *route53.DeleteVPCAssociationAuthorizationInput, ...request.Option) (*route53.DeleteVPCAssociationAuthorizationOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteVPCAssociationAuthorizationRequest(*route53.DeleteVPCAssociationAuthorizationInput) (*request.Request, *route53.DeleteVPCAssociationAuthorizationOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DisassociateVPCFromHostedZone(*route53.DisassociateVPCFromHostedZoneInput) (*route53.DisassociateVPCFromHostedZoneOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DisassociateVPCFromHostedZoneWithContext(aws.Context, *route53.DisassociateVPCFromHostedZoneInput, ...request.Option) (*route53.DisassociateVPCFromHostedZoneOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DisassociateVPCFromHostedZoneRequest(*route53.DisassociateVPCFromHostedZoneInput) (*request.Request, *route53.DisassociateVPCFromHostedZoneOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetChange(*route53.GetChangeInput) (*route53.GetChangeOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetChangeWithContext(aws.Context, *route53.GetChangeInput, ...request.Option) (*route53.GetChangeOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetChangeRequest(*route53.GetChangeInput) (*request.Request, *route53.GetChangeOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetCheckerIpRanges(*route53.GetCheckerIpRangesInput) (*route53.GetCheckerIpRangesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetCheckerIpRangesWithContext(aws.Context, *route53.GetCheckerIpRangesInput, ...request.Option) (*route53.GetCheckerIpRangesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetCheckerIpRangesRequest(*route53.GetCheckerIpRangesInput) (*request.Request, *route53.GetCheckerIpRangesOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetGeoLocation(*route53.GetGeoLocationInput) (*route53.GetGeoLocationOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetGeoLocationWithContext(aws.Context, *route53.GetGeoLocationInput, ...request.Option) (*route53.GetGeoLocationOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetGeoLocationRequest(*route53.GetGeoLocationInput) (*request.Request, *route53.GetGeoLocationOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHealthCheck(*route53.GetHealthCheckInput) (*route53.GetHealthCheckOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHealthCheckWithContext(aws.Context, *route53.GetHealthCheckInput, ...request.Option) (*route53.GetHealthCheckOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHealthCheckRequest(*route53.GetHealthCheckInput) (*request.Request, *route53.GetHealthCheckOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHealthCheckCount(*route53.GetHealthCheckCountInput) (*route53.GetHealthCheckCountOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHealthCheckCountWithContext(aws.Context, *route53.GetHealthCheckCountInput, ...request.Option) (*route53.GetHealthCheckCountOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHealthCheckCountRequest(*route53.GetHealthCheckCountInput) (*request.Request, *route53.GetHealthCheckCountOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHealthCheckLastFailureReason(*route53.GetHealthCheckLastFailureReasonInput) (*route53.GetHealthCheckLastFailureReasonOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHealthCheckLastFailureReasonWithContext(aws.Context, *route53.GetHealthCheckLastFailureReasonInput, ...request.Option) (*route53.GetHealthCheckLastFailureReasonOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHealthCheckLastFailureReasonRequest(*route53.GetHealthCheckLastFailureReasonInput) (*request.Request, *route53.GetHealthCheckLastFailureReasonOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHealthCheckStatus(*route53.GetHealthCheckStatusInput) (*route53.GetHealthCheckStatusOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHealthCheckStatusWithContext(aws.Context, *route53.GetHealthCheckStatusInput, ...request.Option) (*route53.GetHealthCheckStatusOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHealthCheckStatusRequest(*route53.GetHealthCheckStatusInput) (*request.Request, *route53.GetHealthCheckStatusOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetReusableDelegationSet(*route53.GetReusableDelegationSetInput) (*route53.GetReusableDelegationSetOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetReusableDelegationSetWithContext(aws.Context, *route53.GetReusableDelegationSetInput, ...request.Option) (*route53.GetReusableDelegationSetOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetReusableDelegationSetRequest(*route53.GetReusableDelegationSetInput) (*request.Request, *route53.GetReusableDelegationSetOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetTrafficPolicy(*route53.GetTrafficPolicyInput) (*route53.GetTrafficPolicyOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetTrafficPolicyWithContext(aws.Context, *route53.GetTrafficPolicyInput, ...request.Option) (*route53.GetTrafficPolicyOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetTrafficPolicyRequest(*route53.GetTrafficPolicyInput) (*request.Request, *route53.GetTrafficPolicyOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetTrafficPolicyInstance(*route53.GetTrafficPolicyInstanceInput) (*route53.GetTrafficPolicyInstanceOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetTrafficPolicyInstanceWithContext(aws.Context, *route53.GetTrafficPolicyInstanceInput, ...request.Option) (*route53.GetTrafficPolicyInstanceOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetTrafficPolicyInstanceRequest(*route53.GetTrafficPolicyInstanceInput) (*request.Request, *route53.GetTrafficPolicyInstanceOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetTrafficPolicyInstanceCount(*route53.GetTrafficPolicyInstanceCountInput) (*route53.GetTrafficPolicyInstanceCountOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetTrafficPolicyInstanceCountWithContext(aws.Context, *route53.GetTrafficPolicyInstanceCountInput, ...request.Option) (*route53.GetTrafficPolicyInstanceCountOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetTrafficPolicyInstanceCountRequest(*route53.GetTrafficPolicyInstanceCountInput) (*request.Request, *route53.GetTrafficPolicyInstanceCountOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListGeoLocations(*route53.ListGeoLocationsInput) (*route53.ListGeoLocationsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListGeoLocationsWithContext(aws.Context, *route53.ListGeoLocationsInput, ...request.Option) (*route53.ListGeoLocationsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListGeoLocationsRequest(*route53.ListGeoLocationsInput) (*request.Request, *route53.ListGeoLocationsOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListHealthChecks(*route53.ListHealthChecksInput) (*route53.ListHealthChecksOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListHealthChecksWithContext(aws.Context, *route53.ListHealthChecksInput, ...request.Option) (*route53.ListHealthChecksOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListHealthChecksRequest(*route53.ListHealthChecksInput) (*request.Request, *route53.ListHealthChecksOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListHealthChecksPages(*route53.ListHealthChecksInput, func(*route53.ListHealthChecksOutput, bool) bool) error {
panic("Not implemented")
return nil
}
func (m *MockRoute53) ListHealthChecksPagesWithContext(aws.Context, *route53.ListHealthChecksInput, func(*route53.ListHealthChecksOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
return nil
}
func (m *MockRoute53) ListReusableDelegationSets(*route53.ListReusableDelegationSetsInput) (*route53.ListReusableDelegationSetsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListReusableDelegationSetsWithContext(aws.Context, *route53.ListReusableDelegationSetsInput, ...request.Option) (*route53.ListReusableDelegationSetsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListReusableDelegationSetsRequest(*route53.ListReusableDelegationSetsInput) (*request.Request, *route53.ListReusableDelegationSetsOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTagsForResource(*route53.ListTagsForResourceInput) (*route53.ListTagsForResourceOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTagsForResourceWithContext(aws.Context, *route53.ListTagsForResourceInput, ...request.Option) (*route53.ListTagsForResourceOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTagsForResourceRequest(*route53.ListTagsForResourceInput) (*request.Request, *route53.ListTagsForResourceOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTagsForResources(*route53.ListTagsForResourcesInput) (*route53.ListTagsForResourcesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTagsForResourcesWithContext(aws.Context, *route53.ListTagsForResourcesInput, ...request.Option) (*route53.ListTagsForResourcesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTagsForResourcesRequest(*route53.ListTagsForResourcesInput) (*request.Request, *route53.ListTagsForResourcesOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPolicies(*route53.ListTrafficPoliciesInput) (*route53.ListTrafficPoliciesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPoliciesWithContext(aws.Context, *route53.ListTrafficPoliciesInput, ...request.Option) (*route53.ListTrafficPoliciesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPoliciesRequest(*route53.ListTrafficPoliciesInput) (*request.Request, *route53.ListTrafficPoliciesOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPolicyInstances(*route53.ListTrafficPolicyInstancesInput) (*route53.ListTrafficPolicyInstancesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPolicyInstancesWithContext(aws.Context, *route53.ListTrafficPolicyInstancesInput, ...request.Option) (*route53.ListTrafficPolicyInstancesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPolicyInstancesRequest(*route53.ListTrafficPolicyInstancesInput) (*request.Request, *route53.ListTrafficPolicyInstancesOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPolicyInstancesByHostedZone(*route53.ListTrafficPolicyInstancesByHostedZoneInput) (*route53.ListTrafficPolicyInstancesByHostedZoneOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPolicyInstancesByHostedZoneWithContext(aws.Context, *route53.ListTrafficPolicyInstancesByHostedZoneInput, ...request.Option) (*route53.ListTrafficPolicyInstancesByHostedZoneOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPolicyInstancesByHostedZoneRequest(*route53.ListTrafficPolicyInstancesByHostedZoneInput) (*request.Request, *route53.ListTrafficPolicyInstancesByHostedZoneOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPolicyInstancesByPolicy(*route53.ListTrafficPolicyInstancesByPolicyInput) (*route53.ListTrafficPolicyInstancesByPolicyOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPolicyInstancesByPolicyWithContext(aws.Context, *route53.ListTrafficPolicyInstancesByPolicyInput, ...request.Option) (*route53.ListTrafficPolicyInstancesByPolicyOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPolicyInstancesByPolicyRequest(*route53.ListTrafficPolicyInstancesByPolicyInput) (*request.Request, *route53.ListTrafficPolicyInstancesByPolicyOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPolicyVersions(*route53.ListTrafficPolicyVersionsInput) (*route53.ListTrafficPolicyVersionsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPolicyVersionsWithContext(aws.Context, *route53.ListTrafficPolicyVersionsInput, ...request.Option) (*route53.ListTrafficPolicyVersionsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListTrafficPolicyVersionsRequest(*route53.ListTrafficPolicyVersionsInput) (*request.Request, *route53.ListTrafficPolicyVersionsOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListVPCAssociationAuthorizations(*route53.ListVPCAssociationAuthorizationsInput) (*route53.ListVPCAssociationAuthorizationsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListVPCAssociationAuthorizationsWithContext(aws.Context, *route53.ListVPCAssociationAuthorizationsInput, ...request.Option) (*route53.ListVPCAssociationAuthorizationsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListVPCAssociationAuthorizationsRequest(*route53.ListVPCAssociationAuthorizationsInput) (*request.Request, *route53.ListVPCAssociationAuthorizationsOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) TestDNSAnswer(*route53.TestDNSAnswerInput) (*route53.TestDNSAnswerOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) TestDNSAnswerWithContext(aws.Context, *route53.TestDNSAnswerInput, ...request.Option) (*route53.TestDNSAnswerOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) TestDNSAnswerRequest(*route53.TestDNSAnswerInput) (*request.Request, *route53.TestDNSAnswerOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) UpdateHealthCheck(*route53.UpdateHealthCheckInput) (*route53.UpdateHealthCheckOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) UpdateHealthCheckWithContext(aws.Context, *route53.UpdateHealthCheckInput, ...request.Option) (*route53.UpdateHealthCheckOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) UpdateHealthCheckRequest(*route53.UpdateHealthCheckInput) (*request.Request, *route53.UpdateHealthCheckOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) UpdateHostedZoneComment(*route53.UpdateHostedZoneCommentInput) (*route53.UpdateHostedZoneCommentOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) UpdateHostedZoneCommentWithContext(aws.Context, *route53.UpdateHostedZoneCommentInput, ...request.Option) (*route53.UpdateHostedZoneCommentOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) UpdateHostedZoneCommentRequest(*route53.UpdateHostedZoneCommentInput) (*request.Request, *route53.UpdateHostedZoneCommentOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) UpdateTrafficPolicyComment(*route53.UpdateTrafficPolicyCommentInput) (*route53.UpdateTrafficPolicyCommentOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) UpdateTrafficPolicyCommentWithContext(aws.Context, *route53.UpdateTrafficPolicyCommentInput, ...request.Option) (*route53.UpdateTrafficPolicyCommentOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) UpdateTrafficPolicyCommentRequest(*route53.UpdateTrafficPolicyCommentInput) (*request.Request, *route53.UpdateTrafficPolicyCommentOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) UpdateTrafficPolicyInstance(*route53.UpdateTrafficPolicyInstanceInput) (*route53.UpdateTrafficPolicyInstanceOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) UpdateTrafficPolicyInstanceWithContext(aws.Context, *route53.UpdateTrafficPolicyInstanceInput, ...request.Option) (*route53.UpdateTrafficPolicyInstanceOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) UpdateTrafficPolicyInstanceRequest(*route53.UpdateTrafficPolicyInstanceInput) (*request.Request, *route53.UpdateTrafficPolicyInstanceOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) WaitUntilResourceRecordSetsChanged(*route53.GetChangeInput) error {
panic("Not implemented")
return nil
}
func (m *MockRoute53) WaitUntilResourceRecordSetsChangedWithContext(aws.Context, *route53.GetChangeInput, ...request.WaiterOption) error {
panic("Not implemented")
return nil
}
func (m *MockRoute53) CreateQueryLoggingConfig(*route53.CreateQueryLoggingConfigInput) (*route53.CreateQueryLoggingConfigOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateQueryLoggingConfigWithContext(aws.Context, *route53.CreateQueryLoggingConfigInput, ...request.Option) (*route53.CreateQueryLoggingConfigOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) CreateQueryLoggingConfigRequest(*route53.CreateQueryLoggingConfigInput) (*request.Request, *route53.CreateQueryLoggingConfigOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteQueryLoggingConfig(*route53.DeleteQueryLoggingConfigInput) (*route53.DeleteQueryLoggingConfigOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteQueryLoggingConfigWithContext(aws.Context, *route53.DeleteQueryLoggingConfigInput, ...request.Option) (*route53.DeleteQueryLoggingConfigOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) DeleteQueryLoggingConfigRequest(*route53.DeleteQueryLoggingConfigInput) (*request.Request, *route53.DeleteQueryLoggingConfigOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetAccountLimit(*route53.GetAccountLimitInput) (*route53.GetAccountLimitOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetAccountLimitWithContext(aws.Context, *route53.GetAccountLimitInput, ...request.Option) (*route53.GetAccountLimitOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetAccountLimitRequest(*route53.GetAccountLimitInput) (*request.Request, *route53.GetAccountLimitOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHostedZoneLimit(*route53.GetHostedZoneLimitInput) (*route53.GetHostedZoneLimitOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHostedZoneLimitWithContext(aws.Context, *route53.GetHostedZoneLimitInput, ...request.Option) (*route53.GetHostedZoneLimitOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHostedZoneLimitRequest(*route53.GetHostedZoneLimitInput) (*request.Request, *route53.GetHostedZoneLimitOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetQueryLoggingConfig(*route53.GetQueryLoggingConfigInput) (*route53.GetQueryLoggingConfigOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetQueryLoggingConfigWithContext(aws.Context, *route53.GetQueryLoggingConfigInput, ...request.Option) (*route53.GetQueryLoggingConfigOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetQueryLoggingConfigRequest(*route53.GetQueryLoggingConfigInput) (*request.Request, *route53.GetQueryLoggingConfigOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetReusableDelegationSetLimit(*route53.GetReusableDelegationSetLimitInput) (*route53.GetReusableDelegationSetLimitOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetReusableDelegationSetLimitWithContext(aws.Context, *route53.GetReusableDelegationSetLimitInput, ...request.Option) (*route53.GetReusableDelegationSetLimitOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetReusableDelegationSetLimitRequest(*route53.GetReusableDelegationSetLimitInput) (*request.Request, *route53.GetReusableDelegationSetLimitOutput) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListQueryLoggingConfigs(*route53.ListQueryLoggingConfigsInput) (*route53.ListQueryLoggingConfigsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListQueryLoggingConfigsWithContext(aws.Context, *route53.ListQueryLoggingConfigsInput, ...request.Option) (*route53.ListQueryLoggingConfigsOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListQueryLoggingConfigsRequest(*route53.ListQueryLoggingConfigsInput) (*request.Request, *route53.ListQueryLoggingConfigsOutput) {
panic("Not implemented")
return nil, nil
}

View File

@ -27,12 +27,10 @@ import (
func (m *MockRoute53) GetHostedZoneRequest(*route53.GetHostedZoneInput) (*request.Request, *route53.GetHostedZoneOutput) {
panic("MockRoute53 GetHostedZoneRequest not implemented")
return nil, nil
}
func (m *MockRoute53) GetHostedZoneWithContext(aws.Context, *route53.GetHostedZoneInput, ...request.Option) (*route53.GetHostedZoneOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHostedZone(request *route53.GetHostedZoneInput) (*route53.GetHostedZoneOutput, error) {
@ -62,35 +60,28 @@ func (m *MockRoute53) GetHostedZone(request *route53.GetHostedZoneInput) (*route
func (m *MockRoute53) GetHostedZoneCountRequest(*route53.GetHostedZoneCountInput) (*request.Request, *route53.GetHostedZoneCountOutput) {
panic("MockRoute53 GetHostedZoneCountRequest not implemented")
return nil, nil
}
func (m *MockRoute53) GetHostedZoneCountWithContext(aws.Context, *route53.GetHostedZoneCountInput, ...request.Option) (*route53.GetHostedZoneCountOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) GetHostedZoneCount(*route53.GetHostedZoneCountInput) (*route53.GetHostedZoneCountOutput, error) {
panic("MockRoute53 GetHostedZoneCount not implemented")
return nil, nil
}
func (m *MockRoute53) ListHostedZonesRequest(*route53.ListHostedZonesInput) (*request.Request, *route53.ListHostedZonesOutput) {
panic("MockRoute53 ListHostedZonesRequest not implemented")
return nil, nil
}
func (m *MockRoute53) ListHostedZonesWithContext(aws.Context, *route53.ListHostedZonesInput, ...request.Option) (*route53.ListHostedZonesOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListHostedZones(*route53.ListHostedZonesInput) (*route53.ListHostedZonesOutput, error) {
panic("MockRoute53 ListHostedZones not implemented")
return nil, nil
}
func (m *MockRoute53) ListHostedZonesPagesWithContext(aws.Context, *route53.ListHostedZonesInput, func(*route53.ListHostedZonesOutput, bool) bool, ...request.Option) error {
panic("Not implemented")
return nil
}
func (m *MockRoute53) ListHostedZonesPages(request *route53.ListHostedZonesInput, callback func(*route53.ListHostedZonesOutput, bool) bool) error {
@ -112,12 +103,10 @@ func (m *MockRoute53) ListHostedZonesPages(request *route53.ListHostedZonesInput
func (m *MockRoute53) ListHostedZonesByNameRequest(*route53.ListHostedZonesByNameInput) (*request.Request, *route53.ListHostedZonesByNameOutput) {
panic("MockRoute53 ListHostedZonesByNameRequest not implemented")
return nil, nil
}
func (m *MockRoute53) ListHostedZonesByNameWithContext(aws.Context, *route53.ListHostedZonesByNameInput, ...request.Option) (*route53.ListHostedZonesByNameOutput, error) {
panic("Not implemented")
return nil, nil
}
func (m *MockRoute53) ListHostedZonesByName(*route53.ListHostedZonesByNameInput) (*route53.ListHostedZonesByNameOutput, error) {

View File

@ -14,6 +14,7 @@ go_library(
"create_secret_keypair_ca.go",
"create_secret_sshpublickey.go",
"create_secret_tls.go",
"create_secret_weave_encryptionconfig.go",
"delete.go",
"delete_cluster.go",
"delete_instancegroup.go",
@ -77,15 +78,18 @@ go_library(
"//pkg/instancegroups:go_default_library",
"//pkg/kopscodecs:go_default_library",
"//pkg/kubeconfig:go_default_library",
"//pkg/model/components:go_default_library",
"//pkg/pki:go_default_library",
"//pkg/pretty:go_default_library",
"//pkg/resources:go_default_library",
"//pkg/resources/ops:go_default_library",
"//pkg/sshcredentials:go_default_library",
"//pkg/try:go_default_library",
"//pkg/util/templater:go_default_library",
"//pkg/validation:go_default_library",
"//upup/pkg/fi:go_default_library",
"//upup/pkg/fi/cloudup:go_default_library",
"//upup/pkg/fi/cloudup/aliup:go_default_library",
"//upup/pkg/fi/cloudup/awsup:go_default_library",
"//upup/pkg/fi/cloudup/gce:go_default_library",
"//upup/pkg/fi/utils:go_default_library",
@ -110,11 +114,15 @@ go_library(
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
"//vendor/k8s.io/client-go/kubernetes:go_default_library",
"//vendor/k8s.io/client-go/plugin/pkg/client/auth:go_default_library",
"//vendor/k8s.io/client-go/tools/clientcmd:go_default_library",
"//vendor/k8s.io/client-go/util/homedir:go_default_library",
"//vendor/k8s.io/helm/pkg/strvals:go_default_library",
"//vendor/k8s.io/kubernetes/pkg/kubectl/cmd/templates:go_default_library",
"//vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util:go_default_library",
"//vendor/k8s.io/kubernetes/pkg/kubectl/cmd/util/editor:go_default_library",
"//vendor/k8s.io/kubernetes/pkg/kubectl/resource:go_default_library",
"//vendor/k8s.io/kubernetes/pkg/kubectl/genericclioptions:go_default_library",
"//vendor/k8s.io/kubernetes/pkg/kubectl/genericclioptions/resource:go_default_library",
"//vendor/k8s.io/kubernetes/pkg/kubectl/util/i18n:go_default_library",
],
)
@ -124,7 +132,7 @@ go_binary(
embed = [":go_default_library"],
visibility = ["//visibility:public"],
x_defs = {
"k8s.io/kops.Version": "{KOPS_VERSION}", # keep
"k8s.io/kops.Version": "{STABLE_KOPS_VERSION}", # keep
"k8s.io/kops.GitVersion": "{BUILD_SCM_REVISION}", # keep
},
)
@ -139,6 +147,7 @@ go_test(
"delete_confirm_test.go",
"integration_test.go",
"lifecycle_integration_test.go",
"toolbox_template_test.go",
],
data = [
"//channels:channeldata", # keep

View File

@ -142,6 +142,10 @@ func runCompletionBash(out io.Writer, cmd *cobra.Command) error {
}
func runCompletionZsh(out io.Writer, cmd *cobra.Command) error {
zsh_head := "#compdef kops\n"
out.Write([]byte(zsh_head))
zsh_initialization := `
__kops_bash_source() {
alias shopt=':'
@ -284,6 +288,7 @@ __kops_convert_bash_to_zsh() {
BASH_COMPLETION_EOF
}
__kops_bash_source <(__kops_convert_bash_to_zsh)
_complete kops 2>/dev/null
`
out.Write([]byte(zsh_tail))
return nil

View File

@ -33,7 +33,7 @@ import (
"k8s.io/kops/util/pkg/vfs"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/kubectl/resource"
"k8s.io/kubernetes/pkg/kubectl/genericclioptions/resource"
"k8s.io/kubernetes/pkg/kubectl/util/i18n"
)
@ -45,8 +45,8 @@ var (
createLong = templates.LongDesc(i18n.T(`
Create a resource:` + validResources +
`
Create a cluster, instancegroup or secret using command line parameters
or YAML configuration specification files.
Create a cluster, instancegroup or secret using command line parameters,
YAML configuration specification files, or stdin.
(Note: secrets cannot be created from YAML config files yet).
`))
@ -58,6 +58,9 @@ var (
# Create secret from secret spec file
kops create -f secret.yaml
# Create an instancegroup based on the YAML passed into stdin.
cat instancegroup.yaml | kops create -f -
# Create a cluster in AWS
kops create cluster --name=kubernetes-cluster.example.com \
--state=s3://kops-state-1234 --zones=eu-west-1a \
@ -68,7 +71,7 @@ var (
kops create ig --name=k8s-cluster.example.com node-example \
--role node --subnet my-subnet-name
# Create an new ssh public key called admin.
# Create a new ssh public key called admin.
kops create secret sshpublickey admin -i ~/.ssh/id_rsa.pub \
--name k8s-cluster.example.com --state s3://example.com
`))
@ -125,13 +128,20 @@ func RunCreate(f *util.Factory, out io.Writer, c *CreateOptions) error {
var sb bytes.Buffer
fmt.Fprintf(&sb, "\n")
for _, f := range c.Filenames {
contents, err := vfs.Context.ReadFile(f)
if err != nil {
return fmt.Errorf("error reading file %q: %v", f, err)
var contents []byte
if f == "-" {
contents, err = ConsumeStdin()
if err != nil {
return err
}
} else {
contents, err = vfs.Context.ReadFile(f)
if err != nil {
return fmt.Errorf("error reading file %q: %v", f, err)
}
}
// TODO: this does not support a JSON array
sections := bytes.Split(contents, []byte("\n---\n"))
sections := bytes.Split(bytes.Replace(contents, []byte("\r\n"), []byte("\n"), -1), []byte("\n---\n"))
for _, section := range sections {
defaults := &schema.GroupVersionKind{
Group: v1alpha1.SchemeGroupVersion.Group,
@ -156,10 +166,9 @@ func RunCreate(f *util.Factory, out io.Writer, c *CreateOptions) error {
return fmt.Errorf("cluster %q already exists", v.ObjectMeta.Name)
}
return fmt.Errorf("error creating cluster: %v", err)
} else {
fmt.Fprintf(&sb, "Created cluster/%s\n", v.ObjectMeta.Name)
//cSpec = true
}
fmt.Fprintf(&sb, "Created cluster/%s\n", v.ObjectMeta.Name)
//cSpec = true
case *kopsapi.InstanceGroup:
clusterName = v.ObjectMeta.Labels[kopsapi.LabelClusterName]
@ -208,9 +217,8 @@ func RunCreate(f *util.Factory, out io.Writer, c *CreateOptions) error {
err = sshCredentialStore.AddSSHPublicKey("admin", sshKeyArr)
if err != nil {
return err
} else {
fmt.Fprintf(&sb, "Added ssh credential\n")
}
fmt.Fprintf(&sb, "Added ssh credential\n")
default:
glog.V(2).Infof("Type of object was %T", v)

View File

@ -33,6 +33,7 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/kops"
"k8s.io/kops/cmd/kops/util"
api "k8s.io/kops/pkg/apis/kops"
@ -40,10 +41,13 @@ import (
"k8s.io/kops/pkg/apis/kops/registry"
"k8s.io/kops/pkg/apis/kops/validation"
"k8s.io/kops/pkg/assets"
"k8s.io/kops/pkg/commands"
"k8s.io/kops/pkg/dns"
"k8s.io/kops/pkg/featureflag"
"k8s.io/kops/pkg/model/components"
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kops/upup/pkg/fi/cloudup"
"k8s.io/kops/upup/pkg/fi/cloudup/aliup"
"k8s.io/kops/upup/pkg/fi/cloudup/awsup"
"k8s.io/kops/upup/pkg/fi/cloudup/gce"
"k8s.io/kops/upup/pkg/fi/utils"
@ -78,6 +82,7 @@ type CreateClusterOptions struct {
VPCID string
SubnetIDs []string
UtilitySubnetIDs []string
DisableSubnetTags bool
NetworkCIDR string
DNSZone string
AdminAccess []string
@ -121,6 +126,9 @@ type CreateClusterOptions struct {
// Specify API loadbalancer as public or internal
APILoadBalancerType string
// Specify the SSL certificate to use for the API loadbalancer. Currently only supported in AWS.
APISSLCertificate string
// Allow custom public master name
MasterPublicName string
@ -134,6 +142,10 @@ type CreateClusterOptions struct {
// We can remove this once we support higher versions.
VSphereDatastore string
// Spotinst options
SpotinstProduct string
SpotinstOrientation string
// ConfigBase is the location where we will store the configuration, it defaults to the state store
ConfigBase string
@ -220,7 +232,7 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
options := &CreateClusterOptions{}
options.InitDefaults()
sshPublicKey := "~/.ssh/id_rsa.pub"
sshPublicKey := ""
associatePublicIP := false
cmd := &cobra.Command{
@ -241,9 +253,11 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
options.ClusterName = rootCommand.clusterName
options.SSHPublicKeys, err = loadSSHPublicKeys(sshPublicKey, cmd.Flag("ssh-public-key").Changed)
if err != nil {
exitWithError(err)
if sshPublicKey != "" {
options.SSHPublicKeys, err = loadSSHPublicKeys(sshPublicKey)
if err != nil {
exitWithError(fmt.Errorf("error reading SSH key file %q: %v", sshPublicKey, err))
}
}
err = RunCreateCluster(f, out, options)
@ -270,7 +284,7 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
cmd.Flags().StringVar(&options.Project, "project", options.Project, "Project to use (must be set on GCE)")
cmd.Flags().StringVar(&options.KubernetesVersion, "kubernetes-version", options.KubernetesVersion, "Version of kubernetes to run (defaults to version in channel)")
cmd.Flags().StringVar(&sshPublicKey, "ssh-public-key", sshPublicKey, "SSH public key to use")
cmd.Flags().StringVar(&sshPublicKey, "ssh-public-key", sshPublicKey, "SSH public key to use (defaults to ~/.ssh/id_rsa.pub on AWS)")
cmd.Flags().StringVar(&options.NodeSize, "node-size", options.NodeSize, "Set instance size for nodes")
@ -283,6 +297,7 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
cmd.Flags().StringSliceVar(&options.SubnetIDs, "subnets", options.SubnetIDs, "Set to use shared subnets")
cmd.Flags().StringSliceVar(&options.UtilitySubnetIDs, "utility-subnets", options.UtilitySubnetIDs, "Set to use shared utility subnets")
cmd.Flags().StringVar(&options.NetworkCIDR, "network-cidr", options.NetworkCIDR, "Set to override the default network CIDR")
cmd.Flags().BoolVar(&options.DisableSubnetTags, "disable-subnet-tags", options.DisableSubnetTags, "Set to disable automatic subnet tagging")
cmd.Flags().Int32Var(&options.MasterCount, "master-count", options.MasterCount, "Set the number of masters. Defaults to one master per master-zone")
cmd.Flags().Int32Var(&options.NodeCount, "node-count", options.NodeCount, "Set the number of nodes")
@ -306,13 +321,13 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
cmd.Flags().StringVar(&options.Channel, "channel", options.Channel, "Channel for default versions and configuration to use")
// Network topology
cmd.Flags().StringVarP(&options.Topology, "topology", "t", options.Topology, "Controls network topology for the cluster. public|private. Default is 'public'.")
cmd.Flags().StringVarP(&options.Topology, "topology", "t", options.Topology, "Controls network topology for the cluster: public|private.")
// Authorization
cmd.Flags().StringVar(&options.Authorization, "authorization", options.Authorization, "Authorization mode to use: "+AuthorizationFlagAlwaysAllow+" or "+AuthorizationFlagRBAC)
// DNS
cmd.Flags().StringVar(&options.DNSType, "dns", options.DNSType, "DNS hosted zone to use: public|private. Default is 'public'.")
cmd.Flags().StringVar(&options.DNSType, "dns", options.DNSType, "DNS hosted zone to use: public|private.")
// Bastion
cmd.Flags().BoolVar(&options.Bastion, "bastion", options.Bastion, "Pass the --bastion flag to enable a bastion instance group. Only applies to private topology.")
@ -325,6 +340,7 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
cmd.Flags().StringVar(&options.NodeTenancy, "node-tenancy", options.NodeTenancy, "The tenancy of the node group on AWS. Can be either default or dedicated.")
cmd.Flags().StringVar(&options.APILoadBalancerType, "api-loadbalancer-type", options.APILoadBalancerType, "Sets the API loadbalancer type to either 'public' or 'internal'")
cmd.Flags().StringVar(&options.APISSLCertificate, "api-ssl-certificate", options.APISSLCertificate, "Currently only supported in AWS. Sets the ARN of the SSL Certificate to use for the API server loadbalancer.")
// Allow custom public master name
cmd.Flags().StringVar(&options.MasterPublicName, "master-public-name", options.MasterPublicName, "Sets the public master public name")
@ -345,6 +361,13 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
cmd.Flags().StringVar(&options.VSphereCoreDNSServer, "vsphere-coredns-server", options.VSphereCoreDNSServer, "vsphere-coredns-server is required for vSphere.")
cmd.Flags().StringVar(&options.VSphereDatastore, "vsphere-datastore", options.VSphereDatastore, "vsphere-datastore is required for vSphere. Set a valid datastore in which to store dynamic provision volumes.")
}
if featureflag.Spotinst.Enabled() {
// Spotinst flags
cmd.Flags().StringVar(&options.SpotinstProduct, "spotinst-product", options.SpotinstProduct, "Set the product description (valid values: Linux/UNIX, Linux/UNIX (Amazon VPC), Windows and Windows (Amazon VPC))")
cmd.Flags().StringVar(&options.SpotinstOrientation, "spotinst-orientation", options.SpotinstOrientation, "Set the prediction strategy (valid values: balanced, cost, equal-distribution and availability)")
}
return cmd
}
@ -477,9 +500,8 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
if cluster.Spec.CloudProvider == "" {
if allZones.Len() == 0 {
return fmt.Errorf("must specify --zones or --cloud")
} else {
return fmt.Errorf("unable to infer CloudProvider from Zones (is there a typo in --zones?)")
}
return fmt.Errorf("unable to infer CloudProvider from Zones (is there a typo in --zones?)")
}
}
@ -529,6 +551,32 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
cluster.Spec.Subnets = append(cluster.Spec.Subnets, *subnet)
}
zoneToSubnetMap[region] = subnet
} else if api.CloudProviderID(cluster.Spec.CloudProvider) == api.CloudProviderALI {
var zoneToSubnetSwitchID map[string]string
if len(c.Zones) > 0 && len(c.SubnetIDs) > 0 && api.CloudProviderID(cluster.Spec.CloudProvider) == api.CloudProviderALI {
zoneToSubnetSwitchID, err = aliup.ZoneToVSwitchID(cluster.Spec.NetworkID, c.Zones, c.SubnetIDs)
if err != nil {
return err
}
}
for _, zoneName := range allZones.List() {
// We create default subnets named the same as the zones
subnetName := zoneName
subnet := model.FindSubnet(cluster, subnetName)
if subnet == nil {
subnet = &api.ClusterSubnetSpec{
Name: subnetName,
Zone: subnetName,
Egress: c.Egress,
}
if vswitchID, ok := zoneToSubnetSwitchID[zoneName]; ok {
subnet.ProviderID = vswitchID
}
cluster.Spec.Subnets = append(cluster.Spec.Subnets, *subnet)
}
zoneToSubnetMap[zoneName] = subnet
}
} else {
var zoneToSubnetProviderID map[string]string
if len(c.Zones) > 0 && len(c.SubnetIDs) > 0 && api.CloudProviderID(cluster.Spec.CloudProvider) == api.CloudProviderAWS {
@ -806,6 +854,18 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
}
cluster.Spec.CloudConfig.VSphereDatastore = fi.String(c.VSphereDatastore)
}
if featureflag.Spotinst.Enabled() {
if cluster.Spec.CloudConfig == nil {
cluster.Spec.CloudConfig = &api.CloudConfiguration{}
}
if c.SpotinstProduct != "" {
cluster.Spec.CloudConfig.SpotinstProduct = fi.String(c.SpotinstProduct)
}
if c.SpotinstOrientation != "" {
cluster.Spec.CloudConfig.SpotinstOrientation = fi.String(c.SpotinstOrientation)
}
}
}
// Populate project
@ -861,7 +921,17 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
Backend: "udp",
}
case "calico":
cluster.Spec.Networking.Calico = &api.CalicoNetworkingSpec{}
cluster.Spec.Networking.Calico = &api.CalicoNetworkingSpec{
MajorVersion: "v3",
}
// Validate to check if etcd clusters have an acceptable version
if errList := validation.ValidateEtcdVersionForCalicoV3(cluster.Spec.EtcdClusters[0], cluster.Spec.Networking.Calico.MajorVersion, field.NewPath("Calico")); len(errList) != 0 {
// This is not a special version but simply of the 3 series
for _, etcd := range cluster.Spec.EtcdClusters {
etcd.Version = components.DefaultEtcd3Version_1_11
}
}
case "canal":
cluster.Spec.Networking.Canal = &api.CanalNetworkingSpec{}
case "kube-router":
@ -889,6 +959,8 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
c.Topology = api.TopologyPublic
}
cluster.Spec.DisableSubnetTags = c.DisableSubnetTags
switch c.Topology {
case api.TopologyPublic:
cluster.Spec.Topology = &api.TopologySpec{
@ -1030,6 +1102,10 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
}
}
if cluster.Spec.API.LoadBalancer != nil && c.APISSLCertificate != "" {
cluster.Spec.API.LoadBalancer.SSLCertificate = c.APISSLCertificate
}
// Use Strict IAM policy and allow AWS ECR by default when creating a new cluster
cluster.Spec.IAM = &api.IAMSpec{
AllowContainerRegistry: true,
@ -1047,7 +1123,7 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
cluster.Spec.SSHAccess = c.SSHAccess
}
if err := setOverrides(c.Overrides, cluster, instanceGroups); err != nil {
if err := commands.SetClusterFields(c.Overrides, cluster, instanceGroups); err != nil {
return err
}
@ -1124,6 +1200,29 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
return fmt.Errorf("error writing completed cluster spec: %v", err)
}
if len(c.SSHPublicKeys) == 0 {
autoloadSSHPublicKeys := true
switch c.Cloud {
case "gce":
// We don't normally use SSH keys on GCE
autoloadSSHPublicKeys = false
}
if autoloadSSHPublicKeys {
// Load from default location, if found
sshPublicKeyPath := "~/.ssh/id_rsa.pub"
c.SSHPublicKeys, err = loadSSHPublicKeys(sshPublicKeyPath)
if err != nil {
// Don't wrap file-not-found
if os.IsNotExist(err) {
glog.V(2).Infof("ssh key not found at %s", sshPublicKeyPath)
} else {
return fmt.Errorf("error reading SSH key file %q: %v", sshPublicKeyPath, err)
}
}
}
}
if len(c.SSHPublicKeys) != 0 {
sshCredentialStore, err := clientset.SSHCredentialStore(cluster)
if err != nil {
@ -1138,7 +1237,7 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
}
}
// Can we acutally get to this if??
// Can we actually get to this if??
if targetName != "" {
if isDryrun {
fmt.Fprintf(out, "Previewing changes that will be made:\n\n")
@ -1252,29 +1351,6 @@ func parseCloudLabels(s string) (map[string]string, error) {
return m, nil
}
// setOverrides sets override values in the spec
func setOverrides(overrides []string, cluster *api.Cluster, instanceGroups []*api.InstanceGroup) error {
for _, override := range overrides {
kv := strings.SplitN(override, "=", 2)
if len(kv) != 2 {
return fmt.Errorf("unhandled override: %q", override)
}
// For now we have hard-code the values we want to support; we'll get test coverage and then do this properly...
switch kv[0] {
case "cluster.spec.nodePortAccess":
cluster.Spec.NodePortAccess = append(cluster.Spec.NodePortAccess, kv[1])
case "cluster.spec.etcdClusters[*].version":
for _, etcd := range cluster.Spec.EtcdClusters {
etcd.Version = kv[1]
}
default:
return fmt.Errorf("unhandled override: %q", override)
}
}
return nil
}
func getZoneToSubnetProviderID(VPCID string, region string, subnetIDs []string) (map[string]string, error) {
res := make(map[string]string)
cloudTags := map[string]string{}
@ -1306,23 +1382,16 @@ func getZoneToSubnetProviderID(VPCID string, region string, subnetIDs []string)
return res, nil
}
func loadSSHPublicKeys(sshPublicKey string, flagSpecified bool) (map[string][]byte, error) {
func loadSSHPublicKeys(sshPublicKey string) (map[string][]byte, error) {
sshPublicKeys := make(map[string][]byte)
if sshPublicKey != "" {
sshPublicKey = utils.ExpandPath(sshPublicKey)
authorized, err := ioutil.ReadFile(sshPublicKey)
if err != nil {
// Ignore file-not-found unless the user actively specified the flag
if !flagSpecified && os.IsNotExist(err) {
glog.V(2).Infof("SSH key file %q does not exist; ignoring", sshPublicKey)
} else {
return nil, fmt.Errorf("error reading SSH key file %q: %v", sshPublicKey, err)
}
} else {
sshPublicKeys[fi.SecretNameSSHPrimary] = authorized
glog.Infof("Using SSH public key: %v\n", sshPublicKey)
return nil, err
}
sshPublicKeys[fi.SecretNameSSHPrimary] = authorized
glog.Infof("Using SSH public key: %v\n", sshPublicKey)
}
return sshPublicKeys, nil
}

View File

@ -19,6 +19,7 @@ package main
import (
"bytes"
"io/ioutil"
"os"
"path"
"strings"
"testing"
@ -89,6 +90,12 @@ func TestCreateClusterWithNGWSpecified(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ngwspecified", "v1alpha2")
}
// TestCreateClusterWithINGWSpecified runs kops create cluster private.example.com --zones us-test-1a --master-zones us-test-1a
func TestCreateClusterWithINGWSpecified(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ingwspecified", "v1alpha1")
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ingwspecified", "v1alpha2")
}
// TestCreateClusterSharedVPC runs kops create cluster vpc.example.com --zones us-test-1a --master-zones us-test-1a --vpc vpc-12345678
func TestCreateClusterSharedVPC(t *testing.T) {
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/shared_vpc", "v1alpha1")
@ -243,16 +250,32 @@ func runCreateClusterIntegrationTest(t *testing.T, srcDir string, version string
t.Fatalf("unexpected error reading expected YAML: %v", err)
}
expectedYAML := strings.TrimSpace(string(expectedYAMLBytes))
//on windows, with git set to autocrlf, the reference files on disk have windows line endings
expectedYAML := strings.Replace(strings.TrimSpace(string(expectedYAMLBytes)), "\r\n", "\n", -1)
actualYAML := strings.Join(yamlAll, "\n\n---\n\n")
if actualYAML != expectedYAML {
p := path.Join(srcDir, expectedClusterPath)
if os.Getenv("HACK_UPDATE_EXPECTED_IN_PLACE") != "" {
t.Logf("HACK_UPDATE_EXPECTED_IN_PLACE: writing expected output %s", p)
// Format nicely - keep git happy
s := actualYAML
s = strings.TrimSpace(s)
s = s + "\n"
if err := ioutil.WriteFile(p, []byte(s), 0644); err != nil {
t.Errorf("error writing expected output %s: %v", p, err)
}
}
glog.Infof("Actual YAML:\n%s\n", actualYAML)
diffString := diff.FormatDiff(expectedYAML, actualYAML)
t.Logf("diff:\n%s\n", diffString)
t.Fatalf("YAML differed from expected (%s)", path.Join(srcDir, expectedClusterPath))
t.Errorf("YAML differed from expected (%s)", p)
}
}

View File

@ -36,9 +36,8 @@ func checkParse(t *testing.T, s string, expect map[string]string, shouldErr bool
if err != nil {
if shouldErr {
return
} else {
t.Errorf(err.Error())
}
t.Errorf(err.Error())
}
for k, v := range expect {

View File

@ -31,6 +31,7 @@ import (
api "k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/apis/kops/validation"
"k8s.io/kops/pkg/kopscodecs"
"k8s.io/kops/pkg/try"
"k8s.io/kops/upup/pkg/fi/cloudup"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
"k8s.io/kubernetes/pkg/kubectl/cmd/util/editor"
@ -204,7 +205,7 @@ func RunCreateInstanceGroup(f *util.Factory, cmd *cobra.Command, args []string,
edited, file, err := edit.LaunchTempFile(fmt.Sprintf("%s-edit-", filepath.Base(os.Args[0])), ext, bytes.NewReader(raw))
defer func() {
if file != "" {
os.Remove(file)
try.RemoveFile(file)
}
}()
if err != nil {

View File

@ -30,7 +30,7 @@ var (
Create a secret`))
createSecretExample = templates.Examples(i18n.T(`
# Create an new ssh public key called admin.
# Create a new ssh public key called admin.
kops create secret sshpublickey admin -i ~/.ssh/id_rsa.pub \
--name k8s-cluster.example.com --state s3://example.com
@ -57,6 +57,7 @@ func NewCmdCreateSecret(f *util.Factory, out io.Writer) *cobra.Command {
cmd.AddCommand(NewCmdCreateSecretDockerConfig(f, out))
cmd.AddCommand(NewCmdCreateSecretEncryptionConfig(f, out))
cmd.AddCommand(NewCmdCreateKeypairSecret(f, out))
cmd.AddCommand(NewCmdCreateSecretWeaveEncryptionConfig(f, out))
return cmd
}

View File

@ -37,9 +37,12 @@ var (
Use update to modify it, this command will only create a new entry.`))
createSecretDockerconfigExample = templates.Examples(i18n.T(`
# Create an new docker config.
# Create a new docker config.
kops create secret dockerconfig -f /path/to/docker/config.json \
--name k8s-cluster.example.com --state s3://example.com
# Create a docker config via stdin.
generate-docker-config.sh | kops create secret dockerconfig -f - \
--name k8s-cluster.example.com --state s3://example.com
# Replace an existing docker config secret.
kops create secret dockerconfig -f /path/to/docker/config.json --force \
--name k8s-cluster.example.com --state s3://example.com
@ -110,10 +113,17 @@ func RunCreateSecretDockerConfig(f *util.Factory, out io.Writer, options *Create
if err != nil {
return err
}
data, err := ioutil.ReadFile(options.DockerConfigPath)
if err != nil {
return fmt.Errorf("error reading docker config %v: %v", options.DockerConfigPath, err)
var data []byte
if options.DockerConfigPath == "-" {
data, err = ConsumeStdin()
if err != nil {
return fmt.Errorf("error reading docker config from stdin: %v", err)
}
} else {
data, err = ioutil.ReadFile(options.DockerConfigPath)
if err != nil {
return fmt.Errorf("error reading docker config %v: %v", options.DockerConfigPath, err)
}
}
var parsedData map[string]interface{}

View File

@ -40,6 +40,9 @@ var (
# Create a new encryption config.
kops create secret encryptionconfig -f config.yaml \
--name k8s-cluster.example.com --state s3://example.com
# Create a new encryption config via stdin.
generate-encryption-config.sh | kops create secret encryptionconfig -f - \
--name k8s-cluster.example.com --state s3://example.com
# Replace an existing encryption config secret.
kops create secret encryptionconfig -f config.yaml --force \
--name k8s-cluster.example.com --state s3://example.com
@ -111,10 +114,17 @@ func RunCreateSecretEncryptionConfig(f *util.Factory, out io.Writer, options *Cr
if err != nil {
return err
}
data, err := ioutil.ReadFile(options.EncryptionConfigPath)
if err != nil {
return fmt.Errorf("error reading encryption config %v: %v", options.EncryptionConfigPath, err)
var data []byte
if options.EncryptionConfigPath == "-" {
data, err = ConsumeStdin()
if err != nil {
return fmt.Errorf("error reading encryption config from stdin: %v", err)
}
} else {
data, err = ioutil.ReadFile(options.EncryptionConfigPath)
if err != nil {
return fmt.Errorf("error reading encryption config %v: %v", options.EncryptionConfigPath, err)
}
}
var parsedData map[string]interface{}

View File

@ -34,12 +34,12 @@ var (
key is not updated by this command.`))
createSecretSSHPublicKeyExample = templates.Examples(i18n.T(`
# Create an new ssh public key called admin.
# Create a new ssh public key called admin.
kops create secret sshpublickey admin -i ~/.ssh/id_rsa.pub \
--name k8s-cluster.example.com --state s3://example.com
`))
createSecretSSHPublicKeyShort = i18n.T(`Create a ssh public key.`)
createSecretSSHPublicKeyShort = i18n.T(`Create an ssh public key.`)
)
type CreateSecretPublickeyOptions struct {

View File

@ -0,0 +1,151 @@
/*
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"
"io"
"io/ioutil"
"github.com/spf13/cobra"
"k8s.io/kops/cmd/kops/util"
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
"k8s.io/kubernetes/pkg/kubectl/util/i18n"
)
var (
createSecretWeaveEncryptionconfigLong = templates.LongDesc(i18n.T(`
Create a new weave encryption secret, and store it in the state store.
Used to weave networking to use encrypted communication between nodes.
If no password is provided, kops will generate one at random.
WARNING: cannot be enabled on a running cluster without downtime.`))
createSecretWeaveEncryptionconfigExample = templates.Examples(i18n.T(`
# Create a new random weave password.
kops create secret weavepassword \
--name k8s-cluster.example.com --state s3://example.com
# Install a specific weave password.
kops create secret weavepassword -f /path/to/weavepassword \
--name k8s-cluster.example.com --state s3://example.com
# Install a specific weave password via stdin.
kops create secret weavepassword -f - \
--name k8s-cluster.example.com --state s3://example.com
# Replace an existing weavepassword secret.
kops create secret weavepassword -f /path/to/weavepassword --force \
--name k8s-cluster.example.com --state s3://example.com
`))
createSecretWeaveEncryptionconfigShort = i18n.T(`Create a weave encryption config.`)
)
type CreateSecretWeaveEncryptionConfigOptions struct {
ClusterName string
WeavePasswordFilePath string
Force bool
}
func NewCmdCreateSecretWeaveEncryptionConfig(f *util.Factory, out io.Writer) *cobra.Command {
options := &CreateSecretWeaveEncryptionConfigOptions{}
cmd := &cobra.Command{
Use: "weavepassword",
Short: createSecretWeaveEncryptionconfigShort,
Long: createSecretWeaveEncryptionconfigLong,
Example: createSecretWeaveEncryptionconfigExample,
Run: func(cmd *cobra.Command, args []string) {
err := rootCommand.ProcessArgs(args[0:])
if err != nil {
exitWithError(err)
}
options.ClusterName = rootCommand.ClusterName()
err = RunCreateSecretWeaveEncryptionConfig(f, options)
if err != nil {
exitWithError(err)
}
},
}
cmd.Flags().StringVarP(&options.WeavePasswordFilePath, "", "f", "", "Path to the weave password file (optional)")
cmd.Flags().BoolVar(&options.Force, "force", options.Force, "Force replace the kops secret if it already exists")
return cmd
}
func RunCreateSecretWeaveEncryptionConfig(f *util.Factory, options *CreateSecretWeaveEncryptionConfigOptions) error {
secret, err := fi.CreateSecret()
if err != nil {
return fmt.Errorf("error creating encryption secret: %v", err)
}
cluster, err := GetCluster(f, options.ClusterName)
if err != nil {
return err
}
clientset, err := f.Clientset()
if err != nil {
return err
}
secretStore, err := clientset.SecretStore(cluster)
if err != nil {
return err
}
if options.WeavePasswordFilePath != "" {
var data []byte
if options.WeavePasswordFilePath == "-" {
data, err = ConsumeStdin()
if err != nil {
return fmt.Errorf("error reading weave password file from stdin: %v", err)
}
} else {
data, err = ioutil.ReadFile(options.WeavePasswordFilePath)
if err != nil {
return fmt.Errorf("error reading weave password file %v: %v", options.WeavePasswordFilePath, err)
}
}
secret.Data = data
}
if !options.Force {
_, created, err := secretStore.GetOrCreateSecret("weavepassword", secret)
if err != nil {
return fmt.Errorf("error adding weavepassword secret: %v", err)
}
if !created {
return fmt.Errorf("failed to create the weavepassword secret as it already exists. The `--force` flag can be passed to replace an existing secret")
}
} else {
_, err := secretStore.ReplaceSecret("weavepassword", secret)
if err != nil {
return fmt.Errorf("error updating weavepassword secret: %v", err)
}
}
return nil
}

View File

@ -34,7 +34,7 @@ import (
"k8s.io/kops/util/pkg/vfs"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/kubectl/resource"
"k8s.io/kubernetes/pkg/kubectl/genericclioptions/resource"
"k8s.io/kubernetes/pkg/kubectl/util/i18n"
)
@ -51,7 +51,10 @@ var (
deleteExample = templates.Examples(i18n.T(`
# Delete a cluster using a manifest file
kops delete -f my-cluster.yaml
# Delete a cluster using a pasted manifest file from stdin.
pbpaste | kops delete -f -
# Delete a cluster in AWS.
kops delete cluster --name=k8s.example.com --state=s3://kops-state-1234
@ -101,9 +104,18 @@ func RunDelete(factory *util.Factory, out io.Writer, d *DeleteOptions) error {
deletedClusters := sets.NewString()
for _, f := range d.Filenames {
contents, err := vfs.Context.ReadFile(f)
if err != nil {
return fmt.Errorf("error reading file %q: %v", f, err)
var contents []byte
var err error
if f == "-" {
contents, err = ConsumeStdin()
if err != nil {
return fmt.Errorf("error reading from stdin: %v", err)
}
} else {
contents, err = vfs.Context.ReadFile(f)
if err != nil {
return fmt.Errorf("error reading file %q: %v", f, err)
}
}
sections := bytes.Split(contents, []byte("\n---\n"))

View File

@ -34,6 +34,7 @@ import (
"k8s.io/kops/pkg/commands"
"k8s.io/kops/pkg/edit"
"k8s.io/kops/pkg/kopscodecs"
"k8s.io/kops/pkg/try"
"k8s.io/kops/upup/pkg/fi/cloudup"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
util_editor "k8s.io/kubernetes/pkg/kubectl/cmd/util/editor"
@ -147,11 +148,11 @@ func RunEditCluster(f *util.Factory, cmd *cobra.Command, args []string, out io.W
}
if len(results.file) > 0 {
os.Remove(results.file)
try.RemoveFile(results.file)
}
if bytes.Equal(stripComments(raw), stripComments(edited)) {
os.Remove(file)
try.RemoveFile(file)
fmt.Fprintln(out, "Edit cancelled, no changes made.")
return nil
}
@ -161,7 +162,7 @@ func RunEditCluster(f *util.Factory, cmd *cobra.Command, args []string, out io.W
return preservedFile(err, file, out)
}
if !lines {
os.Remove(file)
try.RemoveFile(file)
fmt.Fprintln(out, "Edit cancelled, saved file was empty.")
return nil
}

View File

@ -30,6 +30,7 @@ import (
"k8s.io/kops/pkg/apis/kops/validation"
"k8s.io/kops/pkg/assets"
"k8s.io/kops/pkg/kopscodecs"
"k8s.io/kops/pkg/try"
"k8s.io/kops/upup/pkg/fi/cloudup"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
"k8s.io/kubernetes/pkg/kubectl/cmd/util/editor"
@ -48,7 +49,7 @@ var (
editInstancegroupExample = templates.Examples(i18n.T(`
# Edit an instancegroup desired configuration.
kops edit ig --name k8s-cluster.example.com node --state=s3://kops-state-1234
kops edit ig --name k8s-cluster.example.com nodes --state=s3://kops-state-1234
`))
editInstancegroupShort = i18n.T(`Edit instancegroup.`)
@ -129,7 +130,7 @@ func RunEditInstanceGroup(f *util.Factory, cmd *cobra.Command, args []string, ou
edited, file, err := edit.LaunchTempFile(fmt.Sprintf("%s-edit-", filepath.Base(os.Args[0])), ext, bytes.NewReader(raw))
defer func() {
if file != "" {
os.Remove(file)
try.RemoveFile(file)
}
}()
if err != nil {

View File

@ -126,29 +126,18 @@ func RunGet(context Factory, out io.Writer, options *GetOptions) error {
return fmt.Errorf("No cluster found")
}
clusterList := &api.ClusterList{}
clusterList.Items = make([]api.Cluster, 1)
clusterList.Items[0] = *cluster
args := make([]string, 0)
clusters, err := buildClusters(args, clusterList)
if err != nil {
return fmt.Errorf("error on buildClusters(): %v", err)
}
ig, err := client.InstanceGroupsFor(cluster).List(metav1.ListOptions{})
igList, err := client.InstanceGroupsFor(cluster).List(metav1.ListOptions{})
if err != nil {
return err
}
if ig == nil || ig.Items == nil || len(ig.Items) == 0 {
if igList == nil || igList.Items == nil || len(igList.Items) == 0 {
fmt.Fprintf(os.Stderr, "No instance groups found\n")
}
instancegroups, err := buildInstanceGroups(args, ig)
if err != nil {
return err
var instancegroups []*api.InstanceGroup
for i := range igList.Items {
instancegroups = append(instancegroups, &igList.Items[i])
}
var obj []runtime.Object
@ -175,7 +164,7 @@ func RunGet(context Factory, out io.Writer, options *GetOptions) error {
case OutputTable:
fmt.Fprintf(os.Stdout, "Cluster\n")
err = clusterOutputTable(clusters, out)
err = clusterOutputTable([]*api.Cluster{cluster}, out)
if err != nil {
return err
}

View File

@ -23,6 +23,7 @@ import (
"strings"
"github.com/spf13/cobra"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/sets"
@ -122,12 +123,28 @@ func RunGetClusters(context Factory, out io.Writer, options *GetClusterOptions)
return err
}
clusterList, err := client.ListClusters(metav1.ListOptions{})
if err != nil {
return err
var clusterList []*api.Cluster
if len(options.ClusterNames) != 1 {
list, err := client.ListClusters(metav1.ListOptions{})
if err != nil {
return err
}
for i := range list.Items {
clusterList = append(clusterList, &list.Items[i])
}
} else {
// Optimization - avoid fetching all clusters if we're only querying one
cluster, err := client.GetCluster(options.ClusterNames[0])
if err != nil {
if !apierrors.IsNotFound(err) {
return err
}
} else {
clusterList = append(clusterList, cluster)
}
}
clusters, err := buildClusters(options.ClusterNames, clusterList)
clusters, err := filterClustersByName(options.ClusterNames, clusterList)
if err != nil {
return err
}
@ -165,27 +182,25 @@ func RunGetClusters(context Factory, out io.Writer, options *GetClusterOptions)
}
}
func buildClusters(args []string, clusterList *api.ClusterList) ([]*api.Cluster, error) {
var clusters []*api.Cluster
if len(args) != 0 {
// filterClustersByName returns the clusters matching the specified names.
// If names are specified and no cluster is found with a name, we return an error.
func filterClustersByName(clusterNames []string, clusters []*api.Cluster) ([]*api.Cluster, error) {
if len(clusterNames) != 0 {
// Build a map as we want to return them in the same order as args
m := make(map[string]*api.Cluster)
for i := range clusterList.Items {
c := &clusterList.Items[i]
for _, c := range clusters {
m[c.ObjectMeta.Name] = c
}
for _, clusterName := range args {
var filtered []*api.Cluster
for _, clusterName := range clusterNames {
c := m[clusterName]
if c == nil {
return nil, fmt.Errorf("cluster not found %q", clusterName)
}
clusters = append(clusters, c)
}
} else {
for i := range clusterList.Items {
c := &clusterList.Items[i]
clusters = append(clusters, c)
filtered = append(filtered, c)
}
return filtered, nil
}
return clusters, nil

View File

@ -104,7 +104,7 @@ func RunGetInstanceGroups(options *GetInstanceGroupsOptions, args []string) erro
return err
}
instancegroups, err := buildInstanceGroups(args, list)
instancegroups, err := filterInstanceGroupsByName(args, list.Items)
if err != nil {
return err
}
@ -132,27 +132,26 @@ func RunGetInstanceGroups(options *GetInstanceGroupsOptions, args []string) erro
}
}
func buildInstanceGroups(args []string, list *api.InstanceGroupList) ([]*api.InstanceGroup, error) {
func filterInstanceGroupsByName(instanceGroupNames []string, list []api.InstanceGroup) ([]*api.InstanceGroup, error) {
var instancegroups []*api.InstanceGroup
len := len(args)
if len != 0 {
if len(instanceGroupNames) != 0 {
// Build a map so we can return items in the same order
m := make(map[string]*api.InstanceGroup)
for i := range list.Items {
ig := &list.Items[i]
for i := range list {
ig := &list[i]
m[ig.ObjectMeta.Name] = ig
}
instancegroups = make([]*api.InstanceGroup, 0, len)
for _, arg := range args {
ig := m[arg]
for _, name := range instanceGroupNames {
ig := m[name]
if ig == nil {
return nil, fmt.Errorf("instancegroup not found %q", arg)
return nil, fmt.Errorf("instancegroup not found %q", name)
}
instancegroups = append(instancegroups, ig)
}
} else {
for i := range list.Items {
ig := &list.Items[i]
for i := range list {
ig := &list[i]
instancegroups = append(instancegroups, ig)
}
}
@ -179,7 +178,7 @@ func igOutputTable(cluster *api.Cluster, instancegroups []*api.InstanceGroup, ou
t.AddColumn("MAX", func(c *api.InstanceGroup) string {
return int32PointerToString(c.Spec.MaxSize)
})
// SUBNETS is not not selected by default - not as useful as ZONES
// SUBNETS is not selected by default - not as useful as ZONES
return t.Render(instancegroups, os.Stdout, "NAME", "ROLE", "MACHINETYPE", "MIN", "MAX", "ZONES")
}

View File

@ -52,15 +52,20 @@ const updateClusterTestBase = "../../tests/integration/update_cluster/"
// TestMinimal runs the test on a minimum configuration, similar to kops create cluster minimal.example.com --zones us-west-1a
func TestMinimal(t *testing.T) {
runTestAWS(t, "minimal.example.com", "minimal", "v1alpha0", false, 1)
runTestAWS(t, "minimal.example.com", "minimal", "v1alpha1", false, 1)
runTestAWS(t, "minimal.example.com", "minimal", "v1alpha2", false, 1)
runTestAWS(t, "minimal.example.com", "minimal", "v1alpha0", false, 1, true, nil)
runTestAWS(t, "minimal.example.com", "minimal", "v1alpha1", false, 1, true, nil)
runTestAWS(t, "minimal.example.com", "minimal", "v1alpha2", false, 1, true, nil)
}
// TestRestrictAccess runs the test on a simple SG configuration, similar to kops create cluster minimal.example.com --ssh-access=$(IPS) --admin-access=$(IPS) --master-count=3
func TestRestrictAccess(t *testing.T) {
runTestAWS(t, "restrictaccess.example.com", "restrict_access", "v1alpha2", false, 1, true, nil)
}
// TestHA runs the test on a simple HA configuration, similar to kops create cluster minimal.example.com --zones us-west-1a,us-west-1b,us-west-1c --master-count=3
func TestHA(t *testing.T) {
runTestAWS(t, "ha.example.com", "ha", "v1alpha1", false, 3)
runTestAWS(t, "ha.example.com", "ha", "v1alpha2", false, 3)
runTestAWS(t, "ha.example.com", "ha", "v1alpha1", false, 3, true, nil)
runTestAWS(t, "ha.example.com", "ha", "v1alpha2", false, 3, true, nil)
}
// TestHighAvailabilityGCE runs the test on a simple HA GCE configuration, similar to kops create cluster ha-gce.example.com
@ -71,81 +76,105 @@ func TestHighAvailabilityGCE(t *testing.T) {
// TestComplex runs the test on a more complex configuration, intended to hit more of the edge cases
func TestComplex(t *testing.T) {
runTestAWS(t, "complex.example.com", "complex", "v1alpha2", false, 1)
runTestAWS(t, "complex.example.com", "complex", "v1alpha2", false, 1, true, nil)
}
// TestMinimalCloudformation runs the test on a minimum configuration, similar to kops create cluster minimal.example.com --zones us-west-1a
func TestMinimalCloudformation(t *testing.T) {
runTestCloudformation(t, "minimal.example.com", "minimal-cloudformation", "v1alpha2", false)
runTestCloudformation(t, "minimal.example.com", "minimal-cloudformation", "v1alpha2", false, nil)
}
// TestExistingIAMCloudformation runs the test with existing IAM instance profiles, similar to kops create cluster minimal.example.com --zones us-west-1a
func TestExistingIAMCloudformation(t *testing.T) {
lifecycleOverrides := []string{"IAMRole=ExistsAndWarnIfChanges", "IAMRolePolicy=ExistsAndWarnIfChanges", "IAMInstanceProfileRole=ExistsAndWarnIfChanges"}
runTestCloudformation(t, "minimal.example.com", "existing_iam_cloudformation", "v1alpha2", false, lifecycleOverrides)
}
// TestExistingSG runs the test with existing Security Group, similar to kops create cluster minimal.example.com --zones us-west-1a
func TestExistingSG(t *testing.T) {
lifecycleOverrides := []string{"SecurityGroup=ExistsAndWarnIfChanges", "SecurityGroupRule=ExistsAndWarnIfChanges"}
lifecycleOverrides = nil
runTestAWS(t, "existingsg.example.com", "existing_sg", "v1alpha2", false, 3, true, lifecycleOverrides)
}
// TestAdditionalUserData runs the test on passing additional user-data to an instance at bootstrap.
func TestAdditionalUserData(t *testing.T) {
runTestCloudformation(t, "additionaluserdata.example.com", "additional_user-data", "v1alpha2", false)
runTestCloudformation(t, "additionaluserdata.example.com", "additional_user-data", "v1alpha2", false, nil)
}
// TestBastionAdditionalUserData runs the test on passing additional user-data to a bastion instance group
func TestBastionAdditionalUserData(t *testing.T) {
runTestAWS(t, "bastionuserdata.example.com", "bastionadditional_user-data", "v1alpha2", true, 1)
runTestAWS(t, "bastionuserdata.example.com", "bastionadditional_user-data", "v1alpha2", true, 1, true, nil)
}
// TestMinimal_141 runs the test on a configuration from 1.4.1 release
func TestMinimal_141(t *testing.T) {
runTestAWS(t, "minimal-141.example.com", "minimal-141", "v1alpha0", false, 1)
runTestAWS(t, "minimal-141.example.com", "minimal-141", "v1alpha0", false, 1, true, nil)
}
// TestPrivateWeave runs the test on a configuration with private topology, weave networking
func TestPrivateWeave(t *testing.T) {
runTestAWS(t, "privateweave.example.com", "privateweave", "v1alpha1", true, 1)
runTestAWS(t, "privateweave.example.com", "privateweave", "v1alpha2", true, 1)
runTestAWS(t, "privateweave.example.com", "privateweave", "v1alpha1", true, 1, true, nil)
runTestAWS(t, "privateweave.example.com", "privateweave", "v1alpha2", true, 1, true, nil)
}
// TestPrivateFlannel runs the test on a configuration with private topology, flannel networking
func TestPrivateFlannel(t *testing.T) {
runTestAWS(t, "privateflannel.example.com", "privateflannel", "v1alpha1", true, 1)
runTestAWS(t, "privateflannel.example.com", "privateflannel", "v1alpha2", true, 1)
runTestAWS(t, "privateflannel.example.com", "privateflannel", "v1alpha1", true, 1, true, nil)
runTestAWS(t, "privateflannel.example.com", "privateflannel", "v1alpha2", true, 1, true, nil)
}
// TestPrivateCalico runs the test on a configuration with private topology, calico networking
func TestPrivateCalico(t *testing.T) {
runTestAWS(t, "privatecalico.example.com", "privatecalico", "v1alpha1", true, 1)
runTestAWS(t, "privatecalico.example.com", "privatecalico", "v1alpha2", true, 1)
runTestAWS(t, "privatecalico.example.com", "privatecalico", "v1alpha1", true, 1, true, nil)
runTestAWS(t, "privatecalico.example.com", "privatecalico", "v1alpha2", true, 1, true, nil)
}
// TestPrivateCanal runs the test on a configuration with private topology, canal networking
func TestPrivateCanal(t *testing.T) {
runTestAWS(t, "privatecanal.example.com", "privatecanal", "v1alpha1", true, 1)
runTestAWS(t, "privatecanal.example.com", "privatecanal", "v1alpha2", true, 1)
runTestAWS(t, "privatecanal.example.com", "privatecanal", "v1alpha1", true, 1, true, nil)
runTestAWS(t, "privatecanal.example.com", "privatecanal", "v1alpha2", true, 1, true, nil)
}
// TestPrivateKopeio runs the test on a configuration with private topology, kopeio networking
func TestPrivateKopeio(t *testing.T) {
runTestAWS(t, "privatekopeio.example.com", "privatekopeio", "v1alpha2", true, 1)
runTestAWS(t, "privatekopeio.example.com", "privatekopeio", "v1alpha2", true, 1, true, nil)
}
// TestPrivateSharedSubnet runs the test on a configuration with private topology & shared subnets
func TestPrivateSharedSubnet(t *testing.T) {
runTestAWS(t, "private-shared-subnet.example.com", "private-shared-subnet", "v1alpha2", true, 1)
runTestAWS(t, "private-shared-subnet.example.com", "private-shared-subnet", "v1alpha2", true, 1, true, nil)
}
// TestPrivateDns1 runs the test on a configuration with private topology, private dns
func TestPrivateDns1(t *testing.T) {
runTestAWS(t, "privatedns1.example.com", "privatedns1", "v1alpha2", true, 1)
runTestAWS(t, "privatedns1.example.com", "privatedns1", "v1alpha2", true, 1, true, nil)
}
// TestPrivateDns2 runs the test on a configuration with private topology, private dns, extant vpc
func TestPrivateDns2(t *testing.T) {
runTestAWS(t, "privatedns2.example.com", "privatedns2", "v1alpha2", true, 1)
runTestAWS(t, "privatedns2.example.com", "privatedns2", "v1alpha2", true, 1, true, nil)
}
// TestSharedSubnet runs the test on a configuration with a shared subnet (and VPC)
func TestSharedSubnet(t *testing.T) {
runTestAWS(t, "sharedsubnet.example.com", "shared_subnet", "v1alpha2", false, 1)
runTestAWS(t, "sharedsubnet.example.com", "shared_subnet", "v1alpha2", false, 1, true, nil)
}
// TestSharedVPC runs the test on a configuration with a shared VPC
func TestSharedVPC(t *testing.T) {
runTestAWS(t, "sharedvpc.example.com", "shared_vpc", "v1alpha2", false, 1)
runTestAWS(t, "sharedvpc.example.com", "shared_vpc", "v1alpha2", false, 1, true, nil)
}
// TestExistingIAM runs the test on a configuration with existing IAM instance profiles
func TestExistingIAM(t *testing.T) {
lifecycleOverrides := []string{"IAMRole=ExistsAndWarnIfChanges", "IAMRolePolicy=ExistsAndWarnIfChanges", "IAMInstanceProfileRole=ExistsAndWarnIfChanges"}
runTestAWS(t, "existing-iam.example.com", "existing_iam", "v1alpha2", false, 3, false, lifecycleOverrides)
}
// TestAdditionalCIDR runs the test on a configuration with a shared VPC
func TestAdditionalCIDR(t *testing.T) {
runTestCloudformation(t, "additionalcidr.example.com", "additional_cidr", "v1alpha2", false, nil)
}
// TestPhaseNetwork tests the output of tf for the network phase
@ -153,6 +182,11 @@ func TestPhaseNetwork(t *testing.T) {
runTestPhase(t, "lifecyclephases.example.com", "lifecycle_phases", "v1alpha2", true, 1, cloudup.PhaseNetwork)
}
func TestExternalLoadBalancer(t *testing.T) {
runTestAWS(t, "externallb.example.com", "externallb", "v1alpha2", false, 1, true, nil)
runTestCloudformation(t, "externallb.example.com", "externallb", "v1alpha2", false, nil)
}
// TestPhaseIAM tests the output of tf for the iam phase
func TestPhaseIAM(t *testing.T) {
t.Skip("unable to test w/o allowing failed validation")
@ -166,7 +200,7 @@ func TestPhaseCluster(t *testing.T) {
runTestPhase(t, "lifecyclephases.example.com", "lifecycle_phases", "v1alpha2", true, 1, cloudup.PhaseCluster)
}
func runTest(t *testing.T, h *testutils.IntegrationTestHarness, clusterName string, srcDir string, version string, private bool, zones int, expectedFilenames []string, tfFileName string, phase *cloudup.Phase) {
func runTest(t *testing.T, h *testutils.IntegrationTestHarness, clusterName string, srcDir string, version string, private bool, zones int, expectedDataFilenames []string, tfFileName string, phase *cloudup.Phase, lifecycleOverrides []string) {
var stdout bytes.Buffer
srcDir = updateClusterTestBase + srcDir
@ -210,7 +244,7 @@ func runTest(t *testing.T, h *testutils.IntegrationTestHarness, clusterName stri
options.InitDefaults()
options.Target = "terraform"
options.OutDir = path.Join(h.TempDir, "out")
options.MaxTaskDuration = 30 * time.Second
options.RunTasksOptions.MaxTaskDuration = 30 * time.Second
if phase != nil {
options.Phase = string(*phase)
}
@ -218,6 +252,8 @@ func runTest(t *testing.T, h *testutils.IntegrationTestHarness, clusterName stri
// We don't test it here, and it adds a dependency on kubectl
options.CreateKubecfg = false
options.LifecycleOverrides = lifecycleOverrides
_, err := RunUpdateCluster(factory, clusterName, &stdout, options)
if err != nil {
t.Fatalf("error running update cluster %q: %v", clusterName, err)
@ -238,52 +274,62 @@ func runTest(t *testing.T, h *testutils.IntegrationTestHarness, clusterName stri
sort.Strings(fileNames)
actualFilenames := strings.Join(fileNames, ",")
expected := "kubernetes.tf"
expectedFilenames := "kubernetes.tf"
if len(expectedFilenames) > 0 {
expected = "data,kubernetes.tf"
if len(expectedDataFilenames) > 0 {
expectedFilenames = "data,kubernetes.tf"
}
if actualFilenames != expected {
t.Fatalf("unexpected files. actual=%q, expected=%q, test=%q", actualFilenames, expected, testDataTFPath)
if actualFilenames != expectedFilenames {
t.Fatalf("unexpected files. actual=%q, expected=%q, test=%q", actualFilenames, expectedFilenames, testDataTFPath)
}
actualTF, err := ioutil.ReadFile(path.Join(h.TempDir, "out", actualTFPath))
if err != nil {
t.Fatalf("unexpected error reading actual terraform output: %v", err)
}
testDataTF, err := ioutil.ReadFile(path.Join(srcDir, testDataTFPath))
expectedTF, err := ioutil.ReadFile(path.Join(srcDir, testDataTFPath))
if err != nil {
t.Fatalf("unexpected error reading expected terraform output: %v", err)
}
expectedTF = bytes.Replace(expectedTF, []byte("\r\n"), []byte("\n"), -1)
if !bytes.Equal(actualTF, testDataTF) {
diffString := diff.FormatDiff(string(testDataTF), string(actualTF))
if !bytes.Equal(actualTF, expectedTF) {
diffString := diff.FormatDiff(string(expectedTF), string(actualTF))
t.Logf("diff:\n%s\n", diffString)
if os.Getenv("HACK_UPDATE_EXPECTED_IN_PLACE") != "" {
fp := path.Join(srcDir, testDataTFPath)
t.Logf("HACK_UPDATE_EXPECTED_IN_PLACE: writing expected output %s", fp)
if err := ioutil.WriteFile(fp, actualTF, 0644); err != nil {
t.Errorf("error writing terraform output: %v", err)
}
t.Errorf("terraform output differed from expected")
return // Avoid Fatalf as we want to keep going and update all files
}
t.Fatalf("terraform output differed from expected")
}
}
// Compare data files if they are provided
if len(expectedFilenames) > 0 {
if len(expectedDataFilenames) > 0 {
actualDataPath := path.Join(h.TempDir, "out", "data")
files, err := ioutil.ReadDir(actualDataPath)
if err != nil {
t.Fatalf("failed to read data dir: %v", err)
}
var actualFilenames []string
var actualDataFilenames []string
for _, f := range files {
actualFilenames = append(actualFilenames, f.Name())
actualDataFilenames = append(actualDataFilenames, f.Name())
}
sort.Strings(expectedFilenames)
if !reflect.DeepEqual(actualFilenames, expectedFilenames) {
t.Fatalf("unexpected data files. actual=%q, expected=%q", actualFilenames, expectedFilenames)
sort.Strings(expectedDataFilenames)
if !reflect.DeepEqual(actualDataFilenames, expectedDataFilenames) {
t.Fatalf("unexpected data files. actual=%q, expected=%q", actualDataFilenames, expectedDataFilenames)
}
// Some tests might provide _some_ tf data files (not necessarilly all that
// Some tests might provide _some_ tf data files (not necessarily all that
// are actually produced), validate that the provided expected data file
// contents match actual data file content
expectedDataPath := path.Join(srcDir, "data")
@ -321,7 +367,7 @@ func runTest(t *testing.T, h *testutils.IntegrationTestHarness, clusterName stri
}
}
func runTestAWS(t *testing.T, clusterName string, srcDir string, version string, private bool, zones int) {
func runTestAWS(t *testing.T, clusterName string, srcDir string, version string, private bool, zones int, expectPolicies bool, lifecycleOverrides []string) {
h := testutils.NewIntegrationTestHarness(t)
defer h.Close()
@ -329,10 +375,6 @@ func runTestAWS(t *testing.T, clusterName string, srcDir string, version string,
h.SetupMockAWS()
expectedFilenames := []string{
"aws_iam_role_masters." + clusterName + "_policy",
"aws_iam_role_nodes." + clusterName + "_policy",
"aws_iam_role_policy_masters." + clusterName + "_policy",
"aws_iam_role_policy_nodes." + clusterName + "_policy",
"aws_key_pair_kubernetes." + clusterName + "-c4a6ed9aa889b9e2c39cd663eb9c7157_public_key",
"aws_launch_configuration_nodes." + clusterName + "_user_data",
}
@ -343,20 +385,29 @@ func runTestAWS(t *testing.T, clusterName string, srcDir string, version string,
expectedFilenames = append(expectedFilenames, s)
}
if private {
if expectPolicies {
expectedFilenames = append(expectedFilenames, []string{
"aws_iam_role_bastions." + clusterName + "_policy",
"aws_iam_role_policy_bastions." + clusterName + "_policy",
// bastions usually don't have any userdata
// "aws_launch_configuration_bastions." + clusterName + "_user_data",
"aws_iam_role_masters." + clusterName + "_policy",
"aws_iam_role_nodes." + clusterName + "_policy",
"aws_iam_role_policy_masters." + clusterName + "_policy",
"aws_iam_role_policy_nodes." + clusterName + "_policy",
}...)
if private {
expectedFilenames = append(expectedFilenames, []string{
"aws_iam_role_bastions." + clusterName + "_policy",
"aws_iam_role_policy_bastions." + clusterName + "_policy",
// bastions usually don't have any userdata
// "aws_launch_configuration_bastions." + clusterName + "_user_data",
}...)
}
}
// Special case that tests a bastion with user-data
if srcDir == "bastionadditional_user-data" {
expectedFilenames = append(expectedFilenames, "aws_launch_configuration_bastion."+clusterName+"_user_data")
}
runTest(t, h, clusterName, srcDir, version, private, zones, expectedFilenames, "", nil)
runTest(t, h, clusterName, srcDir, version, private, zones, expectedFilenames, "", nil, lifecycleOverrides)
}
func runTestPhase(t *testing.T, clusterName string, srcDir string, version string, private bool, zones int, phase cloudup.Phase) {
@ -402,7 +453,7 @@ func runTestPhase(t *testing.T, clusterName string, srcDir string, version strin
}
}
runTest(t, h, clusterName, srcDir, version, private, zones, expectedFilenames, tfFileName, &phase)
runTest(t, h, clusterName, srcDir, version, private, zones, expectedFilenames, tfFileName, &phase, nil)
}
func runTestGCE(t *testing.T, clusterName string, srcDir string, version string, private bool, zones int) {
@ -417,6 +468,7 @@ func runTestGCE(t *testing.T, clusterName string, srcDir string, version string,
expectedFilenames := []string{
"google_compute_instance_template_nodes-" + gce.SafeClusterName(clusterName) + "_metadata_cluster-name",
"google_compute_instance_template_nodes-" + gce.SafeClusterName(clusterName) + "_metadata_startup-script",
"google_compute_instance_template_nodes-" + gce.SafeClusterName(clusterName) + "_metadata_ssh-keys",
}
for i := 0; i < zones; i++ {
@ -425,12 +477,13 @@ func runTestGCE(t *testing.T, clusterName string, srcDir string, version string,
expectedFilenames = append(expectedFilenames, prefix+"cluster-name")
expectedFilenames = append(expectedFilenames, prefix+"startup-script")
expectedFilenames = append(expectedFilenames, prefix+"ssh-keys")
}
runTest(t, h, clusterName, srcDir, version, private, zones, expectedFilenames, "", nil)
runTest(t, h, clusterName, srcDir, version, private, zones, expectedFilenames, "", nil, nil)
}
func runTestCloudformation(t *testing.T, clusterName string, srcDir string, version string, private bool) {
func runTestCloudformation(t *testing.T, clusterName string, srcDir string, version string, private bool, lifecycleOverrides []string) {
srcDir = updateClusterTestBase + srcDir
var stdout bytes.Buffer
@ -475,10 +528,11 @@ func runTestCloudformation(t *testing.T, clusterName string, srcDir string, vers
options.InitDefaults()
options.Target = "cloudformation"
options.OutDir = path.Join(h.TempDir, "out")
options.MaxTaskDuration = 30 * time.Second
options.RunTasksOptions.MaxTaskDuration = 30 * time.Second
// We don't test it here, and it adds a dependency on kubectl
options.CreateKubecfg = false
options.LifecycleOverrides = lifecycleOverrides
_, err := RunUpdateCluster(factory, clusterName, &stdout, options)
if err != nil {
@ -548,7 +602,7 @@ func runTestCloudformation(t *testing.T, clusterName string, srcDir string, vers
}
actualCF = buf.Bytes()
expectedCFTrimmed := strings.TrimSpace(string(expectedCF))
expectedCFTrimmed := strings.Replace(strings.TrimSpace(string(expectedCF)), "\r\n", "\n", -1)
actualCFTrimmed := strings.TrimSpace(string(actualCF))
if actualCFTrimmed != expectedCFTrimmed {
diffString := diff.FormatDiff(expectedCFTrimmed, actualCFTrimmed)
@ -560,10 +614,19 @@ func runTestCloudformation(t *testing.T, clusterName string, srcDir string, vers
t.Logf("actual terraform output in %s", actualPath)
}
if os.Getenv("HACK_UPDATE_EXPECTED_IN_PLACE") != "" {
fp := path.Join(srcDir, expectedCfPath)
t.Logf("HACK_UPDATE_EXPECTED_IN_PLACE: writing expected output %s", fp)
if err := ioutil.WriteFile(fp, actualCF, 0644); err != nil {
t.Errorf("error writing expected output file %q: %v", fp, err)
}
}
t.Fatalf("cloudformation output differed from expected. Test file: %s", path.Join(srcDir, expectedCfPath))
}
expectedExtracted, err := ioutil.ReadFile(path.Join(srcDir, expectedCfPath+".extracted.yaml"))
fp := path.Join(srcDir, expectedCfPath+".extracted.yaml")
expectedExtracted, err := ioutil.ReadFile(fp)
if err != nil {
t.Fatalf("unexpected error reading expected extracted cloudformation output: %v", err)
}
@ -578,22 +641,45 @@ func runTestCloudformation(t *testing.T, clusterName string, srcDir string, vers
t.Fatalf("error differed number of cloudformation in expected and extracted: %v", err)
}
actual := make(map[string]string)
for key, expectedValue := range expected {
extractedValue, ok := extracted[key]
if !ok {
t.Fatalf("unexpected error expected cloudformation not found for k: %v", key)
}
// Strip cariage return as expectedValue is stored in a yaml string literal
// and golang will automaticaly strip CR from any string literal
extractedValueTrimmed := strings.Replace(extractedValue, "\r", "", -1)
if expectedValue != extractedValueTrimmed {
actual[key] = extractedValue
// Strip carriage return as expectedValue is stored in a yaml string literal
// and yaml block quoting doesn't seem to support \r in a string
extractedValueTrimmed := strings.Replace(extractedValue, "\r", "", -1)
if expectedValue != extractedValueTrimmed {
diffString := diff.FormatDiff(expectedValue, extractedValueTrimmed)
t.Logf("diff for key %s:\n%s\n\n\n\n\n\n", key, diffString)
t.Fatalf("cloudformation output differed from expected. Test file: %s", path.Join(srcDir, expectedCfPath+".extracted.yaml"))
t.Errorf("cloudformation output differed from expected. Test file: %s", path.Join(srcDir, expectedCfPath+".extracted.yaml"))
}
}
if os.Getenv("HACK_UPDATE_EXPECTED_IN_PLACE") != "" {
t.Logf("HACK_UPDATE_EXPECTED_IN_PLACE: writing expected output %s", fp)
// We replace the \r characters so that the yaml output (should) be block-quoted
// Literal quoting is sadly unreadable...
for k, v := range actual {
actual[k] = strings.Replace(v, "\r", "", -1)
}
b, err := yaml.Marshal(actual)
if err != nil {
t.Errorf("error serializing cloudformation output: %v", err)
}
if err := ioutil.WriteFile(fp, b, 0644); err != nil {
t.Errorf("error writing cloudformation output: %v", err)
}
}
}
}

View File

@ -75,7 +75,7 @@ func TestLifecyclePrivateKopeio(t *testing.T) {
runLifecycleTestAWS(&LifecycleTestOptions{
t: t,
SrcDir: "privatekopeio",
Shared: []string{"nat-12345678"},
Shared: []string{"nat-a2345678", "nat-b2345678"},
})
}
@ -108,6 +108,8 @@ func TestLifecyclePrivateSharedSubnet(t *testing.T) {
func runLifecycleTest(h *testutils.IntegrationTestHarness, o *LifecycleTestOptions, cloud *awsup.MockAWSCloud) {
t := o.t
t.Logf("running lifecycle test for cluster %s", o.ClusterName)
var stdout bytes.Buffer
inputYAML := "in-" + o.Version + ".yaml"
@ -144,7 +146,7 @@ func runLifecycleTest(h *testutils.IntegrationTestHarness, o *LifecycleTestOptio
{
options := &UpdateClusterOptions{}
options.InitDefaults()
options.MaxTaskDuration = 10 * time.Second
options.RunTasksOptions.MaxTaskDuration = 10 * time.Second
options.Yes = true
// We don't test it here, and it adds a dependency on kubectl
@ -160,7 +162,7 @@ func runLifecycleTest(h *testutils.IntegrationTestHarness, o *LifecycleTestOptio
options := &UpdateClusterOptions{}
options.InitDefaults()
options.Target = cloudup.TargetDryRun
options.MaxTaskDuration = 10 * time.Second
options.RunTasksOptions.MaxTaskDuration = 10 * time.Second
// We don't test it here, and it adds a dependency on kubectl
options.CreateKubecfg = false
@ -217,6 +219,9 @@ func runLifecycleTest(h *testutils.IntegrationTestHarness, o *LifecycleTestOptio
if ownership != expect {
t.Errorf("unexpected kubernetes.io/cluster/ tag on %q: actual=%q expected=%q", id, ownership, expect)
}
if legacy != "" {
t.Errorf("added (legacy) KubernetesCluster tag on %q, but it is shared", id)
}
} else {
switch resource {
case "ami":

View File

@ -32,7 +32,7 @@ import (
"k8s.io/kops/util/pkg/vfs"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/kubectl/resource"
"k8s.io/kubernetes/pkg/kubectl/genericclioptions/resource"
"k8s.io/kubernetes/pkg/kubectl/util/i18n"
)
@ -44,6 +44,9 @@ var (
# Replace a cluster desired configuration using a YAML file
kops replace -f my-cluster.yaml
# Replace an instancegroup using YAML passed into stdin.
cat instancegroup.yaml | kops replace -f -
# Note, if the resource does not exist the command will error, use --force to provision resource
kops replace -f my-cluster.yaml --force
`))
@ -97,9 +100,17 @@ func RunReplace(f *util.Factory, cmd *cobra.Command, out io.Writer, c *replaceOp
codec := codecs.UniversalDecoder(kopsapi.SchemeGroupVersion)
for _, f := range c.Filenames {
contents, err := vfs.Context.ReadFile(f)
if err != nil {
return fmt.Errorf("error reading file %q: %v", f, err)
var contents []byte
if f == "-" {
contents, err = ConsumeStdin()
if err != nil {
return err
}
} else {
contents, err = vfs.Context.ReadFile(f)
if err != nil {
return fmt.Errorf("error reading file %q: %v", f, err)
}
}
sections := bytes.Split(contents, []byte("\n---\n"))
@ -154,9 +165,8 @@ func RunReplace(f *util.Factory, cmd *cobra.Command, out io.Writer, c *replaceOp
if err != nil {
if errors.IsNotFound(err) {
return fmt.Errorf("cluster %q not found", clusterName)
} else {
return fmt.Errorf("error fetching cluster %q: %v", clusterName, err)
}
return fmt.Errorf("error fetching cluster %q: %v", clusterName, err)
}
// check if the instancegroup exists already
igName := v.ObjectMeta.Name

View File

@ -21,6 +21,7 @@ import (
"io"
"os"
"strconv"
"strings"
"time"
"github.com/golang/glog"
@ -28,7 +29,7 @@ import (
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
_ "k8s.io/client-go/plugin/pkg/client/auth"
"k8s.io/kops/cmd/kops/util"
api "k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/cloudinstances"
@ -36,9 +37,9 @@ import (
"k8s.io/kops/pkg/instancegroups"
"k8s.io/kops/pkg/pretty"
"k8s.io/kops/upup/pkg/fi/cloudup"
"k8s.io/kops/upup/pkg/kutil"
"k8s.io/kops/util/pkg/tables"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
"k8s.io/kubernetes/pkg/kubectl/genericclioptions"
"k8s.io/kubernetes/pkg/kubectl/util/i18n"
)
@ -88,7 +89,7 @@ var (
# Roll the k8s-cluster.example.com kops cluster,
# only roll the node instancegroup,
# use the new drain an validate functionality.
# use the new drain and validate functionality.
kops rolling-update cluster k8s-cluster.example.com --yes \
--fail-on-validate-error="false" \
--node-interval 8m \
@ -137,6 +138,10 @@ type RollingUpdateOptions struct {
// InstanceGroups is the list of instance groups to rolling-update;
// if not specified, all instance groups will be updated
InstanceGroups []string
// InstanceGroupRoles is the list of roles we should rolling-update
// if not specified, all instance groups will be updated
InstanceGroupRoles []string
}
func (o *RollingUpdateOptions) InitDefaults() {
@ -177,6 +182,7 @@ func NewCmdRollingUpdateCluster(f *util.Factory, out io.Writer) *cobra.Command {
cmd.Flags().DurationVar(&options.BastionInterval, "bastion-interval", options.BastionInterval, "Time to wait between restarting bastions")
cmd.Flags().BoolVarP(&options.Interactive, "interactive", "i", options.Interactive, "Prompt to continue after each instance is updated")
cmd.Flags().StringSliceVar(&options.InstanceGroups, "instance-group", options.InstanceGroups, "List of instance groups to update (defaults to all if not specified)")
cmd.Flags().StringSliceVar(&options.InstanceGroupRoles, "instance-group-roles", options.InstanceGroupRoles, "If specified, only instance groups of the specified role will be updated (e.g. Master,Node,Bastion)")
if featureflag.DrainAndValidateRollingUpdate.Enabled() {
cmd.Flags().BoolVar(&options.FailOnDrainError, "fail-on-drain-error", true, "The rolling-update will fail if draining a node fails.")
@ -222,9 +228,10 @@ func RunRollingUpdateCluster(f *util.Factory, out io.Writer, options *RollingUpd
}
contextName := cluster.ObjectMeta.Name
config, err := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
clientcmd.NewDefaultClientConfigLoadingRules(),
&clientcmd.ConfigOverrides{CurrentContext: contextName}).ClientConfig()
clientGetter := genericclioptions.NewConfigFlags()
clientGetter.Context = &contextName
config, err := clientGetter.ToRESTConfig()
if err != nil {
return fmt.Errorf("cannot load kubecfg settings for %q: %v", contextName, err)
}
@ -285,6 +292,24 @@ func RunRollingUpdateCluster(f *util.Factory, out io.Writer, options *RollingUpd
warnUnmatched = false
}
if len(options.InstanceGroupRoles) != 0 {
var filtered []*api.InstanceGroup
for _, ig := range instanceGroups {
for _, role := range options.InstanceGroupRoles {
if ig.Spec.Role == api.InstanceGroupRole(strings.Title(strings.ToLower(role))) {
filtered = append(filtered, ig)
continue
}
}
}
instanceGroups = filtered
// Don't warn if we find more ASGs than IGs
warnUnmatched = false
}
cloud, err := cloudup.BuildCloud(cluster)
if err != nil {
return err
@ -372,7 +397,7 @@ func RunRollingUpdateCluster(f *util.Factory, out io.Writer, options *RollingUpd
Force: options.Force,
Cloud: cloud,
K8sClient: k8sClient,
ClientConfig: kutil.NewClientConfig(config, "kube-system"),
ClientGetter: clientGetter,
FailOnDrainError: options.FailOnDrainError,
FailOnValidate: options.FailOnValidate,
CloudOnly: options.CloudOnly,

View File

@ -17,10 +17,12 @@ limitations under the License.
package main
import (
"bytes"
goflag "flag"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"github.com/golang/glog"
@ -28,6 +30,7 @@ import (
"github.com/spf13/viper"
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/util/homedir"
"k8s.io/kops/cmd/kops/util"
kopsapi "k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/client/simple"
@ -120,13 +123,13 @@ func NewCmdRoot(f *util.Factory, out io.Writer) *cobra.Command {
}
})
cmd.PersistentFlags().StringVar(&rootCommand.configFile, "config", "", "config file (default is $HOME/.kops.yaml)")
cmd.PersistentFlags().StringVar(&rootCommand.configFile, "config", "", "yaml config file (default is $HOME/.kops.yaml)")
viper.BindPFlag("config", cmd.PersistentFlags().Lookup("config"))
viper.SetDefault("config", "$HOME/.kops.yaml")
defaultStateStore := os.Getenv("KOPS_STATE_STORE")
if strings.HasSuffix(defaultStateStore, "/") {
defaultStateStore = strings.TrimSuffix(defaultStateStore, "/")
}
cmd.PersistentFlags().StringVarP(&rootCommand.RegistryPath, "state", "", defaultStateStore, "Location of state storage. Overrides KOPS_STATE_STORE environment variable")
cmd.PersistentFlags().StringVar(&rootCommand.RegistryPath, "state", "", "Location of state storage (kops 'config' file). Overrides KOPS_STATE_STORE environment variable")
viper.BindPFlag("KOPS_STATE_STORE", cmd.PersistentFlags().Lookup("state"))
viper.BindEnv("KOPS_STATE_STORE")
defaultClusterName := os.Getenv("KOPS_CLUSTER_NAME")
cmd.PersistentFlags().StringVarP(&rootCommand.clusterName, "name", "", defaultClusterName, "Name of cluster. Overrides KOPS_CLUSTER_NAME environment variable")
@ -150,19 +153,38 @@ func NewCmdRoot(f *util.Factory, out io.Writer) *cobra.Command {
// initConfig reads in config file and ENV variables if set.
func initConfig() {
if rootCommand.configFile != "" {
// enable ability to specify config file via flag
viper.SetConfigFile(rootCommand.configFile)
// Config file precedence: --config flag, ${HOME}/.kops.yaml ${HOME}/.kops/config
configFile := rootCommand.configFile
if configFile == "" {
home := homedir.HomeDir()
configPaths := []string{
filepath.Join(home, ".kops.yaml"),
filepath.Join(home, ".kops", "config"),
}
for _, p := range configPaths {
_, err := os.Stat(p)
if err == nil {
configFile = p
break
} else if !os.IsNotExist(err) {
glog.V(2).Infof("error checking for file %s: %v", p, err)
}
}
}
viper.SetConfigName(".kops") // name of config file (without extension)
viper.AddConfigPath("$HOME") // adding home directory as first search path
viper.AutomaticEnv() // read in environment variables that match
if configFile != "" {
viper.SetConfigFile(configFile)
viper.SetConfigType("yaml")
// If a config file is found, read it in.
if err := viper.ReadInConfig(); err == nil {
fmt.Println("Using config file:", viper.ConfigFileUsed())
if err := viper.ReadInConfig(); err != nil {
glog.Warningf("error reading config: %v", err)
}
}
rootCommand.RegistryPath = viper.GetString("KOPS_STATE_STORE")
// Tolerate multiple slashes at end
rootCommand.RegistryPath = strings.TrimSuffix(rootCommand.RegistryPath, "/")
}
func (c *RootCmd) AddCommand(cmd *cobra.Command) {
@ -199,9 +221,8 @@ func (c *RootCmd) ProcessArgs(args []string) error {
if len(args) == 1 {
return fmt.Errorf("Cannot specify cluster via --name and positional argument")
} else {
return fmt.Errorf("expected a single <clustername> to be passed as an argument")
}
return fmt.Errorf("expected a single <clustername> to be passed as an argument")
}
func (c *RootCmd) ClusterName() string {
@ -305,3 +326,14 @@ func GetCluster(factory Factory, clusterName string) (*kopsapi.Cluster, error) {
}
return cluster, nil
}
// ConsumeStdin reads all the bytes available from stdin
func ConsumeStdin() ([]byte, error) {
file := os.Stdin
buf := new(bytes.Buffer)
_, err := buf.ReadFrom(file)
if err != nil {
return nil, fmt.Errorf("error reading stdin: %v", err)
}
return buf.Bytes(), nil
}

View File

@ -33,7 +33,7 @@ var (
setExample = templates.Examples(i18n.T(`
# Set cluster to run kubernetes version 1.10.0
kops set cluster k8s-cluster.example.com cluster.spec.kubernetesVersion=1.10.0
kops set cluster k8s-cluster.example.com spec.kubernetesVersion=1.10.0
`))
)

View File

@ -67,7 +67,7 @@ func NewCmdSetCluster(f *util.Factory, out io.Writer) *cobra.Command {
}
if options.ClusterName == "" {
options.ClusterName = ClusterNameFromKubecfg()
options.ClusterName = rootCommand.ClusterName()
}
if err := commands.RunSetCluster(f, cmd, out, options); err != nil {

View File

@ -29,8 +29,10 @@ import (
"github.com/spf13/cobra"
"golang.org/x/crypto/ssh"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/util/homedir"
"k8s.io/kops/cmd/kops/util"
"k8s.io/kops/pkg/bundle"
"k8s.io/kops/pkg/try"
"k8s.io/kops/upup/pkg/kutil"
"k8s.io/kops/util/pkg/vfs"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
@ -125,7 +127,7 @@ func RunToolboxBundle(context Factory, out io.Writer, options *ToolboxBundleOpti
}
nodeSSH.SSHConfig.HostKeyCallback = ssh.InsecureIgnoreHostKey()
nodeSSH.SSHConfig.User = sshUser
sshIdentity := filepath.Join(os.Getenv("HOME"), ".ssh", "id_rsa")
sshIdentity := filepath.Join(homedir.HomeDir(), ".ssh", "id_rsa")
if err := kutil.AddSSHIdentity(&nodeSSH.SSHConfig, sshIdentity); err != nil {
return err
}
@ -188,7 +190,7 @@ func writeToTar(files []*bundle.DataFile, bundlePath string) error {
if err != nil {
return fmt.Errorf("error creating output bundle file %q: %v", bundlePath, err)
}
defer f.Close()
defer try.CloseFile(f)
gw := gzip.NewWriter(f)
defer gw.Close()

Some files were not shown because too many files have changed in this diff Show More