Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #224 from weaveworks/existinginfra
Browse files Browse the repository at this point in the history
v1alpha3 - Rename BareMetal to ExistingInfra
  • Loading branch information
luxas authored Jul 29, 2020
2 parents 8f84574 + 43fa083 commit 4125b77
Show file tree
Hide file tree
Showing 37 changed files with 593 additions and 528 deletions.
4 changes: 2 additions & 2 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
wks "github.com/weaveworks/wksctl/pkg/apis/wksprovider/controller/wksctl"
baremetalv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3"
machineutil "github.com/weaveworks/wksctl/pkg/cluster/machine"
existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3"
"k8s.io/client-go/kubernetes"
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -91,7 +91,7 @@ func run(cmd *cobra.Command, args []string) {
}

log.Info("registering scheme for all resources")
if err := baremetalv1.AddToScheme(mgr.GetScheme()); err != nil {
if err := existinginfrav1.AddToScheme(mgr.GetScheme()); err != nil {
log.Fatal(err)
}
if err := clusterv1.AddToScheme(mgr.GetScheme()); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cmd/wksctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/weaveworks/wksctl/cmd/wksctl/registrysynccommands"
"github.com/weaveworks/wksctl/cmd/wksctl/version"
"github.com/weaveworks/wksctl/cmd/wksctl/zshcompletions"
baremetalv1 "github.com/weaveworks/wksctl/pkg/baremetal/v1alpha3"
existinginfrav1 "github.com/weaveworks/wksctl/pkg/existinginfra/v1alpha3"
v "github.com/weaveworks/wksctl/pkg/version"
)

