Skip to content

Instantly share code, notes, and snippets.

@ikurni
ikurni / ocp-health-check.yaml
Created March 2, 2018 07:22
OCP Health Check
---
- hosts: clients
tasks:
- name: Check Swap, make sure it's off
shell: ansible nodes -m shell -a 'free -m | grep "^Swap"'
- name: Check Kubelet Config
shell: ansible nodes -m shell -a 'grep -A10 "^kubeletArguments" /etc/origin/node/node-config.yaml'
- name: Selinux Status
@ikurni
ikurni / ocp-post-install.yaml
Created March 2, 2018 12:19
OCP Post Install scripts
---
- name: perform postinstallation steps
hosts: masters[0]
tasks:
- block:
- name: create yaml for cassandra pv
copy:
content: |
apiVersion: v1
kind: PersistentVolume
@ikurni
ikurni / aci-containers.yaml
Created March 13, 2018 08:03
ACI containers file for automatic deploy CNI
apiVersion: v1
kind: ConfigMap
metadata:
name: aci-containers-config
namespace: kube-system
labels:
aci-containers-config-version: "ac19175f-667f-4bf7-8b2c-4e6ed07802cd"
network-plugin: aci-containers
data:
controller-config: |-
@ikurni
ikurni / ds-aci-containers-host
Created March 13, 2018 08:50
Daemon Set ACI Container hosts
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"extensions/v1beta1","kind":"DaemonSet","metadata":{"annotations":{},"labels":{"aci-containers-config-version":"ac19175f-667f-4bf7-8b2c-4e6ed07802cd","network-plugin":"aci-containers"},"name":"aci-containers-host","namespace":"kube-system"},"spec":{"template":{"metadata":{"annotations":{"scheduler.alpha.kubernetes.io/critical-pod":""},"labels":{"name":"aci-containers-host","network-plugin":"aci-containers"}},"spec":{"containers":[{"env":[{"name":"KUBERNETES_NODE_NAME","valueFrom":{"fieldRef":{"fieldPath":"spec.nodeName"}}}],"image":"noiro/aci-containers-host:1.6r15","imagePullPolicy":"Always","livenessProbe":{"httpGet":{"path":"/status","port":8090}},"name":"aci-containers-host","securityContext":{"capabilities":{"add":["SYS_ADMIN","NET_ADMIN"]},"privileged":true},"volumeMounts":[{"mountPath":"/mnt/cni-bin","name":"cni-bin"},{"mountPath":"/mnt/cni-conf","name":"cn
@ikurni
ikurni / es_health_check.sh
Last active March 20, 2018 04:02
Troubleshoot Logging for OCP
#!/bin/bash
oc project logging
anypod=$(oc get po --selector=component=es --no-headers -o jsonpath='{range .items[?(@.status.phase=="Running")]}{.metadata.name}{"\n"}{end}' | head -n1)
ES_URL='https://localhost:9200'
curl_get='curl -s -X GET --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key'
date
$curl_get $ES_URL/_cat/health?v
# See https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-nodes.html for header meanings
@ikurni
ikurni / master-config.yaml
Last active April 27, 2018 09:22
Master config with LDAP Provider
oauthConfig:
assetPublicURL: https://ocpmaster.example.com:8443/console/
grantConfig:
method: auto
identityProviders:
#- challenge: true
# login: true
# mappingMethod: claim
# name: allow_all
# provider:
@ikurni
ikurni / preparation-hosts.yml
Last active October 16, 2018 23:30
OCP hosts preparation before installation - for Docker 1.12
---
- hosts: clients
tasks:
- name: Install additional packages needed
yum:
name: "{{ item }}"
state: latest
with_items:
- wget
- git
@ikurni
ikurni / preparation-host.yml
Created October 16, 2018 23:32
OCP hosts preparation scripts - docker 1.13 above
---
- hosts: clients
tasks:
- name: Install additional packages needed
yum:
name: "{{ item }}"
state: latest
with_items:
- wget
- git
#
# ansible inventory for OpenShift Container Platform 3.11.16
# AgnosticD ansible-config: ocp-ha-lab
[OSEv3:vars]
###########################################################################
### Ansible Vars
###########################################################################
timeout=60
@ikurni
ikurni / Satellite-6.3-Capsule-as-Docker
Last active January 25, 2019 06:30
Satellite 6.3+ - Use capsule as Docker Repository
### To configure Satellite as Docker Repository, it will be depend on how it's set to published at which URL. But for Capsule will use different URL compare to Satellite. To check correct URL for Capsule, so we can pull docker images from Capsule URL directly, do this :
#Go to Directory /var/lib/pulp/published/docker/v2/web/1-xxx-xxx-xxx (xxx represent random name dir generated by Pulp based on content view configuration)
cd /var/lib/pulp/published/docker/v2/web/1-openshift-cv-dr-7a234-12312-1231-3434-3243-4534-2342398704/tags
#Inside the dir, we can find few files in there, but just simply print the tags list
cat list
# {"name": "abc-dr-openshift-cv-docker-registry-openshift:3_ose-deployer", "tags": "["v3.11.51"... output omitted
#