Skip to content

Commit

Permalink
Initial acm-bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
jhorn-redhat committed Sep 5, 2020
1 parent c192a58 commit c1a0462
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 0 deletions.
12 changes: 12 additions & 0 deletions acm-bootstrap/0-namespaces/acm-hub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: v1
kind: Namespace
metadata:
annotations:
config.example.com/managed-by: gitops
config.example.com/scm-url: git@github.com:hornjason/declarative-openshift.git
labels:
config.example.com/name: acm-bootstrap
config.example.com/component: namespaces
name: open-cluster-management
spec:
33 changes: 33 additions & 0 deletions acm-bootstrap/1-operators/acm-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
annotations:
config.example.com/managed-by: gitops
config.example.com/scm-url: git@github.com:hornjason/declarative-openshift.git
labels:
config.example.com/name: acm-bootstrap
config.example.com/component: operators
name: acm-operator
namespace: open-cluster-management
spec:
targetNamespaces:
- open-cluster-management
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
annotations:
config.example.com/managed-by: gitops
config.example.com/scm-url: git@github.com:hornjason/declarative-openshift.git
labels:
config.example.com/name: acm-bootstrap
config.example.com/component: operators
name: acm-operator-subscription
namespace: open-cluster-management
spec:
sourceNamespace: openshift-marketplace
source: redhat-operators
channel: release-2.0
installPlanApproval: Automatic
name: advanced-cluster-management
12 changes: 12 additions & 0 deletions acm-bootstrap/3-acm/multi-cluster-hub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: operator.open-cluster-management.io/v1
kind: MultiClusterHub
metadata:
annotations:
config.example.com/managed-by: gitops
config.example.com/scm-url: git@github.com:hornjason/declarative-openshift.git
labels:
config.example.com/name: acm-bootstrap
config.example.com/component: operators
name: multiclusterhub
namespace: open-cluster-management
spec: {}
56 changes: 56 additions & 0 deletions acm-bootstrap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Installing the ACM operator with the Operator Lifecycle Manager

This directory contains the manifests required to install the [ACM operaDtor](https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/2.0/html/install/installing#installing-while-connected-online).

You will need to create a base64 encoded pull secret to create the Multi-Cluster Hub.
```
cd acm-bootstrap/1-operator/
vim *.yaml
apiVersion: v1
kind: Secret
metadata:
annotations:
config.example.com/managed-by: gitops
config.example.com/scm-url: git@github.com:hornjason/declarative-openshift.git
labels:
config.example.com/name: acm-bootstrap
config.example.com/component: operators
name: pull-secret
namespace: openshift-image-registry
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: < insert pull secret base64| cat pull_secret.txt|base64 -w0>
# or
oc create secret generic <secret> -n <namespace> --from-file=.dockerconfigjson=<path-to-pull-secret> --type=kubernetes.io/dockerconfigjson
```

## 1 Bootstrapping the ACM Operator

The ACM bootstrapping example shows how cluster administrators might begin deploying the ACM operator `oc apply`. Each resource in this example carries a common label (`config.example.com/name: acm-bootstrap`) that associates it with this `project`. In doing this, we can manage the full lifecycle of our resources with a single command.

```
oc apply -Rf ../acm-bootstrap/ --prune -l config.example.com/name=acm-bootstrap
```

The `apply` command idempotently ensures that the live configuration is in sync with our configuration files, while the `--prune` flag allows us to also manage the deletion of live objects by simply deleting the associated file in this repository.

As an example, let's bootstrap our cluster for the first time:

```
$ oc apply -Rf ../acm-bootstrap/ --prune -l config.example.com/name=acm-bootstrap
namespace/open-cluster-management configured
operatorgroup.operators.coreos.com/acm-operator created
subscription.operators.coreos.com/acm-operator created
```
ACM is now deployed by the ACM operator along with the MultiCluster Hub, you can now generate an import command to bring in Clusters for management in ACM.

To begin creating policies take a look at the follow repo for more examples.
[ACM-Policiesr](https://github.com/redhat-cop/acm-policies.git )
```
```



0 comments on commit c1a0462

Please sign in to comment.