Expand Down Expand Up @@ -48,7 +48,7 @@ func main() {
if err := clusterv1.AddToScheme(scheme.Scheme); err != nil {
log.Fatal(err)
}
if err := baremetalv1.AddToScheme(scheme.Scheme); err != nil {
if err := existinginfrav1.AddToScheme(scheme.Scheme); err != nil {
log.Fatal(err)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.3.0
creationTimestamp: null
name: baremetalclusters.cluster.weave.works
name: existinginfraclusters.cluster.weave.works
labels:
cluster.x-k8s.io/v1alpha3: v1alpha3
spec:
group: cluster.weave.works
names:
kind: BareMetalCluster
listKind: BareMetalClusterList
plural: baremetalclusters
singular: baremetalcluster
kind: ExistingInfraCluster
listKind: ExistingInfraClusterList
plural: existinginfraclusters
singular: existinginfracluster
scope: Namespaced
validation:
openAPIV3Schema:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.3.0
creationTimestamp: null
name: baremetalmachines.cluster.weave.works
name: existinginframachines.cluster.weave.works
labels:
cluster.x-k8s.io/v1alpha3: v1alpha3
spec:
group: cluster.weave.works
names:
kind: BareMetalMachine
listKind: BareMetalMachineList
plural: baremetalmachines
singular: baremetalmachine
kind: ExistingInfraMachine
listKind: ExistingInfraMachineList
plural: existinginframachines
singular: existinginframachine
scope: Namespaced
validation:
openAPIV3Schema:
Expand Down
6 changes: 3 additions & 3 deletions docs/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Here's an example of the cluster definition. It is spread across two
objects: a `Cluster` which is defined by Kubernetes ClusterAPI and a
`BareMetalCluster` defined by Weaveworks. Here, both objects have the
`ExistingInfraCluster` defined by Weaveworks. Here, both objects have the
same name `example`, and the field `infrastructureRef` points from one
to the other.

Expand All @@ -20,11 +20,11 @@ spec:
serviceDomain: cluster.local
infrastructureRef:
apiVersion: cluster.weave.works/v1alpha3
kind: BareMetalCluster
kind: ExistingInfraCluster
name: example
---
apiVersion: cluster.weave.works/v1alpha3
kind: BareMetalCluster
kind: ExistingInfraCluster
metadata:
name: example
spec:
Expand Down
4 changes: 2 additions & 2 deletions environments/local-rpm-repo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
5. Configure it in your `cluster.yaml`:

```yaml
apiVersion: "cluster.weave.works/v1alpha3"
kind: "BareMetalCluster"
apiVersion: cluster.weave.works/v1alpha3
kind: ExistingInfraCluster
spec:
os:
files:
Expand Down
64 changes: 35 additions & 29 deletions examples/footloose/cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
apiVersion: cluster.k8s.io/v1alpha1
apiVersion: cluster.x-k8s.io/v1alpha3
kind: Cluster
metadata:
name: example
spec:
clusterNetwork:
services:
cidrBlocks: [10.96.0.0/12]
pods:
cidrBlocks: [192.168.0.0/16]
serviceDomain: cluster.local
providerSpec:
value:
apiVersion: baremetalproviderspec/v1alpha1
kind: BareMetalClusterProviderSpec
user: root
os:
files:
- source:
configmap: repo
key: kubernetes.repo
destination: /etc/yum.repos.d/kubernetes.repo
- source:
configmap: repo
key: docker-ce.repo
destination: /etc/yum.repos.d/docker-ce.repo
- source:
configmap: repo
key: cloud-google-com.gpg.b64
destination: /tmp/cloud-google-com.gpg.b64
cri:
kind: docker
package: docker-ce
version: 19.03.8

cidrBlocks:
- 192.168.0.0/16
services:
cidrBlocks:
- 10.96.0.0/12
infrastructureRef:
apiVersion: cluster.weave.works/v1alpha3
kind: ExistingInfraCluster
name: example-provider
---
apiVersion: cluster.weave.works/v1alpha3
kind: ExistingInfraCluster
metadata:
name: example-provider
spec:
cri:
kind: docker
package: docker-ce
version: 19.03.8
os:
files:
- destination: /etc/yum.repos.d/kubernetes.repo
source:
configmap: repo
key: kubernetes.repo
- destination: /etc/yum.repos.d/docker-ce.repo
source:
configmap: repo
key: docker-ce.repo
- destination: /tmp/cloud-google-com.gpg.b64
source:
configmap: repo
key: cloud-google-com.gpg.b64
user: root
166 changes: 95 additions & 71 deletions examples/footloose/machines-multimaster.yaml
Original file line number Diff line number Diff line change
@@ -1,71 +1,95 @@
apiVersion: v1
kind: List
items:
- apiVersion: cluster.k8s.io/v1alpha1
kind: Machine
metadata:
name: master-1
labels:
set: master
spec:
providerSpec:
value:
apiVersion: baremetalproviderspec/v1alpha1
kind: BareMetalMachineProviderSpec
public:
address: 127.0.0.1
port: 2222
private:
address: 172.17.0.2
port: 22
- apiVersion: cluster.k8s.io/v1alpha1
kind: Machine
metadata:
name: master-2
labels:
set: master
spec:
providerSpec:
value:
apiVersion: baremetalproviderspec/v1alpha1
kind: BareMetalMachineProviderSpec
public:
address: 127.0.0.1
port: 2223
private:
address: 172.17.0.3
port: 22
- apiVersion: cluster.k8s.io/v1alpha1
kind: Machine
metadata:
name: master-3
labels:
set: master
spec:
providerSpec:
value:
apiVersion: baremetalproviderspec/v1alpha1
kind: BareMetalMachineProviderSpec
public:
address: 127.0.0.1
port: 2224
private:
address: 172.17.0.4
port: 22
- apiVersion: cluster.k8s.io/v1alpha1
kind: Machine
metadata:
name: worker-1
labels:
set: worker
spec:
providerSpec:
value:
apiVersion: baremetalproviderspec/v1alpha1
kind: BareMetalMachineProviderSpec
public:
address: 127.0.0.1
port: 2225
private:
address: 172.17.0.5
port: 22
apiVersion: cluster.x-k8s.io/v1alpha3
kind: Machine
metadata:
labels:
set: master
name: master-1
spec:
infrastructureRef:
apiVersion: cluster.weave.works/v1alpha3
kind: ExistingInfraMachine
name: master-1-provider
---
apiVersion: cluster.weave.works/v1alpha3
kind: ExistingInfraMachine
metadata:
name: master-1-provider
spec:
private:
address: 172.17.0.2
port: 22
public:
address: 127.0.0.1
port: 2222
---
apiVersion: cluster.x-k8s.io/v1alpha3
kind: Machine
metadata:
labels:
set: master
name: master-2
spec:
infrastructureRef:
apiVersion: cluster.weave.works/v1alpha3
kind: ExistingInfraMachine
name: master-2-provider
---
apiVersion: cluster.weave.works/v1alpha3
kind: ExistingInfraMachine
metadata:
name: master-2-provider
spec:
private:
address: 172.17.0.3
port: 22
public:
address: 127.0.0.1
port: 2223
---
apiVersion: cluster.x-k8s.io/v1alpha3
kind: Machine
metadata:
labels:
set: master
name: master-3
spec:
infrastructureRef:
apiVersion: cluster.weave.works/v1alpha3
kind: ExistingInfraMachine
name: master-3-provider
---
apiVersion: cluster.weave.works/v1alpha3
kind: ExistingInfraMachine
metadata:
name: master-3-provider
spec:
private:
address: 172.17.0.4
port: 22
public:
address: 127.0.0.1
port: 2224
---
apiVersion: cluster.x-k8s.io/v1alpha3
kind: Machine
metadata:
labels:
set: worker
name: worker-1
spec:
infrastructureRef:
apiVersion: cluster.weave.works/v1alpha3
kind: ExistingInfraMachine
name: worker-1-provider
---
apiVersion: cluster.weave.works/v1alpha3
kind: ExistingInfraMachine
metadata:
name: worker-1-provider
spec:
private:
address: 172.17.0.5
port: 22
public:
address: 127.0.0.1
port: 2225
Loading

0 comments on commit 4125b77

Please sign in to comment.