Skip to content

Instantly share code, notes, and snippets.

View akhilerm's full-sized avatar

Akhil Mohan akhilerm

View GitHub Profile

Keybase proof

I hereby claim:

  • I am akhilerm on github.
  • I am akhilerm (https://keybase.io/akhilerm) on keybase.
  • I have a public key ASBCqlRqDCbrGLEQ6vIHi7fnMwjTKd0E-e-jmGu8f0ZbAwo

To claim this, I am signing this object:

@akhilerm
akhilerm / openebs-privileged-psp.yaml
Last active April 16, 2019 12:48
Pod Security Policy for OpenEBS privileged access
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
metadata:
name: openebs-privileged
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*'
spec:
privileged: true
allowPrivilegeEscalation: true
allowedCapabilities:
@akhilerm
akhilerm / openebs-privileged-role.yaml
Last active August 26, 2020 14:03
openebs-privileged-role.yaml
# Define Role that allows operations on K8s pods/deployments
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: openebs-maya-operator
rules:
- apiGroups: ["*"]
resources: ["nodes", "nodes/proxy"]
verbs: ["*"]
- apiGroups: ["*"]
apiVersion: openebs.io/v1alpha1
kind: StoragePoolClaim
metadata:
name: cstor-pool1
annotations:
cas.openebs.io/config: |
- name: PoolResourceRequests
value: |-
memory: 1Gi
- name: PoolResourceLimits
@akhilerm
akhilerm / uuid.go
Last active August 8, 2019 09:52
UUID generation for disks in NDM
// gets the uuid of the provided disk
func getUid(device *udev.UdevDevice) string {
uid := device.GetPropertyValue(udev.UDEV_WWN) +
device.GetPropertyValue(udev.UDEV_MODEL) +
device.GetPropertyValue(udev.UDEV_SERIAL) +
device.GetPropertyValue(udev.UDEV_VENDOR)
idtype := device.GetPropertyValue(udev.UDEV_TYPE)
@akhilerm
akhilerm / disk_UUID_vmw.md
Created September 10, 2019 09:55
Steps to enable disk unique identification in VMware

Enabling Disk UUID in VMware via vSphere Client

  1. Right-click the virtual machine for which you want to enable the disk UUID attribute, and select Power > Power Off. Wait for the virtual machine to power off
  2. Right-click the virtual machine, and click Edit Settings.
  3. Click the Options tab, and select the General entry in the settings column.
  4. Click Configuration Parameters. The Configuration Parameters window appears.
  5. Click Add Row.
  6. In the Name column, enter disk.EnableUUID.
  7. In the Value column, enter TRUE.

Enabling disk UUID in proxmox VMs

The configuration file for each VM has to be edited, so that the disk comes with a unique serial number

  1. vi /etc/pve/qemu-server/<VMID>.conf
  2. Add a unique serial number to the disk
scsi1: images:<disk image>,cache=writeback,discard=on,size=120G,ssd=1,serial=5fb20ba17c2f
  1. Restart the VM qm shutdown <VMID> && qm start <VMID>
@akhilerm
akhilerm / example-blockdevice.yaml
Created September 16, 2019 04:27
Example BlockDevice custom resource to be used in OpenEBS.
apiVersion: openebs.io/v1alpha1
kind: BlockDevice
metadata:
name: example-blockdevice
labels:
kubernetes.io/hostname: <host name of the node in which disk/blockdevice is attached> # like gke-openebs-user-default-pool-044afcb8-bmc0
ndm.io/managed: "false" # for manual disk creation put false
ndm.io/blockdevice-type: blockdevice
status:
claimState: Unclaimed
Flowchart for local pv upgrade
NOTE: Does not support upgrade of localPV rawblock
For Cstor, the same flowchart as below applies, but instead of using FSUUID annotation, partition table UUID
annotation will be used.
@akhilerm
akhilerm / minio-official.yaml
Created November 15, 2020 17:48
Deploy Sample Minio application
#Create namespace
apiVersion: v1
kind: Namespace
metadata:
name: minio
---
apiVersion: apps/v1
kind: Deployment
metadata:
# This name uniquely identifies the Deployment