Skip to content

Commit

Permalink
Merge pull request #8 from asalkeld/install-providers
Browse files Browse the repository at this point in the history
Install providers
  • Loading branch information
openshift-merge-robot committed Nov 17, 2021
2 parents e592380 + 7f4fc7f commit 3886c49
Show file tree
Hide file tree
Showing 200 changed files with 54,951 additions and 17,052 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ unit:

# Run against the configured Kubernetes cluster in ~/.kube/config
run: verify
go run cmd/cluster-capi-operator/main.go
go run cmd/cluster-capi-operator/main.go --leader-elect=false --images-json=./hack/sample-images.json

# Run go fmt against code
.PHONY: fmt
Expand All @@ -48,8 +48,11 @@ $(KUSTOMIZE):
$(PROJECT_DIR)/hack/go-get-tool.sh go-get-tool $(KUSTOMIZE) sigs.k8s.io/kustomize/kustomize/v3@v3.9.4

import-assets: $(KUSTOMIZE)
mkdir -p assets/capi-operator
mkdir -p assets/providers
$(KUSTOMIZE) build hack/import-assets/capi-operator -o assets/capi-operator/
cd hack/import-assets; go run . move-rbac-manifests
cd hack/import-assets; go run . import-providers

# Run go mod
.PHONY: vendor
Expand Down
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Cluster CAPI Operator

The Cluster CAPI Operator manages the installation of the CAPI Operator and the provider
resources that it requires.

## Controllers

- ClusterOperator Controller

When the featuregate is DevPreviewNoUpgrade
1. Install the CAPI Operator
2. Install all the supported provider configmaps
3. Install the CoreProvider and InfractureProvider CRs (with image overrides)

## Updating manifests and assets

- Import capi-operator and provider manifests:

```sh
$ make import-assets
```

This command does 2 main things:
1. get capi-operator configuration and moves the rbac resources to /manifests/ whilst
placing the remainder in /assets/capi-operator/
It also replaces the default rbac with a smaller subset.
2. use clusterctl to get the provider resources
a. convert from cert-manager to service-ca
b. place provider rbac resources in /manifests
c. place all other resources in /assets/providers as configmaps (to be consumed by capi-operator)

To update the version of a provider, edit hack/import-assets/providers.go and bump
the versions as required.
2 changes: 1 addition & 1 deletion assets/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

//go:embed capi-operator/*.yaml
//go:embed capi-operator/*.yaml providers/*.yaml
var fs embed.FS

func FromDir(dir string, scheme *runtime.Scheme) ([]client.Object, error) {
Expand Down
14 changes: 14 additions & 0 deletions assets/providers/core-cluster-api-provider.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: operator.cluster.x-k8s.io/v1alpha1
kind: CoreProvider
metadata:
creationTimestamp: null
name: cluster-api
namespace: openshift-cluster-api
spec:
fetchConfig:
selector:
matchLabels:
provider.cluster.x-k8s.io/name: cluster-api
provider.cluster.x-k8s.io/type: core
version: v1.0.0
status: {}
9,238 changes: 9,238 additions & 0 deletions assets/providers/core-cluster-api.yaml

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions assets/providers/infrastructure-aws-provider.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: operator.cluster.x-k8s.io/v1alpha1
kind: InfrastructureProvider
metadata:
creationTimestamp: null
name: aws
namespace: openshift-cluster-api
spec:
fetchConfig:
selector:
matchLabels:
provider.cluster.x-k8s.io/name: aws
provider.cluster.x-k8s.io/type: infrastructure
version: v0.7.0
status: {}

0 comments on commit 3886c49

Please sign in to comment.