Skip to content

Instantly share code, notes, and snippets.

View SaravanaStorageNetwork's full-sized avatar

Saravanakumar Arumugam SaravanaStorageNetwork

View GitHub Profile
{
"clusters": [
{
"nodes": [
{
"node": {
"hostnames": {
"manage": [
"node1"
],
@SaravanaStorageNetwork
SaravanaStorageNetwork / tendlr_cleanup
Last active November 28, 2017 13:37
tendrl cleanup and restart
# Stop all services
for i in etcd tendrl-monitoring-integration tendrl-api tendrl-notifier carbon-cache grafana-server tendrl-node-agent httpd ; \
do \
systemctl stop $i;\
done
# Cleanup
rm -rf /var/lib/etcd/*
rm -rf /var/lib/carbon/whisper/*
rm -rf /var/lib/grafana/grafana.db
@SaravanaStorageNetwork
SaravanaStorageNetwork / CNS install failure
Created September 4, 2018 02:29
CNS install failure
2018-09-02 17:44:03,983 p=27009 u=root | ansible-playbook 2.4.6.0
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible-playbook
python version = 2.7.5 (default, May 31 2018, 09:41:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
2018-09-02 17:44:03,983 p=27009 u=root | Using /etc/ansible/ansible.cfg as config file
2018-09-02 17:44:04,029 p=27009 u=root | Parsed /etc/ansible/hosts inventory source with ini plugin
2018-09-02 17:44:08,987 p=27009 u=root | statically imported: /usr/share/ansible/openshift-ansible/roles/rhel_subscribe/tasks/satellite.yml
2018-09-02 17:44:09,316 p=27009 u=root | statically imported: /usr/share/ansible/openshift-ansible/roles/openshift_storage_glusterfs/tasks/mktemp.yml
@SaravanaStorageNetwork
SaravanaStorageNetwork / ansible_conditionals_examples.yaml
Created September 12, 2018 06:56 — forked from marcusphi/ansible_conditionals_examples.yaml
Ansible 1.3 Conditional Execution -- Very complete example with comments -- I find the conditional expressions to be ridiculously hard to get right in Ansible. I don't have a good model of what's going on under the surface so I often get it wrong. What makes it even harder is that there has been at least three different variants over the course …
---
# This has been tested with ansible 1.3 with these commands:
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false"
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true"
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts"
# NB: The type of the variable is crucial!
- name: Ansible Conditionals Examples
hosts: $hosts
vars_files:
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
@SaravanaStorageNetwork
SaravanaStorageNetwork / Dockerfile
Last active August 23, 2019 08:42
Dockerfile which untar kernel tar
FROM registry.fedoraproject.org/fedora:latest
ENV NAME="kernel-test-fedora" \
DESC="Kernel untar test on Fedora" \
VERSION=0 \
RELEASE=1 \
ARCH=x86_64 \
REPO="$FGC" \
container=docker
apiVersion: v1
kind: PersistentVolume
metadata:
annotations:
pv.kubernetes.io/bound-by-controller: "yes"
creationTimestamp: null
finalizers:
- kubernetes.io/pv-protection
name: pv00099
selfLink: /api/v1/persistentvolumes/pv00099
@SaravanaStorageNetwork
SaravanaStorageNetwork / list all images in openshift
Created November 26, 2021 12:58
Get all image present in a Openshift cluster
oc get pods -A -o jsonpath="{..image}" | tr -s '[[:space:]]' '\n' | sort | uniq
@SaravanaStorageNetwork
SaravanaStorageNetwork / oc autocomplete
Created November 26, 2021 14:05
openshift autocomplete
oc completion bash >>/etc/bash_completion.d/oc_completion
@SaravanaStorageNetwork
SaravanaStorageNetwork / oc_get_all
Created December 10, 2021 17:12
openshift 4.9 "oc get" resources
oc get <>
alertmanagerconfigs.monitoring.coreos.com kubeletconfigs.machineconfiguration.openshift.io
alertmanagers.monitoring.coreos.com kubeschedulers.operator.openshift.io
apirequestcounts.apiserver.openshift.io kubestorageversionmigrators.operator.openshift.io
apiservers.config.openshift.io leases.coordination.k8s.io
apiservices.apiregistration.k8s.io limitranges
appliedclusterresourcequotas.quota.openshift.io machineautoscalers.autoscaling.openshift.io
authentications.config.openshift.io machineconfigpools.machineconfiguration.openshift.io
authentications.operator.openshift.io machineconfigs.machineconfiguration.openshift.io