diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index a87a2f2f8f..b1043e53b0 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -1,13 +1,31 @@
version: 2
updates:
+ # GitHub Actions
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "weekly"
+ commit-message:
+ prefix: ":seedling:"
+ labels:
+ - "kind/cleanup"
+ - "area/ci"
+ - "ok-to-test"
+ - "release-note-none"
+
+ # Main Go module
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
+ day: "monday"
commit-message:
prefix: ":seedling:"
labels:
- "kind/cleanup"
+ - "area/dependency"
+ - "ok-to-test"
+ - "release-note-none"
groups:
dependencies:
patterns:
@@ -15,22 +33,33 @@ updates:
ignore:
# Ignore Cluster-API as its upgraded manually.
- dependency-name: "sigs.k8s.io/cluster-api*"
+ update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
# Ignore controller-runtime as its upgraded manually.
- dependency-name: "sigs.k8s.io/controller-runtime"
- # Ignore k8s and its transitives modules as they are upgraded manually
- # together with controller-runtime.
+ update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
+ # Ignore k8s and its transitives modules as they are upgraded manually together with controller-runtime.
- dependency-name: "k8s.io/*"
+ update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
- dependency-name: "go.etcd.io/*"
+ update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
- dependency-name: "google.golang.org/grpc"
+ update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
+ # Bumping the kustomize API independently can break compatibility with client-go as they share k8s.io/kube-openapi as a dependency.
+ - dependency-name: "sigs.k8s.io/kustomize/api"
+ update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
+ day: "monday"
commit-message:
prefix: ":seedling:"
labels:
- "kind/cleanup"
+ - "area/dependency"
+ - "ok-to-test"
+ - "release-note-none"
groups:
dependencies:
patterns:
@@ -41,10 +70,14 @@ updates:
directory: "/hack/tools"
schedule:
interval: "weekly"
+ day: "wednesday"
commit-message:
prefix: ":seedling:"
labels:
- "kind/cleanup"
+ - "area/dependency"
+ - "ok-to-test"
+ - "release-note-none"
groups:
dependencies:
patterns:
@@ -52,35 +85,33 @@ updates:
ignore:
# Ignore Cluster-API as its upgraded manually.
- dependency-name: "sigs.k8s.io/cluster-api*"
+ update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
# Ignore controller-runtime as its upgraded manually.
- dependency-name: "sigs.k8s.io/controller-runtime"
- # Ignore k8s and its transitives modules as they are upgraded manually
- # together with controller-runtime.
+ update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
+ # Ignore k8s and its transitives modules as they are upgraded manually together with controller-runtime.
- dependency-name: "k8s.io/*"
- # Ignore controller-tools as its upgraded manually.
- - dependency-name: "sigs.k8s.io/controller-tools"
+ update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
+ - dependency-name: "go.etcd.io/*"
+ update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
+ - dependency-name: "google.golang.org/grpc"
+ update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
+ # Bumping the kustomize API independently can break compatibility with client-go as they share k8s.io/kube-openapi as a dependency.
+ - dependency-name: "sigs.k8s.io/kustomize/api"
+ update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
- package-ecosystem: "docker"
directory: "/hack/tools"
schedule:
interval: "weekly"
+ day: "wednesday"
commit-message:
prefix: ":seedling:"
labels:
- "kind/cleanup"
- groups:
- dependencies:
- patterns:
- - "*"
-
- - package-ecosystem: "github-actions"
- directory: "/"
- schedule:
- interval: "weekly"
- commit-message:
- prefix: ":seedling:"
- labels:
- - "kind/cleanup"
+ - "area/dependency"
+ - "ok-to-test"
+ - "release-note-none"
groups:
dependencies:
patterns:
diff --git a/.github/workflows/pr-golangci-lint.yaml b/.github/workflows/pr-golangci-lint.yaml
new file mode 100644
index 0000000000..d5e0e91b7e
--- /dev/null
+++ b/.github/workflows/pr-golangci-lint.yaml
@@ -0,0 +1,33 @@
+name: PR golangci-lint
+
+on:
+ pull_request:
+ types: [opened, edited, synchronize, reopened]
+
+# Remove all permissions from GITHUB_TOKEN except metadata.
+permissions: {}
+
+jobs:
+ golangci:
+ name: lint
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ working-directory:
+ - ""
+ steps:
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v4.1.1
+ - name: Calculate go version
+ id: vars
+ run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
+ - name: Set up Go
+ uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0
+ with:
+ go-version: ${{ steps.vars.outputs.go_version }}
+ - name: golangci-lint
+ uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # tag=v4.0.0
+ with:
+ version: v1.56.1
+ args: --out-format=colored-line-number
+ working-directory: ${{matrix.working-directory}}
diff --git a/.golangci.yml b/.golangci.yml
index bd41d21015..7925fdfadb 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -1,79 +1,126 @@
linters:
- enable-all: true
- disable:
- - bidichk
- - contextcheck
- - cyclop
- - dupl
- - durationcheck
- - errname
- - errorlint
- - exhaustive
- - exhaustivestruct
- - exhaustruct
- - forcetypeassert
- - forbidigo
- - funlen
- - gochecknoglobals
- - gochecknoinits
- - gocognit
- - godox
- - goerr113
- - gofumpt
- - golint
- - gomnd
- - gomoddirectives
- - gomodguard
- - interfacer
- - ireturn
- - lll
- - makezero
- - maligned
- - musttag
- - nestif
- - nilnil
- - nlreturn
- - nonamedreturns
- - nosnakecase
- - paralleltest
- - promlinter
- - scopelint
- - sqlclosecheck
- - tagliatelle
- - tenv
- - testpackage
- - tparallel
- - varnamelen
- - wastedassign
- - wrapcheck
- - wsl
- - deadcode
- - ifshort
- - structcheck
- - varcheck
- - interfacebloat
+ disable-all: true
+ enable:
+ - asasalint
+ - asciicheck
+ - bidichk
+ - bodyclose
+ - containedctx
+ - dogsled
+ - dupword
+ - durationcheck
+ - errcheck
+ - errchkjson
+ - exportloopref
+ - gci
+ - ginkgolinter
+ - goconst
+ - gocritic
+ - godot
+ - gofmt
+ - goimports
+ - goprintffuncname
+ - gosec
+ - gosimple
+ - govet
+ - importas
+ - ineffassign
+ - loggercheck
+ - misspell
+ - nakedret
+ - nilerr
+ - noctx
+ - nolintlint
+ - nosprintfhostport
+ - prealloc
+ - predeclared
+ - revive
+ - rowserrcheck
+ - staticcheck
+ - stylecheck
+ - thelper
+ - typecheck
+ - unconvert
+ - unparam
+ - unused
+ - usestdlibvars
+ - whitespace
linters-settings:
- # Restrict revive to exported.
- revive:
- # see https://github.com/mgechev/revive#available-rules for details.
- ignore-generated-header: true
- severity: warning
- rules:
- - name: exported
- severity: warning
gci:
sections:
- standard
- default
- prefix(sigs.k8s.io/cluster-api)
ginkgolinter:
- # Suppress the wrong length assertion warning.
- suppress-len-assertion: true
- # Suppress the wrong nil assertion warning.
- suppress-nil-assertion: false
- # Suppress the wrong error assertion warning.
- suppress-err-assertion: true
+ forbid-focus-container: true
+ suppress-len-assertion: true # Suppress the wrong length assertion warning.
+ suppress-nil-assertion: false # Suppress the wrong nil assertion warning.
+ suppress-err-assertion: true # Suppress the wrong error assertion warning.
+ gocritic:
+ enabled-tags:
+ - diagnostic
+ - experimental
+ - performance
+ disabled-checks:
+ - appendAssign
+ - dupImport # https://github.com/go-critic/go-critic/issues/845
+ - evalOrder
+ - ifElseChain
+ - octalLiteral
+ - regexpSimplify
+ - sloppyReassign
+ - truncateCmp
+ - typeDefFirst
+ - unnamedResult
+ - unnecessaryDefer
+ - whyNoLint
+ - wrapperFunc
+ - rangeValCopy
+ - hugeParam
+ - filepathJoin
+ - emptyStringTest
+ godot:
+ # declarations - for top level declaration comments (default);
+ # toplevel - for top level comments;
+ # all - for all comments.
+ scope: toplevel
+ exclude:
+ - '^ \+.*'
+ - '^ ANCHOR.*'
+ revive:
+ rules:
+ # The following rules are recommended https://github.com/mgechev/revive#recommended-configuration
+ - name: blank-imports
+ - name: context-as-argument
+ - name: context-keys-type
+ - name: dot-imports
+ - name: error-return
+ - name: error-strings
+ - name: error-naming
+ - name: exported
+ - name: if-return
+ - name: increment-decrement
+ - name: var-naming
+ - name: var-declaration
+ - name: package-comments
+ - name: range
+ - name: receiver-naming
+ - name: time-naming
+ - name: unexported-return
+ - name: indent-error-flow
+ - name: errorf
+ - name: empty-block
+ - name: superfluous-else
+ - name: unreachable-code
+ - name: redefines-builtin-id
+ #
+ # Rules in addition to the recommended configuration above.
+ #
+ - name: bool-literal-in-expr
+ - name: constant-logical-expr
+ goconst:
+ ignore-tests: true
gosec:
excludes:
- G307 # Deferring unsafe method "Close" on type "\*os.File"
@@ -159,6 +206,10 @@ linters-settings:
alias: apimachinerytypes
- pkg: "sigs.k8s.io/cluster-api/exp/api/v1beta1"
alias: expclusterv1
+ nolintlint:
+ allow-unused: false
+ allow-leading-space: false
+ require-specific: true
staticcheck:
go: "1.21"
stylecheck:
@@ -178,7 +229,6 @@ issues:
# List of regexps of issue texts to exclude, empty list by default.
exclude:
- (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
- - "exported: exported (const|function|method|type|var) (.+) should have comment or be unexported"
- "exported: (func|type) name will be used as (.+) by other packages, and that stutters; consider calling this (.+)"
- (G104|G107|G404|G505|ST1000)
- "G108: Profiling endpoint is automatically exposed on /debug/pprof"
@@ -188,6 +238,13 @@ issues:
- "net/http.Get must not be called"
exclude-rules:
# Exclude revive's exported for certain packages and code, e.g. tests and fake.
+ - linters:
+ - revive
+ text: "exported: exported method .*\\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported"
+ - linters:
+ - errcheck
+ text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
+ # Exclude some packages or code to require comments, for example test code, or fake clients.
- linters:
- revive
text: exported (method|function|type|const) (.+) should have comment or be unexported
@@ -229,6 +286,11 @@ issues:
- revive
text: "var-naming: don't use underscores in Go names; func (.+) should be (.+)"
path: .*/defaults.go
+ # These directives allow the mock and gc packages to be imported with an underscore everywhere.
+ - linters:
+ - revive
+ text: "var-naming: don't use an underscore in package name"
+ path: .*/.*(mock|gc_).*/.+\.go
# Disable unparam "always receives" which might not be really
# useful when building libraries.
- linters:
diff --git a/Makefile b/Makefile
index d67ddea923..b42d7a1aec 100644
--- a/Makefile
+++ b/Makefile
@@ -48,6 +48,7 @@ KUBETEST_CONF_PATH ?= $(abspath $(E2E_DATA_DIR)/kubetest/conformance.yaml)
EXP_DIR := exp
# Binaries.
+GO_INSTALL := ./scripts/go_install.sh
GO_APIDIFF_BIN := $(BIN_DIR)/go-apidiff
GO_APIDIFF := $(TOOLS_DIR)/$(GO_APIDIFF_BIN)
CLUSTERCTL := $(BIN_DIR)/clusterctl
@@ -58,7 +59,10 @@ DEFAULTER_GEN := $(TOOLS_BIN_DIR)/defaulter-gen
ENVSUBST := $(TOOLS_BIN_DIR)/envsubst
GH := $(TOOLS_BIN_DIR)/gh
GOJQ := $(TOOLS_BIN_DIR)/gojq
-GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
+GOLANGCI_LINT_BIN := golangci-lint
+GOLANGCI_LINT_VER := $(shell cat .github/workflows/pr-golangci-lint.yaml | grep [[:space:]]version: | sed 's/.*version: //')
+GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER))
+GOLANGCI_LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint
KIND := $(TOOLS_BIN_DIR)/kind
KUSTOMIZE := $(TOOLS_BIN_DIR)/kustomize
MOCKGEN := $(TOOLS_BIN_DIR)/mockgen
@@ -290,6 +294,9 @@ generate-go-apis: ## Alias for .build/generate-go-apis
.PHONY: modules
+$(GOLANGCI_LINT): # Build golangci-lint from tools folder.
+ GOBIN=$(abspath $(TOOLS_BIN_DIR)) $(GO_INSTALL) $(GOLANGCI_LINT_PKG) $(GOLANGCI_LINT_BIN) $(GOLANGCI_LINT_VER)
+
.PHONY: lint
lint: $(GOLANGCI_LINT) ## Lint codebase
$(GOLANGCI_LINT) run -v --fast=false $(GOLANGCI_LINT_EXTRA_ARGS)
diff --git a/OWNERS_ALIASES b/OWNERS_ALIASES
index 61e20308a9..6b00c9c108 100644
--- a/OWNERS_ALIASES
+++ b/OWNERS_ALIASES
@@ -30,3 +30,4 @@ aliases:
- faiq
- fiunchinho
- AndiDog
+ - damdo
diff --git a/api/v1beta1/awscluster_types.go b/api/v1beta1/awscluster_types.go
index 0e06987b4b..ddb1d2cd5a 100644
--- a/api/v1beta1/awscluster_types.go
+++ b/api/v1beta1/awscluster_types.go
@@ -207,6 +207,7 @@ type AWSClusterStatus struct {
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
}
+// S3Bucket defines a supporting S3 bucket for the cluster, currently can be optionally used for Ignition.
type S3Bucket struct {
// ControlPlaneIAMInstanceProfile is a name of the IAMInstanceProfile, which will be allowed
// to read control-plane node bootstrap data from S3 Bucket.
diff --git a/api/v1beta1/awsclustertemplate_types.go b/api/v1beta1/awsclustertemplate_types.go
index 404da0b88a..07e2cf4039 100644
--- a/api/v1beta1/awsclustertemplate_types.go
+++ b/api/v1beta1/awsclustertemplate_types.go
@@ -53,6 +53,7 @@ func init() {
SchemeBuilder.Register(&AWSClusterTemplate{}, &AWSClusterTemplateList{})
}
+// AWSClusterTemplateResource defines the desired state of AWSClusterTemplate.
type AWSClusterTemplateResource struct {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
diff --git a/api/v1beta1/conversion_test.go b/api/v1beta1/conversion_test.go
index 7579d59aa8..24aa530ac2 100644
--- a/api/v1beta1/conversion_test.go
+++ b/api/v1beta1/conversion_test.go
@@ -19,9 +19,8 @@ package v1beta1
import (
"testing"
- . "github.com/onsi/gomega"
-
fuzz "github.com/google/gofuzz"
+ . "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
"k8s.io/apimachinery/pkg/runtime"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
@@ -38,7 +37,7 @@ func fuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} {
func AWSMachineFuzzer(obj *AWSMachine, c fuzz.Continue) {
c.FuzzNoCustom(obj)
-
+
// AWSMachine.Spec.FailureDomain, AWSMachine.Spec.Subnet.ARN and AWSMachine.Spec.AdditionalSecurityGroups.ARN has been removed in v1beta2, so setting it to nil in order to avoid v1beta1 --> v1beta2 --> v1beta1 round trip errors.
if obj.Spec.Subnet != nil {
obj.Spec.Subnet.ARN = nil
@@ -54,7 +53,7 @@ func AWSMachineFuzzer(obj *AWSMachine, c fuzz.Continue) {
func AWSMachineTemplateFuzzer(obj *AWSMachineTemplate, c fuzz.Continue) {
c.FuzzNoCustom(obj)
-
+
// AWSMachineTemplate.Spec.Template.Spec.FailureDomain, AWSMachineTemplate.Spec.Template.Spec.Subnet.ARN and AWSMachineTemplate.Spec.Template.Spec.AdditionalSecurityGroups.ARN has been removed in v1beta2, so setting it to nil in order to avoid v1beta1 --> v1beta2 --> v1beta round trip errors.
if obj.Spec.Template.Spec.Subnet != nil {
obj.Spec.Template.Spec.Subnet.ARN = nil
@@ -81,16 +80,16 @@ func TestFuzzyConversion(t *testing.T) {
}))
t.Run("for AWSMachine", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
- Scheme: scheme,
- Hub: &v1beta2.AWSMachine{},
- Spoke: &AWSMachine{},
+ Scheme: scheme,
+ Hub: &v1beta2.AWSMachine{},
+ Spoke: &AWSMachine{},
FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs},
}))
t.Run("for AWSMachineTemplate", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
- Scheme: scheme,
- Hub: &v1beta2.AWSMachineTemplate{},
- Spoke: &AWSMachineTemplate{},
+ Scheme: scheme,
+ Hub: &v1beta2.AWSMachineTemplate{},
+ Spoke: &AWSMachineTemplate{},
FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs},
}))
diff --git a/api/v1beta1/zz_generated.conversion.go b/api/v1beta1/zz_generated.conversion.go
index 6fab23cc8a..30c7102779 100644
--- a/api/v1beta1/zz_generated.conversion.go
+++ b/api/v1beta1/zz_generated.conversion.go
@@ -1938,6 +1938,8 @@ func Convert_v1beta1_Ignition_To_v1beta2_Ignition(in *Ignition, out *v1beta2.Ign
func autoConvert_v1beta2_Ignition_To_v1beta1_Ignition(in *v1beta2.Ignition, out *Ignition, s conversion.Scope) error {
out.Version = in.Version
// WARNING: in.StorageType requires manual conversion: does not exist in peer-type
+ // WARNING: in.Proxy requires manual conversion: does not exist in peer-type
+ // WARNING: in.TLS requires manual conversion: does not exist in peer-type
return nil
}
diff --git a/api/v1beta2/awscluster_types.go b/api/v1beta2/awscluster_types.go
index 1df6c53b89..add00915cd 100644
--- a/api/v1beta2/awscluster_types.go
+++ b/api/v1beta2/awscluster_types.go
@@ -166,13 +166,19 @@ type Bastion struct {
AMI string `json:"ami,omitempty"`
}
+// LoadBalancerType defines the type of load balancer to use.
type LoadBalancerType string
var (
- LoadBalancerTypeClassic = LoadBalancerType("classic")
- LoadBalancerTypeELB = LoadBalancerType("elb")
- LoadBalancerTypeALB = LoadBalancerType("alb")
- LoadBalancerTypeNLB = LoadBalancerType("nlb")
+ // LoadBalancerTypeClassic is the classic ELB type.
+ LoadBalancerTypeClassic = LoadBalancerType("classic")
+ // LoadBalancerTypeELB is the ELB type.
+ LoadBalancerTypeELB = LoadBalancerType("elb")
+ // LoadBalancerTypeALB is the ALB type.
+ LoadBalancerTypeALB = LoadBalancerType("alb")
+ // LoadBalancerTypeNLB is the NLB type.
+ LoadBalancerTypeNLB = LoadBalancerType("nlb")
+ // LoadBalancerTypeDisabled disables the load balancer.
LoadBalancerTypeDisabled = LoadBalancerType("disabled")
)
@@ -268,6 +274,7 @@ type AWSClusterStatus struct {
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
}
+// S3Bucket defines a supporting S3 bucket for the cluster, currently can be optionally used for Ignition.
type S3Bucket struct {
// ControlPlaneIAMInstanceProfile is a name of the IAMInstanceProfile, which will be allowed
// to read control-plane node bootstrap data from S3 Bucket.
diff --git a/api/v1beta2/awsclustertemplate_types.go b/api/v1beta2/awsclustertemplate_types.go
index 333cb285c3..e0a827fa3d 100644
--- a/api/v1beta2/awsclustertemplate_types.go
+++ b/api/v1beta2/awsclustertemplate_types.go
@@ -54,6 +54,7 @@ func init() {
SchemeBuilder.Register(&AWSClusterTemplate{}, &AWSClusterTemplateList{})
}
+// AWSClusterTemplateResource defines the desired state of AWSClusterTemplateResource.
type AWSClusterTemplateResource struct {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
diff --git a/api/v1beta2/awsmachine_types.go b/api/v1beta2/awsmachine_types.go
index 10d8ce0dcb..c4fd5530ad 100644
--- a/api/v1beta2/awsmachine_types.go
+++ b/api/v1beta2/awsmachine_types.go
@@ -210,6 +210,7 @@ type CloudInit struct {
}
// Ignition defines options related to the bootstrapping systems where Ignition is used.
+// For more information on Ignition configuration, see https://coreos.github.io/butane/specs/
type Ignition struct {
// Version defines which version of Ignition will be used to generate bootstrap data.
//
@@ -237,6 +238,66 @@ type Ignition struct {
// +kubebuilder:default="ClusterObjectStore"
// +kubebuilder:validation:Enum:="ClusterObjectStore";"UnencryptedUserData"
StorageType IgnitionStorageTypeOption `json:"storageType,omitempty"`
+
+ // Proxy defines proxy settings for Ignition.
+ // Only valid for Ignition versions 3.1 and above.
+ // +optional
+ Proxy *IgnitionProxy `json:"proxy,omitempty"`
+
+ // TLS defines TLS settings for Ignition.
+ // Only valid for Ignition versions 3.1 and above.
+ // +optional
+ TLS *IgnitionTLS `json:"tls,omitempty"`
+}
+
+// IgnitionCASource defines the source of the certificate authority to use for Ignition.
+// +kubebuilder:validation:MaxLength:=65536
+type IgnitionCASource string
+
+// IgnitionTLS defines TLS settings for Ignition.
+type IgnitionTLS struct {
+ // CASources defines the list of certificate authorities to use for Ignition.
+ // The value is the certificate bundle (in PEM format). The bundle can contain multiple concatenated certificates.
+ // Supported schemes are http, https, tftp, s3, arn, gs, and `data` (RFC 2397) URL scheme.
+ //
+ // +optional
+ // +kubebuilder:validation:MaxItems=64
+ CASources []IgnitionCASource `json:"certificateAuthorities,omitempty"`
+}
+
+// IgnitionNoProxy defines the list of domains to not proxy for Ignition.
+// +kubebuilder:validation:MaxLength:=2048
+type IgnitionNoProxy string
+
+// IgnitionProxy defines proxy settings for Ignition.
+type IgnitionProxy struct {
+ // HTTPProxy is the HTTP proxy to use for Ignition.
+ // A single URL that specifies the proxy server to use for HTTP and HTTPS requests,
+ // unless overridden by the HTTPSProxy or NoProxy options.
+ // +optional
+ HTTPProxy *string `json:"httpProxy,omitempty"`
+
+ // HTTPSProxy is the HTTPS proxy to use for Ignition.
+ // A single URL that specifies the proxy server to use for HTTPS requests,
+ // unless overridden by the NoProxy option.
+ // +optional
+ HTTPSProxy *string `json:"httpsProxy,omitempty"`
+
+ // NoProxy is the list of domains to not proxy for Ignition.
+ // Specifies a list of strings to hosts that should be excluded from proxying.
+ //
+ // Each value is represented by:
+ // - An IP address prefix (1.2.3.4)
+ // - An IP address prefix in CIDR notation (1.2.3.4/8)
+ // - A domain name
+ // - A domain name matches that name and all subdomains
+ // - A domain name with a leading . matches subdomains only
+ // - A special DNS label (*), indicates that no proxying should be done
+ //
+ // An IP address prefix and domain name can also include a literal port number (1.2.3.4:80).
+ // +optional
+ // +kubebuilder:validation:MaxItems=64
+ NoProxy []IgnitionNoProxy `json:"noProxy,omitempty"`
}
// AWSMachineStatus defines the observed state of AWSMachine.
diff --git a/api/v1beta2/awsmachine_webhook.go b/api/v1beta2/awsmachine_webhook.go
index 2fe32083db..8938e01dfb 100644
--- a/api/v1beta2/awsmachine_webhook.go
+++ b/api/v1beta2/awsmachine_webhook.go
@@ -17,10 +17,17 @@ limitations under the License.
package v1beta2
import (
+ "encoding/base64"
+ "fmt"
+ "net"
+ "net/url"
+ "strings"
+
"github.com/google/go-cmp/cmp"
"github.com/pkg/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/util/validation"
"k8s.io/apimachinery/pkg/util/validation/field"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/webhook"
@@ -171,17 +178,132 @@ func (r *AWSMachine) ignitionEnabled() bool {
func (r *AWSMachine) validateIgnitionAndCloudInit() field.ErrorList {
var allErrs field.ErrorList
+ if !r.ignitionEnabled() {
+ return allErrs
+ }
// Feature gate is not enabled but ignition is enabled then send a forbidden error.
- if !feature.Gates.Enabled(feature.BootstrapFormatIgnition) && r.ignitionEnabled() {
+ if !feature.Gates.Enabled(feature.BootstrapFormatIgnition) {
allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "ignition"),
"can be set only if the BootstrapFormatIgnition feature gate is enabled"))
}
- if r.ignitionEnabled() && r.cloudInitConfigured() {
+ // If ignition is enabled, cloudInit should not be configured.
+ if r.cloudInitConfigured() {
allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "cloudInit"), "cannot be set if spec.ignition is set"))
}
+ // Proxy and TLS are only valid for Ignition versions >= 3.1.
+ if r.Spec.Ignition.Version == "2.3" || r.Spec.Ignition.Version == "3.0" {
+ if r.Spec.Ignition.Proxy != nil {
+ allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "ignition", "proxy"), "cannot be set if spec.ignition.version is 2.3 or 3.0"))
+ }
+ if r.Spec.Ignition.TLS != nil {
+ allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "ignition", "tls"), "cannot be set if spec.ignition.version is 2.3 or 3.0"))
+ }
+ }
+
+ allErrs = append(allErrs, r.validateIgnitionProxy()...)
+ allErrs = append(allErrs, r.validateIgnitionTLS()...)
+
+ return allErrs
+}
+
+func (r *AWSMachine) validateIgnitionProxy() field.ErrorList {
+ var allErrs field.ErrorList
+
+ if r.Spec.Ignition.Proxy == nil {
+ return allErrs
+ }
+
+ // Validate HTTPProxy.
+ if r.Spec.Ignition.Proxy.HTTPProxy != nil {
+ // Parse the url to check if it is valid.
+ _, err := url.Parse(*r.Spec.Ignition.Proxy.HTTPProxy)
+ if err != nil {
+ allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "ignition", "proxy", "httpProxy"), *r.Spec.Ignition.Proxy.HTTPProxy, "invalid URL"))
+ }
+ }
+
+ // Validate HTTPSProxy.
+ if r.Spec.Ignition.Proxy.HTTPSProxy != nil {
+ // Parse the url to check if it is valid.
+ _, err := url.Parse(*r.Spec.Ignition.Proxy.HTTPSProxy)
+ if err != nil {
+ allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "ignition", "proxy", "httpsProxy"), *r.Spec.Ignition.Proxy.HTTPSProxy, "invalid URL"))
+ }
+ }
+
+ // Validate NoProxy.
+ for _, noProxy := range r.Spec.Ignition.Proxy.NoProxy {
+ noProxy := string(noProxy)
+ // Validate here that the value `noProxy` is:
+ // - A domain name
+ // - A domain name matches that name and all subdomains
+ // - A domain name with a leading . matches subdomains only
+
+ // A special DNS label (*).
+ if noProxy == "*" {
+ continue
+ }
+ // An IP address prefix (1.2.3.4).
+ if ip := net.ParseIP(noProxy); ip != nil {
+ continue
+ }
+ // An IP address prefix in CIDR notation (1.2.3.4/8).
+ if _, _, err := net.ParseCIDR(noProxy); err == nil {
+ continue
+ }
+ // An IP or domain name with a port.
+ if _, _, err := net.SplitHostPort(noProxy); err == nil {
+ continue
+ }
+ // A domain name.
+ if noProxy[0] == '.' {
+ // If it starts with a dot, it should be a domain name.
+ noProxy = noProxy[1:]
+ }
+ // Validate that the value matches DNS 1123.
+ if errs := validation.IsDNS1123Subdomain(noProxy); len(errs) > 0 {
+ allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "ignition", "proxy", "noProxy"), noProxy, fmt.Sprintf("invalid noProxy value, please refer to the field documentation: %s", strings.Join(errs, "; "))))
+ }
+ }
+
+ return allErrs
+}
+
+func (r *AWSMachine) validateIgnitionTLS() field.ErrorList {
+ var allErrs field.ErrorList
+
+ if r.Spec.Ignition.TLS == nil {
+ return allErrs
+ }
+
+ for _, source := range r.Spec.Ignition.TLS.CASources {
+ // Validate that source is RFC 2397 data URL.
+ u, err := url.Parse(string(source))
+ if err != nil {
+ allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "ignition", "tls", "caSources"), source, "invalid URL"))
+ }
+
+ switch u.Scheme {
+ case "http", "https", "tftp", "s3", "arn", "gs":
+ // Valid schemes.
+ case "data":
+ // Validate that the data URL is base64 encoded.
+ i := strings.Index(u.Opaque, ",")
+ if i < 0 {
+ allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "ignition", "tls", "caSources"), source, "invalid data URL"))
+ }
+ // Validate that the data URL is base64 encoded.
+ if _, err := base64.StdEncoding.DecodeString(u.Opaque[i+1:]); err != nil {
+ allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "ignition", "tls", "caSources"), source, "invalid base64 encoding for data url"))
+ }
+ default:
+ allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "ignition", "tls", "caSources"), source, "unsupported URL scheme"))
+ }
+ }
+
return allErrs
}
diff --git a/api/v1beta2/awsmachine_webhook_test.go b/api/v1beta2/awsmachine_webhook_test.go
index a2b6ecd607..8588211aa7 100644
--- a/api/v1beta2/awsmachine_webhook_test.go
+++ b/api/v1beta2/awsmachine_webhook_test.go
@@ -24,8 +24,10 @@ import (
"github.com/aws/aws-sdk-go/aws"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ utilfeature "k8s.io/component-base/featuregate/testing"
"k8s.io/utils/ptr"
+ "sigs.k8s.io/cluster-api-provider-aws/v2/feature"
utildefaulting "sigs.k8s.io/cluster-api/util/defaulting"
)
@@ -248,9 +250,129 @@ func TestAWSMachineCreate(t *testing.T) {
},
wantErr: true,
},
+ {
+ name: "ignition proxy and TLS can be from version 3.1",
+ machine: &AWSMachine{
+ Spec: AWSMachineSpec{
+ InstanceType: "test",
+ Ignition: &Ignition{
+ Version: "3.1",
+ Proxy: &IgnitionProxy{
+ HTTPProxy: ptr.To("http://proxy.example.com:3128"),
+ },
+ TLS: &IgnitionTLS{
+ CASources: []IgnitionCASource{"s3://example.com/ca.pem"},
+ },
+ },
+ },
+ },
+ wantErr: false,
+ },
+ {
+ name: "ignition tls with invalid CASources URL",
+ machine: &AWSMachine{
+ Spec: AWSMachineSpec{
+ InstanceType: "test",
+ Ignition: &Ignition{
+ Version: "3.1",
+ TLS: &IgnitionTLS{
+ CASources: []IgnitionCASource{"data;;"},
+ },
+ },
+ },
+ },
+ wantErr: true,
+ },
+ {
+ name: "ignition proxy with valid URLs, and noproxy",
+ machine: &AWSMachine{
+ Spec: AWSMachineSpec{
+ InstanceType: "test",
+ Ignition: &Ignition{
+ Version: "3.1",
+ Proxy: &IgnitionProxy{
+ HTTPProxy: ptr.To("http://proxy.example.com:3128"),
+ HTTPSProxy: ptr.To("https://proxy.example.com:3128"),
+ NoProxy: []IgnitionNoProxy{
+ "10.0.0.1", // single ip
+ "example.com", // domain
+ ".example.com", // all subdomains
+ "example.com:3128", // domain with port
+ "10.0.0.1:3128", // ip with port
+ "10.0.0.0/8", // cidr block
+ "*", // no proxy wildcard
+ },
+ },
+ },
+ },
+ },
+ wantErr: false,
+ },
+ {
+ name: "ignition proxy with invalid HTTPProxy URL",
+ machine: &AWSMachine{
+ Spec: AWSMachineSpec{
+ InstanceType: "test",
+ Ignition: &Ignition{
+ Version: "3.1",
+ Proxy: &IgnitionProxy{
+ HTTPProxy: ptr.To("*:80"),
+ },
+ },
+ },
+ },
+ wantErr: true,
+ },
+ {
+ name: "ignition proxy with invalid HTTPSProxy URL",
+ machine: &AWSMachine{
+ Spec: AWSMachineSpec{
+ InstanceType: "test",
+ Ignition: &Ignition{
+ Version: "3.1",
+ Proxy: &IgnitionProxy{
+ HTTPSProxy: ptr.To("*:80"),
+ },
+ },
+ },
+ },
+ wantErr: true,
+ },
+ {
+ name: "ignition proxy with invalid noproxy URL",
+ machine: &AWSMachine{
+ Spec: AWSMachineSpec{
+ InstanceType: "test",
+ Ignition: &Ignition{
+ Version: "3.1",
+ Proxy: &IgnitionProxy{
+ NoProxy: []IgnitionNoProxy{"&"},
+ },
+ },
+ },
+ },
+ wantErr: true,
+ },
+ {
+ name: "cannot use ignition proxy with version 2.3",
+ machine: &AWSMachine{
+ Spec: AWSMachineSpec{
+ InstanceType: "test",
+ Ignition: &Ignition{
+ Version: "2.3.0",
+ Proxy: &IgnitionProxy{
+ HTTPProxy: ptr.To("http://proxy.example.com:3128"),
+ },
+ },
+ },
+ },
+ wantErr: true,
+ },
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
+ defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.BootstrapFormatIgnition, true)()
+
machine := tt.machine.DeepCopy()
machine.ObjectMeta = metav1.ObjectMeta{
GenerateName: "machine-",
diff --git a/api/v1beta2/awsmachinetemplate_webhook.go b/api/v1beta2/awsmachinetemplate_webhook.go
index 30dee37458..426a42882f 100644
--- a/api/v1beta2/awsmachinetemplate_webhook.go
+++ b/api/v1beta2/awsmachinetemplate_webhook.go
@@ -180,7 +180,7 @@ func (r *AWSMachineTemplateWebhook) ValidateCreate(_ context.Context, raw runtim
var allErrs field.ErrorList
obj, ok := raw.(*AWSMachineTemplate)
if !ok {
- return nil, apierrors.NewBadRequest(fmt.Sprintf("expected a VSphereMachineTemplate but got a %T", raw))
+ return nil, apierrors.NewBadRequest(fmt.Sprintf("expected a AWSMachineTemplate but got a %T", raw))
}
spec := obj.Spec.Template.Spec
diff --git a/api/v1beta2/doc.go b/api/v1beta2/doc.go
index 912b8f6556..4ed8bbddb8 100644
--- a/api/v1beta2/doc.go
+++ b/api/v1beta2/doc.go
@@ -17,5 +17,5 @@ limitations under the License.
// +gencrdrefdocs:force
// +groupName=infrastructure.cluster.x-k8s.io
-// package v1beta2 contains the v1beta2 API implementation.
+// Package v1beta2 contains the v1beta2 API implementation.
package v1beta2
diff --git a/api/v1beta2/groupversion_info.go b/api/v1beta2/groupversion_info.go
index 7b92eca9fa..1d921ac08c 100644
--- a/api/v1beta2/groupversion_info.go
+++ b/api/v1beta2/groupversion_info.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-// package v1beta2 contains API Schema definitions for the infrastructure v1beta2 API group
+// Package v1beta2 contains API Schema definitions for the infrastructure v1beta2 API group
// +kubebuilder:object:generate=true
// +groupName=infrastructure.cluster.x-k8s.io
package v1beta2
diff --git a/api/v1beta2/network_types.go b/api/v1beta2/network_types.go
index 55cb919cdc..d487183025 100644
--- a/api/v1beta2/network_types.go
+++ b/api/v1beta2/network_types.go
@@ -106,6 +106,7 @@ type TargetGroupHealthCheck struct {
type TargetGroupAttribute string
var (
+ // TargetGroupAttributeEnablePreserveClientIP defines the attribute key for enabling preserve client IP.
TargetGroupAttributeEnablePreserveClientIP = "preserve_client_ip.enabled"
)
@@ -113,8 +114,11 @@ var (
type LoadBalancerAttribute string
var (
- LoadBalancerAttributeEnableLoadBalancingCrossZone = "load_balancing.cross_zone.enabled"
- LoadBalancerAttributeIdleTimeTimeoutSeconds = "idle_timeout.timeout_seconds"
+ // LoadBalancerAttributeEnableLoadBalancingCrossZone defines the attribute key for enabling load balancing cross zone.
+ LoadBalancerAttributeEnableLoadBalancingCrossZone = "load_balancing.cross_zone.enabled"
+ // LoadBalancerAttributeIdleTimeTimeoutSeconds defines the attribute key for idle timeout.
+ LoadBalancerAttributeIdleTimeTimeoutSeconds = "idle_timeout.timeout_seconds"
+ // LoadBalancerAttributeIdleTimeDefaultTimeoutSecondsInSeconds defines the default idle timeout in seconds.
LoadBalancerAttributeIdleTimeDefaultTimeoutSecondsInSeconds = "60"
)
diff --git a/api/v1beta2/types.go b/api/v1beta2/types.go
index 545c4f320c..55ce2f9cca 100644
--- a/api/v1beta2/types.go
+++ b/api/v1beta2/types.go
@@ -80,6 +80,7 @@ const (
ExternalResourceGCTasksAnnotation = "aws.cluster.x-k8s.io/external-resource-tasks-gc"
)
+// GCTask defines a task to be executed by the garbage collector.
type GCTask string
var (
@@ -313,6 +314,7 @@ type InstanceMetadataOptions struct {
InstanceMetadataTags InstanceMetadataState `json:"instanceMetadataTags,omitempty"`
}
+// SetDefaults sets the default values for the InstanceMetadataOptions.
func (obj *InstanceMetadataOptions) SetDefaults() {
if obj.HTTPEndpoint == "" {
obj.HTTPEndpoint = InstanceMetadataEndpointStateEnabled
diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go
index fa6fe0e594..ee0dc510c2 100644
--- a/api/v1beta2/zz_generated.deepcopy.go
+++ b/api/v1beta2/zz_generated.deepcopy.go
@@ -743,7 +743,7 @@ func (in *AWSMachineSpec) DeepCopyInto(out *AWSMachineSpec) {
if in.Ignition != nil {
in, out := &in.Ignition, &out.Ignition
*out = new(Ignition)
- **out = **in
+ (*in).DeepCopyInto(*out)
}
if in.SpotMarketOptions != nil {
in, out := &in.SpotMarketOptions, &out.SpotMarketOptions
@@ -1332,6 +1332,16 @@ func (in *IPv6) DeepCopy() *IPv6 {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Ignition) DeepCopyInto(out *Ignition) {
*out = *in
+ if in.Proxy != nil {
+ in, out := &in.Proxy, &out.Proxy
+ *out = new(IgnitionProxy)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.TLS != nil {
+ in, out := &in.TLS, &out.TLS
+ *out = new(IgnitionTLS)
+ (*in).DeepCopyInto(*out)
+ }
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ignition.
@@ -1344,6 +1354,56 @@ func (in *Ignition) DeepCopy() *Ignition {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *IgnitionProxy) DeepCopyInto(out *IgnitionProxy) {
+ *out = *in
+ if in.HTTPProxy != nil {
+ in, out := &in.HTTPProxy, &out.HTTPProxy
+ *out = new(string)
+ **out = **in
+ }
+ if in.HTTPSProxy != nil {
+ in, out := &in.HTTPSProxy, &out.HTTPSProxy
+ *out = new(string)
+ **out = **in
+ }
+ if in.NoProxy != nil {
+ in, out := &in.NoProxy, &out.NoProxy
+ *out = make([]IgnitionNoProxy, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IgnitionProxy.
+func (in *IgnitionProxy) DeepCopy() *IgnitionProxy {
+ if in == nil {
+ return nil
+ }
+ out := new(IgnitionProxy)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *IgnitionTLS) DeepCopyInto(out *IgnitionTLS) {
+ *out = *in
+ if in.CASources != nil {
+ in, out := &in.CASources, &out.CASources
+ *out = make([]IgnitionCASource, len(*in))
+ copy(*out, *in)
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IgnitionTLS.
+func (in *IgnitionTLS) DeepCopy() *IgnitionTLS {
+ if in == nil {
+ return nil
+ }
+ out := new(IgnitionTLS)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *IngressRule) DeepCopyInto(out *IngressRule) {
*out = *in
diff --git a/bootstrap/eks/api/v1beta1/conversion_test.go b/bootstrap/eks/api/v1beta1/conversion_test.go
index c6b4485354..47dcb9736d 100644
--- a/bootstrap/eks/api/v1beta1/conversion_test.go
+++ b/bootstrap/eks/api/v1beta1/conversion_test.go
@@ -20,7 +20,6 @@ import (
"testing"
. "github.com/onsi/gomega"
-
runtime "k8s.io/apimachinery/pkg/runtime"
v1beta2 "sigs.k8s.io/cluster-api-provider-aws/v2/bootstrap/eks/api/v1beta2"
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
diff --git a/bootstrap/eks/api/v1beta2/doc.go b/bootstrap/eks/api/v1beta2/doc.go
index 2069db82a5..992666159f 100644
--- a/bootstrap/eks/api/v1beta2/doc.go
+++ b/bootstrap/eks/api/v1beta2/doc.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package v1beta2 contains API Schema definitions for the Amazon EKS Bootstrap v1beta2 API group.
// +gencrdrefdocs:force //nolint: revive
// +groupName=bootstrap.cluster.x-k8s.io
-
package v1beta2
diff --git a/bootstrap/eks/api/v1beta2/eksconfig_webhook.go b/bootstrap/eks/api/v1beta2/eksconfig_webhook.go
index e1459ba1dd..30609f6755 100644
--- a/bootstrap/eks/api/v1beta2/eksconfig_webhook.go
+++ b/bootstrap/eks/api/v1beta2/eksconfig_webhook.go
@@ -42,7 +42,7 @@ func (r *EKSConfig) ValidateCreate() (admission.Warnings, error) {
}
// ValidateUpdate will do any extra validation when updating a EKSConfig.
-func (r *EKSConfig) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
+func (r *EKSConfig) ValidateUpdate(_ runtime.Object) (admission.Warnings, error) {
return nil, nil
}
diff --git a/bootstrap/eks/api/v1beta2/eksconfigtemplate_webhook.go b/bootstrap/eks/api/v1beta2/eksconfigtemplate_webhook.go
index fc2504eca4..d6611c40c3 100644
--- a/bootstrap/eks/api/v1beta2/eksconfigtemplate_webhook.go
+++ b/bootstrap/eks/api/v1beta2/eksconfigtemplate_webhook.go
@@ -42,7 +42,7 @@ func (r *EKSConfigTemplate) ValidateCreate() (admission.Warnings, error) {
}
// ValidateUpdate will do any extra validation when updating a EKSConfigTemplate.
-func (r *EKSConfigTemplate) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
+func (r *EKSConfigTemplate) ValidateUpdate(_ runtime.Object) (admission.Warnings, error) {
return nil, nil
}
diff --git a/bootstrap/eks/api/v1beta2/groupversion_info.go b/bootstrap/eks/api/v1beta2/groupversion_info.go
index a93c42785f..7c26521b41 100644
--- a/bootstrap/eks/api/v1beta2/groupversion_info.go
+++ b/bootstrap/eks/api/v1beta2/groupversion_info.go
@@ -14,10 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-// package v1beta2 contains API Schema definitions for the Amazon EKS Bootstrap v1beta2 API group
+// Package v1beta2 contains API Schema definitions for the Amazon EKS Bootstrap v1beta2 API group
// +kubebuilder:object:generate=true
// +groupName=bootstrap.cluster.x-k8s.io
-
package v1beta2
import (
diff --git a/bootstrap/eks/controllers/eksconfig_controller.go b/bootstrap/eks/controllers/eksconfig_controller.go
index 8f1de94fc3..5aa9425dd5 100644
--- a/bootstrap/eks/controllers/eksconfig_controller.go
+++ b/bootstrap/eks/controllers/eksconfig_controller.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package controllers provides a way to reconcile EKSConfig objects.
package controllers
import (
diff --git a/bootstrap/eks/controllers/suite_test.go b/bootstrap/eks/controllers/suite_test.go
index 74cd527bd6..2b61ab258a 100644
--- a/bootstrap/eks/controllers/suite_test.go
+++ b/bootstrap/eks/controllers/suite_test.go
@@ -42,8 +42,6 @@ func TestMain(m *testing.M) {
}
func setup() {
- // utilruntime.Must(bootstrapv1.AddToScheme(scheme.Scheme))
- // utilruntime.Must(clusterv1.AddToScheme(scheme.Scheme))
utilruntime.Must(ekscontrolplanev1.AddToScheme(scheme.Scheme))
testEnvConfig := helpers.NewTestEnvironmentConfiguration([]string{
path.Join("config", "crd", "bases"),
diff --git a/bootstrap/eks/internal/userdata/commands.go b/bootstrap/eks/internal/userdata/commands.go
index af7551d8b6..1ee0c85abf 100644
--- a/bootstrap/eks/internal/userdata/commands.go
+++ b/bootstrap/eks/internal/userdata/commands.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package userdata provides a way to generate ec2 instance userdata.
package userdata
const (
diff --git a/bootstrap/eks/internal/userdata/node.go b/bootstrap/eks/internal/userdata/node.go
index 7be304cdb7..468f15478f 100644
--- a/bootstrap/eks/internal/userdata/node.go
+++ b/bootstrap/eks/internal/userdata/node.go
@@ -68,6 +68,7 @@ type NodeInput struct {
NTP *eksbootstrapv1.NTP
}
+// DockerConfigJSONEscaped returns the DockerConfigJSON escaped for use in cloud-init.
func (ni *NodeInput) DockerConfigJSONEscaped() string {
if ni.DockerConfigJSON == nil || len(*ni.DockerConfigJSON) == 0 {
return "''"
@@ -76,6 +77,7 @@ func (ni *NodeInput) DockerConfigJSONEscaped() string {
return shellescape.Quote(*ni.DockerConfigJSON)
}
+// BootstrapCommand returns the bootstrap command to be used on a node instance.
func (ni *NodeInput) BootstrapCommand() string {
if ni.BootstrapCommandOverride != nil && *ni.BootstrapCommandOverride != "" {
return *ni.BootstrapCommandOverride
diff --git a/cmd/clusterawsadm/ami/helper.go b/cmd/clusterawsadm/ami/helper.go
index e8c8a2d9ed..ebc393084c 100644
--- a/cmd/clusterawsadm/ami/helper.go
+++ b/cmd/clusterawsadm/ami/helper.go
@@ -241,16 +241,14 @@ func findAMI(imagesMap map[string][]*ec2.Image, baseOS, kubernetesVersion string
}
if val, ok := imagesMap[amiName]; ok && val != nil {
return latestAMI(val)
- } else {
- amiName, err = ec2service.GenerateAmiName(amiNameFormat, baseOS, strings.TrimPrefix(kubernetesVersion, "v"))
- if err != nil {
- return nil, errors.Wrapf(err, "failed to process ami format: %q", amiNameFormat)
- }
- if val, ok = imagesMap[amiName]; ok && val != nil {
- return latestAMI(val)
- }
}
-
+ amiName, err = ec2service.GenerateAmiName(amiNameFormat, baseOS, strings.TrimPrefix(kubernetesVersion, "v"))
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to process ami format: %q", amiNameFormat)
+ }
+ if val, ok := imagesMap[amiName]; ok && val != nil {
+ return latestAMI(val)
+ }
return nil, nil
}
diff --git a/cmd/clusterawsadm/ami/list.go b/cmd/clusterawsadm/ami/list.go
index b17166f75f..2b04f81422 100644
--- a/cmd/clusterawsadm/ami/list.go
+++ b/cmd/clusterawsadm/ami/list.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package ami provides a way to interact with AWS AMIs.
package ami
import (
diff --git a/cmd/clusterawsadm/api/ami/v1beta1/scheme/scheme.go b/cmd/clusterawsadm/api/ami/v1beta1/scheme/scheme.go
index 1dc2079536..851bbead25 100644
--- a/cmd/clusterawsadm/api/ami/v1beta1/scheme/scheme.go
+++ b/cmd/clusterawsadm/api/ami/v1beta1/scheme/scheme.go
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package scheme provides a way to generate a Scheme and CodecFactory f
+// or the bootstrap.aws.infrastructure.cluster.x-k8s.io API group.
package scheme
import (
diff --git a/cmd/clusterawsadm/api/bootstrap/v1alpha1/scheme/scheme.go b/cmd/clusterawsadm/api/bootstrap/v1alpha1/scheme/scheme.go
index fc604a190f..b320f44db3 100644
--- a/cmd/clusterawsadm/api/bootstrap/v1alpha1/scheme/scheme.go
+++ b/cmd/clusterawsadm/api/bootstrap/v1alpha1/scheme/scheme.go
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package scheme provides a way to generate a Scheme and CodecFactory
+// for the bootstrap.aws.infrastructure.cluster.x-k8s.io API group.
package scheme
import (
diff --git a/cmd/clusterawsadm/api/bootstrap/v1beta1/scheme/scheme.go b/cmd/clusterawsadm/api/bootstrap/v1beta1/scheme/scheme.go
index d84a39aee5..f70029e383 100644
--- a/cmd/clusterawsadm/api/bootstrap/v1beta1/scheme/scheme.go
+++ b/cmd/clusterawsadm/api/bootstrap/v1beta1/scheme/scheme.go
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package scheme provides a way to generate a Scheme and CodecFactory
+// for the bootstrap.aws.infrastructure.cluster.x-k8s.io API group.
package scheme
import (
diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_controller.go b/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_controller.go
index 14f8d423bb..c91939295b 100644
--- a/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_controller.go
+++ b/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_controller.go
@@ -322,60 +322,59 @@ func (t Template) ControllersPolicy() *iamv1.PolicyDocument {
// ControllersPolicyEKS creates a policy from a template for AWS Controllers.
func (t Template) ControllersPolicyEKS() *iamv1.PolicyDocument {
- statement := []iamv1.StatementEntry{}
+ statements := []iamv1.StatementEntry{}
allowedIAMActions := iamv1.Actions{
"iam:GetRole",
"iam:ListAttachedRolePolicies",
}
- statement = append(statement, iamv1.StatementEntry{
- Effect: iamv1.EffectAllow,
- Resource: iamv1.Resources{
- "arn:*:ssm:*:*:parameter/aws/service/eks/optimized-ami/*",
- },
- Action: iamv1.Actions{
- "ssm:GetParameter",
- },
- })
-
- statement = append(statement, iamv1.StatementEntry{
- Effect: iamv1.EffectAllow,
- Action: iamv1.Actions{
- "iam:CreateServiceLinkedRole",
- },
- Resource: iamv1.Resources{
- "arn:*:iam::*:role/aws-service-role/eks.amazonaws.com/AWSServiceRoleForAmazonEKS",
- },
- Condition: iamv1.Conditions{
- iamv1.StringLike: map[string]string{"iam:AWSServiceName": "eks.amazonaws.com"},
- },
- })
-
- statement = append(statement, iamv1.StatementEntry{
- Effect: iamv1.EffectAllow,
- Action: iamv1.Actions{
- "iam:CreateServiceLinkedRole",
- },
- Resource: iamv1.Resources{
- "arn:*:iam::*:role/aws-service-role/eks-nodegroup.amazonaws.com/AWSServiceRoleForAmazonEKSNodegroup",
- },
- Condition: iamv1.Conditions{
- iamv1.StringLike: map[string]string{"iam:AWSServiceName": "eks-nodegroup.amazonaws.com"},
+ statements = append(statements,
+ iamv1.StatementEntry{
+ Effect: iamv1.EffectAllow,
+ Resource: iamv1.Resources{
+ "arn:*:ssm:*:*:parameter/aws/service/eks/optimized-ami/*",
+ },
+ Action: iamv1.Actions{
+ "ssm:GetParameter",
+ },
},
- })
-
- statement = append(statement, iamv1.StatementEntry{
- Effect: iamv1.EffectAllow,
- Action: iamv1.Actions{
- "iam:CreateServiceLinkedRole",
+ iamv1.StatementEntry{
+ Effect: iamv1.EffectAllow,
+ Action: iamv1.Actions{
+ "iam:CreateServiceLinkedRole",
+ },
+ Resource: iamv1.Resources{
+ "arn:*:iam::*:role/aws-service-role/eks.amazonaws.com/AWSServiceRoleForAmazonEKS",
+ },
+ Condition: iamv1.Conditions{
+ iamv1.StringLike: map[string]string{"iam:AWSServiceName": "eks.amazonaws.com"},
+ },
},
- Resource: iamv1.Resources{
- "arn:" + t.Spec.Partition + ":iam::*:role/aws-service-role/eks-fargate-pods.amazonaws.com/AWSServiceRoleForAmazonEKSForFargate",
+ iamv1.StatementEntry{
+ Effect: iamv1.EffectAllow,
+ Action: iamv1.Actions{
+ "iam:CreateServiceLinkedRole",
+ },
+ Resource: iamv1.Resources{
+ "arn:*:iam::*:role/aws-service-role/eks-nodegroup.amazonaws.com/AWSServiceRoleForAmazonEKSNodegroup",
+ },
+ Condition: iamv1.Conditions{
+ iamv1.StringLike: map[string]string{"iam:AWSServiceName": "eks-nodegroup.amazonaws.com"},
+ },
},
- Condition: iamv1.Conditions{
- iamv1.StringLike: map[string]string{"iam:AWSServiceName": "eks-fargate.amazonaws.com"},
+ iamv1.StatementEntry{
+ Effect: iamv1.EffectAllow,
+ Action: iamv1.Actions{
+ "iam:CreateServiceLinkedRole",
+ },
+ Resource: iamv1.Resources{
+ "arn:" + t.Spec.Partition + ":iam::*:role/aws-service-role/eks-fargate-pods.amazonaws.com/AWSServiceRoleForAmazonEKSForFargate",
+ },
+ Condition: iamv1.Conditions{
+ iamv1.StringLike: map[string]string{"iam:AWSServiceName": "eks-fargate.amazonaws.com"},
+ },
},
- })
+ )
if t.Spec.EKS.AllowIAMRoleCreation {
allowedIAMActions = append(allowedIAMActions, iamv1.Actions{
@@ -386,7 +385,7 @@ func (t Template) ControllersPolicyEKS() *iamv1.PolicyDocument {
"iam:AttachRolePolicy",
}...)
- statement = append(statement, iamv1.StatementEntry{
+ statements = append(statements, iamv1.StatementEntry{
Action: iamv1.Actions{
"iam:ListOpenIDConnectProviders",
"iam:GetOpenIDConnectProvider",
@@ -402,7 +401,8 @@ func (t Template) ControllersPolicyEKS() *iamv1.PolicyDocument {
Effect: iamv1.EffectAllow,
})
}
- statement = append(statement, []iamv1.StatementEntry{
+
+ statements = append(statements, []iamv1.StatementEntry{
{
Action: allowedIAMActions,
Resource: iamv1.Resources{
@@ -495,7 +495,7 @@ func (t Template) ControllersPolicyEKS() *iamv1.PolicyDocument {
return &iamv1.PolicyDocument{
Version: iamv1.CurrentVersion,
- Statement: statement,
+ Statement: statements,
}
}
diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/iam.go b/cmd/clusterawsadm/cloudformation/bootstrap/iam.go
index 1aa016606e..2a30b4ea33 100644
--- a/cmd/clusterawsadm/cloudformation/bootstrap/iam.go
+++ b/cmd/clusterawsadm/cloudformation/bootstrap/iam.go
@@ -71,6 +71,7 @@ func (t Template) policyFunctionMap() map[PolicyName]func() *iamv1.PolicyDocumen
}
}
+// PrintPolicyDocs prints the JSON representation of policy documents for all ManagedIAMPolicy.
func (t Template) PrintPolicyDocs() error {
for _, name := range ManagedIAMPolicyNames {
policyDoc := t.GetPolicyDocFromPolicyName(name)
diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/template.go b/cmd/clusterawsadm/cloudformation/bootstrap/template.go
index 030bc248ee..c4eb4cbff7 100644
--- a/cmd/clusterawsadm/cloudformation/bootstrap/template.go
+++ b/cmd/clusterawsadm/cloudformation/bootstrap/template.go
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package bootstrap provides a way to generate a CloudFormation template for IAM policies,
+// users and roles for use by Cluster API Provider AWS.
package bootstrap
import (
diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/template_test.go b/cmd/clusterawsadm/cloudformation/bootstrap/template_test.go
index c80f2312ef..e47fbbd047 100644
--- a/cmd/clusterawsadm/cloudformation/bootstrap/template_test.go
+++ b/cmd/clusterawsadm/cloudformation/bootstrap/template_test.go
@@ -17,6 +17,7 @@ limitations under the License.
package bootstrap
import (
+ "bytes"
"fmt"
"os"
"path"
@@ -201,7 +202,7 @@ func TestRenderCloudformation(t *testing.T) {
t.Fatal(err)
}
- if string(tData) != string(data) {
+ if !bytes.Equal(tData, data) {
dmp := diffmatchpatch.New()
diffs := dmp.DiffMain(string(tData), string(data), false)
out := dmp.DiffPrettyText(diffs)
diff --git a/cmd/clusterawsadm/cloudformation/service/service.go b/cmd/clusterawsadm/cloudformation/service/service.go
index 14a27fd2e9..33db42a8d0 100644
--- a/cmd/clusterawsadm/cloudformation/service/service.go
+++ b/cmd/clusterawsadm/cloudformation/service/service.go
@@ -82,6 +82,7 @@ func (s *Service) ReconcileBootstrapStack(stackName string, t go_cfn.Template, t
return nil
}
+// ReconcileBootstrapNoUpdate creates or updates bootstrap CloudFormation without updating the stack.
func (s *Service) ReconcileBootstrapNoUpdate(stackName string, t go_cfn.Template, tags map[string]string) error {
yaml, err := t.YAML()
processedYaml := string(yaml)
diff --git a/cmd/clusterawsadm/cmd/ami/ami.go b/cmd/clusterawsadm/cmd/ami/ami.go
index 0992c0723c..b4959b29e5 100644
--- a/cmd/clusterawsadm/cmd/ami/ami.go
+++ b/cmd/clusterawsadm/cmd/ami/ami.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package ami provides a way to generate AMI commands.
package ami
import (
diff --git a/cmd/clusterawsadm/cmd/ami/common/common.go b/cmd/clusterawsadm/cmd/ami/common/common.go
index 14ad2babaf..c3f79ed0de 100644
--- a/cmd/clusterawsadm/cmd/ami/common/common.go
+++ b/cmd/clusterawsadm/cmd/ami/common/common.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package common provides common flags and functions for the AMI commands.
package common
import (
diff --git a/cmd/clusterawsadm/cmd/ami/common/copy.go b/cmd/clusterawsadm/cmd/ami/common/copy.go
index 406d10f015..c2c95c6448 100644
--- a/cmd/clusterawsadm/cmd/ami/common/copy.go
+++ b/cmd/clusterawsadm/cmd/ami/common/copy.go
@@ -89,7 +89,6 @@ func CopyAMICmd() *cobra.Command {
printer.Print(ami)
- // klog.V(0).Infof("Completed copying %v\n", *image.ImageId)
return nil
},
}
diff --git a/cmd/clusterawsadm/cmd/ami/list/list.go b/cmd/clusterawsadm/cmd/ami/list/list.go
index 12ee0cfc88..5e1bef32ed 100644
--- a/cmd/clusterawsadm/cmd/ami/list/list.go
+++ b/cmd/clusterawsadm/cmd/ami/list/list.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package list provides a way to list AMIs from the default AWS account where AMIs are stored.
package list
import (
diff --git a/cmd/clusterawsadm/cmd/bootstrap/bootstrap.go b/cmd/clusterawsadm/cmd/bootstrap/bootstrap.go
index 00d7322f75..cfa73aa658 100644
--- a/cmd/clusterawsadm/cmd/bootstrap/bootstrap.go
+++ b/cmd/clusterawsadm/cmd/bootstrap/bootstrap.go
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package bootstrap provides cli commands for bootstrapping
+// AWS accounts for use with the Kubernetes Cluster API Provider AWS.
package bootstrap
import (
diff --git a/cmd/clusterawsadm/cmd/bootstrap/credentials/credentials.go b/cmd/clusterawsadm/cmd/bootstrap/credentials/credentials.go
index 2abda3f3b6..0c919d7e7e 100644
--- a/cmd/clusterawsadm/cmd/bootstrap/credentials/credentials.go
+++ b/cmd/clusterawsadm/cmd/bootstrap/credentials/credentials.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package credentials provides a way to encode credentials for use with Kubernetes Cluster API Provider AWS.
package credentials
import (
diff --git a/cmd/clusterawsadm/cmd/bootstrap/iam/iam_doc.go b/cmd/clusterawsadm/cmd/bootstrap/iam/iam_doc.go
index f518c5cc96..775187858f 100644
--- a/cmd/clusterawsadm/cmd/bootstrap/iam/iam_doc.go
+++ b/cmd/clusterawsadm/cmd/bootstrap/iam/iam_doc.go
@@ -44,7 +44,7 @@ func printPolicyCmd() *cobra.Command {
clusterawsadm bootstrap iam print-policy --document AWSIAMManagedPolicyControllers
# Print out the IAM policy for the Kubernetes Cluster API Provider AWS Controller using a given configuration file.
- clusterawsadm bootstrap iam print-policy --document AWSIAMManagedPolicyControllers --config bootstrap_config.yaml
+ clusterawsadm bootstrap iam print-policy --document AWSIAMManagedPolicyControllers --config bootstrap_config.yaml
# Print out the IAM policy for the Kubernetes AWS Cloud Provider for the control plane.
clusterawsadm bootstrap iam print-policy --document AWSIAMManagedPolicyCloudProviderControlPlane
diff --git a/cmd/clusterawsadm/cmd/bootstrap/iam/root.go b/cmd/clusterawsadm/cmd/bootstrap/iam/root.go
index 1f9f2b9ca5..491610cd59 100644
--- a/cmd/clusterawsadm/cmd/bootstrap/iam/root.go
+++ b/cmd/clusterawsadm/cmd/bootstrap/iam/root.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package iam provides a way to generate IAM policies and roles.
package iam
import (
diff --git a/cmd/clusterawsadm/cmd/controller/controller.go b/cmd/clusterawsadm/cmd/controller/controller.go
index a8897cea08..31e018d432 100644
--- a/cmd/clusterawsadm/cmd/controller/controller.go
+++ b/cmd/clusterawsadm/cmd/controller/controller.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package controller provides the controller command.
package controller
import (
diff --git a/cmd/clusterawsadm/cmd/controller/credentials/print.go b/cmd/clusterawsadm/cmd/controller/credentials/print.go
index b88621cf25..0b4e27094a 100644
--- a/cmd/clusterawsadm/cmd/controller/credentials/print.go
+++ b/cmd/clusterawsadm/cmd/controller/credentials/print.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package credentials provides a CLI utilities for AWS credentials.
package credentials
import (
diff --git a/cmd/clusterawsadm/cmd/controller/rollout/common.go b/cmd/clusterawsadm/cmd/controller/rollout/common.go
index 37cc67b6e9..47707f3970 100644
--- a/cmd/clusterawsadm/cmd/controller/rollout/common.go
+++ b/cmd/clusterawsadm/cmd/controller/rollout/common.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package rollout provides the rollout command.
package rollout
import (
diff --git a/cmd/clusterawsadm/cmd/eks/addons/addons.go b/cmd/clusterawsadm/cmd/eks/addons/addons.go
index 3b8ae23e76..709f2f2cf3 100644
--- a/cmd/clusterawsadm/cmd/eks/addons/addons.go
+++ b/cmd/clusterawsadm/cmd/eks/addons/addons.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package addons provides EKS addons commands.
package addons
import "github.com/spf13/cobra"
diff --git a/cmd/clusterawsadm/cmd/eks/addons/list_installed.go b/cmd/clusterawsadm/cmd/eks/addons/list_installed.go
index 827c944e0a..cb73ee64b5 100644
--- a/cmd/clusterawsadm/cmd/eks/addons/list_installed.go
+++ b/cmd/clusterawsadm/cmd/eks/addons/list_installed.go
@@ -113,10 +113,10 @@ func listInstalledAddons(region, clusterName, printerType *string) error {
newIssue := issue{
Code: *addonIssue.Code,
Message: *addonIssue.Message,
- ResourceIds: []string{},
+ ResourceIDs: []string{},
}
for _, resID := range addonIssue.ResourceIds {
- newIssue.ResourceIds = append(newIssue.ResourceIds, *resID)
+ newIssue.ResourceIDs = append(newIssue.ResourceIDs, *resID)
}
installedAddon.HealthIssues = append(installedAddon.HealthIssues, newIssue)
}
diff --git a/cmd/clusterawsadm/cmd/eks/addons/types.go b/cmd/clusterawsadm/cmd/eks/addons/types.go
index a59368f8f6..9c9ae62616 100644
--- a/cmd/clusterawsadm/cmd/eks/addons/types.go
+++ b/cmd/clusterawsadm/cmd/eks/addons/types.go
@@ -106,7 +106,7 @@ type installedAddon struct {
type issue struct {
Code string
Message string
- ResourceIds []string
+ ResourceIDs []string
}
type installedAddonsList struct {
diff --git a/cmd/clusterawsadm/cmd/eks/eks.go b/cmd/clusterawsadm/cmd/eks/eks.go
index 42d271f481..8856216aa8 100644
--- a/cmd/clusterawsadm/cmd/eks/eks.go
+++ b/cmd/clusterawsadm/cmd/eks/eks.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package eks provides a CLI to manage EKS clusters.
package eks
import (
diff --git a/cmd/clusterawsadm/cmd/flags/common.go b/cmd/clusterawsadm/cmd/flags/common.go
index 096d289927..d6d7e4e808 100644
--- a/cmd/clusterawsadm/cmd/flags/common.go
+++ b/cmd/clusterawsadm/cmd/flags/common.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package flags provides a way to add flags to the cli.
package flags
import (
diff --git a/cmd/clusterawsadm/cmd/gc/gc.go b/cmd/clusterawsadm/cmd/gc/gc.go
index 0bd0344514..c9d91bf703 100644
--- a/cmd/clusterawsadm/cmd/gc/gc.go
+++ b/cmd/clusterawsadm/cmd/gc/gc.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package gc provides commands related to garbage collecting external resources of clusters.
package gc
import (
@@ -27,10 +28,7 @@ func RootCmd() *cobra.Command {
Short: "Commands related to garbage collecting external resources of clusters",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
- if err := cmd.Help(); err != nil {
- return err
- }
- return nil
+ return cmd.Help()
},
}
diff --git a/cmd/clusterawsadm/cmd/resource/list/list.go b/cmd/clusterawsadm/cmd/resource/list/list.go
index 01b84e2ae4..1e65ef61ad 100644
--- a/cmd/clusterawsadm/cmd/resource/list/list.go
+++ b/cmd/clusterawsadm/cmd/resource/list/list.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package list provides the list command for the resource package.
package list
import (
@@ -38,7 +39,7 @@ func ListAWSResourceCmd() *cobra.Command {
Short: "List all AWS resources created by CAPA",
Long: cmd.LongDesc(`
List AWS resources directly created by CAPA based on region and cluster-name. There are some indirect resources like Cloudwatch alarms, rules, etc
- which are not directly created by CAPA, so those resources are not listed here.
+ which are not directly created by CAPA, so those resources are not listed here.
If region and cluster-name are not set, then it will throw an error.
`),
Example: cmd.Examples(`
diff --git a/cmd/clusterawsadm/cmd/resource/resource.go b/cmd/clusterawsadm/cmd/resource/resource.go
index 36e5aa3e25..c2cbde7a6a 100644
--- a/cmd/clusterawsadm/cmd/resource/resource.go
+++ b/cmd/clusterawsadm/cmd/resource/resource.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package resource provides commands related to AWS resources.
package resource
import (
@@ -34,10 +35,7 @@ func RootCmd() *cobra.Command {
# List of AWS resources created by CAPA
`),
RunE: func(cmd *cobra.Command, args []string) error {
- if err := cmd.Help(); err != nil {
- return err
- }
- return nil
+ return cmd.Help()
},
}
diff --git a/cmd/clusterawsadm/cmd/root.go b/cmd/clusterawsadm/cmd/root.go
index dc25175824..0c0b2b5614 100644
--- a/cmd/clusterawsadm/cmd/root.go
+++ b/cmd/clusterawsadm/cmd/root.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package cmd implements the clusterawsadm command line utility.
package cmd
import (
@@ -63,7 +64,7 @@ func RootCmd() *cobra.Command {
export AWS_B64ENCODED_CREDENTIALS=$(clusterawsadm bootstrap credentials encode-as-profile)
clusterctl init --infrastructure aws
`),
- RunE: func(cmd *cobra.Command, args []string) error {
+ RunE: func(cmd *cobra.Command, _ []string) error {
return cmd.Help()
},
}
diff --git a/cmd/clusterawsadm/cmd/util/util.go b/cmd/clusterawsadm/cmd/util/util.go
index 8e714ed80c..7b974add4a 100644
--- a/cmd/clusterawsadm/cmd/util/util.go
+++ b/cmd/clusterawsadm/cmd/util/util.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package util provides utility functions.
package util
import (
diff --git a/cmd/clusterawsadm/cmd/version/version.go b/cmd/clusterawsadm/cmd/version/version.go
index db85908013..23930f6fde 100644
--- a/cmd/clusterawsadm/cmd/version/version.go
+++ b/cmd/clusterawsadm/cmd/version/version.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package version provides the version information of clusterawsadm.
package version
import (
diff --git a/cmd/clusterawsadm/configreader/configreader.go b/cmd/clusterawsadm/configreader/configreader.go
index 3047152cb6..e5b1d800cd 100644
--- a/cmd/clusterawsadm/configreader/configreader.go
+++ b/cmd/clusterawsadm/configreader/configreader.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package configreader provides a way to load a bootstrapv1.AWSIAMConfiguration from a file.
package configreader
import (
diff --git a/cmd/clusterawsadm/controller/credentials/update_credentials.go b/cmd/clusterawsadm/controller/credentials/update_credentials.go
index e4a9d1afc4..eba621cb3e 100644
--- a/cmd/clusterawsadm/controller/credentials/update_credentials.go
+++ b/cmd/clusterawsadm/controller/credentials/update_credentials.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package credentials provides AWS credentials management.
package credentials
import (
@@ -49,7 +50,7 @@ func UpdateCredentials(input UpdateCredentialsInput) error {
creds = "Cg=="
}
- patch := fmt.Sprintf("{\"data\":{\"credentials\": \"%s\"}}", creds)
+ patch := fmt.Sprintf("{\"data\":{\"credentials\": %q}}", creds)
_, err = client.CoreV1().Secrets(input.Namespace).Patch(
context.TODO(),
controller.BootstrapCredsSecret,
diff --git a/cmd/clusterawsadm/controller/helper.go b/cmd/clusterawsadm/controller/helper.go
index d7ff024ff2..809678bf2b 100644
--- a/cmd/clusterawsadm/controller/helper.go
+++ b/cmd/clusterawsadm/controller/helper.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package controller contains the controller logic for the capa manager.
package controller
import (
diff --git a/cmd/clusterawsadm/controller/rollout/rollout.go b/cmd/clusterawsadm/controller/rollout/rollout.go
index 12f9f722cd..eb55e32947 100644
--- a/cmd/clusterawsadm/controller/rollout/rollout.go
+++ b/cmd/clusterawsadm/controller/rollout/rollout.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package rollout provides a way to rollout the CAPA controller manager deployment.
package rollout
import (
diff --git a/cmd/clusterawsadm/converters/iam.go b/cmd/clusterawsadm/converters/iam.go
index cecf4f5530..a571962fee 100644
--- a/cmd/clusterawsadm/converters/iam.go
+++ b/cmd/clusterawsadm/converters/iam.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package converters contains the conversion functions for AWS.
package converters
import (
diff --git a/cmd/clusterawsadm/credentials/credentials.go b/cmd/clusterawsadm/credentials/credentials.go
index 4c640dfbfe..2aa320839a 100644
--- a/cmd/clusterawsadm/credentials/credentials.go
+++ b/cmd/clusterawsadm/credentials/credentials.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package credentials contains utilities for working with AWS credentials.
package credentials
import (
diff --git a/cmd/clusterawsadm/gc/gc.go b/cmd/clusterawsadm/gc/gc.go
index 046c841be6..27a9887d41 100644
--- a/cmd/clusterawsadm/gc/gc.go
+++ b/cmd/clusterawsadm/gc/gc.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package gc provides a way to handle AWS garbage collection on deletion.
package gc
import (
@@ -23,8 +24,8 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
- _ "k8s.io/client-go/plugin/pkg/client/auth/exec"
- _ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
+ _ "k8s.io/client-go/plugin/pkg/client/auth/exec" // import all auth plugins
+ _ "k8s.io/client-go/plugin/pkg/client/auth/oidc" // import all oidc plugins
"k8s.io/client-go/tools/clientcmd"
"sigs.k8s.io/controller-runtime/pkg/client"
diff --git a/cmd/clusterawsadm/main.go b/cmd/clusterawsadm/main.go
index bd97bc0adb..0a30981ed0 100644
--- a/cmd/clusterawsadm/main.go
+++ b/cmd/clusterawsadm/main.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package main is the entrypoint for the clusterawsadm command.
package main
import "sigs.k8s.io/cluster-api-provider-aws/v2/cmd/clusterawsadm/cmd"
diff --git a/cmd/clusterawsadm/printers/printers.go b/cmd/clusterawsadm/printers/printers.go
index 4d3b6aa713..0c106aca12 100644
--- a/cmd/clusterawsadm/printers/printers.go
+++ b/cmd/clusterawsadm/printers/printers.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package printers provides a wrapper for the k8s.io/cli-runtime/pkg/printers package.
package printers
import (
diff --git a/cmd/clusterawsadm/resource/type.go b/cmd/clusterawsadm/resource/type.go
index e5b344aff3..0dda210426 100644
--- a/cmd/clusterawsadm/resource/type.go
+++ b/cmd/clusterawsadm/resource/type.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package resource provides definitions for AWS resource types.
package resource
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/config/crd/bases/controlplane.cluster.x-k8s.io_rosacontrolplanes.yaml b/config/crd/bases/controlplane.cluster.x-k8s.io_rosacontrolplanes.yaml
index d67cf97022..38cc06b8f0 100644
--- a/config/crd/bases/controlplane.cluster.x-k8s.io_rosacontrolplanes.yaml
+++ b/config/crd/bases/controlplane.cluster.x-k8s.io_rosacontrolplanes.yaml
@@ -30,6 +30,7 @@ spec:
name: v1beta2
schema:
openAPIV3Schema:
+ description: ROSAControlPlane is the Schema for the ROSAControlPlanes API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
@@ -44,21 +45,23 @@ spec:
metadata:
type: object
spec:
+ description: RosaControlPlaneSpec defines the desired state of ROSAControlPlane.
properties:
- autoscaling:
- description: Autoscaling specifies auto scaling behaviour for the
- MachinePools.
- properties:
- maxReplicas:
- minimum: 1
- type: integer
- minReplicas:
- minimum: 1
- type: integer
+ additionalTags:
+ additionalProperties:
+ type: string
+ description: AdditionalTags are user-defined tags to be added on the
+ AWS resources associated with the control plane.
type: object
+ auditLogRoleARN:
+ description: AuditLogRoleARN defines the role that is used to forward
+ audit logs to AWS CloudWatch. If not set, audit log forwarding is
+ disabled.
+ type: string
availabilityZones:
- description: AWS AvailabilityZones of the worker nodes should match
- the AvailabilityZones of the Subnets.
+ description: AvailabilityZones describe AWS AvailabilityZones of the
+ worker nodes. should match the AvailabilityZones of the provided
+ Subnets. a machinepool will be created for each availabilityZone.
items:
type: string
type: array
@@ -100,6 +103,59 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
+ defaultMachinePoolSpec:
+ description: "DefaultMachinePoolSpec defines the configuration for
+ the default machinepool(s) provisioned as part of the cluster creation.
+ One MachinePool will be created with this configuration per AvailabilityZone.
+ Those default machinepools are required for openshift cluster operators
+ to work properly. As these machinepool not created using ROSAMachinePool
+ CR, they will not be visible/managed by ROSA CAPI provider. `rosa
+ list machinepools -c
+ Package v1beta2 contains API Schema definitions for the Amazon EKS Bootstrap v1beta2 API group.
bootstrap.cluster.x-k8s.io/v1beta2
+
IdentityRef is a reference to a identity to be used when reconciling the managed control plane.
+IdentityRef is a reference to an identity to be used when reconciling the managed control plane. +If no identity is specified, the default identity for this controller will be used.
IdentityRef is a reference to a identity to be used when reconciling the managed control plane.
+IdentityRef is a reference to an identity to be used when reconciling the managed control plane. +If no identity is specified, the default identity for this controller will be used.
+
IdentityProviderStatus holds the status for associated identity provider
-(Optional)
- IdentityRef is a reference to a identity to be used when reconciling the managed control plane. +IdentityRef is a reference to an identity to be used when reconciling the managed control plane. +If no identity is specified, the default identity for this controller will be used. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-(Optional)
- IdentityRef is a reference to a identity to be used when reconciling the managed control plane. +IdentityRef is a reference to an identity to be used when reconciling the managed control plane. +If no identity is specified, the default identity for this controller will be used. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-
Package v1beta1 contains the v1beta1 API implementation.
+(Appears on:RosaControlPlaneSpec) -Resource Types: -+
AWSRolesRef contains references to various AWS IAM roles required for operators to make calls against the AWS API.
+ +Field | +Description | +
---|---|
+ingressARN + +string + + |
+
+ The referenced role must have a trust relationship that allows it to be assumed via web identity. +https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc.html. +Example: +{ +“Version”: “2012-10-17”, +“Statement”: [ +{ +“Effect”: “Allow”, +“Principal”: { +“Federated”: “{{ .ProviderARN }}” +}, +“Action”: “sts:AssumeRoleWithWebIdentity”, +“Condition”: { +“StringEquals”: { +“{{ .ProviderName }}:sub”: {{ .ServiceAccounts }} +} +} +} +] +} +IngressARN is an ARN value referencing a role appropriate for the Ingress Operator. +The following is an example of a valid policy document: +{ +“Version”: “2012-10-17”, +“Statement”: [ +{ +“Effect”: “Allow”, +“Action”: [ +“elasticloadbalancing:DescribeLoadBalancers”, +“tag:GetResources”, +“route53:ListHostedZones” +], +“Resource”: “*” +}, +{ +“Effect”: “Allow”, +“Action”: [ +“route53:ChangeResourceRecordSets” +], +“Resource”: [ +“arn:aws:route53:::PUBLIC_ZONE_ID”, +“arn:aws:route53:::PRIVATE_ZONE_ID” +] +} +] +} + |
+
+imageRegistryARN + +string + + |
+
+ ImageRegistryARN is an ARN value referencing a role appropriate for the Image Registry Operator. +The following is an example of a valid policy document: +{ +“Version”: “2012-10-17”, +“Statement”: [ +{ +“Effect”: “Allow”, +“Action”: [ +“s3:CreateBucket”, +“s3:DeleteBucket”, +“s3:PutBucketTagging”, +“s3:GetBucketTagging”, +“s3:PutBucketPublicAccessBlock”, +“s3:GetBucketPublicAccessBlock”, +“s3:PutEncryptionConfiguration”, +“s3:GetEncryptionConfiguration”, +“s3:PutLifecycleConfiguration”, +“s3:GetLifecycleConfiguration”, +“s3:GetBucketLocation”, +“s3:ListBucket”, +“s3:GetObject”, +“s3:PutObject”, +“s3:DeleteObject”, +“s3:ListBucketMultipartUploads”, +“s3:AbortMultipartUpload”, +“s3:ListMultipartUploadParts” +], +“Resource”: “*” +} +] +} + |
+
+storageARN + +string + + |
+
+ StorageARN is an ARN value referencing a role appropriate for the Storage Operator. +The following is an example of a valid policy document: +{ +“Version”: “2012-10-17”, +“Statement”: [ +{ +“Effect”: “Allow”, +“Action”: [ +“ec2:AttachVolume”, +“ec2:CreateSnapshot”, +“ec2:CreateTags”, +“ec2:CreateVolume”, +“ec2:DeleteSnapshot”, +“ec2:DeleteTags”, +“ec2:DeleteVolume”, +“ec2:DescribeInstances”, +“ec2:DescribeSnapshots”, +“ec2:DescribeTags”, +“ec2:DescribeVolumes”, +“ec2:DescribeVolumesModifications”, +“ec2:DetachVolume”, +“ec2:ModifyVolume” +], +“Resource”: “*” +} +] +} + |
+
+networkARN + +string + + |
+
+ NetworkARN is an ARN value referencing a role appropriate for the Network Operator. +The following is an example of a valid policy document: +{ +“Version”: “2012-10-17”, +“Statement”: [ +{ +“Effect”: “Allow”, +“Action”: [ +“ec2:DescribeInstances”, +“ec2:DescribeInstanceStatus”, +“ec2:DescribeInstanceTypes”, +“ec2:UnassignPrivateIpAddresses”, +“ec2:AssignPrivateIpAddresses”, +“ec2:UnassignIpv6Addresses”, +“ec2:AssignIpv6Addresses”, +“ec2:DescribeSubnets”, +“ec2:DescribeNetworkInterfaces” +], +“Resource”: “*” +} +] +} + |
+
+kubeCloudControllerARN + +string + + |
+
+ KubeCloudControllerARN is an ARN value referencing a role appropriate for the KCM/KCC. +Source: https://cloud-provider-aws.sigs.k8s.io/prerequisites/#iam-policies +The following is an example of a valid policy document: +{ +“Version”: “2012-10-17”, +“Statement”: [ +{ +“Action”: [ +“autoscaling:DescribeAutoScalingGroups”, +“autoscaling:DescribeLaunchConfigurations”, +“autoscaling:DescribeTags”, +“ec2:DescribeAvailabilityZones”, +“ec2:DescribeInstances”, +“ec2:DescribeImages”, +“ec2:DescribeRegions”, +“ec2:DescribeRouteTables”, +“ec2:DescribeSecurityGroups”, +“ec2:DescribeSubnets”, +“ec2:DescribeVolumes”, +“ec2:CreateSecurityGroup”, +“ec2:CreateTags”, +“ec2:CreateVolume”, +“ec2:ModifyInstanceAttribute”, +“ec2:ModifyVolume”, +“ec2:AttachVolume”, +“ec2:AuthorizeSecurityGroupIngress”, +“ec2:CreateRoute”, +“ec2:DeleteRoute”, +“ec2:DeleteSecurityGroup”, +“ec2:DeleteVolume”, +“ec2:DetachVolume”, +“ec2:RevokeSecurityGroupIngress”, +“ec2:DescribeVpcs”, +“elasticloadbalancing:AddTags”, +“elasticloadbalancing:AttachLoadBalancerToSubnets”, +“elasticloadbalancing:ApplySecurityGroupsToLoadBalancer”, +“elasticloadbalancing:CreateLoadBalancer”, +“elasticloadbalancing:CreateLoadBalancerPolicy”, +“elasticloadbalancing:CreateLoadBalancerListeners”, +“elasticloadbalancing:ConfigureHealthCheck”, +“elasticloadbalancing:DeleteLoadBalancer”, +“elasticloadbalancing:DeleteLoadBalancerListeners”, +“elasticloadbalancing:DescribeLoadBalancers”, +“elasticloadbalancing:DescribeLoadBalancerAttributes”, +“elasticloadbalancing:DetachLoadBalancerFromSubnets”, +“elasticloadbalancing:DeregisterInstancesFromLoadBalancer”, +“elasticloadbalancing:ModifyLoadBalancerAttributes”, +“elasticloadbalancing:RegisterInstancesWithLoadBalancer”, +“elasticloadbalancing:SetLoadBalancerPoliciesForBackendServer”, +“elasticloadbalancing:AddTags”, +“elasticloadbalancing:CreateListener”, +“elasticloadbalancing:CreateTargetGroup”, +“elasticloadbalancing:DeleteListener”, +“elasticloadbalancing:DeleteTargetGroup”, +“elasticloadbalancing:DeregisterTargets”, +“elasticloadbalancing:DescribeListeners”, +“elasticloadbalancing:DescribeLoadBalancerPolicies”, +“elasticloadbalancing:DescribeTargetGroups”, +“elasticloadbalancing:DescribeTargetHealth”, +“elasticloadbalancing:ModifyListener”, +“elasticloadbalancing:ModifyTargetGroup”, +“elasticloadbalancing:RegisterTargets”, +“elasticloadbalancing:SetLoadBalancerPoliciesOfListener”, +“iam:CreateServiceLinkedRole”, +“kms:DescribeKey” +], +“Resource”: [ +“*” +], +“Effect”: “Allow” +} +] +} + |
+
+nodePoolManagementARN + +string + + |
+
+ NodePoolManagementARN is an ARN value referencing a role appropriate for the CAPI Controller. +The following is an example of a valid policy document: +{ +“Version”: “2012-10-17”, +“Statement”: [ +{ +“Action”: [ +“ec2:AssociateRouteTable”, +“ec2:AttachInternetGateway”, +“ec2:AuthorizeSecurityGroupIngress”, +“ec2:CreateInternetGateway”, +“ec2:CreateNatGateway”, +“ec2:CreateRoute”, +“ec2:CreateRouteTable”, +“ec2:CreateSecurityGroup”, +“ec2:CreateSubnet”, +“ec2:CreateTags”, +“ec2:DeleteInternetGateway”, +“ec2:DeleteNatGateway”, +“ec2:DeleteRouteTable”, +“ec2:DeleteSecurityGroup”, +“ec2:DeleteSubnet”, +“ec2:DeleteTags”, +“ec2:DescribeAccountAttributes”, +“ec2:DescribeAddresses”, +“ec2:DescribeAvailabilityZones”, +“ec2:DescribeImages”, +“ec2:DescribeInstances”, +“ec2:DescribeInternetGateways”, +“ec2:DescribeNatGateways”, +“ec2:DescribeNetworkInterfaces”, +“ec2:DescribeNetworkInterfaceAttribute”, +“ec2:DescribeRouteTables”, +“ec2:DescribeSecurityGroups”, +“ec2:DescribeSubnets”, +“ec2:DescribeVpcs”, +“ec2:DescribeVpcAttribute”, +“ec2:DescribeVolumes”, +“ec2:DetachInternetGateway”, +“ec2:DisassociateRouteTable”, +“ec2:DisassociateAddress”, +“ec2:ModifyInstanceAttribute”, +“ec2:ModifyNetworkInterfaceAttribute”, +“ec2:ModifySubnetAttribute”, +“ec2:RevokeSecurityGroupIngress”, +“ec2:RunInstances”, +“ec2:TerminateInstances”, +“tag:GetResources”, +“ec2:CreateLaunchTemplate”, +“ec2:CreateLaunchTemplateVersion”, +“ec2:DescribeLaunchTemplates”, +“ec2:DescribeLaunchTemplateVersions”, +“ec2:DeleteLaunchTemplate”, +“ec2:DeleteLaunchTemplateVersions” +], +“Resource”: [ +“” +], +“Effect”: “Allow” +}, +{ +“Condition”: { +“StringLike”: { +“iam:AWSServiceName”: “elasticloadbalancing.amazonaws.com” +} +}, +“Action”: [ +“iam:CreateServiceLinkedRole” +], +“Resource”: [ +“arn::iam:::role/aws-service-role/elasticloadbalancing.amazonaws.com/AWSServiceRoleForElasticLoadBalancing” +], +“Effect”: “Allow” +}, +{ +“Action”: [ +“iam:PassRole” +], +“Resource”: [ +“arn::iam:::role/-worker-role” +], +“Effect”: “Allow” +}, +{ +“Effect”: “Allow”, +“Action”: [ +“kms:Decrypt”, +“kms:ReEncrypt”, +“kms:GenerateDataKeyWithoutPlainText”, +“kms:DescribeKey” +], +“Resource”: “” +}, +{ +“Effect”: “Allow”, +“Action”: [ +“kms:CreateGrant” +], +“Resource”: “”, +“Condition”: { +“Bool”: { +“kms:GrantIsForAWSResource”: true +} +} +} +] +} + |
+
+controlPlaneOperatorARN + +string + + |
+
+ ControlPlaneOperatorARN is an ARN value referencing a role appropriate for the Control Plane Operator. +The following is an example of a valid policy document: +{ +“Version”: “2012-10-17”, +“Statement”: [ +{ +“Effect”: “Allow”, +“Action”: [ +“ec2:CreateVpcEndpoint”, +“ec2:DescribeVpcEndpoints”, +“ec2:ModifyVpcEndpoint”, +“ec2:DeleteVpcEndpoints”, +“ec2:CreateTags”, +“route53:ListHostedZones”, +“ec2:CreateSecurityGroup”, +“ec2:AuthorizeSecurityGroupIngress”, +“ec2:AuthorizeSecurityGroupEgress”, +“ec2:DeleteSecurityGroup”, +“ec2:RevokeSecurityGroupIngress”, +“ec2:RevokeSecurityGroupEgress”, +“ec2:DescribeSecurityGroups”, +“ec2:DescribeVpcs”, +], +“Resource”: “*” +}, +{ +“Effect”: “Allow”, +“Action”: [ +“route53:ChangeResourceRecordSets”, +“route53:ListResourceRecordSets” +], +“Resource”: “arn:aws:route53:::%s” +} +] +} + |
+
+kmsProviderARN + +string + + |
++ | +
-(Appears on:AWSMachineSpec) +(Appears on:RosaControlPlaneSpec)
-
AMIReference is a reference to a specific AWS resource by ID, ARN, or filters. -Only one of ID, ARN or Filters may be specified. Specifying more than one will result in -a validation error.
+DefaultMachinePoolSpec defines the configuration for the required worker nodes provisioned as part of the cluster creation.
-id + instanceType string |
(Optional)
- ID of resource +The instance type to use, for example |
-eksLookupType + autoscaling - -EKSAMILookupType + +RosaMachinePoolAutoScaling |
(Optional)
- EKSOptimizedLookupType If specified, will look up an EKS Optimized image in SSM Parameter store +Autoscaling specifies auto scaling behaviour for this MachinePool. |
-
AWSCluster is the schema for Amazon EC2 based Kubernetes Cluster API.
+(Appears on:RosaControlPlaneSpec) + ++
NetworkSpec for ROSA-HCP.
+ +Field | +Description | +
---|---|
+machineCIDR + +string + + |
+
+(Optional)
+ IP addresses block used by OpenShift while installing the cluster, for example “10.0.0.0/16”. + |
+
+podCIDR + +string + + |
+
+(Optional)
+ IP address block from which to assign pod IP addresses, for example |
+
+serviceCIDR + +string + + |
+
+(Optional)
+ IP address block from which to assign service IP addresses, for example |
+
+hostPrefix + +int + + |
+
+(Optional)
+ Network host prefix which is defaulted to |
+
+networkType + +string + + |
+
+(Optional)
+ The CNI network type default is OVNKubernetes. + |
+
+
ROSAControlPlane is the Schema for the ROSAControlPlanes API.
spec - -AWSClusterSpec + +RosaControlPlaneSpec |
@@ -8154,250 +8669,1083 @@ AWSClusterSpec
-network + rosaClusterName - -NetworkSpec - +string |
- NetworkSpec encapsulates all things related to AWS network. +Cluster name must be valid DNS-1035 label, so it must consist of lower case alphanumeric +characters or ‘-’, start with an alphabetic character, end with an alphanumeric character +and have a max length of 54 characters. |
-region + domainPrefix string |
- The AWS Region the cluster lives in. +(Optional) +DomainPrefix is an optional prefix added to the cluster’s domain name. It will be used +when generating a sub-domain for the cluster on openshiftapps domain. It must be valid DNS-1035 label +consisting of lower case alphanumeric characters or ‘-’, start with an alphabetic character +end with an alphanumeric character and have a max length of 15 characters. |
-sshKeyName + subnets -string +[]string |
-(Optional)
- SSHKeyName is the name of the ssh key to attach to the bastion host. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name) +The Subnet IDs to use when installing the cluster. +SubnetIDs should come in pairs; two per availability zone, one private and one public. |
-controlPlaneEndpoint + availabilityZones - -Cluster API api/v1beta1.APIEndpoint - +[]string |
-(Optional)
- ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. +AvailabilityZones describe AWS AvailabilityZones of the worker nodes. +should match the AvailabilityZones of the provided Subnets. +a machinepool will be created for each availabilityZone. |
-additionalTags + region - -Tags - +string |
-(Optional)
- AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the -ones added by default. +The AWS Region the cluster lives in. |
-controlPlaneLoadBalancer + version - -AWSLoadBalancerSpec - +string |
-(Optional)
- ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior. +OpenShift semantic version, for example “4.14.5”. |
-imageLookupFormat + rolesRef -string + +AWSRolesRef + |
-(Optional)
- ImageLookupFormat is the AMI naming format to look up machine images when -a machine does not specify an AMI. When set, this will be used for all -cluster machines unless a machine specifies a different ImageLookupOrg. -Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base -OS and kubernetes version, respectively. The BaseOS will be the value in -ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as -defined by the packages produced by kubernetes/release without v as a -prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default -image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up -searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a -Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See -also: https://golang.org/pkg/text/template/ +AWS IAM roles used to perform credential requests by the openshift operators. |
-imageLookupOrg + oidcID string |
-(Optional)
- ImageLookupOrg is the AWS Organization ID to look up machine images when a -machine does not specify an AMI. When set, this will be used for all -cluster machines unless a machine specifies a different ImageLookupOrg. +The ID of the OpenID Connect Provider. |
-imageLookupBaseOS + installerRoleARN string |
- ImageLookupBaseOS is the name of the base operating system used to look -up machine images when a machine does not specify an AMI. When set, this -will be used for all cluster machines unless a machine specifies a -different ImageLookupBaseOS. +InstallerRoleARN is an AWS IAM role that OpenShift Cluster Manager will assume to create the cluster.. |
-bastion + supportRoleARN - -Bastion - +string |
-(Optional)
- Bastion contains options to configure the bastion host. +SupportRoleARN is an AWS IAM role used by Red Hat SREs to enable +access to the cluster account in order to provide support. |
-identityRef + workerRoleARN - -AWSIdentityReference - +string |
-(Optional)
- IdentityRef is a reference to a identity to be used when reconciling this cluster +WorkerRoleARN is an AWS IAM role that will be attached to worker instances. |
-s3Bucket + billingAccount - -S3Bucket - +string |
(Optional)
- S3Bucket contains options to configure a supporting S3 bucket for this -cluster - currently used for nodes requiring Ignition -(https://coreos.github.io/ignition/) for bootstrapping (requires -BootstrapFormatIgnition feature flag to be enabled). - |
-
BillingAccount is an optional AWS account to use for billing the subscription fees for ROSA clusters. +The cost of running each ROSA cluster will be billed to the infrastructure account in which the cluster +is running.
status
defaultMachinePoolSpec
DefaultMachinePoolSpec defines the configuration for the default machinepool(s) provisioned as part of the cluster creation.
+One MachinePool will be created with this configuration per AvailabilityZone. Those default machinepools are required for openshift cluster operators
+to work properly.
+As these machinepool not created using ROSAMachinePool CR, they will not be visible/managed by ROSA CAPI provider.
+rosa list machinepools -c <rosaClusterName>
can be used to view those machinepools.
This field will be removed in the future once the current limitation is resolved.
-
AWSClusterControllerIdentity is the Schema for the awsclustercontrolleridentities API -It is used to grant access to use Cluster API Provider AWS Controller credentials.
- -Field | -Description | -||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-metadata + network - -Kubernetes meta/v1.ObjectMeta + +NetworkSpec |
-Refer to the Kubernetes API documentation for the fields of the
-metadata field.
+(Optional)
+Network config for the ROSA HCP cluster. |
||||||||||||
-spec + endpointAccess - -AWSClusterControllerIdentitySpec + +RosaEndpointAccessType |
- Spec for this AWSClusterControllerIdentity. -- -
|
+||||||||||||
+status + + +RosaControlPlaneStatus + + + |
++ | +
+(Appears on:ROSAControlPlane) +
++
RosaControlPlaneSpec defines the desired state of ROSAControlPlane.
+ +Field | +Description | +
---|---|
+rosaClusterName + +string + + |
+
+ Cluster name must be valid DNS-1035 label, so it must consist of lower case alphanumeric +characters or ‘-’, start with an alphabetic character, end with an alphanumeric character +and have a max length of 54 characters. + |
+
+domainPrefix + +string + + |
+
+(Optional)
+ DomainPrefix is an optional prefix added to the cluster’s domain name. It will be used +when generating a sub-domain for the cluster on openshiftapps domain. It must be valid DNS-1035 label +consisting of lower case alphanumeric characters or ‘-’, start with an alphabetic character +end with an alphanumeric character and have a max length of 15 characters. + |
+
+subnets + +[]string + + |
+
+ The Subnet IDs to use when installing the cluster. +SubnetIDs should come in pairs; two per availability zone, one private and one public. + |
+
+availabilityZones + +[]string + + |
+
+ AvailabilityZones describe AWS AvailabilityZones of the worker nodes. +should match the AvailabilityZones of the provided Subnets. +a machinepool will be created for each availabilityZone. + |
+
+region + +string + + |
+
+ The AWS Region the cluster lives in. + |
+
+version + +string + + |
+
+ OpenShift semantic version, for example “4.14.5”. + |
+
+rolesRef + + +AWSRolesRef + + + |
+
+ AWS IAM roles used to perform credential requests by the openshift operators. + |
+
+oidcID + +string + + |
+
+ The ID of the OpenID Connect Provider. + |
+
+installerRoleARN + +string + + |
+
+ InstallerRoleARN is an AWS IAM role that OpenShift Cluster Manager will assume to create the cluster.. + |
+
+supportRoleARN + +string + + |
+
+ SupportRoleARN is an AWS IAM role used by Red Hat SREs to enable +access to the cluster account in order to provide support. + |
+
+workerRoleARN + +string + + |
+
+ WorkerRoleARN is an AWS IAM role that will be attached to worker instances. + |
+
+billingAccount + +string + + |
+
+(Optional)
+ BillingAccount is an optional AWS account to use for billing the subscription fees for ROSA clusters. +The cost of running each ROSA cluster will be billed to the infrastructure account in which the cluster +is running. + |
+
+defaultMachinePoolSpec + + +DefaultMachinePoolSpec + + + |
+
+(Optional)
+ DefaultMachinePoolSpec defines the configuration for the default machinepool(s) provisioned as part of the cluster creation.
+One MachinePool will be created with this configuration per AvailabilityZone. Those default machinepools are required for openshift cluster operators
+to work properly.
+As these machinepool not created using ROSAMachinePool CR, they will not be visible/managed by ROSA CAPI provider.
+ This field will be removed in the future once the current limitation is resolved. + |
+
+network + + +NetworkSpec + + + |
+
+(Optional)
+ Network config for the ROSA HCP cluster. + |
+
+endpointAccess + + +RosaEndpointAccessType + + + |
+
+(Optional)
+ EndpointAccess specifies the publishing scope of cluster endpoints. The +default is Public. + |
+
+additionalTags + + +Tags + + + |
+
+(Optional)
+ AdditionalTags are user-defined tags to be added on the AWS resources associated with the control plane. + |
+
+etcdEncryptionKMSARN + +string + + |
+
+(Optional)
+ EtcdEncryptionKMSARN is the ARN of the KMS key used to encrypt etcd. The key itself needs to be
+created out-of-band by the user and tagged with |
+
+auditLogRoleARN + +string + + |
+
+(Optional)
+ AuditLogRoleARN defines the role that is used to forward audit logs to AWS CloudWatch. +If not set, audit log forwarding is disabled. + |
+
+credentialsSecretRef + + +Kubernetes core/v1.LocalObjectReference + + + |
+
+(Optional)
+ CredentialsSecretRef references a secret with necessary credentials to connect to the OCM API. +The secret should contain the following data keys: +- ocmToken: eyJhbGciOiJIUzI1NiIsI…. +- ocmApiUrl: Optional, defaults to ‘https://api.openshift.com’ + |
+
+identityRef + + +AWSIdentityReference + + + |
+
+(Optional)
+ IdentityRef is a reference to an identity to be used when reconciling the managed control plane. +If no identity is specified, the default identity for this controller will be used. + |
+
+controlPlaneEndpoint + + +Cluster API api/v1beta1.APIEndpoint + + + |
+
+(Optional)
+ ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + |
+
+(Appears on:ROSAControlPlane) +
++
RosaControlPlaneStatus defines the observed state of ROSAControlPlane.
+ +Field | +Description | +
---|---|
+externalManagedControlPlane + +bool + + |
+
+ ExternalManagedControlPlane indicates to cluster-api that the control plane +is managed by an external service such as AKS, EKS, GKE, etc. + |
+
+initialized + +bool + + |
+
+(Optional)
+ Initialized denotes whether or not the control plane has the +uploaded kubernetes config-map. + |
+
+ready + +bool + + |
+
+ Ready denotes that the ROSAControlPlane API Server is ready to receive requests. + |
+
+failureMessage + +string + + |
+
+(Optional)
+ FailureMessage will be set in the event that there is a terminal problem +reconciling the state and will be set to a descriptive error message. +This field should not be set for transitive errors that a controller +faces that are expected to be fixed automatically over +time (like service outages), but instead indicate that something is +fundamentally wrong with the spec or the configuration of +the controller, and that manual intervention is required. + |
+
+conditions + + +Cluster API api/v1beta1.Conditions + + + |
+
+ Conditions specifies the conditions for the managed control plane + |
+
+id + +string + + |
+
+ ID is the cluster ID given by ROSA. + |
+
+consoleURL + +string + + |
+
+ ConsoleURL is the url for the openshift console. + |
+
+oidcEndpointURL + +string + + |
+
+ OIDCEndpointURL is the endpoint url for the managed OIDC provider. + |
+
string
alias)+(Appears on:RosaControlPlaneSpec) +
++
RosaEndpointAccessType specifies the publishing scope of cluster endpoints.
+ +Value | +Description | +
---|---|
"Private" |
+Private endpoint access allows only private API server access and private +node communication with the control plane. + |
+
"Public" |
+Public endpoint access allows public API server access and +private node communication with the control plane. + |
+
+
Package v1beta1 contains the v1beta1 API implementation.
+ +Resource Types: ++(Appears on:AWSMachineSpec) +
++
AMIReference is a reference to a specific AWS resource by ID, ARN, or filters. +Only one of ID, ARN or Filters may be specified. Specifying more than one will result in +a validation error.
+ +Field | +Description | +
---|---|
+id + +string + + |
+
+(Optional)
+ ID of resource + |
+
+eksLookupType + + +EKSAMILookupType + + + |
+
+(Optional)
+ EKSOptimizedLookupType If specified, will look up an EKS Optimized image in SSM Parameter store + |
+
+
AWSCluster is the schema for Amazon EC2 based Kubernetes Cluster API.
+ +Field | +Description | +||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+metadata + + +Kubernetes meta/v1.ObjectMeta + + + |
+
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+||||||||||||||||||||||||
+spec + + +AWSClusterSpec + + + |
+
+ + +
|
+||||||||||||||||||||||||
+status + + +AWSClusterStatus + + + |
++ | +
+
AWSClusterControllerIdentity is the Schema for the awsclustercontrolleridentities API +It is used to grant access to use Cluster API Provider AWS Controller credentials.
+ +Field | +Description | +||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+metadata + + +Kubernetes meta/v1.ObjectMeta + + + |
+
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+||||||||||||||||||||||||||||||||||||||||||
+spec + + +AWSClusterControllerIdentitySpec + + + |
+
+ Spec for this AWSClusterControllerIdentity. ++ +
+ |
+securityGroupOverrides + +map[sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2.SecurityGroupRole]string + +
+(Optional)
+ |
+SecurityGroupOverrides is an optional set of security groups to use for the node. +This is optional - if not provided security groups from the cluster will be used. +
|
sshKeyName string @@ -17794,6 +19185,20 @@ string Tenancy indicates if instance should run on shared or single-tenant hardware.
+ |
+privateDnsName + + +PrivateDNSName + + +
+(Optional)
+ |
+PrivateDNSName is the options for the instance hostname. +AWSMachineStatus @@ -18231,6 +19636,19 @@ the cluster subnet will be used.
+ |
+securityGroupOverrides + +map[sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2.SecurityGroupRole]string + +
+(Optional)
+ |
+SecurityGroupOverrides is an optional set of security groups to use for the node. +This is optional - if not provided security groups from the cluster will be used. +
|
sshKeyName string @@ -18363,6 +19781,20 @@ string Tenancy indicates if instance should run on shared or single-tenant hardware.
+ |
+privateDnsName + + +PrivateDNSName + + +
+(Optional)
+ |
+PrivateDNSName is the options for the instance hostname. +GCTask
(
|
+storageType + + +IgnitionStorageTypeOption + + + |
+
+(Optional)
+ StorageType defines how to store the boostrap user data for Ignition. +This can be used to instruct Ignition from where to fetch the user data to bootstrap an instance. +When omitted, the storage option will default to ClusterObjectStore. +When set to “ClusterObjectStore”, if the capability is available and a Cluster ObjectStore configuration +is correctly provided in the Cluster object (under .spec.s3Bucket), +an object store will be used to store bootstrap user data. +When set to “UnencryptedUserData”, EC2 Instance User Data will be used to store the machine bootstrap user data, unencrypted. +This option is considered less secure than others as user data may contain sensitive informations (keys, certificates, etc.) +and users with ec2:DescribeInstances permission or users running pods +that can access the ec2 metadata service have access to this sensitive information. +So this is only to be used at ones own risk, and only when other more secure options are not viable. + |
+
+proxy + + +IgnitionProxy + + + |
+
+(Optional)
+ Proxy defines proxy settings for Ignition. +Only valid for Ignition versions 3.1 and above. + |
+
+tls + + +IgnitionTLS + + + |
+
+(Optional)
+ TLS defines TLS settings for Ignition. +Only valid for Ignition versions 3.1 and above. + |
+
string
alias)+(Appears on:IgnitionTLS) +
++
IgnitionCASource defines the source of the certificate authority to use for Ignition.
+ +string
alias)+(Appears on:IgnitionProxy) +
++
IgnitionNoProxy defines the list of domains to not proxy for Ignition.
+ ++(Appears on:Ignition) +
++
IgnitionProxy defines proxy settings for Ignition.
+ +Field | +Description | +
---|---|
+httpProxy + +string + + |
+
+(Optional)
+ HTTPProxy is the HTTP proxy to use for Ignition. +A single URL that specifies the proxy server to use for HTTP and HTTPS requests, +unless overridden by the HTTPSProxy or NoProxy options. + |
+
+httpsProxy + +string + + |
+
+(Optional)
+ HTTPSProxy is the HTTPS proxy to use for Ignition. +A single URL that specifies the proxy server to use for HTTPS requests, +unless overridden by the NoProxy option. + |
+
+noProxy + + +[]IgnitionNoProxy + + + |
+
+(Optional)
+ NoProxy is the list of domains to not proxy for Ignition. +Specifies a list of strings to hosts that should be excluded from proxying. +Each value is represented by: +- An IP address prefix (1.2.3.4) +- An IP address prefix in CIDR notation (1.2.3.4⁄8) +- A domain name +- A domain name matches that name and all subdomains +- A domain name with a leading . matches subdomains only +- A special DNS label (*), indicates that no proxying should be done +An IP address prefix and domain name can also include a literal port number (1.2.3.4:80). + |
+
string
alias)+(Appears on:Ignition) +
++
IgnitionStorageTypeOption defines the different storage types for Ignition.
+ ++(Appears on:Ignition) +
++
IgnitionTLS defines TLS settings for Ignition.
+ +Field | +Description | +
---|---|
+certificateAuthorities + + +[]IgnitionCASource + + + |
+
+(Optional)
+ CASources defines the list of certificate authorities to use for Ignition.
+The value is the certificate bundle (in PEM format). The bundle can contain multiple concatenated certificates.
+Supported schemes are http, https, tftp, s3, arn, gs, and |
+
InstanceMetadataOptions is the metadata options for the EC2 instance.
+privateDnsName
PrivateDNSName is the options for the instance hostname.
++
LoadBalancerType defines the type of load balancer to use.
+(Appears on:AWSMachineSpec, Instance, AWSLaunchTemplate) +
++
PrivateDNSName is the options for the instance hostname.
+ +Field | +Description | +
---|---|
+enableResourceNameDnsAAAARecord + +bool + + |
+
+(Optional)
+ EnableResourceNameDNSAAAARecord indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. + |
+
+enableResourceNameDnsARecord + +bool + + |
+
+(Optional)
+ EnableResourceNameDNSARecord indicates whether to respond to DNS queries for instance hostnames with DNS A records. + |
+
+hostnameType + +string + + |
+
+(Optional)
+ The type of hostname to assign to an instance. + |
+
string
alias)@@ -20530,6 +22214,7 @@ string (Appears on:AWSClusterSpec)
+
S3Bucket defines a supporting S3 bucket for the cluster, currently can be optionally used for Ignition.
emptyRoutesDefaultVPCSecurityGroup -bool +bool + + |
+
+(Optional)
+ EmptyRoutesDefaultVPCSecurityGroup specifies whether the default VPC security group ingress +and egress rules should be removed. +By default, when creating a VPC, AWS creates a security group called NOTE: This only applies when the VPC is managed by the Cluster API AWS controller. + |
+
+
+privateDnsHostnameTypeOnLaunch + +string |
(Optional)
- EmptyRoutesDefaultVPCSecurityGroup specifies whether the default VPC security group ingress -and egress rules should be removed. -By default, when creating a VPC, AWS creates a security group called NOTE: This only applies when the VPC is managed by the Cluster API AWS controller. +PrivateDNSHostnameTypeOnLaunch is the type of hostname to assign to instances in the subnet at launch. +For IPv4-only and dual-stack (IPv4 and IPv6) subnets, an instance DNS name can be based on the instance IPv4 address (ip-name) +or the instance ID (resource-name). For IPv6 only subnets, an instance DNS name must be based on the instance ID (resource-name). |
+privateDnsName + + +PrivateDNSName + + + |
+
+(Optional)
+ PrivateDNSName is the options for the instance hostname. + |
+
defaultInstanceWarmup
The amount of time, in seconds, until a new instance is considered to +have finished initializing and resource consumption to become stable +after it enters the InService state. +If no value is supplied by user a default value of 300 seconds is set
+refreshPreferences
defaultInstanceWarmup
The amount of time, in seconds, until a new instance is considered to +have finished initializing and resource consumption to become stable +after it enters the InService state. +If no value is supplied by user a default value of 300 seconds is set
+refreshPreferences
defaultInstanceWarmup
capacityRebalance
+
ROSACluster is the Schema for the ROSAClusters API.
+version + +string + + |
+
+(Optional)
+ Version specifies the OpenShift version of the nodes associated with this machinepool. +ROSAControlPlane version is used if not set. + |
+
availabilityZone string @@ -24150,6 +25924,34 @@ map[string]string | |
+taints + + +[]RosaTaint + + + |
+
+(Optional)
+ Taints specifies the taints to apply to the nodes of the machine pool + |
+
+additionalTags + + +Tags + + + |
+
+(Optional)
+ AdditionalTags are user-defined tags to be added on the underlying EC2 instances associated with this machine pool. + |
+
autoRepair bool @@ -24189,6 +25991,32 @@ required if Replicas is not configured | |
+tuningConfigs + +[]string + + |
+
+(Optional)
+ TuningConfigs specifies the names of the tuning configs to be applied to this MachinePool. +Tuning configs must already exist. + |
+
+additionalSecurityGroups + +[]string + + |
+
+(Optional)
+ AdditionalSecurityGroups is an optional set of security groups to associate +with all node instances of the machine pool. + |
+
providerIDList []string @@ -24199,6 +26027,24 @@ required if Replicas is not configured ProviderIDList contain a ProviderID for each machine instance that’s currently managed by this machine pool. |
|
+nodeDrainGracePeriod + + +Kubernetes meta/v1.Duration + + + |
+
+(Optional)
+ NodeDrainGracePeriod is grace period for how long Pod Disruption Budget-protected workloads will be +respected during upgrades. After this grace period, any workloads protected by Pod Disruption +Budgets that have not been successfully drained from a node will be forcibly evicted. +Valid values are from 0 to 1 week(10080m|168h) . +0 or empty value means that the MachinePool can be drained without any time limitation. + |
+
-(Appears on:RosaMachinePoolSpec) +(Appears on:DefaultMachinePoolSpec, RosaMachinePoolSpec)
RosaMachinePoolAutoScaling specifies scaling options.
@@ -24356,6 +26202,19 @@ must be a valid DNS-1035 label, so it must consist of lower case alphanumeric anversion
Version specifies the OpenShift version of the nodes associated with this machinepool. +ROSAControlPlane version is used if not set.
+availabilityZone
taints
Taints specifies the taints to apply to the nodes of the machine pool
+additionalTags
AdditionalTags are user-defined tags to be added on the underlying EC2 instances associated with this machine pool.
+autoRepair
tuningConfigs
TuningConfigs specifies the names of the tuning configs to be applied to this MachinePool. +Tuning configs must already exist.
+additionalSecurityGroups
AdditionalSecurityGroups is an optional set of security groups to associate +with all node instances of the machine pool.
+providerIDList
ProviderIDList contain a ProviderID for each machine instance that’s currently managed by this machine pool.
nodeDrainGracePeriod
NodeDrainGracePeriod is grace period for how long Pod Disruption Budget-protected workloads will be +respected during upgrades. After this grace period, any workloads protected by Pod Disruption +Budgets that have not been successfully drained from a node will be forcibly evicted.
+Valid values are from 0 to 1 week(10080m|168h) . +0 or empty value means that the MachinePool can be drained without any time limitation.
+failureMessage
FailureMessage will be set in the event that there is a terminal problem +reconciling the state and will be set to a descriptive error message.
+This field should not be set for transitive errors that a controller +faces that are expected to be fixed automatically over +time (like service outages), but instead indicate that something is +fundamentally wrong with the spec or the configuration of +the controller, and that manual intervention is required.
+id
+(Appears on:RosaMachinePoolSpec) +
++
RosaTaint represents a taint to be applied to a node.
+ +Field | +Description | +
---|---|
+key + +string + + |
+
+ The taint key to be applied to a node. + |
+
+value + +string + + |
+
+(Optional)
+ The taint value corresponding to the taint key. + |
+
+effect + + +Kubernetes core/v1.TaintEffect + + + |
+
+ The effect of the taint on pods that do not tolerate the taint. +Valid effects are NoSchedule, PreferNoSchedule and NoExecute. + |
+
string
alias)
diff --git a/docs/book/src/development/releasing.md b/docs/book/src/development/releasing.md
index 7a5c2d3761..3884fdce8b 100644
--- a/docs/book/src/development/releasing.md
+++ b/docs/book/src/development/releasing.md
@@ -7,14 +7,18 @@
## Create tag, and build staging container images
-1. Create a new local repository of