Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ In order to deploy the machine-api-operator from scratch, one needs to:
```
and run the `machine-api-operator` binary:
```sh
./bin/machine-api-operator --kubeconfig ${HOME}/.kube/config --config pkg/render/machine-api-operator-config.yaml --manifest-dir manifests
./bin/machine-api-operator --kubeconfig ${HOME}/.kube/config --config examples/machine-api-operator-config.yaml --manifest-dir manifests
```

# CI & tests
Expand Down
12 changes: 12 additions & 0 deletions examples/machine-api-operator-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: machineAPIOperatorConfig
clusterConfig:
vpcName: "test"
keyPairName: "test"
region: "us-east-1"
machineConfig:
ami: "ami-00cc4337762ba4a52"
availabilityZone: "us-east-1a"
iamInstanceProfile: "test"
subnet: "subnet-864ff9ce"
securityGroups: ["sg-105fda6e"]
27 changes: 5 additions & 22 deletions machines/cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apiVersion: "cluster.k8s.io/v1alpha1"
---
apiVersion: cluster.k8s.io/v1alpha1
kind: Cluster
metadata:
name: test
Expand All @@ -16,24 +17,6 @@ spec:
value:
apiVersion: awsproviderconfig/v1alpha1
kind: AWSClusterProviderConfig
clusterId: {{.VpcName}}
clusterVersionRef:
namespace: test
name: test
hardware:
aws:
region: {{.Region}}
keyPairName: {{.SshKey}}
defaultHardwareSpec:
aws:
instanceType: m4.large
machineSets:
- nodeType: Master
size: 1
- shortName: infra
nodeType: Compute
infra: true
size: 1
- shortName: compute
nodeType: Compute
size: 1
region: "{{ .ClusterConfig.Region }}"
keyPairName: "{{ .ClusterConfig.KeyPairName }}"
vpcName: "{{ .ClusterConfig.VPCName }}"
59 changes: 37 additions & 22 deletions machines/machine-set.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,55 @@
---
apiVersion: cluster.k8s.io/v1alpha1
kind: MachineSet
metadata:
name: worker
namespace: test
labels:
machineapioperator.openshift.io/cluster: test
sigs.k8s.io/cluster-api-cluster: test
sigs.k8s.io/cluster-api-machine-role: worker
sigs.k8s.io/cluster-api-machine-type: worker
spec:
replicas: 3
selector:
matchLabels:
machineapioperator.openshift.io/machineset: worker
machineapioperator.openshift.io/cluster: test
sigs.k8s.io/cluster-api-machineset: worker
sigs.k8s.io/cluster-api-cluster: test
template:
metadata:
labels:
machineapioperator.openshift.io/machineset: worker
machineapioperator.openshift.io/cluster: test
sigs.k8s.io/cluster-api-machineset: worker
sigs.k8s.io/cluster-api-cluster: test
sigs.k8s.io/cluster-api-machine-role: worker
sigs.k8s.io/cluster-api-machine-type: worker
spec:
providerConfig:
value:
apiVersion: awsproviderconfig/v1alpha1
kind: AWSMachineProviderConfig
clusterId: {{.VpcName}}
clusterHardware:
aws:
keyPairName: {{.SshKey}}
region: {{.Region}}
hardware:
aws:
instanceType: m4.large
infra: false
vmImage:
awsImage: {{.Image}}
versions:
kubelet: 0.0.0
controlPlane: 0.0.0
roles:
- Master

ami:
id: "{{ .MachineConfig.AMI }}"
{{- if .AWSCredentialsSecret }}
credentialsSecret:
name: "{{ .AWSCredentialsSecret }}"
{{- end }}
instanceType: m4.xlarge
placement:
region: "{{ .ClusterConfig.Region }}"
availabilityZone: "{{ .MachineConfig.AvailabilityZone }}"
subnet:
id: "{{ .MachineConfig.Subnet }}"
iamInstanceProfile:
id: "{{ .MachineConfig.IAMInstanceProfile }}"
keyName: "{{ .ClusterConfig.KeyPairName }}"
tags:
- name: openshift-node-group-config
value: node-config-worker
- name: host-type
value: worker
- name: sub-host-type
value: default
securityGroups:
{{- range .MachineConfig.SecurityGroups }}
- id: "{{ . }}"
{{- end }}
publicIP: true
4 changes: 2 additions & 2 deletions manifests/clusterapi-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ spec:
cpu: 100m
memory: 30Mi
- name: aws-machine-controller
image: quay.io/alberto_lamela/aws-machine-controller:mvp # TODO: move this to openshift org
image: quay.io/bison/aws-machine-controller:cfc14e5 # TODO: move this to openshift org
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to use image built by CI now? cc @ingvagabund

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't find the image yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see machine-api-operator images in the output of oc describe is -n openshift origin-v3.11 --server https://api.ci.openshift.org but they reference the internal registry on that cluster. The images are supposed to be mirrored to Quay and Docker Hub, but I'm not sure where to find them.

env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
command:
- /opt/services/aws-machine-controller
- /machine-controller
args:
- --log-level=debug
resources:
Expand Down
26 changes: 20 additions & 6 deletions pkg/render/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,31 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
const (
// Kind is the TypeMeta.Kind for the OperatorConfig.
Kind = "MachineAPIOperatorConfig"

// APIVersion is the TypeMeta.APIVersion for the OperatorConfig.
APIVersion = "v1"
)

// OperatorConfig contains configuration for KAO managed add-ons
type OperatorConfig struct {
metav1.TypeMeta `json:",inline"`
VpcName string `json:"vpcName"`
SshKey string `json:"sshKey"`
ClusterName string `json:"clusterName"`
ClusterDomain string `json:"clusterDomain"`
Region string `json:"region"`
Image string `json:"image"`

AWSCredentialsSecret string `json:"awsCredentialsSecret"`

ClusterConfig ClusterConfig `json:"clusterConfig"`
MachineConfig MachineConfig `json:"machineConfig"`
}

type ClusterConfig struct {
KeyPairName string `json:"keyPairName"`
Region string `json:"region"`
VPCName string `json:"vpcName,omitempty"`
}

type MachineConfig struct {
AMI string `json:"ami"`
AvailabilityZone string `json:"availabilityZone"`
Subnet string `json:"subnet"`
IAMInstanceProfile string `json:"iamInstanceProfile"`
SecurityGroups []string `json:"securityGroups"`
}
6 changes: 0 additions & 6 deletions pkg/render/machine-api-operator-config.yaml

This file was deleted.

Loading