Skip to content

Instantly share code, notes, and snippets.

View csibbitt's full-sized avatar

Chris Sibbitt csibbitt

  • Red Hat, Inc
  • Ottawa, Canada
View GitHub Profile

Working on infrawatch/service-telemetry-operator#336

Smoketests are failing due to the lack of --serviceaccount option in the oc run command in our jenkins agent container.

Here is my local:

$ oc run --help | grep serviceaccount
      --serviceaccount='': Service account to set in the pod spec.
$ oc version
@csibbitt
csibbitt / net.sh
Created March 10, 2022 17:18
Linux primary interface IP config snippet
export IP=$(ip route get 1.1.1.1 | head -1 | cut -d' ' -f7)
export NETMASK=$(ip route | grep $IP | sed -E 's!.*/([[:digit:]]+) dev.*!\1!')
export GATEWAY=$(ip route | grep default | sed -E 's/.*via (.*) dev.*/\1/')
export INTERFACE=$(ip route | grep $IP | sed -E 's!.* dev (.*) proto.*!\1!')
@csibbitt
csibbitt / gist:95db8af1ca882a9d7bee4ef09d53300d
Last active October 15, 2020 20:38
Ansible variable scoping

While working on the sslProfiles for internal TLS, I got bit by this highly weird variable scoping problem.

- name: Set SSL Profiles
  set_fact:
    ssl_profiles: TESTING

- name: Show profiles
  debug:
 msg: "ssl_profiles: {{ ssl_profiles }}"
# Generated by Puppet (Not... exactly)
#Hostname localhost
FQDNLookup true
AutoLoadPlugin false
#BaseDir "/var/lib/collectd"
#PluginDir "/usr/lib/collectd"
TypesDB "/usr/share/collectd/types.db"
Interval 5
sh-4.2$ qdstat -vl
2020-04-24 20:07:16.891436 UTC
stf-default-interconnect-5ccfd444f4-7xtds
Router Links
type dir conn id id peer class addr phs cap pri undel unsett deliv presett psdrop acc rej rel mod delay rate stuck cred blkd admin oper
name
=============================================================================================================================================================================================================
=============================================================================
endpoint out 2 9 mobile anycast/ceilometer/event.sample 0 250 0 0 0 0 0 0 0 0 0 0 0 0 0 1 - enabled up
apiVersion: v1
kind: Pod
metadata:
annotations:
k8s.v1.cni.cncf.io/networks-status: |-
[{
"name": "openshift-sdn",
"interface": "eth0",
"ips": [
"10.128.1.55"
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "2"
creationTimestamp: "2020-04-24T19:13:11Z"
generation: 2
labels:
app: smart-gateway
smart-gateway: stf-default-collectd-telemetry
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "2"
creationTimestamp: "2020-04-24T19:13:11Z"
generation: 2
labels:
app: smart-gateway
smart-gateway: stf-default-collectd-telemetry
@csibbitt
csibbitt / sg-deployment.yaml
Created March 10, 2020 16:52
Experimental deployment of sg2 code
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
name: stf-default-collectd-telemetry-smartgateway
namespace: service-telemetry
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
app: smart-gateway
top - 10:00:00 up 1 day, 8:00, 4 users, load average: 21.07, 21.05, 21.01
Tasks: 529 total, 1 running, 528 sleeping, 0 stopped, 0 zombie
%Cpu0 : 0.3 us, 1.0 sy, 0.0 ni, 98.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu1 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu2 : 0.7 us, 0.0 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu3 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu4 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu5 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu6 : 0.3 us, 0.3 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu7 : 0.0 us, 0.3 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st