-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
157 lines (151 loc) · 8.18 KB
/
docker-compose.yml
File metadata and controls
157 lines (151 loc) · 8.18 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
version: '2'
services:
mimir:
image: docker.io/yolean/ystack-runner:cd9cb05b51adf3a9b545c622c7424421ebb4945e@sha256:d48744967206aade113797f728d4dd67b0dcebb805e2665146605bcc55539728
working_dir: /tmp
volumes:
- /tmp/unhelm:/tmp/unhelm:rw
- ./mimir:/workspace/mimir:ro
command:
- /bin/bash
- -cx
- |
set -eo pipefail
helm version
helm repo add grafana https://grafana.github.io/helm-charts
mkdir -p /tmp/unhelm/mimir/mimir-distributed
echo 'resources:' > /tmp/unhelm/mimir/mimir-distributed/kustomization.yaml
cat <<EOF > /tmp/unhelm/mimir/mimir-distributed/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
secretGenerator:
- name: mimir-config
files:
- mimir.yaml
resources:
EOF
helm template unhelm grafana/mimir-distributed -f /workspace/mimir/mimir-distributed.values.yaml --namespace mimir --output-dir /tmp/unhelm/mimir | sed 's|wrote /tmp/unhelm/mimir/mimir-distributed/|- ./|' | tee -a /tmp/unhelm/mimir/mimir-distributed/kustomization.yaml
yq e '.data."mimir.yaml"' /tmp/unhelm/mimir/mimir-distributed/templates/mimir-config.yaml > /tmp/unhelm/mimir/mimir-distributed/mimir.yaml
sed -i 's|- ./templates/mimir-config.yaml|#- ./templates/mimir-config.yaml|' /tmp/unhelm/mimir/mimir-distributed/kustomization.yaml
find /tmp/unhelm/mimir/ -type f -exec sed -i 's|unhelm-||g' '{}' \;
find /tmp/unhelm/mimir/ -type f -exec sed -i 's| app.kubernetes.io/instance: unhelm| #app.kubernetes.io/instance: unhelm|g' '{}' \;
find /tmp/unhelm/mimir/ -type f -exec sed -i 's|-distributed||g' '{}' \;
set +x
echo "Done. To extract the results:"
echo "rsync -av --delete /tmp/unhelm/mimir/* ./mimir/"
logs:
image: docker.io/yolean/ystack-runner:cd9cb05b51adf3a9b545c622c7424421ebb4945e@sha256:d48744967206aade113797f728d4dd67b0dcebb805e2665146605bcc55539728
working_dir: /tmp
volumes:
- /tmp/unhelm:/tmp/unhelm:rw
- ./logs:/workspace/logs:ro
command:
- /bin/bash
- -cx
- |
set -eo pipefail
helm version
helm repo add grafana https://grafana.github.io/helm-charts
mkdir -p /tmp/unhelm/logs/{grafana,loki,loki-distributed}
echo 'resources:' > /tmp/unhelm/logs/grafana/kustomization.yaml
echo 'resources:' > /tmp/unhelm/logs/loki/kustomization.yaml
cat <<EOF > /tmp/unhelm/logs/loki-distributed/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configMapGenerator:
- name: loki
files:
- config.yaml
patchesJson6902:
- target:
version: v1
kind: Service
name: loki-query-frontend
patch: |-
- op: remove
path: /spec/clusterIP
resources:
EOF
helm template unhelm grafana/grafana -f /workspace/logs/grafana.values.yaml --namespace logs --output-dir /tmp/unhelm/logs | sed 's|wrote /tmp/unhelm/logs/grafana/|- ./|' | tee -a /tmp/unhelm/logs/grafana/kustomization.yaml
helm template unhelm grafana/loki -f /workspace/logs/loki.values.yaml --namespace logs --output-dir /tmp/unhelm/logs | sed 's|wrote /tmp/unhelm/logs/loki/|- ./|' | tee -a /tmp/unhelm/logs/loki/kustomization.yaml
helm template unhelm grafana/loki-distributed -f /workspace/logs/loki-distributed.values.yaml --namespace logs --output-dir /tmp/unhelm/logs | sed 's|wrote /tmp/unhelm/logs/loki-distributed/|- ./|' | tee -a /tmp/unhelm/logs/loki-distributed/kustomization.yaml
yq e '.data."config.yaml"' /tmp/unhelm/logs/loki-distributed/templates/configmap.yaml > /tmp/unhelm/logs/loki-distributed/config.yaml
sed -i 's|- ./templates/configmap.yaml|#- ./templates/configmap.yaml|' /tmp/unhelm/logs/loki-distributed/kustomization.yaml
find /tmp/unhelm/logs/ -type f -exec sed -i 's|unhelm-||g' '{}' \;
find /tmp/unhelm/logs/ -type f -exec sed -i 's| app.kubernetes.io/instance: unhelm| #app.kubernetes.io/instance: unhelm|g' '{}' \;
find /tmp/unhelm/logs/ -type f -exec sed -i 's|-distributed||g' '{}' \;
set +x
echo "Done. To extract the results:"
echo "rsync -av --delete /tmp/unhelm/logs/* ./logs/"
mysql:
image: docker.io/yolean/ystack-runner:cd9cb05b51adf3a9b545c622c7424421ebb4945e@sha256:d48744967206aade113797f728d4dd67b0dcebb805e2665146605bcc55539728
working_dir: /tmp
volumes:
- /tmp/unhelm:/tmp/unhelm:rw
- ./mysql:/workspace/mysql:ro
command:
- /bin/bash
- -cx
- |
set -eo pipefail
helm version
helm repo add bitnami https://charts.bitnami.com/bitnami
helm search repo bitnami
mkdir -p /tmp/unhelm/mysql/mariadb-galera
echo 'resources:' > /tmp/unhelm/mysql/mariadb-galera/kustomization.yaml
helm template ystack bitnami/mariadb-galera -f mysql/mariadb-galera.yaml --namespace unhelm-namespace-placeholder --output-dir /tmp/unhelm/mysql | sed 's|wrote /tmp/unhelm/mysql/mariadb-galera/|- ./|' | tee -a /tmp/unhelm/mysql/mariadb-galera/kustomization.yaml
# Opinions, https://github.com/Yolean/kubernetes-mysql-cluster/pull/35
sed -i.org 's/\butf8/utf8mb4/' /tmp/unhelm/mysql/mariadb-galera/templates/configmap.yaml
sed -i 's/plugin_load_add=auth_pam/#plugin_load_add=auth_pam/' /tmp/unhelm/mysql/mariadb-galera/templates/configmap.yaml
# Your Kustomize base must override:
grep -rn unhelm-namespace-placeholder /tmp/unhelm/mysql
set +x
echo "Done. To extract the results:"
echo "rsync -av --delete /tmp/unhelm/mysql/* ./mysql/"
vault:
image: docker.io/yolean/ystack-runner:cd9cb05b51adf3a9b545c622c7424421ebb4945e@sha256:d48744967206aade113797f728d4dd67b0dcebb805e2665146605bcc55539728
working_dir: /tmp
volumes:
- /tmp/unhelm:/tmp/unhelm:rw
- ./vault:/workspace/vault:ro
# https://learn.hashicorp.com/tutorials/vault/kubernetes-google-cloud-gke
command:
- /bin/bash
- -cx
- |
set -eo pipefail
helm version
helm repo add hashicorp https://helm.releases.hashicorp.com
helm repo update
helm search repo vault --versions
mkdir -p /tmp/unhelm/vault/raft
echo 'resources:' > /tmp/unhelm/vault/raft/kustomization.yaml
helm template vault hashicorp/vault -n unhelm-namespace-placeholder -f /workspace/vault/vault-raft.values.yaml --output-dir /tmp/unhelm/vault/raft | sed 's|wrote /tmp/unhelm/vault/raft/vault/|- ./vault/|' | grep -v /tests/ | tee -a /tmp/unhelm/vault/raft/kustomization.yaml
sed -i 's/ namespace: unhelm-namespace-placeholder/ #namespace: unhelm-namespace-placeholder/' /tmp/unhelm/vault/raft/vault/templates/*.yaml /tmp/unhelm/vault/raft/vault/templates/tests/*.yaml
set +x
echo "Done. To extract the results:"
echo "rsync -av --delete /tmp/unhelm/vault/* ./vault/"
openreplay:
image: docker.io/yolean/ystack-runner:755de97a9e73114abea98bd8c8247186de560c49
working_dir: /tmp
volumes:
- /tmp/unhelm:/tmp/unhelm:rw
- ./openreplay:/workspace/openreplay:ro
command:
- /bin/bash
- -cx
- |
set -eo pipefail
helm version
git clone https://github.com/openreplay/openreplay.git
cd openreplay/scripts/helmcharts/
mkdir -p /tmp/unhelm/openreplay/databases /tmp/unhelm/openreplay/openreplay
echo 'resources:' > /tmp/unhelm/openreplay/databases/kustomization.yaml
echo 'resources:' > /tmp/unhelm/openreplay/openreplay/kustomization.yaml
helm template ./databases/ -f ./vars.yaml -n unhelm-namespace-placeholder --output-dir /tmp/unhelm/openreplay | sed 's|wrote /tmp/unhelm/openreplay/databases/|- ./|' | tee -a /tmp/unhelm/openreplay/databases/kustomization.yaml
helm template ./openreplay/ -f ./vars.yaml -n unhelm-namespace-placeholder --output-dir /tmp/unhelm/openreplay | sed 's|wrote /tmp/unhelm/openreplay/openreplay/|- ./|' | tee -a /tmp/unhelm/openreplay/openreplay/kustomization.yaml
sed -i 's|- ./charts/ingress|#- ./charts/ingress|' /tmp/unhelm/openreplay/openreplay/kustomization.yaml
sed -i 's|- \(.*\)/ingress.yaml|#- \1/ingress.yaml|' /tmp/unhelm/openreplay/openreplay/kustomization.yaml
set +x
echo "Done. To extract the results:"
echo "rsync -av --delete /tmp/unhelm/openreplay/* ./openreplay/"