Skip to content

Instantly share code, notes, and snippets.

View arcolife's full-sized avatar

Archit Sharma arcolife

View GitHub Profile
@arcolife
arcolife / gist:d6649e7e919663a7644ad38c6c26aac2
Last active July 25, 2017 07:37
rolebindings openshift
[root@openshift-master hello-python]# oc get rolebindings --all-namespaces
NAMESPACE NAME ROLE USERS GROUPS SERVICE ACCOUNTS SUBJECTS
blabla0 system:deployers /system:deployer deployer
blabla0 system:image-builders /system:image-builder builder
blabla0 system:image-pullers /system:image-puller system:serviceaccounts:blabla0
blabla0 admin /admin admin, demo0, demo1
clusterproject-a0 system:image-pullers /system:image-puller
@arcolife
arcolife / gist:082e7d2327fc8b1f1aa10786ebb158af
Last active July 26, 2017 12:41
generate 20K images in OCP
#!/bin/bash
# Usage: $ ./generate_builds.sh [count start] [count end]
# Example: (to generate 40K images):
# $ for i in $(seq 1 500 40000); do ./generate_builds.sh $i `expr $i + 500`; done
seq_init=$1
count=$2
registry='70.30.60.158:5000'
Checking EVM status...
Zone | Server | Status | ID | PID | SPID | URL | Started On | Last Heartbeat | Master? | Active Roles
-------------+--------+----------------+----+-------+-------+-------------------------+----------------------+----------------------+---------+----------------------------------------------------------------------------------------------------------------------------------
DB Zone | EVM | started | 1 | 23429 | 23440 | druby://127.0.0.1:34113 | 2017-07-07T11:04:54Z | 2017-07-12T10:50:43Z | true | database_operations:database_owner:ems_operations:smartstate:user_interface:web_services:websocket
Worker Zone | EVM | not responding | 32 | 2704 | 23293 | druby://127.0.0.1:41181 | 2017-07-10T05:32:43Z | 2017-07-10T05:35:31Z | false |
Worker Zone | EVM | started | 30 | 48190 | 30384 | druby://127.0.0.1:46205 | 2017-07-07T14:32:14Z | 2017-07-12T10:50:52Z | false | automate:ems_metrics_collector:ems_metr
x=(a b)
for i in ${x[@]};^Co echo -e "\n$i"; done
echo ${x[@]}
a b
echo ${!x[@]}
0 1
echo ${#x[@]}
2
@arcolife
arcolife / ems_refresh.txt
Created June 8, 2017 15:47
ems refresh timings
# on searching for ':ems_refresh=>'
...
...
[----] I, [2017-06-08T05:12:36.116510 #4392:ee3130] INFO -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::Refresher#refresh)
EMS: [ocp new], id: [1] Refreshing targets for EMS...Complete - Timings {:server_dequeue=>0.003165721893310547, :collect_inventory_for_targets=>0.013364315032958984, :parse_legacy_inventory=>93.21573758125305,
:parse_targeted_inventory=>93.21653270721436, :save_inventory=>485.05302691459656, :ems_refresh=>578.2846529483795}
[----] I, [2017-06-08T05:42:20.890895 #4392:ee3130] INFO -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::Refresher#refresh)
EMS: [ocp new], id: [1] Refreshing targets for EMS...Complete - Timings {:server_dequeue=>0.003165721893310547, :collect_inventory_for_targets=>0.01921844482421875, :parse_legacy_inventory=>127.7628972530365, :
@arcolife
arcolife / sarjitsu_openshift.md
Last active June 2, 2017 02:22
current state of sarjitsu
arcolife  …  ARCO  source  sarjitsu  oc get dc,svc,is,pvc,pods -o wide
NAME             REVISION   DESIRED   CURRENT   TRIGGERED BY
dc/datasource    1          1         1         config,image(datasource:elasticsearch)
dc/frontend      1          1         1         config,image(frontend:grafana)
dc/metricstore   1          1         1         config,image(metricstore:9.5)
dc/middleware    1          1         1         config,image(middleware:api)
dc/nginx         1          1         1         config,image(nginx:proxy)
dc/redis         1          1         1         config,image(redis:alpine)
dc/web           1          1         1         config,image(web:backend)
@arcolife
arcolife / processes_worker_output.md
Last active May 29, 2017 09:56
puma <-> worker mapping
root@CF vmdb]# rails evm:status
Checking EVM status...
 Zone | Server | Status  | ID |   PID |  SPID | URL                     | Started On           | Last Heartbeat       | Master? | Active Roles
------+--------+---------+----+-------+-------+-------------------------+----------------------+----------------------+---------+---------------------------------------------------------------------------------------------------------------------------------------
 Test | EVM    | started |  6 | 35999 | 39034 | druby://127.0.0.1:34301 | 2017-05-24T16:58:42Z | 2017-05-29T09:44:39Z | false   | automate:database_operations:ems_metrics_processor:ems_operations:git_owner:reporting:scheduler:user_interface:web_services:websocket

 Worker Type                  | Status  |  ID |   PID | SPID  | Server id | Queue Name / URL      | Started On           | Last Heartbeat
------------------------------+---------+-----+-------+-------+-----------+-----------------------+----------------------+----------------------
 MiqEmsMe
@arcolife
arcolife / oc-edit-esruc.yaml
Created April 24, 2017 14:00
oc edit image stream
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: ImageStream
metadata:
annotations:
openshift.io/image.dockerRepositoryCheck: 2017-04-24T12:36:09Z
creationTimestamp: 2017-04-24T12:36:09Z
@arcolife
arcolife / gist:07ed204419a35f0fe1a255734f211445
Created April 24, 2017 13:56
openshift image stream labels example
[root@openshift-master openshift_scalability]# oc get is --show-labels
NAME DOCKER REPO TAGS UPDATED LABELS
my_test_image 70.30.60.158:5000/default/my_test_image latest About an hour ago <none>
registry-console 70.30.60.158:5000/default/registry-console 3.4 13 days ago app=registry-console,createdBy=registry-console-template
[root@openshift-master openshift_scalability]# oc edit is my_test_image
imagestream "my_test_image" edited
[root@openshift-master openshift_scalability]# oc get is --show-labels
NAME DOCKER REPO TAGS UPDATED LABELS
my_test_image 70.30.60.158:5000/default/my_test_image latest About an hour ago foo=bar
@arcolife
arcolife / config.js
Created April 10, 2017 14:53
statsd /etc config
{
graphitePort: 2003
, graphiteHost: "localhost"
, port: 8125
, graphite: {
legacyNamespace: false
}
, deleteIdleStats: true
, backends: [ "./backends/graphite" ]
}