Skip to content

Commit

Permalink
Merge pull request elastic#341 from masci/massi/fix-gke-on-prem
Browse files Browse the repository at this point in the history
Update GKE on-prem example
  • Loading branch information
masci authored Oct 23, 2020
2 parents 9af3861 + 7b35d58 commit 999e93d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 18 deletions.
8 changes: 6 additions & 2 deletions GKE-On-Prem/filebeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ data:
output.elasticsearch:
hosts: ${ELASTICSEARCH_HOSTS}
ilm.enabled: true
---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: filebeat-dynamic
Expand All @@ -87,6 +87,10 @@ metadata:
k8s-app: filebeat-dynamic
kubernetes.io/cluster-service: "true"
spec:
selector:
matchLabels:
k8s-app: filebeat-dynamic
kubernetes.io/cluster-service: "true"
template:
metadata:
labels:
Expand Down
36 changes: 25 additions & 11 deletions GKE-On-Prem/guestbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,31 +164,36 @@ metadata:
labels:
app: redis
tier: backend
role: master
role: primary
spec:
ports:
- port: 6379
targetPort: 6379
selector:
app: redis
tier: backend
role: master
role: primary
---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-master
spec:
replicas: 1
selector:
matchLabels:
app: redis
role: primary
tier: backend
template:
metadata:
labels:
app: redis
role: master
role: primary
tier: backend
spec:
containers:
- name: master
- name: primary
image: k8s.gcr.io/redis:e2e # or just image: redis
resources:
requests:
Expand All @@ -214,30 +219,35 @@ metadata:
labels:
app: redis
tier: backend
role: slave
role: replica
spec:
ports:
- port: 6379
selector:
app: redis
tier: backend
role: slave
role: replica
---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-slave
spec:
replicas: 1
selector:
matchLabels:
app: redis
role: replica
tier: backend
template:
metadata:
labels:
app: redis
role: slave
role: replica
tier: backend
spec:
containers:
- name: slave
- name: replica
image: gcr.io/google_samples/gb-redisslave:v1
resources:
requests:
Expand Down Expand Up @@ -271,12 +281,16 @@ spec:
tier: frontend
loadBalancerIP: 10.0.10.42
---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
spec:
replicas: 1
selector:
matchLabels:
app: guestbook
tier: frontend
template:
metadata:
labels:
Expand Down
8 changes: 6 additions & 2 deletions GKE-On-Prem/journalbeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ data:
output.elasticsearch:
hosts: ${ELASTICSEARCH_HOSTS}
ilm.enabled: true
---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: journalbeat-dynamic
Expand All @@ -39,6 +39,10 @@ metadata:
k8s-app: journalbeat-dynamic
kubernetes.io/cluster-service: "true"
spec:
selector:
matchLabels:
k8s-app: journalbeat-dynamic
kubernetes.io/cluster-service: "true"
template:
metadata:
labels:
Expand Down
13 changes: 10 additions & 3 deletions GKE-On-Prem/metricbeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ data:
period: 10s
host: ${NODE_NAME}
hosts: ["localhost:10255"]
# If using Red Hat OpenShift remove the previous hosts entry and
# If using Red Hat OpenShift remove the previous hosts entry and
# uncomment these settings:
#hosts: ["https://${HOSTNAME}:10250"]
#bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
Expand All @@ -110,14 +110,17 @@ data:
---
# Deploy a Metricbeat instance per node for node metrics retrieval
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: metricbeat
namespace: kube-system
labels:
k8s-app: metricbeat
spec:
selector:
matchLabels:
k8s-app: metricbeat
template:
metadata:
labels:
Expand Down Expand Up @@ -237,14 +240,18 @@ data:
hosts: ["kube-state-metrics:8080"]
---
# Deploy singleton instance in the whole cluster for some unique data sources, like kube-state-metrics
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: metricbeat
namespace: kube-system
labels:
k8s-app: metricbeat
spec:
selector:
matchLabels:
k8s-app: metricbeat

template:
metadata:
labels:
Expand Down

0 comments on commit 999e93d

Please sign in to comment.