diff --git a/README.md b/README.md index 7454af8..eb09cca 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ This repo is a mono-repo that is broken up into three sections: ## Prerequisites - Ansible user created -- Ansible configured +- Ansible configured - [Networking](docs/networks.md) - [Proxmox](docs/proxmox.md) (In my homelab, internal DNS, identity manangement, and ipxe are hosted here.) - Matchbox @@ -94,6 +94,7 @@ This makes it to where you just need 3 bare metal nodes. You could run one HCP B You'll also either need you just need at least 2 bare metal nodes. --- + ## Credits - Ken Moini - As I used his [repo](https://github.com/kenmoini/ztp-for-you-and-me) as the baseline for this project. diff --git a/acm-hub-bootstrap/values-4.18-hub.yaml b/acm-hub-bootstrap/values-4.18-hub.yaml index faa4f2e..e582c25 100644 --- a/acm-hub-bootstrap/values-4.18-hub.yaml +++ b/acm-hub-bootstrap/values-4.18-hub.yaml @@ -3,4 +3,4 @@ clusterGroup: acm: name: advanced-cluster-management namespace: open-cluster-management - channel: release-2.12 + channel: release-2.13 diff --git a/acm-hub-bootstrap/values-hub.yaml b/acm-hub-bootstrap/values-hub.yaml index 0850092..3f08449 100644 --- a/acm-hub-bootstrap/values-hub.yaml +++ b/acm-hub-bootstrap/values-hub.yaml @@ -11,7 +11,7 @@ clusterGroup: acm: name: advanced-cluster-management namespace: open-cluster-management - channel: release-2.11 + channel: release-2.13 #csv: advanced-cluster-management.v2.6.1 projects: - hub diff --git a/hub-cluster-bootstrap/app-of-apps.yaml b/hub-cluster-bootstrap/app-of-apps.yaml new file mode 100644 index 0000000..373c8fd --- /dev/null +++ b/hub-cluster-bootstrap/app-of-apps.yaml @@ -0,0 +1,26 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: cluster-applications + namespace: openshift-gitops +spec: + destination: + name: in-cluster + namespace: openshift-gitops + project: default + source: + path: cluster + repoURL: git@github.com:rblundon/homelab.git + targetRevision: HEAD + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - RespectIgnoreDifferences=true + ignoreDifferences: + - group: argoproj.io + kind: Application + jsonPointers: + - /spec/syncPolicy/automated diff --git a/hub-cluster-bootstrap/enable-iscsi.yaml b/hub-cluster-bootstrap/enable-iscsi.yaml new file mode 100644 index 0000000..dd8a732 --- /dev/null +++ b/hub-cluster-bootstrap/enable-iscsi.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: machineconfiguration.openshift.io/v1 +kind: MachineConfig +metadata: + labels: + machineconfiguration.openshift.io/role: master + name: 99-master-custom-enable-iscsid +spec: + config: + ignition: + version: 3.1.0 + systemd: + units: + - enabled: true + name: iscsid.service \ No newline at end of file diff --git a/hub-cluster-bootstrap/kustomization.yaml b/hub-cluster-bootstrap/kustomization.yaml new file mode 100644 index 0000000..3e120d5 --- /dev/null +++ b/hub-cluster-bootstrap/kustomization.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +commonLabels: + cluster: hub.int.mk-labs.cloud + +resources: +- namespace.yaml +- operatorgroup.yaml +- subscription.yaml +- rbac.yaml +# - argocd.yaml +- app-of-apps.yaml +- enable-iscsi.yaml \ No newline at end of file diff --git a/hub-cluster-bootstrap/namespace.yaml b/hub-cluster-bootstrap/namespace.yaml new file mode 100644 index 0000000..80658b7 --- /dev/null +++ b/hub-cluster-bootstrap/namespace.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + labels: + argocd.argoproj.io/managed-by: openshift-gitops-operator + name: openshift-gitops-operator diff --git a/hub-cluster-bootstrap/operatorgroup.yaml b/hub-cluster-bootstrap/operatorgroup.yaml new file mode 100644 index 0000000..e12d145 --- /dev/null +++ b/hub-cluster-bootstrap/operatorgroup.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: openshift-gitops-operator + namespace: openshift-gitops-operator +spec: + upgradeStrategy: Default \ No newline at end of file diff --git a/hub-cluster-bootstrap/rbac.yaml b/hub-cluster-bootstrap/rbac.yaml new file mode 100644 index 0000000..a5ad645 --- /dev/null +++ b/hub-cluster-bootstrap/rbac.yaml @@ -0,0 +1,37 @@ +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: openshift-gitops-admin +subjects: + - kind: ServiceAccount + name: gitops-service-cluster + namespace: openshift-gitops + - kind: ServiceAccount + name: openshift-gitops-applicationset-controller + namespace: openshift-gitops + - kind: ServiceAccount + name: openshift-gitops-argocd-application-controller + namespace: openshift-gitops + - kind: ServiceAccount + name: openshift-gitops-argocd-dex-server + namespace: openshift-gitops + - kind: ServiceAccount + name: openshift-gitops-argocd-grafana + namespace: openshift-gitops + - kind: ServiceAccount + name: openshift-gitops-argocd-redis + namespace: openshift-gitops + - kind: ServiceAccount + name: openshift-gitops-argocd-redis-ha + namespace: openshift-gitops + - kind: ServiceAccount + name: openshift-gitops-argocd-server + namespace: openshift-gitops + - kind: ServiceAccount + name: openshift-gitops-operator-controller-manager + namespace: openshift-operators +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: cluster-admin \ No newline at end of file diff --git a/hub-cluster-bootstrap/subscription.yaml b/hub-cluster-bootstrap/subscription.yaml new file mode 100644 index 0000000..6962b99 --- /dev/null +++ b/hub-cluster-bootstrap/subscription.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: openshift-gitops-operator + namespace: openshift-gitops-operator +spec: + channel: gitops-1.16 + config: + env: + - name: ARGOCD_CLUSTER_CONFIG_NAMESPACES + value: openshift-gitops + installPlanApproval: Automatic + name: openshift-gitops-operator + source: redhat-operators + sourceNamespace: openshift-marketplace diff --git a/step-by-step.md b/step-by-step.md index 382bc03..66be01d 100644 --- a/step-by-step.md +++ b/step-by-step.md @@ -69,6 +69,7 @@ This repo is a mono-repo that is broken up into three sections: ``` Other needed software: + - ~~kustomize~~ - git - oc @@ -111,6 +112,14 @@ Other needed software: ``` - Admin password and kubeconfig are in the homelab/10-sno-hub-cluster/03-openshift-image/auth directory + + From laptop/infra server: + + ```bash + cd homelab + oc apply -k hub-cluster-bootstrap + ``` + - Bootstrap ACM Running this playbook will configure Matchbox to wait for the sno-cluster to boot via iPXE and will install Single Node OpenShift. All configuration files are built from templates driven from Ansible variables. @@ -119,8 +128,6 @@ Other needed software: ansible-playbook -i inventory.yml 10-sno-hub-cluster/install2.yml ``` -10-sno-hub-cluster/05-bootstrap-acm/bootstrap.sh - ## Internal Cluster *TBD* (Deployed in conjunction with ACM)