Skip to content

Instantly share code, notes, and snippets.

View tstrul1's full-sized avatar

Tzachi Strul tstrul1

View GitHub Profile
@tstrul1
tstrul1 / cheatsheet-elasticsearch.md
Created July 23, 2021 13:49 — forked from ruanbekker/cheatsheet-elasticsearch.md
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
apiVersion: apps/v1
kind: Deployment
metadata:
name: greeter
spec:
selector:
matchLabels:
app.kubernetes.io/name: greeter
replicas: 1
template:
@tstrul1
tstrul1 / ingress.yaml
Created August 29, 2020 12:13 — forked from subudhiroshan/ingress.yaml
ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: iron-gallery-ingress
spec:
rules:
- host: iron-gallery-braavos.com
http:
paths:
- path: /
@tstrul1
tstrul1 / volume.yaml
Created August 29, 2020 12:09 — forked from matthewpalmer/volume.yaml
Kubernetes volume example YAML
kind: Pod
apiVersion: v1
metadata:
name: simple-volume-pod
spec:
# Volumes are declared by the pod. They share its lifecycle
# and are communal across containers.
volumes:
# Volumes have a name and configuration based on the type of volume.
# In this example, we use the emptyDir volume type
kind: Service
apiVersion: v1
metadata:
name: hostname-service
spec:
# Expose the service on a static port on each node
# so that we can access the service from outside the cluster
type: NodePort
# When the node receives a request on the static port (30163)
kind: Pod
apiVersion: v1
metadata:
name: pod-env-var
spec:
containers:
- name: env-var-configmap
image: nginx:1.7.9
envFrom:
- configMapRef:
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: nginx-deployment
spec:
# A deployment's specification really only
# has a few useful options
# 1. How many copies of each pod do we want?
replicas: 3
kind: ConfigMap
apiVersion: v1
metadata:
name: example-configmap
data:
# Configuration values can be set as key-value properties
database: mongodb
database_uri: mongodb://localhost:27017
# Or set as complete file contents (even JSON!)
---
- hosts: tomcatServer
vars:
- warName: ROOT.war
- warRemotePath: /home/tomcat
tasks:
- name: Download WAR to server
command: wget http://git-internal/release.war -O {{ warRemotePath }}/{{ warName }}
#!/usr/bin/env bash
while read -r instance; do
while read -r current_node_cpus; do
current_node=();
for i in $current_node_cpus; do
current_node[i]=1
done