Skip to content

Instantly share code, notes, and snippets.

@richm
richm / gist:e63e1c9efe8a2e9bb8a1a1a41b7ca04f
Created February 21, 2018 20:53
verify-loader output for test - 3 containers output interleaved in one stream
+++ verify-loader
interval read rate: 0.957 MB/sec, 979.358/sec (ignored 0.000 MB/sec, 0.287/sec); overall read rate: 0.957 MB/sec 979.358/sec (ignored 0.000 MB/sec, 0.287/sec)
--- verify-loader
0b1c4ac78b204812a9cea96f7d2c388b: 1519245646.35s ( 3.75s) 1207.165 1207.165 10239 8768 0 0
+++ verify-loader
interval read rate: 23.739 MB/sec, 24294.603/sec (ignored 0.000 MB/sec, 0.000/sec); overall read rate: 1.840 MB/sec 1883.156/sec (ignored 0.000 MB/sec, 0.276/sec)
--- verify-loader
python -c '
import sys,yaml
with open("logging.yml") as file:
c = yaml.load(file)
for appender in ["file", "deprecation_log_file", "index_search_slow_log_file", "index_indexing_slow_log_file"]:
if f = c["appender"][appender]:
f = c["type"] = "io.openshift.log4jextras.appender.DailyRollingFileAppender"
f["maxBackupIndex"] = sys.argv[1]
f["datePattern"] = sys.argv[2]
f["append"] = True
@richm
richm / logging-conn-tester.rb
Created July 13, 2018 18:36
test connections from fluentd to elasticsearch
require 'elasticsearch'
require 'excon'
class ESConnTester
def initialize(host='logging-es', port=9200)
@host = host
@port = port
@scheme = 'https'
@client_key = '/etc/fluent/keys/key'
---
- name: Get OpenShift specific information
hosts: masters[0]
sudo: yes
tasks:
- name: Get OpenShift information from the first master
import_role:
name: openshift_logging_rsyslog
tasks_from: main.yaml
when: rsyslog__enabled|bool and rsyslog__viaq|bool
E1128 22:29:02.134677 1 reflector.go:205] github.com/operator-framework/operator-lifecycle-manager/pkg/lib/queueinformer/queueinformer_operator.go:108: Failed to list *v1alpha2.OperatorGroup: the server could not find the requested resource (get operatorgroups.operators.coreos.com)
@richm
richm / gist:4865049ba17bd946a3c84959ec017253
Last active December 10, 2018 23:34
python https client
import ssl
import httplib
import pprint
ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH, "/etc/pki/tls/certs/ca-bundle.crt")
ctx.verify_mode = ssl.CERT_OPTIONAL
c = httplib.HTTPSConnection("www.google.com:443", context=ctx)
c.request("GET", "/")
print c.getresponse().read()[:80]
$ oc get deploy router-default -o yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
creationTimestamp: 2018-12-12T21:33:40Z
generation: 1
labels:
app: router
apiVersion: logging.openshift.io/v1alpha1
kind: Elasticsearch
metadata:
creationTimestamp: 2019-01-09T16:40:58Z
generation: 1
name: elasticsearch
namespace: openshift-logging
ownerReferences:
- apiVersion: logging.openshift.io/v1alpha1
controller: true
apiVersion: logging.openshift.io/v1alpha1
kind: ClusterLogging
metadata:
annotations:
io.openshift.clusterlogging.alpha/allinone: ""
creationTimestamp: 2019-01-09T16:40:56Z
generation: 1
name: example
namespace: openshift-logging
resourceVersion: "112581"
aggregationRule:
clusterRoleSelectors:
- matchLabels:
rbac.authorization.k8s.io/aggregate-to-cluster-reader: "true"
- matchLabels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations: