Skip to content

Instantly share code, notes, and snippets.

@JohnStrunk
Last active October 19, 2018 20:51
Show Gist options
  • Save JohnStrunk/63fd6141a25ca959e49b9c99758eeff7 to your computer and use it in GitHub Desktop.
Save JohnStrunk/63fd6141a25ca959e49b9c99758eeff7 to your computer and use it in GitHub Desktop.
Anthill CRD scratch space
---
apiVersion: "operator.gluster.org/v1alpha1"
kind: GlusterCluster
metadata:
# Name for the Gluster cluster that will be created by the operator
name: my-cluster
# CRD is namespaced
namespace: gcs
spec:
# Cluster options allows setting "gluster vol set" options that are
# cluster-wide (i.e. don't take a volname argument).
clusterOptions: # (optional)
"cluster.halo-enabled": "yes"
# Drivers lists the CSI drivers that should be deployed for use with this
# cluster
drivers:
- gluster-fuse
- gluster-block
# Gluster CA to use for generating Gluster TLS keys.
# Contains Secret w/ CA key & cert
glusterCA: # (optional)
secretName: my-secret
secretNamespace: my-ns # default is metadata.namespace
# Georeplication
replication: # (optional)
# Credentials for using this cluster as a target
credentials:
secretName: my-secret
secretNamespace: my-ns # default is metadata.namespace
targets:
# Each target has a name that can be used in the StorageClass
- name: foo
# Addresses of node(s) in the peer cluster
address:
- 1.1.1.1
- my.dns.com
# Credentials for setting up session (ssh user & key)
credentials:
secretName: my-secret
secretNamespace: my-ns # default is metadata.namespace
# Only PV-based nodes are built from templates
nodeTemplates: # (optional)
- name: myTemplate
# Zone is the "failure domain"
zone: my-zone # default is .nodeTemplates.name
thresholds:
nodes: 7 # may only be specified if other fields are absent
minNodes: 3
maxNodes: 42
freeStorageMin: 1Ti
freeStorageMax: 3Ti
nodeAffinity: # (optional)
# https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
# Would include "zone"-level affinity
# Operator will overlay best-effort pod anti-affinity
...
storage:
storageClassName: my-sc
capacity: 1Ti
status:
# TBD operator state
...
---
apiVersion: "operator.gluster.org/v1alpha1"
kind: GlusterNode
metadata:
# Name for this node
name: az1-001
# CRD is namespaced
namespace: gcs
annotations:
# Applied by operator when it creates/manages this object from a template.
# When this is present, contents will be dynamically adjusted accd to the
# template in the cluster CR.
# When this annotation is present, the admin may only modify
# .spec.desiredState or delete the CR. Any other change will be
# overwritten.
anthill.gluster.org/template: template-name
spec:
# Nodes belong to a cluster
cluster: my-cluster
# Nodes belong to a zone
zone: az1
# Admin (or operator) sets desired state for the node.
desiredState: enabled # (enabled | disabled)
# Only 1 of external | storage
external:
address: my.host.com
credentials:
secretName: my-secret
secretNamespace: my-ns # default is metadata.namespace
storage:
# Only 1 of device | pvcName
# Device names must to be stable on the host
- device: /dev/sd[b-d]
pvcName: my-pvc
tags: [tag1, tag2]
nodeAffinity:
# https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
# For admin created GlusterNodes, this needs to specify a node selector
# that matches exactly one node. For template-based GNs, this will inherit
# from the template.
...
status:
# TBD operator state
# Possible states: (enabled | deleting | disabled)
currentState: enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment