Deploy openshift gitops

This commit is contained in:
2025-04-18 23:25:36 -05:00
parent 0f26afd794
commit 0b22970bad
11 changed files with 137 additions and 5 deletions

View File

@@ -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.

View File

@@ -3,4 +3,4 @@ clusterGroup:
acm:
name: advanced-cluster-management
namespace: open-cluster-management
channel: release-2.12
channel: release-2.13

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,7 @@
---
apiVersion: v1
kind: Namespace
metadata:
labels:
argocd.argoproj.io/managed-by: openshift-gitops-operator
name: openshift-gitops-operator

View File

@@ -0,0 +1,8 @@
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: openshift-gitops-operator
namespace: openshift-gitops-operator
spec:
upgradeStrategy: Default

View File

@@ -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

View File

@@ -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

View File

@@ -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)