Skip to content

Instantly share code, notes, and snippets.

RHEL 6.3 veewee templates for vagrant use

These templates can be used to feed to veewee to spin up an el6 basebox for use with vagrant.

There are some coded values in definition.rb and ks.cfg which point at Yale-ishness. Amend to point at local RHEL iso/yum repo.

Built successfully with veewee 0.2.3, vagrant 1.0.3, Virtualbox 4.1.18.

Config Management

@sudhirpandey
sudhirpandey / graphite.md
Last active August 29, 2015 14:27 — forked from ashrithr/graphite.md
Installing graphite 0.10, collectd and grafana on centos 6

Installing Graphite:

Graphite does two things:

  1. Store numeric time-series data
  2. Render graphs of this data on demand

What Graphite does not do is collect data for you, however there are some tools out there that know

@sudhirpandey
sudhirpandey / gist:1c971566c66bce701503
Created February 15, 2016 16:42
delete resources created by metric-deployer
oc delete all --selector=metrics-infra -n openshift-infra
oc delete secrets --selector=metrics-infra -n openshift-infra
oc delete sa --selector=metrics-infra -n openshift-infra
oc delete templates --selector=metrics-infra -n openshift-infra
oc delete sa metrics-deployer -n openshift-infra
oc delete secret metrics-deployer -n openshift-infra
systemctl restart docker
__________
oc get pvc
oc delete pvc metrics-cassandra-
@sudhirpandey
sudhirpandey / gist:7ac8bf3d18558d9c3c4b46e6d0974a35
Created August 1, 2017 08:32
Helm usage with triller in confined namespace and other options eg
helm del --purge prometheus --tiller-namespace=helmtest
helm ls --all prometheus --tiller-namespace=helmtest
helm install --name prometheus stable/prometheus --set nodeExporter.enabled=false --tiller-namespace=helmtest
helm del --purge prometheus --tiller-namespace=helmtest
helm install --name prometheus stable/prometheus --set nodeExporter.enabled=false --tiller-namespace=helmtest
helm del --purge prometheus --tiller-namespace=helmtest
helm install --name prometheus stable/prometheus --set nodeExporter.enabled=false,server.persistentVolume.storageClass=slow --tiller-namespace=helmtest
helm install stable/grafana --tiller-namespace=helmtest --set server.persistentVolume.size=false
gcloud beta compute instances create osd1 --machine-type=n1-standard-1 --image=centos-7-ocp-gold-image --network-interface subnet=default --network-interface subnet=backend-storage,no-address --tags=osds,ceph,allowinternal,allowssh --zone=europe-west2-a
@sudhirpandey
sudhirpandey / assign_shards.sh
Last active July 31, 2018 12:27
scripts to do maintainence of elastic cluster in openshift
!/bin/bash
array=(083kuvhb 56ghubyf mdaaepif)
RANDOM=$$$(date +%s)
for index in $(curl --key /etc/elasticsearch/secret/admin-key --cert /etc/elasticsearch/secret/admin-cert --cacert /etc/elasticsearch/secret/admin-ca -XGET https://localhost:9200/_cat/shards | grep UNASSIGNED | awk '{print $1}'| sort | uniq); do
for shard in $(curl --key /etc/elasticsearch/secret/admin-key --cert /etc/elasticsearch/secret/admin-cert --cacert /etc/elasticsearch/secret/admin-ca -XGET https://localhost:9200/_cat/shards | grep $index |grep UNASSIGNED | awk '{print $2}'); do
i=${array[$RANDOM % ${#array[@]} ]}
@sudhirpandey
sudhirpandey / gist:34fca2ff6b1ff73c8b83e59112988578
Last active November 14, 2017 16:24
If you see this Nov 14 17:18:17 logs.go:41] skydns: failure to forward request "read udp nodeIP:50958->nodeIO:53: i/o timeout"
systemctl restart origin-node.service
journalctl -f -u origin-node.service |grep "skydns: failure to forward request"
and this should work on each host
nslookup docker-registry.default.svc.cluster.local
Server: 10.89.10.46
Address: 10.89.10.46#53
Name: docker-registry.default.svc.cluster.local
@sudhirpandey
sudhirpandey / kubectl.md
Created May 23, 2018 12:34 — forked from so0k/kubectl.md
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@sudhirpandey
sudhirpandey / oc command lines
Last active November 17, 2021 13:58
openshift command line with Go templating and others
#expose console from 443
oc create route reencrypt master --service kubernetes --port 443 -n default
#nested loops , tags count in IS
oc get is --template='{{range $i, $is:=.items}}{{ $total :=0 }}{{ range $index, $element :=$is.status.tags }}{{if eq $element.tag "latest"}}{{$is.metadata.name}}{{"\t"}}{{ $index }}{{end}}{{end}}{{"\n"}}{{end}}'
get complex labels
oc get nodes --template='{{ with $i := index .items 0 }}{{ index $i.metadata.labels "failure-domain.beta.kubernetes.io/region" }}{{ end }}'
#patchin resource limits
@sudhirpandey
sudhirpandey / prometheus.config
Created July 23, 2018 10:21
Prometheus scrape configs
# Example scrape config for pods
#
# The relabeling allows the actual pod scrape endpoint to be configured via the
# following annotations:
#
# * `prometheus.io/scrape`: Only scrape pods that have a value of `true`
# * `prometheus.io/path`: If the metrics path is not `/metrics` override this. This
# will be the same for every container in the pod that is scraped.
# * this will scrape every container in a pod with `prometheus.io/scrape` set to true and the
port is name `metrics` in the container