Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make the vddk creation more fluent #98

Merged
merged 2 commits into from
Dec 11, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ roleRef:
name: migration-cluster-day2-installer
apiGroup: rbac.authorization.k8s.io
---

---
# pvc for the image registry for RWO - used with LVM storage backend
kind: PersistentVolumeClaim
apiVersion: v1
Expand All @@ -46,15 +44,14 @@ metadata:
annotations:
argocd.argoproj.io/sync-wave: "5"
spec:
storageClassName: lvms-vg1-1
accessModes:
- ReadWriteOnce
resources:
requests:
# we require the image registry for building the vddk image, we don't need more than
# 50Gi at the moment
storage: 40Gi


---
apiVersion: batch/v1
kind: Job
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,3 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: {{ .Values.lvmsOperator.subscription.namespace }}
# prevent the namespace deletion because in some sceneraious the namespace
# is not removed and stays in terminating state.
annotations:
argocd.argoproj.io/sync-wave: "-1"
labels:
argocd.argoproj.io/managed-by: openshift-gitops
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: lvm-storage-operator-group
namespace: {{ .Values.lvmsOperator.subscription.namespace }}
labels: {{ include "migration-cluster-day2.labels" . | nindent 4 }}
annotations:
argocd.argoproj.io/sync-wave: "1"
spec:
targetNamespaces:
- {{ .Values.lvmsOperator.subscription.namespace }}
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: lvm-storage-operator
namespace: {{ .Values.lvmsOperator.subscription.namespace }}
labels: {{ include "migration-cluster-day2.labels" . | nindent 4 }}
annotations:
argocd.argoproj.io/sync-wave: "1"
spec:
channel: {{ .Values.lvmsOperator.subscription.channel }}
installPlanApproval: Automatic
name: lvms-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
---

allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
Copy link
Collaborator

Choose a reason for hiding this comment

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

So do I understand corectly that you now rely on assisted installer to configure LVMCluster CR, but the only think you can't configure is the storage class, so you do it using gitops?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes

Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool! Can you please investigate if you can use this feature:
openshift/assisted-installer#940

To setup storage class?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

wow this is a super cool feature! I will investigate it, thank you!

kind: StorageClass
Expand All @@ -56,28 +16,4 @@ parameters:
topolvm.io/device-class: vg1
provisioner: topolvm.io
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer

---
apiVersion: lvm.topolvm.io/v1alpha1
kind: LVMCluster
metadata:
annotations:
argocd.argoproj.io/sync-wave: "2"
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
finalizers:
- lvmcluster.topolvm.io
generation: 1
name: lvmcluster
namespace: {{ .Values.lvmsOperator.subscription.namespace }}
labels: {{ include "migration-cluster-day2.labels" . | nindent 4 }}
spec:
storage:
deviceClasses:
- fstype: xfs
name: vg1
thinPoolConfig:
chunkSizeCalculationPolicy: Static
name: thin-pool-1
overprovisionRatio: 10
sizePercent: 90
volumeBindingMode: WaitForFirstConsumer
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,13 @@ spec:
kind: "Service"
name: mtv-init
weight: null
---
apiVersion: v1
kind: Secret
metadata:
name: vmware-credentials
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need empty credentials?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

namespace: {{ .Values.mtvOperator.subscription.namespace }}
annotations:
argocd.argoproj.io/sync-wave: "2"


This file was deleted.

24 changes: 24 additions & 0 deletions migration-cluster-day2/custom-manifests/0gitops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v1
kind: Namespace
metadata:
name: openshift-gitops-operator
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: openshift-gitops-operator
namespace: openshift-gitops-operator
spec:
upgradeStrategy: Default
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: openshift-gitops-operator
namespace: openshift-gitops-operator
spec:
channel: latest
installPlanApproval: Automatic
name: openshift-gitops-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
127 changes: 127 additions & 0 deletions migration-cluster-day2/custom-manifests/1rolebindings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: namespace-manager
rules:
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get", "create", "update", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: namespace-manager-binding
subjects:
- kind: ServiceAccount
name: openshift-gitops-argocd-application-controller
namespace: openshift-gitops
roleRef:
kind: ClusterRole
name: namespace-manager
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: persistentvolumeclaim-manager
namespace: openshift-image-registry
rules:
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "create", "update", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: persistentvolumeclaim-manager-binding
namespace: openshift-image-registry
subjects:
- kind: ServiceAccount
name: openshift-gitops-argocd-application-controller
namespace: openshift-gitops
roleRef:
kind: Role
name: persistentvolumeclaim-manager
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: job-manager
rules:
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: ["get", "create", "update", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: job-manager-binding
subjects:
- kind: ServiceAccount
name: openshift-gitops-argocd-application-controller
namespace: openshift-gitops
roleRef:
kind: ClusterRole
name: job-manager
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: argocd-application-controller
rules:
- apiGroups: [""]
resources: ["serviceaccounts", "services", "secrets"]
verbs: ["create", "get", "list", "update", "delete", "patch"]
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["create", "get", "list", "update", "delete", "patch"]
- apiGroups: ["route.openshift.io"]
resources: ["routes"]
verbs: ["create", "get", "list", "update", "delete", "patch"]
- apiGroups: ["image.openshift.io"]
resources: ["imagestreams"]
verbs: ["create", "get", "list", "update", "delete", "patch"]
- apiGroups: ["build.openshift.io"]
resources: ["buildconfigs"]
verbs: ["create", "get", "list", "update", "delete", "patch"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: argocd-application-controller-binding
subjects:
- kind: ServiceAccount
name: openshift-gitops-argocd-application-controller
namespace: openshift-gitops
roleRef:
kind: ClusterRole
name: argocd-application-controller
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: argocd-secrets-role
namespace: openshift-mtv
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["create", "get", "list", "update", "delete", "patch"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: argocd-secrets-rolebinding
namespace: openshift-mtv
subjects:
- kind: ServiceAccount
name: openshift-gitops-argocd-application-controller
namespace: openshift-gitops
roleRef:
kind: Role
name: argocd-secrets-role
apiGroup: rbac.authorization.k8s.io
Loading