My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: greeter | |
| spec: | |
| selector: | |
| matchLabels: | |
| app.kubernetes.io/name: greeter | |
| replicas: 1 | |
| template: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: extensions/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: iron-gallery-ingress | |
| spec: | |
| rules: | |
| - host: iron-gallery-braavos.com | |
| http: | |
| paths: | |
| - path: / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kind: Pod | |
| apiVersion: v1 | |
| metadata: | |
| name: pod-env-var | |
| spec: | |
| containers: | |
| - name: env-var-configmap | |
| image: nginx:1.7.9 | |
| envFrom: | |
| - configMapRef: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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!) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - 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 }} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
NewerOlder