-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to CRDs - WIP #67
Changes from 9 commits
09b438f
2e21063
c6efff4
3c4b774
7e0251b
1e3683b
c92ffa3
be2001a
69d1882
b4dd7a0
9d5de45
ea4fb15
0fc1b81
a0d06f7
7bc2a82
3c07079
8f6668c
1fb525f
63beccd
a023a30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,43 @@ | ||
# Gopkg.toml example | ||
# | ||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md | ||
# for detailed Gopkg.toml documentation. | ||
# | ||
# required = ["github.com/user/thing/cmd/thing"] | ||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] | ||
# | ||
# [[constraint]] | ||
# name = "github.com/user/project" | ||
# version = "1.0.0" | ||
# | ||
# [[constraint]] | ||
# name = "github.com/user/project2" | ||
# branch = "dev" | ||
# source = "github.com/myfork/project2" | ||
# | ||
# [[override]] | ||
# name = "github.com/x/y" | ||
# version = "2.4.0" | ||
# | ||
# [prune] | ||
# non-go = false | ||
# go-tests = true | ||
# unused-packages = true | ||
|
||
required = [ | ||
"k8s.io/code-generator/cmd/deepcopy-gen", | ||
] | ||
"github.com/emicklei/go-restful", | ||
"github.com/onsi/ginkgo", # for test framework | ||
"github.com/onsi/gomega", # for test matchers | ||
"k8s.io/client-go/plugin/pkg/client/auth/gcp", # for development against gcp | ||
"k8s.io/code-generator/cmd/deepcopy-gen", # for go generate | ||
"sigs.k8s.io/controller-tools/cmd/controller-gen", # for crd/rbac generation | ||
"sigs.k8s.io/controller-runtime/pkg/client/config", | ||
"sigs.k8s.io/controller-runtime/pkg/controller", | ||
"sigs.k8s.io/controller-runtime/pkg/handler", | ||
"sigs.k8s.io/controller-runtime/pkg/manager", | ||
"sigs.k8s.io/controller-runtime/pkg/runtime/signals", | ||
"sigs.k8s.io/controller-runtime/pkg/source", | ||
"sigs.k8s.io/testing_frameworks/integration", # for integration testing | ||
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1", | ||
] | ||
|
||
[prune] | ||
go-tests = true | ||
|
||
[[constraint]] | ||
name = "sigs.k8s.io/cluster-api" | ||
revision = "f31486484d5b33c785540eeaffd47fe57832aef5" | ||
|
||
[[constraint]] | ||
name = "k8s.io/code-generator" | ||
branch = "release-1.9" | ||
branch = "master" | ||
|
||
[[constraint]] | ||
name = "github.com/aws/aws-sdk-go" | ||
version = "v1.15.5" | ||
|
||
# We need to specify fsnotify source to avoid dep panic | ||
[[override]] | ||
name = "gopkg.in/fsnotify.v1" | ||
source = "https://github.com/fsnotify/fsnotify.git" | ||
|
||
[[constraint]] | ||
name = "k8s.io/kube-aggregator" | ||
branch = "release-1.9" | ||
|
||
[[constraint]] | ||
name = "k8s.io/apiextensions-apiserver" | ||
branch = "release-1.9" | ||
|
||
[[constraint]] | ||
name = "k8s.io/apimachinery" | ||
branch = "release-1.9" | ||
# STANZAS BELOW ARE GENERATED AND MAY BE WRITTEN - DO NOT MODIFY BELOW THIS LINE. | ||
|
||
[[constraint]] | ||
name = "k8s.io/apiserver" | ||
branch = "release-1.9" | ||
name="sigs.k8s.io/controller-runtime" | ||
version="v0.1.1" | ||
|
||
[[constraint]] | ||
name = "k8s.io/client-go" | ||
branch = "release-6.0" | ||
name="sigs.k8s.io/controller-tools" | ||
version="v0.1.1" | ||
|
||
[[constraint]] | ||
name = "k8s.io/api" | ||
branch = "release-1.9" | ||
# For dependency below: Refer to issue https://github.com/golang/dep/issues/1799 | ||
[[override]] | ||
name = "gopkg.in/fsnotify.v1" | ||
source = "https://github.com/fsnotify/fsnotify.git" | ||
version="v1.4.7" |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
Copyright 2018 The Kubernetes Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"log" | ||
|
||
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp" | ||
"sigs.k8s.io/cluster-api-provider-aws/migration/pkg/apis" | ||
"sigs.k8s.io/cluster-api-provider-aws/migration/pkg/controller" | ||
"sigs.k8s.io/controller-runtime/pkg/client/config" | ||
"sigs.k8s.io/controller-runtime/pkg/manager" | ||
"sigs.k8s.io/controller-runtime/pkg/runtime/signals" | ||
) | ||
|
||
func main() { | ||
// Get a config to talk to the apiserver | ||
cfg, err := config.GetConfig() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
// Create a new Cmd to provide shared dependencies and start components | ||
mgr, err := manager.New(cfg, manager.Options{}) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
log.Printf("Registering Components.") | ||
|
||
// Setup Scheme for all resources | ||
if err := apis.AddToScheme(mgr.GetScheme()); err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
// Setup all Controllers | ||
if err := controller.AddToManager(mgr); err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
log.Printf("Starting the Cmd.") | ||
|
||
// Start the Cmd | ||
log.Fatal(mgr.Start(signals.SetupSignalHandler())) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
controller-tools.k8s.io: "1.0" | ||
name: awsmachineproviderconfigs.awsproviderconfig.k8s.io | ||
spec: | ||
group: awsproviderconfig.k8s.io | ||
names: | ||
kind: AWSMachineProviderConfig | ||
plural: awsmachineproviderconfigs | ||
scope: Namespaced | ||
validation: | ||
openAPIV3Schema: | ||
properties: | ||
apiVersion: | ||
type: string | ||
kind: | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
type: object | ||
status: | ||
type: object | ||
version: v1alpha1 | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Adds namespace to all resources. | ||
namespace: migration-system | ||
|
||
# Value of this field is prepended to the | ||
# names of all resources, e.g. a deployment named | ||
# "wordpress" becomes "alices-wordpress". | ||
# Note that it should also match with the prefix (text before '-') of the namespace | ||
# field above. | ||
namePrefix: migration- | ||
|
||
# Labels to add to all resources and selectors. | ||
#commonLabels: | ||
# someName: someValue | ||
|
||
# Each entry in this list must resolve to an existing | ||
# resource definition in YAML. These are the resource | ||
# files that kustomize reads, modifies and emits as a | ||
# YAML string, with resources separated by document | ||
# markers ("---"). | ||
resources: | ||
- ../rbac/rbac_role.yaml | ||
- ../rbac/rbac_role_binding.yaml | ||
- ../manager/manager.yaml | ||
|
||
patches: | ||
- manager_image_patch.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: controller-manager | ||
namespace: system | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
# Change the value of image field below to your controller image URL | ||
- image: IMAGE_URL | ||
name: manager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice.