Instantly share code, notes, and snippets.

Embed
What would you like to do?
---
apiVersion: "v1"
kind: "ConfigMap"
metadata:
name: "wp-es-demo-config"
namespace: "dev"
labels:
app: "wp-es-demo"
data:
cluster_nodes: "<your_elasticsearch_instance_tcp_host_and_port>"
cluser_name: "elasticsearch"
---
apiVersion: "extensions/v1beta1"
kind: "Deployment"
metadata:
name: "wp-es-demo"
namespace: "dev"
labels:
app: "wp-es-demo"
spec:
replicas: 3
selector:
matchLabels:
app: "wp-es-demo"
template:
metadata:
labels:
app: "wp-es-demo"
spec:
containers:
- name: "wp-es-demo"
image: "gcr.io/wp-search-bot/wp-es-demo"
imagePullPolicy: Always
env:
- name: "SPRING_DATA_ELASTICSEARCH_CLUSTER-NODES"
valueFrom:
configMapKeyRef:
key: "cluster_nodes"
name: "wp-es-demo-config"
- name: "SPRING_DATA_ELASTICSEARCH_CLUSTER-NAME"
valueFrom:
configMapKeyRef:
key: "cluser_name"
name: "wp-es-demo-config"
---
apiVersion: "autoscaling/v1"
kind: "HorizontalPodAutoscaler"
metadata:
name: "wp-es-demo-hpa"
namespace: "dev"
labels:
app: "wp-es-demo"
spec:
scaleTargetRef:
kind: "Deployment"
name: "wp-es-demo"
apiVersion: "apps/v1beta1"
minReplicas: 1
maxReplicas: 3
targetCPUUtilizationPercentage: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment