Skip to content

Instantly share code, notes, and snippets.

View parisnakitakejser's full-sized avatar

Paris Nakita Kejser parisnakitakejser

View GitHub Profile
@parisnakitakejser
parisnakitakejser / es-create-document.sh
Created January 27, 2022 11:24
How to create document into Elasticsearch
curl -XPUT "http://localhost:9200/test-index-1/1" -d"{\"test\":\"hello world\"}"
curl -XPUT "http://localhost:9200/test-index-1/2" -d"{\"test\":\"demo world\"}"
curl -XPUT "http://localhost:9200/test-index-1/3" -d"{\"test\":\"hello demo\"}"
@parisnakitakejser
parisnakitakejser / es-delete-indexes.sh
Created January 27, 2022 11:09
Remove Elasticsearch index
curl -X DELETE "localhost:9200/test-index-1?pretty"
curl -X DELETE "localhost:9200/test-index-3?pretty"
@parisnakitakejser
parisnakitakejser / es-get-index-list.sh
Created January 27, 2022 11:07
Get a list over Elasticsearch indexes
curl -X GET "localhost:9200/_cat/indices?h=index"
@parisnakitakejser
parisnakitakejser / es-create-index.sh
Created January 27, 2022 11:02
Create 3 test Elasticsearch indexes
curl -X PUT "localhost:9200/test-index-1?pretty"
curl -X PUT "localhost:9200/test-index-2?pretty"
curl -X PUT "localhost:9200/test-index-3?pretty"
@parisnakitakejser
parisnakitakejser / first-deployment.yml
Created January 22, 2022 17:29
First deployment for Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
name: sample-server
labels:
app: web
spec:
replicas: 2
selector:
matchLabels:
@parisnakitakejser
parisnakitakejser / first-load-balancer.yml
Last active January 22, 2022 17:30
Load balancer in Kubernetes as Service
apiVersion: v1
kind: Service
metadata:
name: sample-lb
spec:
selector:
app: web
ports:
- protocol: TCP
port: 80
apiVersion: apps/v1
kind: Deployment
metadata:
name: dynamic-env-test
spec:
replicas: 3
template:
spec:
containers:
- name: pods-dynamic-env-test
apiVersion: v1
kind: Secret
metadata:
name: test-env-secret
type: Opaque
stringData:
SERVICE_NAME: "flask-api-test-env"
@parisnakitakejser
parisnakitakejser / deployment-static-env.yml
Created January 15, 2022 15:12
Use static environment variables in Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
name: static-env-test
spec:
replicas: 3
template:
spec:
containers:
- name: pods-static-env-test
@parisnakitakejser
parisnakitakejser / service-with-2-python-flask-test-services.yml
Last active January 8, 2022 21:25
Service and Pods with support hostname & subdomain
apiVersion: v1
kind: Service
metadata:
name: default-subdomain
spec:
selector:
app: web
ports:
- name: "5000"
port: 5000