Skip to content

Instantly share code, notes, and snippets.

@gnufied
Last active April 18, 2019 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnufied/c9f40d8c2db5a25909c9b19f4dc319de to your computer and use it in GitHub Desktop.
Save gnufied/c9f40d8c2db5a25909c9b19f4dc319de to your computer and use it in GitHub Desktop.

local-storage-operator

Operator for local storage

Deployment on Openshift-4.1 via OLM

Create a namespace for deploying the operator

~> oc new-project local-storage

Create a OperatorGroup

apiVersion: operators.coreos.com/v1alpha2
kind: OperatorGroup
metadata:
  name: local-operator-group
  namespace: local-storage
  spec:
    targetNamespaces:
    - local-storage

Create a catalog source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: local-storage-manifests
  namespace: local-storage
spec:
  sourceType: grpc
  image: quay.io/gnufied/local-registry:latest

Subscribe to the local-storage catalog

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: local-storage-subscription-2
  namespace: local-storage
spec:
  channel: alpha
  name: local-storage
  source: local-storage-manifests
  sourceNamespace: local-storage

Create CR with node selector:

apiVersion: "local.storage.openshift.io/v1alpha1"
kind: "LocalVolume"
metadata:
  name: "local-disks"
spec:
  nodeSelector:
    nodeSelectorTerms:
    - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - ip-10-0-167-94
  storageClassDevices:
    - storageClassName: "local-sc"
      volumeMode: Filesystem
      fsType: xfs
      deviceNames:
        - xvdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment