寫給已經架server上Azure然後發現好像要蒐集LOG的人
新增兩個yaml檔案
1.工作負載
kind: Deployment
apiVersion: apps/v1
metadata:
name: elasticsearch-yc
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: elasticsearch-yc
template:
metadata:
creationTimestamp: null
labels:
app: elasticsearch-yc
spec:
volumes:
- name: data
emptyDir: {}
initContainers:
- name: increase-vm-max-map
image: busybox
command:
- sysctl
- '-w'
- vm.max_map_count=262144
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: Always
securityContext:
privileged: true
containers:
- name: elk-elasticsearch
image: 'docker.elastic.co/elasticsearch/elasticsearch:7.12.0'
ports:
- containerPort: 9200
protocol: TCP
- containerPort: 9300
protocol: TCP
env:
- name: cluster.name
value: elasticsearch-cluster
- name: discovery.zen.ping.unicast.hosts
value: elasticsearch-discovery
- name: discovery.zen.minimum_master_nodes
value: '3'
- name: discovery.zen.ping_timeout
value: 5s
- name: node.master
value: 'true'
- name: node.data
value: 'false'
- name: node.ingest
value: 'false'
- name: ES_JAVA_OPTS
value: '-Xms256m -Xmx256m'
- name: discovery.type
value: single-node
- name: network.host
value: 0.0.0.0
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 25%
maxSurge: 25%
1.服務與輸入
kind: Service
apiVersion: v1
metadata:
name: elasticsearch-yc
namespace: default
spec:
ports:
- protocol: TCP
port: 80
targetPort: 9200
nodePort: 31346
selector:
app: elasticsearch-yc
type: LoadBalancer
sessionAffinity: None
externalTrafficPolicy: Cluster
這樣再看下生成的外部IP應該就完成了。