Skip to content

Instantly share code, notes, and snippets.

@badri
badri / gist:00ff36dfca9440f1bfcb87449fe8fa4c
Created April 23, 2019 11:20
Openshift describe node
Conditions:
Type Status LastHeartbeatTime LastTransitionTime Reason Message
---- ------ ----------------- ------------------ ------ -------
OutOfDisk False Tue, 23 Apr 2019 11:15:00 +0000 Tue, 23 Apr 2019 02:46:44 +0000 KubeletHasSufficientDisk kubelet has sufficient disk space available
MemoryPressure False Tue, 23 Apr 2019 11:15:00 +0000 Tue, 23 Apr 2019 02:46:44 +0000 KubeletHasSufficientMemory kubelet has sufficient memory available
DiskPressure False Tue, 23 Apr 2019 11:15:00 +0000 Tue, 23 Apr 2019 02:46:44 +0000 KubeletHasNoDiskPressure kubelet has no disk pressure
PIDPressure False Tue, 23 Apr 2019 11:15:00 +0000 Tue, 23 Apr 2019 02:46:44 +0000 KubeletHasSufficientPID kubelet has sufficient PID available
Ready True Tue, 23 Apr 2019 11:15:00 +0000 Tue, 23 Apr 2019 02:47:04 +0000 Kubelet
@badri
badri / playbook.yml
Last active April 24, 2019 16:49
Ansible playbook for post install
---
- hosts: all
gather_facts: false
tasks:
- name: Update default storage class
command: >-
oc patch storageclass glusterfs-storage -p '{"metadata":{"annotations":{"storageclass.beta.kubernetes.io/is-default-class":"true"}}}'
- name: Make admin the cluster administrator
command: >-
oc adm policy add-cluster-role-to-user cluster-admin admin
@badri
badri / Dockerfile
Created February 20, 2019 23:07
docker compose for rundeck
FROM rundeck/rundeck:3.0.13
RUN sed -i 's|dataSource.url = {{ getv("/rundeck/database/url", "jdbc:h2:file:/home/rundeck/server/data/grailsdb;MVCC=true") }}|dataSource.url = {{ getenv("RUNDECK_DATABASE_URL") }}|g' /etc/remco/templates/rundeck-config.properties
RUN sed -i 's|dataSource.username = {{ getv("/rundeck/database/username", "") }}|dataSource.username={{ getenv("RUNDECK_DATABASE_USERNAME") }}|g' /etc/remco/templates/rundeck-config.properties
RUN sed -i 's|dataSource.password = {{ getv("/rundeck/database/password", "") }}|dataSource.password={{ getenv("RUNDECK_DATABASE_PASSWORD") }}|g' /etc/remco/templates/rundeck-config.properties
@badri
badri / digitalocean.tf
Last active December 3, 2018 00:01
Terraform script
resource "digitalocean_ssh_key" "default" {
name = "Terraform Example"
public_key = "${file("/scripts/id_rsa.pub")}"
}
resource "digitalocean_droplet" "web" {
image = "centos-7-x64"
name = "web-1"
region = "tor1"
size = "s-1vcpu-1gb"
@badri
badri / do-inventory.cfg
Created November 14, 2018 13:17
DigitalOcean 3 node OKD 3.10 inventory
[OSEv3:children]
masters
nodes
etcd
glusterfs
new_nodes
[masters]
console.example.com openshift_ip=1.2.3.4 openshift_schedulable=true
@badri
badri / CloudFormationTemplateOpenShift.yaml
Created October 27, 2018 19:58 — forked from mateobur/CloudFormationTemplateOpenShift.yaml
CloudFormation Template OpenShift
AWSTemplateFormatVersion: '2010-09-09'
Metadata: {}
Parameters:
###########
KeyName:
Description: The EC2 Key Pair to allow SSH access to the instance
Type: 'AWS::EC2::KeyPair::KeyName'
AvailabilityZone:
Description: Availability zone to deploy
@badri
badri / ubuntu-lemp.yaml
Last active August 6, 2018 04:30
OpenShift LEMP template construction
apiVersion: v1
kind: Template
metadata:
name: ubuntu-lemp
objects:
- apiVersion: v1
kind: BuildConfig
metadata:
annotations:
openshift.io/generated-by: OpenShiftNewApp
/**
* GET /api/file/:id
* Download an uploaded file.
*/
export let download = (req: Request, res: Response, next: NextFunction) => {
File.findByIdAndRemove(req.params.id).exec((err, file) => {
if (err) res.status(500).send(err);
if (!file) {
res.status(404).send('not found');
return;
@badri
badri / op.txt
Created May 17, 2018 06:50
Better results
--- Failed scenarios:
features/archive/sessions.feature:80
features/discussions/privacy.feature:25
features/miscellaneous/site_settings.feature:7
125 scenarios (117 passed, 3 failed, 5 undefined)
1255 steps (1218 passed, 3 failed, 6 undefined, 28 skipped)
13m55.29s (69.77Mb)
@badri
badri / op.txt
Created May 17, 2018 05:25
Behat output
--- Failed scenarios:
features/archive/sessions.feature:80
features/discussions/privacy.feature:25
125 scenarios (100 passed, 2 failed, 23 undefined)
1255 steps (1096 passed, 2 failed, 59 undefined, 98 skipped)
15m6.36s (70.64Mb)
--- FeatureContext has missing steps. Define them with these snippets: