-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmaster-deployment.yaml
133 lines (133 loc) · 3.97 KB
/
master-deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
kind: PersistentVolume
apiVersion: v1
metadata:
name: scripts-pv
labels:
type: local
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/vol/splunk/scripts"
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: scripts-pv-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: master
spec:
replicas: 1
template:
metadata:
labels:
app: splunk
role: master
tier: frontend
spec:
volumes:
# AWS Credentials for pushing config backups to s3
- name: secret-volume
secret:
secretName: credentials
# Splunk Data
- name: data
hostPath:
path: /vol/splunk/data
# Splunk Config. Shared with config-backup container
- name: config
emptyDir: {}
- name: scripts
persistentVolumeClaim:
claimName: scripts-pv-claim
# Master bootstrap config. see master.conf
- name: boot-config
configMap:
name: master-boot-config
items:
- key: master.conf
path: master.conf
containers:
- name: master
image: andycunn/splunk-kube:latest
env:
- name: SPLUNK_ADD_1
value: "role service_discovery_role -auth admin:changeme"
- name: SPLUNK_ADD_2
value: "user service_discovery_user -password service_discovery_password -role service_discovery_role -auth admin:changeme"
- name: SPLUNK_BEFORE_START_CMD_1
value: "version $SPLUNK_START_ARGS"
- name: SPLUNK_BEFORE_START_CMD_2
value: "cmd python /opt/splunk/bin/splunk_setup.py --restore-config"
- name: SPLUNK_BEFORE_START_CMD_3
value: "cmd python /opt/splunk/bin/splunk_setup.py --configure '/tmp/master.conf'"
- name: SPLUNK_CMD_7
value: "status"
- name: SPLUNK_ENABLE_DEPLOY_SERVER
value: "true"
- name: SPLUNK_HEALTHCHECK_SPLUNKD
value: "https://127.0.0.1:8089"
- name: SPLUNK_HEALTHCHECK_SPLUNKWEB
value: "http://127.0.0.1:8000"
- name: SPLUNK_START_ARGS
value: "--accept-license --answer-yes --no-prompt"
- name: SPLUNK_ENABLE_DEPLOY_SERVER
value: "true"
- name: CONFIG_RESTORE_PARENT
value: "/tmp"
- name: REPO_ZIP_FILENAME
value: "splunk-configuration-latest"
- name: REPO_ZIP_URL_FORMAT
value: "https://s3-us-west-2.amazonaws.com/splunk-kubernetes/{}.zip"
resources:
requests:
cpu: 100m
memory: 256Mi
readinessProbe:
httpGet:
path: /en-US/account/login
port: web
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 20
ports:
- name: web
containerPort: 8000
- name: mgmt
containerPort: 8089
- name: kv
containerPort: 8191
- name: indexing
containerPort: 9997
volumeMounts:
- name: data
mountPath: /opt/splunk/var
- name: config
mountPath: /opt/splunk/etc
- name: scripts
mountPath: /opt/splunk/bin/scripts
- name: boot-config
mountPath: /tmp
- name: config-backup
image: andycunn/splunk-config-backup
volumeMounts:
- name: secret-volume
mountPath: /root/.aws
- name: config
mountPath: /opt/splunk/etc
env:
- name: SPLUNK_CONFIG_PATH
value: /opt/splunk/etc
- name: CONFIG_BACKUP_S3_BUCKET
value: splunk-kubernetes