mastodon.yaml 88 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876
  1. ---
  2. # Source: mastodon/charts/minio/templates/serviceaccount.yaml
  3. apiVersion: v1
  4. kind: ServiceAccount
  5. metadata:
  6. name: mastodon-minio
  7. namespace: "mastodon"
  8. labels:
  9. app.kubernetes.io/name: minio
  10. helm.sh/chart: minio-12.0.0
  11. app.kubernetes.io/instance: mastodon
  12. app.kubernetes.io/managed-by: Helm
  13. automountServiceAccountToken: true
  14. secrets:
  15. - name: mastodon-minio
  16. ---
  17. # Source: mastodon/charts/redis/templates/serviceaccount.yaml
  18. apiVersion: v1
  19. kind: ServiceAccount
  20. automountServiceAccountToken: true
  21. metadata:
  22. name: mastodon-redis
  23. namespace: "mastodon"
  24. labels:
  25. app.kubernetes.io/name: redis
  26. helm.sh/chart: redis-17.4.3
  27. app.kubernetes.io/instance: mastodon
  28. app.kubernetes.io/managed-by: Helm
  29. ---
  30. # Source: mastodon/templates/service-account.yaml
  31. apiVersion: v1
  32. kind: ServiceAccount
  33. metadata:
  34. name: mastodon
  35. namespace: "mastodon"
  36. labels:
  37. app.kubernetes.io/name: mastodon
  38. helm.sh/chart: mastodon-1.0.1
  39. app.kubernetes.io/instance: mastodon
  40. app.kubernetes.io/managed-by: Helm
  41. app.kubernetes.io/part-of: mastodon
  42. automountServiceAccountToken: true
  43. ---
  44. # Source: mastodon/charts/minio/templates/secrets.yaml
  45. apiVersion: v1
  46. kind: Secret
  47. metadata:
  48. name: mastodon-minio
  49. namespace: "mastodon"
  50. labels:
  51. app.kubernetes.io/name: minio
  52. helm.sh/chart: minio-12.0.0
  53. app.kubernetes.io/instance: mastodon
  54. app.kubernetes.io/managed-by: Helm
  55. type: Opaque
  56. data:
  57. root-user: "YWRtaW4="
  58. root-password: "U1lNNDBMeXRjVg=="
  59. key.json: ""
  60. ---
  61. # Source: mastodon/charts/postgresql/templates/secrets.yaml
  62. apiVersion: v1
  63. kind: Secret
  64. metadata:
  65. name: mastodon-postgresql
  66. namespace: "mastodon"
  67. labels:
  68. app.kubernetes.io/name: postgresql
  69. helm.sh/chart: postgresql-12.1.9
  70. app.kubernetes.io/instance: mastodon
  71. app.kubernetes.io/managed-by: Helm
  72. type: Opaque
  73. data:
  74. postgres-password: "cHVaRkp2c1VCOQ=="
  75. password: "aGtJUGFJZGg1Vg=="
  76. # We don't auto-generate LDAP password when it's not provided as we do for other passwords
  77. ---
  78. # Source: mastodon/charts/redis/templates/secret.yaml
  79. apiVersion: v1
  80. kind: Secret
  81. metadata:
  82. name: mastodon-redis
  83. namespace: "mastodon"
  84. labels:
  85. app.kubernetes.io/name: redis
  86. helm.sh/chart: redis-17.4.3
  87. app.kubernetes.io/instance: mastodon
  88. app.kubernetes.io/managed-by: Helm
  89. type: Opaque
  90. data:
  91. redis-password: "RVdvWWdYNzI1Sg=="
  92. ---
  93. # Source: mastodon/templates/default-secret.yaml
  94. apiVersion: v1
  95. kind: Secret
  96. metadata:
  97. name: mastodon-default
  98. namespace: "mastodon"
  99. labels:
  100. app.kubernetes.io/name: mastodon
  101. helm.sh/chart: mastodon-1.0.1
  102. app.kubernetes.io/instance: mastodon
  103. app.kubernetes.io/managed-by: Helm
  104. app.kubernetes.io/part-of: mastodon
  105. data:
  106. MASTODON_ADMIN_PASSWORD: "ZEJ2OGp3aVkxUA=="
  107. SECRET_KEY_BASE: "TFZtQXZkMW9Caw=="
  108. OTP_SECRET: "dWlmdzhSSUpDbQ=="
  109. ---
  110. # Source: mastodon/charts/minio/templates/provisioning-configmap.yaml
  111. apiVersion: v1
  112. kind: ConfigMap
  113. metadata:
  114. name: mastodon-minio-provisioning
  115. namespace: "mastodon"
  116. labels:
  117. app.kubernetes.io/name: minio
  118. helm.sh/chart: minio-12.0.0
  119. app.kubernetes.io/instance: mastodon
  120. app.kubernetes.io/managed-by: Helm
  121. app.kubernetes.io/component: minio-provisioning
  122. data:
  123. ---
  124. # Source: mastodon/charts/redis/templates/configmap.yaml
  125. apiVersion: v1
  126. kind: ConfigMap
  127. metadata:
  128. name: mastodon-redis-configuration
  129. namespace: "mastodon"
  130. labels:
  131. app.kubernetes.io/name: redis
  132. helm.sh/chart: redis-17.4.3
  133. app.kubernetes.io/instance: mastodon
  134. app.kubernetes.io/managed-by: Helm
  135. data:
  136. redis.conf: |-
  137. # User-supplied common configuration:
  138. # Enable AOF https://redis.io/topics/persistence#append-only-file
  139. appendonly yes
  140. # Disable RDB persistence, AOF persistence already enabled.
  141. save ""
  142. # End of common configuration
  143. master.conf: |-
  144. dir /data
  145. # User-supplied master configuration:
  146. rename-command FLUSHDB ""
  147. rename-command FLUSHALL ""
  148. # End of master configuration
  149. replica.conf: |-
  150. dir /data
  151. # User-supplied replica configuration:
  152. rename-command FLUSHDB ""
  153. rename-command FLUSHALL ""
  154. # End of replica configuration
  155. ---
  156. # Source: mastodon/charts/redis/templates/health-configmap.yaml
  157. apiVersion: v1
  158. kind: ConfigMap
  159. metadata:
  160. name: mastodon-redis-health
  161. namespace: "mastodon"
  162. labels:
  163. app.kubernetes.io/name: redis
  164. helm.sh/chart: redis-17.4.3
  165. app.kubernetes.io/instance: mastodon
  166. app.kubernetes.io/managed-by: Helm
  167. data:
  168. ping_readiness_local.sh: |-
  169. #!/bin/bash
  170. [[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
  171. [[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD"
  172. response=$(
  173. timeout -s 3 $1 \
  174. redis-cli \
  175. -h localhost \
  176. -p $REDIS_PORT \
  177. ping
  178. )
  179. if [ "$?" -eq "124" ]; then
  180. echo "Timed out"
  181. exit 1
  182. fi
  183. if [ "$response" != "PONG" ]; then
  184. echo "$response"
  185. exit 1
  186. fi
  187. ping_liveness_local.sh: |-
  188. #!/bin/bash
  189. [[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
  190. [[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD"
  191. response=$(
  192. timeout -s 3 $1 \
  193. redis-cli \
  194. -h localhost \
  195. -p $REDIS_PORT \
  196. ping
  197. )
  198. if [ "$?" -eq "124" ]; then
  199. echo "Timed out"
  200. exit 1
  201. fi
  202. responseFirstWord=$(echo $response | head -n1 | awk '{print $1;}')
  203. if [ "$response" != "PONG" ] && [ "$responseFirstWord" != "LOADING" ] && [ "$responseFirstWord" != "MASTERDOWN" ]; then
  204. echo "$response"
  205. exit 1
  206. fi
  207. ping_readiness_master.sh: |-
  208. #!/bin/bash
  209. [[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")"
  210. [[ -n "$REDIS_MASTER_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_MASTER_PASSWORD"
  211. response=$(
  212. timeout -s 3 $1 \
  213. redis-cli \
  214. -h $REDIS_MASTER_HOST \
  215. -p $REDIS_MASTER_PORT_NUMBER \
  216. ping
  217. )
  218. if [ "$?" -eq "124" ]; then
  219. echo "Timed out"
  220. exit 1
  221. fi
  222. if [ "$response" != "PONG" ]; then
  223. echo "$response"
  224. exit 1
  225. fi
  226. ping_liveness_master.sh: |-
  227. #!/bin/bash
  228. [[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")"
  229. [[ -n "$REDIS_MASTER_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_MASTER_PASSWORD"
  230. response=$(
  231. timeout -s 3 $1 \
  232. redis-cli \
  233. -h $REDIS_MASTER_HOST \
  234. -p $REDIS_MASTER_PORT_NUMBER \
  235. ping
  236. )
  237. if [ "$?" -eq "124" ]; then
  238. echo "Timed out"
  239. exit 1
  240. fi
  241. responseFirstWord=$(echo $response | head -n1 | awk '{print $1;}')
  242. if [ "$response" != "PONG" ] && [ "$responseFirstWord" != "LOADING" ]; then
  243. echo "$response"
  244. exit 1
  245. fi
  246. ping_readiness_local_and_master.sh: |-
  247. script_dir="$(dirname "$0")"
  248. exit_status=0
  249. "$script_dir/ping_readiness_local.sh" $1 || exit_status=$?
  250. "$script_dir/ping_readiness_master.sh" $1 || exit_status=$?
  251. exit $exit_status
  252. ping_liveness_local_and_master.sh: |-
  253. script_dir="$(dirname "$0")"
  254. exit_status=0
  255. "$script_dir/ping_liveness_local.sh" $1 || exit_status=$?
  256. "$script_dir/ping_liveness_master.sh" $1 || exit_status=$?
  257. exit $exit_status
  258. ---
  259. # Source: mastodon/charts/redis/templates/scripts-configmap.yaml
  260. apiVersion: v1
  261. kind: ConfigMap
  262. metadata:
  263. name: mastodon-redis-scripts
  264. namespace: "mastodon"
  265. labels:
  266. app.kubernetes.io/name: redis
  267. helm.sh/chart: redis-17.4.3
  268. app.kubernetes.io/instance: mastodon
  269. app.kubernetes.io/managed-by: Helm
  270. data:
  271. start-master.sh: |
  272. #!/bin/bash
  273. [[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
  274. if [[ -f /opt/bitnami/redis/mounted-etc/master.conf ]];then
  275. cp /opt/bitnami/redis/mounted-etc/master.conf /opt/bitnami/redis/etc/master.conf
  276. fi
  277. if [[ -f /opt/bitnami/redis/mounted-etc/redis.conf ]];then
  278. cp /opt/bitnami/redis/mounted-etc/redis.conf /opt/bitnami/redis/etc/redis.conf
  279. fi
  280. ARGS=("--port" "${REDIS_PORT}")
  281. ARGS+=("--requirepass" "${REDIS_PASSWORD}")
  282. ARGS+=("--masterauth" "${REDIS_PASSWORD}")
  283. ARGS+=("--include" "/opt/bitnami/redis/etc/redis.conf")
  284. ARGS+=("--include" "/opt/bitnami/redis/etc/master.conf")
  285. exec redis-server "${ARGS[@]}"
  286. ---
  287. # Source: mastodon/templates/apache-configmap.yaml
  288. apiVersion: v1
  289. kind: ConfigMap
  290. metadata:
  291. name: mastodon-apache-mastodon-vhost
  292. namespace: "mastodon"
  293. labels:
  294. app.kubernetes.io/name: mastodon
  295. helm.sh/chart: mastodon-1.0.1
  296. app.kubernetes.io/instance: mastodon
  297. app.kubernetes.io/managed-by: Helm
  298. app.kubernetes.io/part-of: mastodon
  299. data:
  300. mastodon-vhost.conf: |-
  301. <VirtualHost VirtualHost 127.0.0.1:8080 _default_:8080>
  302. ServerName mastodon.dezendorf.net
  303. ServerAlias *
  304. <Location "/">
  305. ProxyPass http://mastodon-web:80/
  306. ProxyPassReverse mastodon.dezendorf.net
  307. Order allow,deny
  308. Allow from all
  309. </Location>
  310. <Location "/api/v1/streaming">
  311. # Streaming uses normal API calls and websockets. We used this configuration
  312. # based on https://stackoverflow.com/questions/27526281/websockets-and-apache-proxy-how-to-configure-mod-proxy-wstunnel
  313. RewriteEngine On
  314. RewriteCond %{HTTP:Upgrade} =websocket [NC]
  315. RewriteRule /api/(.*) ws://mastodon-streaming:80/api/$1 [P,L]
  316. RewriteCond %{HTTP:Upgrade} !=websocket [NC]
  317. RewriteRule /api/(.*) http://mastodon-streaming:80/api/$1 [P,L]
  318. ProxyPassReverse mastodon.dezendorf.net
  319. Order allow,deny
  320. Allow from all
  321. </Location>
  322. <Location "/s3storage">
  323. ProxyPass http://mastodon-minio:80/s3storage/
  324. ProxyPassReverse mastodon.dezendorf.net
  325. Order allow,deny
  326. Allow from all
  327. </Location>
  328. </VirtualHost>
  329. ---
  330. # Source: mastodon/templates/default-configmap.yaml
  331. apiVersion: v1
  332. kind: ConfigMap
  333. metadata:
  334. name: mastodon-default
  335. namespace: "mastodon"
  336. labels:
  337. app.kubernetes.io/name: mastodon
  338. helm.sh/chart: mastodon-1.0.1
  339. app.kubernetes.io/instance: mastodon
  340. app.kubernetes.io/managed-by: Helm
  341. app.kubernetes.io/part-of: mastodon
  342. data:
  343. MASTODON_ADMIN_USERNAME: "breandan"
  344. MASTODON_ADMIN_EMAIL: "breandan@dezendorf.com"
  345. DB_HOST: "mastodon-postgresql"
  346. DB_PORT: "5432"
  347. DB_NAME: "bitnami_mastodon"
  348. DB_USER: "bn_mastodon"
  349. ES_ENABLED: "true"
  350. ES_HOST: "mastodon-elasticsearch"
  351. ES_PORT: "9200"
  352. WEB_DOMAIN: "mastodon.dezendorf.net"
  353. STREAMING_API_BASE_URL: "ws://mastodon.dezendorf.net"
  354. REDIS_HOST: "mastodon-redis-master"
  355. REDIS_PORT: "6379"
  356. S3_ENABLED: "true"
  357. S3_BUCKET: "s3storage"
  358. S3_ENDPOINT: "http://mastodon-minio"
  359. S3_HOSTNAME: "mastodon-minio"
  360. S3_REGION: "us-east-1"
  361. S3_ALIAS_HOST: "mastodon.dezendorf.net/s3storage"
  362. S3_PROTOCOL: "http"
  363. ---
  364. # Source: mastodon/templates/init-job/init-job-configmap.yaml
  365. apiVersion: v1
  366. kind: ConfigMap
  367. metadata:
  368. name: mastodon-init-scripts
  369. namespace: "mastodon"
  370. labels:
  371. app.kubernetes.io/name: mastodon
  372. helm.sh/chart: mastodon-1.0.1
  373. app.kubernetes.io/instance: mastodon
  374. app.kubernetes.io/managed-by: Helm
  375. app.kubernetes.io/part-of: mastodon
  376. data:
  377. # All these operations require access to PostgreSQL (including Elasticsearch migration) and Redis. In order to avoid
  378. # potential race conditions we include them in the same script.
  379. migrate-and-create-admin.sh: |-
  380. #!/bin/bash
  381. set -o errexit
  382. set -o nounset
  383. set -o pipefail
  384. # Load libraries
  385. . /opt/bitnami/scripts/liblog.sh
  386. . /opt/bitnami/scripts/libos.sh
  387. . /opt/bitnami/scripts/libvalidations.sh
  388. . /opt/bitnami/scripts/libmastodon.sh
  389. # Load Mastodon environment variables
  390. . /opt/bitnami/scripts/mastodon-env.sh
  391. info "Migrating database"
  392. psql_connection_string="postgresql://${MASTODON_DATABASE_USERNAME}:${MASTODON_DATABASE_PASSWORD}@${MASTODON_DATABASE_HOST}:${MASTODON_DATABASE_PORT_NUMBER}/${MASTODON_DATABASE_NAME}"
  393. mastodon_wait_for_postgresql_connection "$psql_connection_string"
  394. mastodon_rake_execute db:migrate
  395. elasticsearch_connection_string="http://${MASTODON_ELASTICSEARCH_HOST}:${MASTODON_ELASTICSEARCH_PORT_NUMBER}"
  396. mastodon_wait_for_elasticsearch_connection "$elasticsearch_connection_string"
  397. info "Migrating Elasticsearch"
  398. mastodon_rake_execute chewy:upgrade
  399. mastodon_ensure_admin_user_exists
  400. precompile-assets.sh: |-
  401. #!/bin/bash
  402. set -o errexit
  403. set -o nounset
  404. set -o pipefail
  405. # Load libraries
  406. . /opt/bitnami/scripts/liblog.sh
  407. . /opt/bitnami/scripts/libos.sh
  408. . /opt/bitnami/scripts/libvalidations.sh
  409. . /opt/bitnami/scripts/libmastodon.sh
  410. # Load Mastodon environment variables
  411. . /opt/bitnami/scripts/mastodon-env.sh
  412. mastodon_wait_for_s3_connection "$MASTODON_S3_HOSTNAME" "$MASTODON_S3_PORT_NUMBER"
  413. info "Precompiling assets"
  414. mastodon_rake_execute assets:precompile
  415. ---
  416. # Source: mastodon/charts/minio/templates/pvc.yaml
  417. kind: PersistentVolumeClaim
  418. apiVersion: v1
  419. metadata:
  420. name: mastodon-minio
  421. namespace: "mastodon"
  422. labels:
  423. app.kubernetes.io/name: minio
  424. helm.sh/chart: minio-12.0.0
  425. app.kubernetes.io/instance: mastodon
  426. app.kubernetes.io/managed-by: Helm
  427. spec:
  428. accessModes:
  429. - "ReadWriteOnce"
  430. resources:
  431. requests:
  432. storage: "8Gi"
  433. storageClassName: longhorn
  434. ---
  435. # Source: mastodon/charts/apache/templates/svc.yaml
  436. apiVersion: v1
  437. kind: Service
  438. metadata:
  439. name: mastodon-apache
  440. namespace: "mastodon"
  441. labels:
  442. app.kubernetes.io/name: apache
  443. helm.sh/chart: apache-9.2.11
  444. app.kubernetes.io/instance: mastodon
  445. app.kubernetes.io/managed-by: Helm
  446. spec:
  447. type: LoadBalancer
  448. externalTrafficPolicy: "Cluster"
  449. loadBalancerSourceRanges: []
  450. sessionAffinity: None
  451. ports:
  452. - name: http
  453. port: 80
  454. targetPort: http
  455. - name: https
  456. port: 443
  457. targetPort: https
  458. selector:
  459. app.kubernetes.io/name: apache
  460. app.kubernetes.io/instance: mastodon
  461. ---
  462. # Source: mastodon/charts/elasticsearch/templates/coordinating/svc-headless.yaml
  463. apiVersion: v1
  464. kind: Service
  465. metadata:
  466. name: mastodon-elasticsearch-coordinating-hl
  467. namespace: "mastodon"
  468. labels:
  469. app.kubernetes.io/name: elasticsearch
  470. helm.sh/chart: elasticsearch-19.5.8
  471. app.kubernetes.io/instance: mastodon
  472. app.kubernetes.io/managed-by: Helm
  473. app.kubernetes.io/component: coordinating-only
  474. spec:
  475. type: ClusterIP
  476. publishNotReadyAddresses: true
  477. ports:
  478. - name: tcp-rest-api
  479. port: 9200
  480. targetPort: rest-api
  481. - name: tcp-transport
  482. port: 9300
  483. targetPort: transport
  484. selector:
  485. app.kubernetes.io/name: elasticsearch
  486. app.kubernetes.io/instance: mastodon
  487. app.kubernetes.io/component: coordinating-only
  488. ---
  489. # Source: mastodon/charts/elasticsearch/templates/data/svc-headless.yaml
  490. apiVersion: v1
  491. kind: Service
  492. metadata:
  493. name: mastodon-elasticsearch-data-hl
  494. namespace: "mastodon"
  495. labels:
  496. app.kubernetes.io/name: elasticsearch
  497. helm.sh/chart: elasticsearch-19.5.8
  498. app.kubernetes.io/instance: mastodon
  499. app.kubernetes.io/managed-by: Helm
  500. app.kubernetes.io/component: data
  501. spec:
  502. type: ClusterIP
  503. publishNotReadyAddresses: true
  504. ports:
  505. - name: tcp-rest-api
  506. port: 9200
  507. targetPort: rest-api
  508. - name: tcp-transport
  509. port: 9300
  510. targetPort: transport
  511. selector:
  512. app.kubernetes.io/name: elasticsearch
  513. app.kubernetes.io/instance: mastodon
  514. app.kubernetes.io/component: data
  515. ---
  516. # Source: mastodon/charts/elasticsearch/templates/ingest/svc-headless.yaml
  517. apiVersion: v1
  518. kind: Service
  519. metadata:
  520. name: mastodon-elasticsearch-ingest-hl
  521. namespace: "mastodon"
  522. labels:
  523. app.kubernetes.io/name: elasticsearch
  524. helm.sh/chart: elasticsearch-19.5.8
  525. app.kubernetes.io/instance: mastodon
  526. app.kubernetes.io/managed-by: Helm
  527. app.kubernetes.io/component: ingest
  528. spec:
  529. type: ClusterIP
  530. publishNotReadyAddresses: true
  531. ports:
  532. - name: tcp-rest-api
  533. port: 9200
  534. targetPort: rest-api
  535. - name: tcp-transport
  536. port: 9300
  537. targetPort: transport
  538. selector:
  539. app.kubernetes.io/name: elasticsearch
  540. app.kubernetes.io/instance: mastodon
  541. app.kubernetes.io/component: ingest
  542. ---
  543. # Source: mastodon/charts/elasticsearch/templates/master/svc-headless.yaml
  544. apiVersion: v1
  545. kind: Service
  546. metadata:
  547. name: mastodon-elasticsearch-master-hl
  548. namespace: "mastodon"
  549. labels:
  550. app.kubernetes.io/name: elasticsearch
  551. helm.sh/chart: elasticsearch-19.5.8
  552. app.kubernetes.io/instance: mastodon
  553. app.kubernetes.io/managed-by: Helm
  554. app.kubernetes.io/component: master
  555. spec:
  556. type: ClusterIP
  557. publishNotReadyAddresses: true
  558. ports:
  559. - name: tcp-rest-api
  560. port: 9200
  561. targetPort: rest-api
  562. - name: tcp-transport
  563. port: 9300
  564. targetPort: transport
  565. selector:
  566. app.kubernetes.io/name: elasticsearch
  567. app.kubernetes.io/instance: mastodon
  568. app.kubernetes.io/component: master
  569. ---
  570. # Source: mastodon/charts/elasticsearch/templates/service.yaml
  571. apiVersion: v1
  572. kind: Service
  573. metadata:
  574. name: mastodon-elasticsearch
  575. namespace: "mastodon"
  576. labels:
  577. app.kubernetes.io/name: elasticsearch
  578. helm.sh/chart: elasticsearch-19.5.8
  579. app.kubernetes.io/instance: mastodon
  580. app.kubernetes.io/managed-by: Helm
  581. app.kubernetes.io/component: coordinating-only
  582. annotations:
  583. spec:
  584. type: ClusterIP
  585. sessionAffinity: None
  586. ports:
  587. - name: tcp-rest-api
  588. port: 9200
  589. targetPort: rest-api
  590. nodePort: null
  591. - name: tcp-transport
  592. port: 9300
  593. nodePort: null
  594. selector:
  595. app.kubernetes.io/name: elasticsearch
  596. app.kubernetes.io/instance: mastodon
  597. app.kubernetes.io/component: coordinating-only
  598. ---
  599. # Source: mastodon/charts/minio/templates/service.yaml
  600. apiVersion: v1
  601. kind: Service
  602. metadata:
  603. name: mastodon-minio
  604. namespace: "mastodon"
  605. labels:
  606. app.kubernetes.io/name: minio
  607. helm.sh/chart: minio-12.0.0
  608. app.kubernetes.io/instance: mastodon
  609. app.kubernetes.io/managed-by: Helm
  610. spec:
  611. type: ClusterIP
  612. ports:
  613. - name: minio-api
  614. port: 80
  615. targetPort: minio-api
  616. nodePort: null
  617. - name: minio-console
  618. port: 9001
  619. targetPort: minio-console
  620. nodePort: null
  621. selector:
  622. app.kubernetes.io/name: minio
  623. app.kubernetes.io/instance: mastodon
  624. ---
  625. # Source: mastodon/charts/postgresql/templates/primary/svc-headless.yaml
  626. apiVersion: v1
  627. kind: Service
  628. metadata:
  629. name: mastodon-postgresql-hl
  630. namespace: "mastodon"
  631. labels:
  632. app.kubernetes.io/name: postgresql
  633. helm.sh/chart: postgresql-12.1.9
  634. app.kubernetes.io/instance: mastodon
  635. app.kubernetes.io/managed-by: Helm
  636. app.kubernetes.io/component: primary
  637. # Use this annotation in addition to the actual publishNotReadyAddresses
  638. # field below because the annotation will stop being respected soon but the
  639. # field is broken in some versions of Kubernetes:
  640. # https://github.com/kubernetes/kubernetes/issues/58662
  641. service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
  642. spec:
  643. type: ClusterIP
  644. clusterIP: None
  645. # We want all pods in the StatefulSet to have their addresses published for
  646. # the sake of the other Postgresql pods even before they're ready, since they
  647. # have to be able to talk to each other in order to become ready.
  648. publishNotReadyAddresses: true
  649. ports:
  650. - name: tcp-postgresql
  651. port: 5432
  652. targetPort: tcp-postgresql
  653. selector:
  654. app.kubernetes.io/name: postgresql
  655. app.kubernetes.io/instance: mastodon
  656. app.kubernetes.io/component: primary
  657. ---
  658. # Source: mastodon/charts/postgresql/templates/primary/svc.yaml
  659. apiVersion: v1
  660. kind: Service
  661. metadata:
  662. name: mastodon-postgresql
  663. namespace: "mastodon"
  664. labels:
  665. app.kubernetes.io/name: postgresql
  666. helm.sh/chart: postgresql-12.1.9
  667. app.kubernetes.io/instance: mastodon
  668. app.kubernetes.io/managed-by: Helm
  669. app.kubernetes.io/component: primary
  670. annotations:
  671. spec:
  672. type: ClusterIP
  673. sessionAffinity: None
  674. ports:
  675. - name: tcp-postgresql
  676. port: 5432
  677. targetPort: tcp-postgresql
  678. nodePort: null
  679. selector:
  680. app.kubernetes.io/name: postgresql
  681. app.kubernetes.io/instance: mastodon
  682. app.kubernetes.io/component: primary
  683. ---
  684. # Source: mastodon/charts/redis/templates/headless-svc.yaml
  685. apiVersion: v1
  686. kind: Service
  687. metadata:
  688. name: mastodon-redis-headless
  689. namespace: "mastodon"
  690. labels:
  691. app.kubernetes.io/name: redis
  692. helm.sh/chart: redis-17.4.3
  693. app.kubernetes.io/instance: mastodon
  694. app.kubernetes.io/managed-by: Helm
  695. annotations:
  696. spec:
  697. type: ClusterIP
  698. clusterIP: None
  699. ports:
  700. - name: tcp-redis
  701. port: 6379
  702. targetPort: redis
  703. selector:
  704. app.kubernetes.io/name: redis
  705. app.kubernetes.io/instance: mastodon
  706. ---
  707. # Source: mastodon/charts/redis/templates/master/service.yaml
  708. apiVersion: v1
  709. kind: Service
  710. metadata:
  711. name: mastodon-redis-master
  712. namespace: "mastodon"
  713. labels:
  714. app.kubernetes.io/name: redis
  715. helm.sh/chart: redis-17.4.3
  716. app.kubernetes.io/instance: mastodon
  717. app.kubernetes.io/managed-by: Helm
  718. app.kubernetes.io/component: master
  719. spec:
  720. type: ClusterIP
  721. sessionAffinity: None
  722. ports:
  723. - name: tcp-redis
  724. port: 6379
  725. targetPort: redis
  726. nodePort: null
  727. selector:
  728. app.kubernetes.io/name: redis
  729. app.kubernetes.io/instance: mastodon
  730. app.kubernetes.io/component: master
  731. ---
  732. # Source: mastodon/templates/streaming/service.yaml
  733. apiVersion: v1
  734. kind: Service
  735. metadata:
  736. name: mastodon-streaming
  737. namespace: "mastodon"
  738. labels:
  739. app.kubernetes.io/name: mastodon
  740. helm.sh/chart: mastodon-1.0.1
  741. app.kubernetes.io/instance: mastodon
  742. app.kubernetes.io/managed-by: Helm
  743. app.kubernetes.io/part-of: mastodon
  744. app.kubernetes.io/component: streaming
  745. spec:
  746. type: ClusterIP
  747. sessionAffinity: None
  748. ports:
  749. - name: http
  750. port: 80
  751. targetPort: http
  752. protocol: TCP
  753. nodePort: null
  754. selector:
  755. app.kubernetes.io/name: mastodon
  756. app.kubernetes.io/instance: mastodon
  757. app.kubernetes.io/component: streaming
  758. ---
  759. # Source: mastodon/templates/web/service.yaml
  760. apiVersion: v1
  761. kind: Service
  762. metadata:
  763. name: mastodon-web
  764. namespace: "mastodon"
  765. labels:
  766. app.kubernetes.io/name: mastodon
  767. helm.sh/chart: mastodon-1.0.1
  768. app.kubernetes.io/instance: mastodon
  769. app.kubernetes.io/managed-by: Helm
  770. app.kubernetes.io/part-of: mastodon
  771. app.kubernetes.io/component: web
  772. spec:
  773. type: ClusterIP
  774. sessionAffinity: None
  775. ports:
  776. - name: http
  777. port: 80
  778. protocol: TCP
  779. targetPort: http
  780. nodePort: null
  781. selector:
  782. app.kubernetes.io/name: mastodon
  783. app.kubernetes.io/instance: mastodon
  784. app.kubernetes.io/component: web
  785. ---
  786. # Source: mastodon/charts/apache/templates/deployment.yaml
  787. apiVersion: apps/v1
  788. kind: Deployment
  789. metadata:
  790. name: mastodon-apache
  791. namespace: "mastodon"
  792. labels:
  793. app.kubernetes.io/name: apache
  794. helm.sh/chart: apache-9.2.11
  795. app.kubernetes.io/instance: mastodon
  796. app.kubernetes.io/managed-by: Helm
  797. spec:
  798. selector:
  799. matchLabels:
  800. app.kubernetes.io/name: apache
  801. app.kubernetes.io/instance: mastodon
  802. replicas: 1
  803. strategy:
  804. type: RollingUpdate
  805. template:
  806. metadata:
  807. labels:
  808. app.kubernetes.io/name: apache
  809. helm.sh/chart: apache-9.2.11
  810. app.kubernetes.io/instance: mastodon
  811. app.kubernetes.io/managed-by: Helm
  812. spec:
  813. # yamllint disable rule:indentation
  814. hostAliases:
  815. - hostnames:
  816. - status.localhost
  817. ip: 127.0.0.1
  818. # yamllint enable rule:indentation
  819. priorityClassName: ""
  820. affinity:
  821. podAffinity:
  822. podAntiAffinity:
  823. preferredDuringSchedulingIgnoredDuringExecution:
  824. - podAffinityTerm:
  825. labelSelector:
  826. matchLabels:
  827. app.kubernetes.io/name: apache
  828. app.kubernetes.io/instance: mastodon
  829. topologyKey: kubernetes.io/hostname
  830. weight: 1
  831. nodeAffinity:
  832. securityContext:
  833. fsGroup: 1001
  834. containers:
  835. - name: apache
  836. image: docker.io/bitnami/apache:2.4.55-debian-11-r0
  837. imagePullPolicy: "IfNotPresent"
  838. securityContext:
  839. runAsNonRoot: true
  840. runAsUser: 1001
  841. env:
  842. - name: BITNAMI_DEBUG
  843. value: "false"
  844. - name: APACHE_HTTP_PORT_NUMBER
  845. value: "8080"
  846. - name: APACHE_HTTPS_PORT_NUMBER
  847. value: "8443"
  848. envFrom:
  849. ports:
  850. - name: http
  851. containerPort: 8080
  852. - name: https
  853. containerPort: 8443
  854. livenessProbe:
  855. httpGet:
  856. path: /api/v1/streaming/health
  857. port: http
  858. initialDelaySeconds: 180
  859. periodSeconds: 20
  860. timeoutSeconds: 5
  861. successThreshold: 1
  862. failureThreshold: 6
  863. readinessProbe:
  864. httpGet:
  865. path: /api/v1/streaming/health
  866. port: http
  867. initialDelaySeconds: 30
  868. periodSeconds: 10
  869. timeoutSeconds: 5
  870. successThreshold: 1
  871. failureThreshold: 6
  872. resources:
  873. limits: {}
  874. requests: {}
  875. volumeMounts:
  876. - name: vhosts
  877. mountPath: /vhosts
  878. volumes:
  879. - name: vhosts
  880. configMap:
  881. name: mastodon-apache-mastodon-vhost
  882. ---
  883. # Source: mastodon/charts/minio/templates/standalone/deployment.yaml
  884. apiVersion: apps/v1
  885. kind: Deployment
  886. metadata:
  887. name: mastodon-minio
  888. namespace: "mastodon"
  889. labels:
  890. app.kubernetes.io/name: minio
  891. helm.sh/chart: minio-12.0.0
  892. app.kubernetes.io/instance: mastodon
  893. app.kubernetes.io/managed-by: Helm
  894. spec:
  895. selector:
  896. matchLabels:
  897. app.kubernetes.io/name: minio
  898. app.kubernetes.io/instance: mastodon
  899. strategy:
  900. type: Recreate
  901. template:
  902. metadata:
  903. labels:
  904. app.kubernetes.io/name: minio
  905. helm.sh/chart: minio-12.0.0
  906. app.kubernetes.io/instance: mastodon
  907. app.kubernetes.io/managed-by: Helm
  908. annotations:
  909. checksum/credentials-secret: 2db43b4c4682cc08fe1b802debca807f538d84655d6d362d0cbd488873cf2364
  910. spec:
  911. serviceAccountName: mastodon-minio
  912. affinity:
  913. podAffinity:
  914. podAntiAffinity:
  915. preferredDuringSchedulingIgnoredDuringExecution:
  916. - podAffinityTerm:
  917. labelSelector:
  918. matchLabels:
  919. app.kubernetes.io/name: minio
  920. app.kubernetes.io/instance: mastodon
  921. topologyKey: kubernetes.io/hostname
  922. weight: 1
  923. nodeAffinity:
  924. securityContext:
  925. fsGroup: 1001
  926. containers:
  927. - name: minio
  928. image: docker.io/bitnami/minio:2023.1.12-debian-11-r0
  929. imagePullPolicy: "IfNotPresent"
  930. securityContext:
  931. runAsNonRoot: true
  932. runAsUser: 1001
  933. env:
  934. - name: BITNAMI_DEBUG
  935. value: "false"
  936. - name: MINIO_SCHEME
  937. value: "http"
  938. - name: MINIO_FORCE_NEW_KEYS
  939. value: "no"
  940. - name: MINIO_ROOT_USER
  941. valueFrom:
  942. secretKeyRef:
  943. name: mastodon-minio
  944. key: root-user
  945. - name: MINIO_ROOT_PASSWORD
  946. valueFrom:
  947. secretKeyRef:
  948. name: mastodon-minio
  949. key: root-password
  950. - name: MINIO_DEFAULT_BUCKETS
  951. value: s3storage
  952. - name: MINIO_BROWSER
  953. value: "on"
  954. - name: MINIO_PROMETHEUS_AUTH_TYPE
  955. value: "public"
  956. - name: MINIO_CONSOLE_PORT_NUMBER
  957. value: "9001"
  958. envFrom:
  959. ports:
  960. - name: minio-api
  961. containerPort: 9000
  962. protocol: TCP
  963. - name: minio-console
  964. containerPort: 9001
  965. protocol: TCP
  966. livenessProbe:
  967. httpGet:
  968. path: /minio/health/live
  969. port: minio-api
  970. scheme: "HTTP"
  971. initialDelaySeconds: 5
  972. periodSeconds: 5
  973. timeoutSeconds: 5
  974. successThreshold: 1
  975. failureThreshold: 5
  976. readinessProbe:
  977. tcpSocket:
  978. port: minio-api
  979. initialDelaySeconds: 5
  980. periodSeconds: 5
  981. timeoutSeconds: 1
  982. successThreshold: 1
  983. failureThreshold: 5
  984. resources:
  985. limits: {}
  986. requests: {}
  987. volumeMounts:
  988. - name: data
  989. mountPath: /data
  990. volumes:
  991. - name: data
  992. persistentVolumeClaim:
  993. claimName: mastodon-minio
  994. ---
  995. # Source: mastodon/templates/sidekiq/deployment.yaml
  996. apiVersion: apps/v1
  997. kind: Deployment
  998. metadata:
  999. name: mastodon-sidekiq
  1000. namespace: "mastodon"
  1001. labels:
  1002. app.kubernetes.io/name: mastodon
  1003. helm.sh/chart: mastodon-1.0.1
  1004. app.kubernetes.io/instance: mastodon
  1005. app.kubernetes.io/managed-by: Helm
  1006. app.kubernetes.io/part-of: mastodon
  1007. app.kubernetes.io/component: sidekiq
  1008. spec:
  1009. replicas: 1
  1010. strategy:
  1011. type: RollingUpdate
  1012. selector:
  1013. matchLabels:
  1014. app.kubernetes.io/name: mastodon
  1015. app.kubernetes.io/instance: mastodon
  1016. app.kubernetes.io/component: sidekiq
  1017. template:
  1018. metadata:
  1019. labels:
  1020. app.kubernetes.io/name: mastodon
  1021. helm.sh/chart: mastodon-1.0.1
  1022. app.kubernetes.io/instance: mastodon
  1023. app.kubernetes.io/managed-by: Helm
  1024. app.kubernetes.io/component: sidekiq
  1025. spec:
  1026. serviceAccountName: mastodon
  1027. affinity:
  1028. podAffinity:
  1029. podAntiAffinity:
  1030. preferredDuringSchedulingIgnoredDuringExecution:
  1031. - podAffinityTerm:
  1032. labelSelector:
  1033. matchLabels:
  1034. app.kubernetes.io/name: mastodon
  1035. app.kubernetes.io/instance: mastodon
  1036. app.kubernetes.io/component: sidekiq
  1037. topologyKey: kubernetes.io/hostname
  1038. weight: 1
  1039. nodeAffinity:
  1040. securityContext:
  1041. fsGroup: 1001
  1042. seccompProfile:
  1043. type: RuntimeDefault
  1044. initContainers:
  1045. - name: wait-for-web
  1046. image: docker.io/bitnami/mastodon:4.0.2-debian-11-r18
  1047. imagePullPolicy: IfNotPresent
  1048. securityContext:
  1049. allowPrivilegeEscalation: false
  1050. capabilities:
  1051. drop:
  1052. - ALL
  1053. readOnlyRootFilesystem: false
  1054. runAsNonRoot: true
  1055. runAsUser: 1001
  1056. command:
  1057. - bash
  1058. - -ec
  1059. - |
  1060. #!/bin/bash
  1061. set -o errexit
  1062. set -o nounset
  1063. set -o pipefail
  1064. . /opt/bitnami/scripts/liblog.sh
  1065. . /opt/bitnami/scripts/libvalidations.sh
  1066. . /opt/bitnami/scripts/libmastodon.sh
  1067. . /opt/bitnami/scripts/mastodon-env.sh
  1068. mastodon_wait_for_web_connection "http://${MASTODON_WEB_HOST}:${MASTODON_WEB_PORT}"
  1069. info "Mastodon web is ready"
  1070. env:
  1071. - name: BITNAMI_DEBUG
  1072. value: "false"
  1073. - name: MASTODON_WEB_HOST
  1074. value: "mastodon-web"
  1075. - name: MASTODON_WEB_PORT
  1076. value: "80"
  1077. - name: wait-for-s3
  1078. image: docker.io/bitnami/mastodon:4.0.2-debian-11-r18
  1079. imagePullPolicy: IfNotPresent
  1080. securityContext:
  1081. allowPrivilegeEscalation: false
  1082. capabilities:
  1083. drop:
  1084. - ALL
  1085. readOnlyRootFilesystem: false
  1086. runAsNonRoot: true
  1087. runAsUser: 1001
  1088. command:
  1089. - bash
  1090. - -ec
  1091. - |
  1092. #!/bin/bash
  1093. set -o errexit
  1094. set -o nounset
  1095. set -o pipefail
  1096. . /opt/bitnami/scripts/liblog.sh
  1097. . /opt/bitnami/scripts/libvalidations.sh
  1098. . /opt/bitnami/scripts/libmastodon.sh
  1099. . /opt/bitnami/scripts/mastodon-env.sh
  1100. mastodon_wait_for_s3_connection "$MASTODON_S3_HOSTNAME" "$MASTODON_S3_PORT_NUMBER"
  1101. info "S3 is ready"
  1102. env:
  1103. - name: BITNAMI_DEBUG
  1104. value: "false"
  1105. - name: MASTODON_S3_HOSTNAME
  1106. value: "mastodon-minio"
  1107. - name: MASTODON_S3_PORT_NUMBER
  1108. value: "80"
  1109. containers:
  1110. - name: mastodon
  1111. image: docker.io/bitnami/mastodon:4.0.2-debian-11-r18
  1112. imagePullPolicy: IfNotPresent
  1113. securityContext:
  1114. allowPrivilegeEscalation: false
  1115. capabilities:
  1116. drop:
  1117. - ALL
  1118. readOnlyRootFilesystem: false
  1119. runAsNonRoot: true
  1120. runAsUser: 1001
  1121. command:
  1122. - /opt/bitnami/scripts/mastodon/run.sh
  1123. env:
  1124. - name: BITNAMI_DEBUG
  1125. value: "false"
  1126. - name: MASTODON_MODE
  1127. value: "sidekiq"
  1128. - name: MASTODON_DATABASE_PASSWORD
  1129. valueFrom:
  1130. secretKeyRef:
  1131. name: mastodon-postgresql
  1132. key: "password"
  1133. - name: MASTODON_REDIS_PASSWORD
  1134. valueFrom:
  1135. secretKeyRef:
  1136. name: mastodon-redis
  1137. key: "redis-password"
  1138. - name: MASTODON_AWS_ACCESS_KEY_ID
  1139. valueFrom:
  1140. secretKeyRef:
  1141. name: mastodon-minio
  1142. key: "root-user"
  1143. - name: MASTODON_AWS_SECRET_ACCESS_KEY
  1144. valueFrom:
  1145. secretKeyRef:
  1146. name: mastodon-minio
  1147. key: "root-password"
  1148. envFrom:
  1149. - configMapRef:
  1150. name: mastodon-default
  1151. - secretRef:
  1152. name: mastodon-default
  1153. resources:
  1154. limits: {}
  1155. requests: {}
  1156. livenessProbe:
  1157. failureThreshold: 6
  1158. initialDelaySeconds: 10
  1159. periodSeconds: 10
  1160. successThreshold: 1
  1161. timeoutSeconds: 5
  1162. exec:
  1163. command:
  1164. - /bin/sh
  1165. - -c
  1166. - pgrep -f ^sidekiq
  1167. readinessProbe:
  1168. failureThreshold: 6
  1169. initialDelaySeconds: 10
  1170. periodSeconds: 10
  1171. successThreshold: 1
  1172. timeoutSeconds: 5
  1173. exec:
  1174. command:
  1175. - /bin/sh
  1176. - -c
  1177. - pgrep -f ^sidekiq
  1178. volumeMounts:
  1179. volumes:
  1180. ---
  1181. # Source: mastodon/templates/streaming/deployment.yaml
  1182. apiVersion: apps/v1
  1183. kind: Deployment
  1184. metadata:
  1185. name: mastodon-streaming
  1186. namespace: "mastodon"
  1187. labels:
  1188. app.kubernetes.io/name: mastodon
  1189. helm.sh/chart: mastodon-1.0.1
  1190. app.kubernetes.io/instance: mastodon
  1191. app.kubernetes.io/managed-by: Helm
  1192. app.kubernetes.io/part-of: mastodon
  1193. app.kubernetes.io/component: streaming
  1194. spec:
  1195. replicas: 1
  1196. strategy:
  1197. type: RollingUpdate
  1198. selector:
  1199. matchLabels:
  1200. app.kubernetes.io/name: mastodon
  1201. app.kubernetes.io/instance: mastodon
  1202. app.kubernetes.io/component: streaming
  1203. template:
  1204. metadata:
  1205. labels:
  1206. app.kubernetes.io/name: mastodon
  1207. helm.sh/chart: mastodon-1.0.1
  1208. app.kubernetes.io/instance: mastodon
  1209. app.kubernetes.io/managed-by: Helm
  1210. app.kubernetes.io/component: streaming
  1211. spec:
  1212. serviceAccountName: mastodon
  1213. affinity:
  1214. podAffinity:
  1215. podAntiAffinity:
  1216. preferredDuringSchedulingIgnoredDuringExecution:
  1217. - podAffinityTerm:
  1218. labelSelector:
  1219. matchLabels:
  1220. app.kubernetes.io/name: mastodon
  1221. app.kubernetes.io/instance: mastodon
  1222. app.kubernetes.io/component: streaming
  1223. topologyKey: kubernetes.io/hostname
  1224. weight: 1
  1225. nodeAffinity:
  1226. securityContext:
  1227. fsGroup: 1001
  1228. seccompProfile:
  1229. type: RuntimeDefault
  1230. initContainers:
  1231. # We need to wait for the PostgreSQL database to be ready in order to start with Mastodon.
  1232. # As it is a ReplicaSet, we need that all nodes are configured in order to start with
  1233. # the application or race conditions can occur
  1234. - name: wait-for-db
  1235. image: docker.io/bitnami/mastodon:4.0.2-debian-11-r18
  1236. imagePullPolicy: IfNotPresent
  1237. securityContext:
  1238. allowPrivilegeEscalation: false
  1239. capabilities:
  1240. drop:
  1241. - ALL
  1242. readOnlyRootFilesystem: false
  1243. runAsNonRoot: true
  1244. runAsUser: 1001
  1245. command:
  1246. - bash
  1247. - -ec
  1248. - |
  1249. #!/bin/bash
  1250. set -o errexit
  1251. set -o nounset
  1252. set -o pipefail
  1253. . /opt/bitnami/scripts/liblog.sh
  1254. . /opt/bitnami/scripts/libvalidations.sh
  1255. . /opt/bitnami/scripts/libmastodon.sh
  1256. . /opt/bitnami/scripts/mastodon-env.sh
  1257. mastodon_wait_for_postgresql_connection "postgresql://${MASTODON_DATABASE_USER}:${MASTODON_DATABASE_PASSWORD:-}@${MASTODON_DATABASE_HOST}:${MASTODON_DATABASE_PORT_NUMBER}/${MASTODON_DATABASE_NAME}"
  1258. info "Database is ready"
  1259. env:
  1260. - name: BITNAMI_DEBUG
  1261. value: "false"
  1262. - name: MASTODON_DATABASE_HOST
  1263. value: "mastodon-postgresql"
  1264. - name: MASTODON_DATABASE_PORT_NUMBER
  1265. value: "5432"
  1266. - name: MASTODON_DATABASE_PASSWORD
  1267. valueFrom:
  1268. secretKeyRef:
  1269. name: mastodon-postgresql
  1270. key: password
  1271. - name: MASTODON_DATABASE_USER
  1272. value: bn_mastodon
  1273. - name: MASTODON_DATABASE_NAME
  1274. value: bitnami_mastodon
  1275. - name: wait-for-web
  1276. image: docker.io/bitnami/mastodon:4.0.2-debian-11-r18
  1277. imagePullPolicy: IfNotPresent
  1278. securityContext:
  1279. allowPrivilegeEscalation: false
  1280. capabilities:
  1281. drop:
  1282. - ALL
  1283. readOnlyRootFilesystem: false
  1284. runAsNonRoot: true
  1285. runAsUser: 1001
  1286. command:
  1287. - bash
  1288. - -ec
  1289. - |
  1290. #!/bin/bash
  1291. set -o errexit
  1292. set -o nounset
  1293. set -o pipefail
  1294. . /opt/bitnami/scripts/liblog.sh
  1295. . /opt/bitnami/scripts/libvalidations.sh
  1296. . /opt/bitnami/scripts/libmastodon.sh
  1297. . /opt/bitnami/scripts/mastodon-env.sh
  1298. mastodon_wait_for_web_connection "http://${MASTODON_WEB_HOST}:${MASTODON_WEB_PORT}"
  1299. info "Mastodon web is ready"
  1300. env:
  1301. - name: BITNAMI_DEBUG
  1302. value: "false"
  1303. - name: MASTODON_WEB_HOST
  1304. value: "mastodon-web"
  1305. - name: MASTODON_WEB_PORT
  1306. value: "80"
  1307. containers:
  1308. - name: mastodon
  1309. image: docker.io/bitnami/mastodon:4.0.2-debian-11-r18
  1310. imagePullPolicy: IfNotPresent
  1311. securityContext:
  1312. allowPrivilegeEscalation: false
  1313. capabilities:
  1314. drop:
  1315. - ALL
  1316. readOnlyRootFilesystem: false
  1317. runAsNonRoot: true
  1318. runAsUser: 1001
  1319. command:
  1320. - /opt/bitnami/scripts/mastodon/run.sh
  1321. env:
  1322. - name: BITNAMI_DEBUG
  1323. value: "false"
  1324. - name: MASTODON_MODE
  1325. value: "streaming"
  1326. - name: MASTODON_STREAMING_PORT_NUMBER
  1327. value: "8080"
  1328. - name: MASTODON_DATABASE_PASSWORD
  1329. valueFrom:
  1330. secretKeyRef:
  1331. name: mastodon-postgresql
  1332. key: "password"
  1333. - name: MASTODON_REDIS_PASSWORD
  1334. valueFrom:
  1335. secretKeyRef:
  1336. name: mastodon-redis
  1337. key: "redis-password"
  1338. - name: MASTODON_AWS_ACCESS_KEY_ID
  1339. valueFrom:
  1340. secretKeyRef:
  1341. name: mastodon-minio
  1342. key: "root-user"
  1343. - name: MASTODON_AWS_SECRET_ACCESS_KEY
  1344. valueFrom:
  1345. secretKeyRef:
  1346. name: mastodon-minio
  1347. key: "root-password"
  1348. envFrom:
  1349. - configMapRef:
  1350. name: mastodon-default
  1351. - secretRef:
  1352. name: mastodon-default
  1353. resources:
  1354. limits: {}
  1355. requests: {}
  1356. ports:
  1357. - name: http
  1358. containerPort: 8080
  1359. livenessProbe:
  1360. failureThreshold: 6
  1361. initialDelaySeconds: 10
  1362. periodSeconds: 10
  1363. successThreshold: 1
  1364. timeoutSeconds: 5
  1365. httpGet:
  1366. path: /api/v1/streaming/health
  1367. port: http
  1368. readinessProbe:
  1369. failureThreshold: 6
  1370. initialDelaySeconds: 10
  1371. periodSeconds: 10
  1372. successThreshold: 1
  1373. timeoutSeconds: 5
  1374. httpGet:
  1375. path: /api/v1/streaming/health
  1376. port: http
  1377. volumeMounts:
  1378. volumes:
  1379. ---
  1380. # Source: mastodon/templates/web/deployment.yaml
  1381. apiVersion: apps/v1
  1382. kind: Deployment
  1383. metadata:
  1384. name: mastodon-web
  1385. namespace: "mastodon"
  1386. labels:
  1387. app.kubernetes.io/name: mastodon
  1388. helm.sh/chart: mastodon-1.0.1
  1389. app.kubernetes.io/instance: mastodon
  1390. app.kubernetes.io/managed-by: Helm
  1391. app.kubernetes.io/part-of: mastodon
  1392. app.kubernetes.io/component: web
  1393. spec:
  1394. replicas: 1
  1395. strategy:
  1396. type: RollingUpdate
  1397. selector:
  1398. matchLabels:
  1399. app.kubernetes.io/name: mastodon
  1400. app.kubernetes.io/instance: mastodon
  1401. app.kubernetes.io/component: web
  1402. template:
  1403. metadata:
  1404. labels:
  1405. app.kubernetes.io/name: mastodon
  1406. helm.sh/chart: mastodon-1.0.1
  1407. app.kubernetes.io/instance: mastodon
  1408. app.kubernetes.io/managed-by: Helm
  1409. app.kubernetes.io/component: web
  1410. spec:
  1411. serviceAccountName: mastodon
  1412. affinity:
  1413. podAffinity:
  1414. podAntiAffinity:
  1415. preferredDuringSchedulingIgnoredDuringExecution:
  1416. - podAffinityTerm:
  1417. labelSelector:
  1418. matchLabels:
  1419. app.kubernetes.io/name: mastodon
  1420. app.kubernetes.io/instance: mastodon
  1421. app.kubernetes.io/component: web
  1422. topologyKey: kubernetes.io/hostname
  1423. weight: 1
  1424. nodeAffinity:
  1425. securityContext:
  1426. fsGroup: 1001
  1427. seccompProfile:
  1428. type: RuntimeDefault
  1429. initContainers:
  1430. # We need to wait for the PostgreSQL database to be ready in order to start with Mastodon.
  1431. # As it is a ReplicaSet, we need that all nodes are configured in order to start with
  1432. # the application or race conditions can occur
  1433. - name: wait-for-db
  1434. image: docker.io/bitnami/mastodon:4.0.2-debian-11-r18
  1435. imagePullPolicy: IfNotPresent
  1436. securityContext:
  1437. allowPrivilegeEscalation: false
  1438. capabilities:
  1439. drop:
  1440. - ALL
  1441. readOnlyRootFilesystem: false
  1442. runAsNonRoot: true
  1443. runAsUser: 1001
  1444. command:
  1445. - bash
  1446. - -ec
  1447. - |
  1448. #!/bin/bash
  1449. set -o errexit
  1450. set -o nounset
  1451. set -o pipefail
  1452. . /opt/bitnami/scripts/liblog.sh
  1453. . /opt/bitnami/scripts/libvalidations.sh
  1454. . /opt/bitnami/scripts/libmastodon.sh
  1455. . /opt/bitnami/scripts/mastodon-env.sh
  1456. mastodon_wait_for_postgresql_connection "postgresql://${MASTODON_DATABASE_USER}:${MASTODON_DATABASE_PASSWORD:-}@${MASTODON_DATABASE_HOST}:${MASTODON_DATABASE_PORT_NUMBER}/${MASTODON_DATABASE_NAME}"
  1457. info "Database is ready"
  1458. env:
  1459. - name: BITNAMI_DEBUG
  1460. value: "false"
  1461. - name: MASTODON_DATABASE_HOST
  1462. value: "mastodon-postgresql"
  1463. - name: MASTODON_DATABASE_PORT_NUMBER
  1464. value: "5432"
  1465. - name: MASTODON_DATABASE_PASSWORD
  1466. valueFrom:
  1467. secretKeyRef:
  1468. name: mastodon-postgresql
  1469. key: password
  1470. - name: MASTODON_DATABASE_USER
  1471. value: bn_mastodon
  1472. - name: MASTODON_DATABASE_NAME
  1473. value: bitnami_mastodon
  1474. # We need to wait for the PostgreSQL database to be ready in order to start with Mastodon.
  1475. # As it is a ReplicaSet, we need that all nodes are configured in order to start with
  1476. # the application or race conditions can occur
  1477. - name: wait-for-redis
  1478. image: docker.io/bitnami/mastodon:4.0.2-debian-11-r18
  1479. imagePullPolicy: IfNotPresent
  1480. securityContext:
  1481. allowPrivilegeEscalation: false
  1482. capabilities:
  1483. drop:
  1484. - ALL
  1485. readOnlyRootFilesystem: false
  1486. runAsNonRoot: true
  1487. runAsUser: 1001
  1488. command:
  1489. - bash
  1490. - -ec
  1491. - |
  1492. #!/bin/bash
  1493. set -o errexit
  1494. set -o nounset
  1495. set -o pipefail
  1496. . /opt/bitnami/scripts/liblog.sh
  1497. . /opt/bitnami/scripts/libvalidations.sh
  1498. . /opt/bitnami/scripts/libmastodon.sh
  1499. . /opt/bitnami/scripts/mastodon-env.sh
  1500. mastodon_wait_for_redis_connection "redis://${MASTODON_REDIS_PASSWORD:-}@${MASTODON_REDIS_HOST}:${MASTODON_REDIS_PORT_NUMBER}"
  1501. info "Redis(TM) is ready"
  1502. env:
  1503. - name: BITNAMI_DEBUG
  1504. value: "false"
  1505. - name: MASTODON_REDIS_HOST
  1506. value: "mastodon-redis-master"
  1507. - name: MASTODON_REDIS_PORT_NUMBER
  1508. value: "6379"
  1509. - name: MASTODON_REDIS_PASSWORD
  1510. valueFrom:
  1511. secretKeyRef:
  1512. name: mastodon-redis
  1513. key: redis-password
  1514. - name: wait-for-elasticsearch
  1515. image: docker.io/bitnami/mastodon:4.0.2-debian-11-r18
  1516. imagePullPolicy: IfNotPresent
  1517. securityContext:
  1518. allowPrivilegeEscalation: false
  1519. capabilities:
  1520. drop:
  1521. - ALL
  1522. readOnlyRootFilesystem: false
  1523. runAsNonRoot: true
  1524. runAsUser: 1001
  1525. command:
  1526. - bash
  1527. - -ec
  1528. - |
  1529. #!/bin/bash
  1530. set -o errexit
  1531. set -o nounset
  1532. set -o pipefail
  1533. . /opt/bitnami/scripts/liblog.sh
  1534. . /opt/bitnami/scripts/libvalidations.sh
  1535. . /opt/bitnami/scripts/libmastodon.sh
  1536. . /opt/bitnami/scripts/mastodon-env.sh
  1537. mastodon_wait_for_elasticsearch_connection "http://${MASTODON_ELASTICSEARCH_HOST}:${MASTODON_ELASTICSEARCH_PORT_NUMBER}"
  1538. info "Mastodon web is ready"
  1539. env:
  1540. - name: BITNAMI_DEBUG
  1541. value: "false"
  1542. - name: MASTODON_ELASTICSEARCH_HOST
  1543. value: "mastodon-elasticsearch"
  1544. - name: MASTODON_ELASTICSEARCH_PORT_NUMBER
  1545. value: "9200"
  1546. - name: wait-for-s3
  1547. image: docker.io/bitnami/mastodon:4.0.2-debian-11-r18
  1548. imagePullPolicy: IfNotPresent
  1549. securityContext:
  1550. allowPrivilegeEscalation: false
  1551. capabilities:
  1552. drop:
  1553. - ALL
  1554. readOnlyRootFilesystem: false
  1555. runAsNonRoot: true
  1556. runAsUser: 1001
  1557. command:
  1558. - bash
  1559. - -ec
  1560. - |
  1561. #!/bin/bash
  1562. set -o errexit
  1563. set -o nounset
  1564. set -o pipefail
  1565. . /opt/bitnami/scripts/liblog.sh
  1566. . /opt/bitnami/scripts/libvalidations.sh
  1567. . /opt/bitnami/scripts/libmastodon.sh
  1568. . /opt/bitnami/scripts/mastodon-env.sh
  1569. mastodon_wait_for_s3_connection "$MASTODON_S3_HOSTNAME" "$MASTODON_S3_PORT_NUMBER"
  1570. info "S3 is ready"
  1571. env:
  1572. - name: BITNAMI_DEBUG
  1573. value: "false"
  1574. - name: MASTODON_S3_HOSTNAME
  1575. value: "mastodon-minio"
  1576. - name: MASTODON_S3_PORT_NUMBER
  1577. value: "80"
  1578. containers:
  1579. - name: mastodon
  1580. image: docker.io/bitnami/mastodon:4.0.2-debian-11-r18
  1581. imagePullPolicy: IfNotPresent
  1582. securityContext:
  1583. allowPrivilegeEscalation: false
  1584. capabilities:
  1585. drop:
  1586. - ALL
  1587. readOnlyRootFilesystem: false
  1588. runAsNonRoot: true
  1589. runAsUser: 1001
  1590. command:
  1591. - /opt/bitnami/scripts/mastodon/run.sh
  1592. env:
  1593. - name: BITNAMI_DEBUG
  1594. value: "false"
  1595. - name: MASTODON_MODE
  1596. value: "web"
  1597. - name: MASTODON_WEB_PORT_NUMBER
  1598. value: "3000"
  1599. - name: MASTODON_DATABASE_PASSWORD
  1600. valueFrom:
  1601. secretKeyRef:
  1602. name: mastodon-postgresql
  1603. key: "password"
  1604. - name: MASTODON_REDIS_PASSWORD
  1605. valueFrom:
  1606. secretKeyRef:
  1607. name: mastodon-redis
  1608. key: "redis-password"
  1609. - name: MASTODON_AWS_ACCESS_KEY_ID
  1610. valueFrom:
  1611. secretKeyRef:
  1612. name: mastodon-minio
  1613. key: "root-user"
  1614. - name: MASTODON_AWS_SECRET_ACCESS_KEY
  1615. valueFrom:
  1616. secretKeyRef:
  1617. name: mastodon-minio
  1618. key: "root-password"
  1619. envFrom:
  1620. - configMapRef:
  1621. name: mastodon-default
  1622. - secretRef:
  1623. name: mastodon-default
  1624. resources:
  1625. limits: {}
  1626. requests: {}
  1627. ports:
  1628. - name: http
  1629. containerPort: 3000
  1630. livenessProbe:
  1631. failureThreshold: 6
  1632. initialDelaySeconds: 10
  1633. periodSeconds: 10
  1634. successThreshold: 1
  1635. timeoutSeconds: 5
  1636. httpGet:
  1637. path: /health
  1638. port: http
  1639. readinessProbe:
  1640. failureThreshold: 6
  1641. initialDelaySeconds: 10
  1642. periodSeconds: 10
  1643. successThreshold: 1
  1644. timeoutSeconds: 5
  1645. httpGet:
  1646. path: /health
  1647. port: http
  1648. volumeMounts:
  1649. volumes:
  1650. ---
  1651. # Source: mastodon/charts/elasticsearch/templates/coordinating/statefulset.yaml
  1652. apiVersion: apps/v1
  1653. kind: StatefulSet
  1654. metadata:
  1655. name: mastodon-elasticsearch-coordinating
  1656. namespace: "mastodon"
  1657. labels:
  1658. app.kubernetes.io/name: elasticsearch
  1659. helm.sh/chart: elasticsearch-19.5.8
  1660. app.kubernetes.io/instance: mastodon
  1661. app.kubernetes.io/managed-by: Helm
  1662. app.kubernetes.io/component: coordinating-only
  1663. ## Istio Labels: https://istio.io/docs/ops/deployment/requirements/
  1664. app: coordinating-only
  1665. spec:
  1666. replicas: 1
  1667. selector:
  1668. matchLabels:
  1669. app.kubernetes.io/name: elasticsearch
  1670. app.kubernetes.io/instance: mastodon
  1671. app.kubernetes.io/component: coordinating-only
  1672. updateStrategy:
  1673. type: RollingUpdate
  1674. serviceName: mastodon-elasticsearch-coordinating-hl
  1675. podManagementPolicy: Parallel
  1676. template:
  1677. metadata:
  1678. labels:
  1679. app.kubernetes.io/name: elasticsearch
  1680. helm.sh/chart: elasticsearch-19.5.8
  1681. app.kubernetes.io/instance: mastodon
  1682. app.kubernetes.io/managed-by: Helm
  1683. app.kubernetes.io/component: coordinating-only
  1684. ## Istio Labels: https://istio.io/docs/ops/deployment/requirements/
  1685. app: coordinating-only
  1686. annotations:
  1687. spec:
  1688. serviceAccountName: default
  1689. affinity:
  1690. podAffinity:
  1691. podAntiAffinity:
  1692. nodeAffinity:
  1693. securityContext:
  1694. fsGroup: 1001
  1695. initContainers:
  1696. ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors)
  1697. - name: sysctl
  1698. image: docker.io/bitnami/bitnami-shell:11-debian-11-r70
  1699. imagePullPolicy: "IfNotPresent"
  1700. command:
  1701. - /bin/bash
  1702. - -ec
  1703. - |
  1704. CURRENT=`sysctl -n vm.max_map_count`;
  1705. DESIRED="262144";
  1706. if [ "$DESIRED" -gt "$CURRENT" ]; then
  1707. sysctl -w vm.max_map_count=262144;
  1708. fi;
  1709. CURRENT=`sysctl -n fs.file-max`;
  1710. DESIRED="65536";
  1711. if [ "$DESIRED" -gt "$CURRENT" ]; then
  1712. sysctl -w fs.file-max=65536;
  1713. fi;
  1714. securityContext:
  1715. privileged: true
  1716. runAsUser: 0
  1717. resources:
  1718. limits: {}
  1719. requests: {}
  1720. containers:
  1721. - name: elasticsearch
  1722. image: docker.io/bitnami/elasticsearch:8.6.0-debian-11-r0
  1723. imagePullPolicy: "IfNotPresent"
  1724. securityContext:
  1725. runAsNonRoot: true
  1726. runAsUser: 1001
  1727. env:
  1728. - name: MY_POD_NAME
  1729. valueFrom:
  1730. fieldRef:
  1731. fieldPath: metadata.name
  1732. - name: BITNAMI_DEBUG
  1733. value: "false"
  1734. - name: ELASTICSEARCH_CLUSTER_NAME
  1735. value: "elastic"
  1736. - name: ELASTICSEARCH_IS_DEDICATED_NODE
  1737. value: "yes"
  1738. - name: ELASTICSEARCH_NODE_ROLES
  1739. value: ""
  1740. - name: ELASTICSEARCH_TRANSPORT_PORT_NUMBER
  1741. value: "9300"
  1742. - name: ELASTICSEARCH_HTTP_PORT_NUMBER
  1743. value: "9200"
  1744. - name: ELASTICSEARCH_CLUSTER_HOSTS
  1745. value: "mastodon-elasticsearch-master-hl.mastodon.svc.cluster.local,mastodon-elasticsearch-coordinating-hl.mastodon.svc.cluster.local,mastodon-elasticsearch-data-hl.mastodon.svc.cluster.local,mastodon-elasticsearch-ingest-hl.mastodon.svc.cluster.local,"
  1746. - name: ELASTICSEARCH_TOTAL_NODES
  1747. value: "2"
  1748. - name: ELASTICSEARCH_CLUSTER_MASTER_HOSTS
  1749. value: mastodon-elasticsearch-master-0
  1750. - name: ELASTICSEARCH_MINIMUM_MASTER_NODES
  1751. value: "1"
  1752. - name: ELASTICSEARCH_ADVERTISED_HOSTNAME
  1753. value: "$(MY_POD_NAME).mastodon-elasticsearch-coordinating-hl.mastodon.svc.cluster.local"
  1754. - name: ELASTICSEARCH_HEAP_SIZE
  1755. value: "128m"
  1756. ports:
  1757. - name: rest-api
  1758. containerPort: 9200
  1759. - name: transport
  1760. containerPort: 9300
  1761. livenessProbe:
  1762. failureThreshold: 5
  1763. initialDelaySeconds: 90
  1764. periodSeconds: 10
  1765. successThreshold: 1
  1766. timeoutSeconds: 5
  1767. exec:
  1768. command:
  1769. - /opt/bitnami/scripts/elasticsearch/healthcheck.sh
  1770. readinessProbe:
  1771. failureThreshold: 5
  1772. initialDelaySeconds: 90
  1773. periodSeconds: 10
  1774. successThreshold: 1
  1775. timeoutSeconds: 5
  1776. exec:
  1777. command:
  1778. - /opt/bitnami/scripts/elasticsearch/healthcheck.sh
  1779. resources:
  1780. limits: {}
  1781. requests:
  1782. cpu: 25m
  1783. memory: 256Mi
  1784. volumeMounts:
  1785. - name: data
  1786. mountPath: /bitnami/elasticsearch/data
  1787. volumes:
  1788. - name: "data"
  1789. emptyDir: {}
  1790. ---
  1791. # Source: mastodon/charts/elasticsearch/templates/data/statefulset.yaml
  1792. apiVersion: apps/v1
  1793. kind: StatefulSet
  1794. metadata:
  1795. name: mastodon-elasticsearch-data
  1796. namespace: "mastodon"
  1797. labels:
  1798. app.kubernetes.io/name: elasticsearch
  1799. helm.sh/chart: elasticsearch-19.5.8
  1800. app.kubernetes.io/instance: mastodon
  1801. app.kubernetes.io/managed-by: Helm
  1802. app.kubernetes.io/component: data
  1803. ## Istio Labels: https://istio.io/docs/ops/deployment/requirements/
  1804. app: data
  1805. spec:
  1806. replicas: 1
  1807. podManagementPolicy: Parallel
  1808. selector:
  1809. matchLabels:
  1810. app.kubernetes.io/name: elasticsearch
  1811. app.kubernetes.io/instance: mastodon
  1812. app.kubernetes.io/component: data
  1813. serviceName: mastodon-elasticsearch-data-hl
  1814. updateStrategy:
  1815. type: RollingUpdate
  1816. template:
  1817. metadata:
  1818. labels:
  1819. app.kubernetes.io/name: elasticsearch
  1820. helm.sh/chart: elasticsearch-19.5.8
  1821. app.kubernetes.io/instance: mastodon
  1822. app.kubernetes.io/managed-by: Helm
  1823. app.kubernetes.io/component: data
  1824. ## Istio Labels: https://istio.io/docs/ops/deployment/requirements/
  1825. app: data
  1826. annotations:
  1827. spec:
  1828. serviceAccountName: default
  1829. affinity:
  1830. podAffinity:
  1831. podAntiAffinity:
  1832. nodeAffinity:
  1833. securityContext:
  1834. fsGroup: 1001
  1835. initContainers:
  1836. ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors)
  1837. - name: sysctl
  1838. image: docker.io/bitnami/bitnami-shell:11-debian-11-r70
  1839. imagePullPolicy: "IfNotPresent"
  1840. command:
  1841. - /bin/bash
  1842. - -ec
  1843. - |
  1844. CURRENT=`sysctl -n vm.max_map_count`;
  1845. DESIRED="262144";
  1846. if [ "$DESIRED" -gt "$CURRENT" ]; then
  1847. sysctl -w vm.max_map_count=262144;
  1848. fi;
  1849. CURRENT=`sysctl -n fs.file-max`;
  1850. DESIRED="65536";
  1851. if [ "$DESIRED" -gt "$CURRENT" ]; then
  1852. sysctl -w fs.file-max=65536;
  1853. fi;
  1854. securityContext:
  1855. privileged: true
  1856. runAsUser: 0
  1857. resources:
  1858. limits: {}
  1859. requests: {}
  1860. containers:
  1861. - name: elasticsearch
  1862. image: docker.io/bitnami/elasticsearch:8.6.0-debian-11-r0
  1863. imagePullPolicy: "IfNotPresent"
  1864. securityContext:
  1865. runAsNonRoot: true
  1866. runAsUser: 1001
  1867. env:
  1868. - name: BITNAMI_DEBUG
  1869. value: "false"
  1870. - name: MY_POD_NAME
  1871. valueFrom:
  1872. fieldRef:
  1873. fieldPath: metadata.name
  1874. - name: ELASTICSEARCH_IS_DEDICATED_NODE
  1875. value: "yes"
  1876. - name: ELASTICSEARCH_NODE_ROLES
  1877. value: "data"
  1878. - name: ELASTICSEARCH_TRANSPORT_PORT_NUMBER
  1879. value: "9300"
  1880. - name: ELASTICSEARCH_HTTP_PORT_NUMBER
  1881. value: "9200"
  1882. - name: ELASTICSEARCH_CLUSTER_NAME
  1883. value: "elastic"
  1884. - name: ELASTICSEARCH_CLUSTER_HOSTS
  1885. value: "mastodon-elasticsearch-master-hl.mastodon.svc.cluster.local,mastodon-elasticsearch-coordinating-hl.mastodon.svc.cluster.local,mastodon-elasticsearch-data-hl.mastodon.svc.cluster.local,mastodon-elasticsearch-ingest-hl.mastodon.svc.cluster.local,"
  1886. - name: ELASTICSEARCH_TOTAL_NODES
  1887. value: "2"
  1888. - name: ELASTICSEARCH_CLUSTER_MASTER_HOSTS
  1889. value: mastodon-elasticsearch-master-0
  1890. - name: ELASTICSEARCH_MINIMUM_MASTER_NODES
  1891. value: "1"
  1892. - name: ELASTICSEARCH_ADVERTISED_HOSTNAME
  1893. value: "$(MY_POD_NAME).mastodon-elasticsearch-data-hl.mastodon.svc.cluster.local"
  1894. - name: ELASTICSEARCH_HEAP_SIZE
  1895. value: "1024m"
  1896. ports:
  1897. - name: rest-api
  1898. containerPort: 9200
  1899. - name: transport
  1900. containerPort: 9300
  1901. livenessProbe:
  1902. failureThreshold: 5
  1903. initialDelaySeconds: 90
  1904. periodSeconds: 10
  1905. successThreshold: 1
  1906. timeoutSeconds: 5
  1907. exec:
  1908. command:
  1909. - /opt/bitnami/scripts/elasticsearch/healthcheck.sh
  1910. readinessProbe:
  1911. failureThreshold: 5
  1912. initialDelaySeconds: 90
  1913. periodSeconds: 10
  1914. successThreshold: 1
  1915. timeoutSeconds: 5
  1916. exec:
  1917. command:
  1918. - /opt/bitnami/scripts/elasticsearch/healthcheck.sh
  1919. resources:
  1920. limits: {}
  1921. requests:
  1922. cpu: 25m
  1923. memory: 2048Mi
  1924. volumeMounts:
  1925. - name: data
  1926. mountPath: /bitnami/elasticsearch/data
  1927. volumes:
  1928. volumeClaimTemplates:
  1929. - metadata:
  1930. name: "data"
  1931. annotations:
  1932. spec:
  1933. accessModes:
  1934. - "ReadWriteOnce"
  1935. resources:
  1936. requests:
  1937. storage: "8Gi"
  1938. storageClassName: longhorn
  1939. ---
  1940. # Source: mastodon/charts/elasticsearch/templates/ingest/statefulset.yaml
  1941. apiVersion: apps/v1
  1942. kind: StatefulSet
  1943. metadata:
  1944. name: mastodon-elasticsearch-ingest
  1945. namespace: "mastodon"
  1946. labels:
  1947. app.kubernetes.io/name: elasticsearch
  1948. helm.sh/chart: elasticsearch-19.5.8
  1949. app.kubernetes.io/instance: mastodon
  1950. app.kubernetes.io/managed-by: Helm
  1951. app.kubernetes.io/component: ingest
  1952. ## Istio Labels: https://istio.io/docs/ops/deployment/requirements/
  1953. app: ingest
  1954. spec:
  1955. replicas: 1
  1956. podManagementPolicy: Parallel
  1957. selector:
  1958. matchLabels:
  1959. app.kubernetes.io/name: elasticsearch
  1960. app.kubernetes.io/instance: mastodon
  1961. app.kubernetes.io/component: ingest
  1962. serviceName: mastodon-elasticsearch-ingest-hl
  1963. updateStrategy:
  1964. type: RollingUpdate
  1965. template:
  1966. metadata:
  1967. labels:
  1968. app.kubernetes.io/name: elasticsearch
  1969. helm.sh/chart: elasticsearch-19.5.8
  1970. app.kubernetes.io/instance: mastodon
  1971. app.kubernetes.io/managed-by: Helm
  1972. app.kubernetes.io/component: ingest
  1973. ## Istio Labels: https://istio.io/docs/ops/deployment/requirements/
  1974. app: ingest
  1975. annotations:
  1976. spec:
  1977. serviceAccountName: default
  1978. affinity:
  1979. podAffinity:
  1980. podAntiAffinity:
  1981. nodeAffinity:
  1982. securityContext:
  1983. fsGroup: 1001
  1984. initContainers:
  1985. ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors)
  1986. - name: sysctl
  1987. image: docker.io/bitnami/bitnami-shell:11-debian-11-r70
  1988. imagePullPolicy: "IfNotPresent"
  1989. command:
  1990. - /bin/bash
  1991. - -ec
  1992. - |
  1993. CURRENT=`sysctl -n vm.max_map_count`;
  1994. DESIRED="262144";
  1995. if [ "$DESIRED" -gt "$CURRENT" ]; then
  1996. sysctl -w vm.max_map_count=262144;
  1997. fi;
  1998. CURRENT=`sysctl -n fs.file-max`;
  1999. DESIRED="65536";
  2000. if [ "$DESIRED" -gt "$CURRENT" ]; then
  2001. sysctl -w fs.file-max=65536;
  2002. fi;
  2003. securityContext:
  2004. privileged: true
  2005. runAsUser: 0
  2006. resources:
  2007. limits: {}
  2008. requests: {}
  2009. containers:
  2010. - name: elasticsearch
  2011. image: docker.io/bitnami/elasticsearch:8.6.0-debian-11-r0
  2012. imagePullPolicy: "IfNotPresent"
  2013. securityContext:
  2014. runAsNonRoot: true
  2015. runAsUser: 1001
  2016. env:
  2017. - name: BITNAMI_DEBUG
  2018. value: "false"
  2019. - name: MY_POD_NAME
  2020. valueFrom:
  2021. fieldRef:
  2022. fieldPath: metadata.name
  2023. - name: ELASTICSEARCH_IS_DEDICATED_NODE
  2024. value: "yes"
  2025. - name: ELASTICSEARCH_NODE_ROLES
  2026. value: "ingest"
  2027. - name: ELASTICSEARCH_TRANSPORT_PORT_NUMBER
  2028. value: "9300"
  2029. - name: ELASTICSEARCH_HTTP_PORT_NUMBER
  2030. value: "9200"
  2031. - name: ELASTICSEARCH_CLUSTER_NAME
  2032. value: "elastic"
  2033. - name: ELASTICSEARCH_CLUSTER_HOSTS
  2034. value: "mastodon-elasticsearch-master-hl.mastodon.svc.cluster.local,mastodon-elasticsearch-coordinating-hl.mastodon.svc.cluster.local,mastodon-elasticsearch-data-hl.mastodon.svc.cluster.local,mastodon-elasticsearch-ingest-hl.mastodon.svc.cluster.local,"
  2035. - name: ELASTICSEARCH_TOTAL_NODES
  2036. value: "2"
  2037. - name: ELASTICSEARCH_CLUSTER_MASTER_HOSTS
  2038. value: mastodon-elasticsearch-master-0
  2039. - name: ELASTICSEARCH_MINIMUM_MASTER_NODES
  2040. value: "1"
  2041. - name: ELASTICSEARCH_ADVERTISED_HOSTNAME
  2042. value: "$(MY_POD_NAME).mastodon-elasticsearch-ingest-hl.mastodon.svc.cluster.local"
  2043. - name: ELASTICSEARCH_HEAP_SIZE
  2044. value: "128m"
  2045. ports:
  2046. - name: rest-api
  2047. containerPort: 9200
  2048. - name: transport
  2049. containerPort: 9300
  2050. livenessProbe:
  2051. failureThreshold: 5
  2052. initialDelaySeconds: 90
  2053. periodSeconds: 10
  2054. successThreshold: 1
  2055. timeoutSeconds: 5
  2056. exec:
  2057. command:
  2058. - /opt/bitnami/scripts/elasticsearch/healthcheck.sh
  2059. readinessProbe:
  2060. failureThreshold: 5
  2061. initialDelaySeconds: 90
  2062. periodSeconds: 10
  2063. successThreshold: 1
  2064. timeoutSeconds: 5
  2065. exec:
  2066. command:
  2067. - /opt/bitnami/scripts/elasticsearch/healthcheck.sh
  2068. resources:
  2069. limits: {}
  2070. requests:
  2071. cpu: 25m
  2072. memory: 256Mi
  2073. volumeMounts:
  2074. - name: data
  2075. mountPath: /bitnami/elasticsearch/data
  2076. volumes:
  2077. - name: "data"
  2078. emptyDir: {}
  2079. ---
  2080. # Source: mastodon/charts/elasticsearch/templates/master/statefulset.yaml
  2081. apiVersion: apps/v1
  2082. kind: StatefulSet
  2083. metadata:
  2084. name: mastodon-elasticsearch-master
  2085. namespace: "mastodon"
  2086. labels:
  2087. app.kubernetes.io/name: elasticsearch
  2088. helm.sh/chart: elasticsearch-19.5.8
  2089. app.kubernetes.io/instance: mastodon
  2090. app.kubernetes.io/managed-by: Helm
  2091. app.kubernetes.io/component: master
  2092. ## Istio Labels: https://istio.io/docs/ops/deployment/requirements/
  2093. app: master
  2094. spec:
  2095. replicas: 1
  2096. podManagementPolicy: Parallel
  2097. selector:
  2098. matchLabels:
  2099. app.kubernetes.io/name: elasticsearch
  2100. app.kubernetes.io/instance: mastodon
  2101. app.kubernetes.io/component: master
  2102. serviceName: mastodon-elasticsearch-master-hl
  2103. updateStrategy:
  2104. type: RollingUpdate
  2105. template:
  2106. metadata:
  2107. labels:
  2108. app.kubernetes.io/name: elasticsearch
  2109. helm.sh/chart: elasticsearch-19.5.8
  2110. app.kubernetes.io/instance: mastodon
  2111. app.kubernetes.io/managed-by: Helm
  2112. app.kubernetes.io/component: master
  2113. ## Istio Labels: https://istio.io/docs/ops/deployment/requirements/
  2114. app: master
  2115. annotations:
  2116. spec:
  2117. serviceAccountName: default
  2118. affinity:
  2119. podAffinity:
  2120. podAntiAffinity:
  2121. nodeAffinity:
  2122. securityContext:
  2123. fsGroup: 1001
  2124. initContainers:
  2125. ## Image that performs the sysctl operation to modify Kernel settings (needed sometimes to avoid boot errors)
  2126. - name: sysctl
  2127. image: docker.io/bitnami/bitnami-shell:11-debian-11-r70
  2128. imagePullPolicy: "IfNotPresent"
  2129. command:
  2130. - /bin/bash
  2131. - -ec
  2132. - |
  2133. CURRENT=`sysctl -n vm.max_map_count`;
  2134. DESIRED="262144";
  2135. if [ "$DESIRED" -gt "$CURRENT" ]; then
  2136. sysctl -w vm.max_map_count=262144;
  2137. fi;
  2138. CURRENT=`sysctl -n fs.file-max`;
  2139. DESIRED="65536";
  2140. if [ "$DESIRED" -gt "$CURRENT" ]; then
  2141. sysctl -w fs.file-max=65536;
  2142. fi;
  2143. securityContext:
  2144. privileged: true
  2145. runAsUser: 0
  2146. resources:
  2147. limits: {}
  2148. requests: {}
  2149. containers:
  2150. - name: elasticsearch
  2151. image: docker.io/bitnami/elasticsearch:8.6.0-debian-11-r0
  2152. imagePullPolicy: "IfNotPresent"
  2153. securityContext:
  2154. runAsNonRoot: true
  2155. runAsUser: 1001
  2156. env:
  2157. - name: BITNAMI_DEBUG
  2158. value: "false"
  2159. - name: MY_POD_NAME
  2160. valueFrom:
  2161. fieldRef:
  2162. fieldPath: metadata.name
  2163. - name: ELASTICSEARCH_IS_DEDICATED_NODE
  2164. value: "yes"
  2165. - name: ELASTICSEARCH_NODE_ROLES
  2166. value: "master"
  2167. - name: ELASTICSEARCH_TRANSPORT_PORT_NUMBER
  2168. value: "9300"
  2169. - name: ELASTICSEARCH_HTTP_PORT_NUMBER
  2170. value: "9200"
  2171. - name: ELASTICSEARCH_CLUSTER_NAME
  2172. value: "elastic"
  2173. - name: ELASTICSEARCH_CLUSTER_HOSTS
  2174. value: "mastodon-elasticsearch-master-hl.mastodon.svc.cluster.local,mastodon-elasticsearch-coordinating-hl.mastodon.svc.cluster.local,mastodon-elasticsearch-data-hl.mastodon.svc.cluster.local,mastodon-elasticsearch-ingest-hl.mastodon.svc.cluster.local,"
  2175. - name: ELASTICSEARCH_TOTAL_NODES
  2176. value: "2"
  2177. - name: ELASTICSEARCH_CLUSTER_MASTER_HOSTS
  2178. value: mastodon-elasticsearch-master-0
  2179. - name: ELASTICSEARCH_MINIMUM_MASTER_NODES
  2180. value: "1"
  2181. - name: ELASTICSEARCH_ADVERTISED_HOSTNAME
  2182. value: "$(MY_POD_NAME).mastodon-elasticsearch-master-hl.mastodon.svc.cluster.local"
  2183. - name: ELASTICSEARCH_HEAP_SIZE
  2184. value: "128m"
  2185. ports:
  2186. - name: rest-api
  2187. containerPort: 9200
  2188. - name: transport
  2189. containerPort: 9300
  2190. livenessProbe:
  2191. failureThreshold: 5
  2192. initialDelaySeconds: 90
  2193. periodSeconds: 10
  2194. successThreshold: 1
  2195. timeoutSeconds: 5
  2196. exec:
  2197. command:
  2198. - /opt/bitnami/scripts/elasticsearch/healthcheck.sh
  2199. readinessProbe:
  2200. failureThreshold: 5
  2201. initialDelaySeconds: 90
  2202. periodSeconds: 10
  2203. successThreshold: 1
  2204. timeoutSeconds: 5
  2205. exec:
  2206. command:
  2207. - /opt/bitnami/scripts/elasticsearch/healthcheck.sh
  2208. resources:
  2209. limits: {}
  2210. requests:
  2211. cpu: 25m
  2212. memory: 256Mi
  2213. volumeMounts:
  2214. - name: data
  2215. mountPath: /bitnami/elasticsearch/data
  2216. volumes:
  2217. volumeClaimTemplates:
  2218. - metadata:
  2219. name: "data"
  2220. annotations:
  2221. spec:
  2222. accessModes:
  2223. - "ReadWriteOnce"
  2224. resources:
  2225. requests:
  2226. storage: "8Gi"
  2227. storageClassName: longhorn
  2228. ---
  2229. # Source: mastodon/charts/postgresql/templates/primary/statefulset.yaml
  2230. apiVersion: apps/v1
  2231. kind: StatefulSet
  2232. metadata:
  2233. name: mastodon-postgresql
  2234. namespace: "mastodon"
  2235. labels:
  2236. app.kubernetes.io/name: postgresql
  2237. helm.sh/chart: postgresql-12.1.9
  2238. app.kubernetes.io/instance: mastodon
  2239. app.kubernetes.io/managed-by: Helm
  2240. app.kubernetes.io/component: primary
  2241. annotations:
  2242. spec:
  2243. replicas: 1
  2244. serviceName: mastodon-postgresql-hl
  2245. updateStrategy:
  2246. rollingUpdate: {}
  2247. type: RollingUpdate
  2248. selector:
  2249. matchLabels:
  2250. app.kubernetes.io/name: postgresql
  2251. app.kubernetes.io/instance: mastodon
  2252. app.kubernetes.io/component: primary
  2253. template:
  2254. metadata:
  2255. name: mastodon-postgresql
  2256. labels:
  2257. app.kubernetes.io/name: postgresql
  2258. helm.sh/chart: postgresql-12.1.9
  2259. app.kubernetes.io/instance: mastodon
  2260. app.kubernetes.io/managed-by: Helm
  2261. app.kubernetes.io/component: primary
  2262. annotations:
  2263. spec:
  2264. serviceAccountName: default
  2265. affinity:
  2266. podAffinity:
  2267. podAntiAffinity:
  2268. preferredDuringSchedulingIgnoredDuringExecution:
  2269. - podAffinityTerm:
  2270. labelSelector:
  2271. matchLabels:
  2272. app.kubernetes.io/name: postgresql
  2273. app.kubernetes.io/instance: mastodon
  2274. app.kubernetes.io/component: primary
  2275. topologyKey: kubernetes.io/hostname
  2276. weight: 1
  2277. nodeAffinity:
  2278. securityContext:
  2279. fsGroup: 1001
  2280. hostNetwork: false
  2281. hostIPC: false
  2282. initContainers:
  2283. containers:
  2284. - name: postgresql
  2285. image: docker.io/bitnami/postgresql:15.1.0-debian-11-r20
  2286. imagePullPolicy: "IfNotPresent"
  2287. securityContext:
  2288. runAsUser: 1001
  2289. env:
  2290. - name: BITNAMI_DEBUG
  2291. value: "false"
  2292. - name: POSTGRESQL_PORT_NUMBER
  2293. value: "5432"
  2294. - name: POSTGRESQL_VOLUME_DIR
  2295. value: "/bitnami/postgresql"
  2296. - name: PGDATA
  2297. value: "/bitnami/postgresql/data"
  2298. # Authentication
  2299. - name: POSTGRES_USER
  2300. value: "bn_mastodon"
  2301. - name: POSTGRES_POSTGRES_PASSWORD
  2302. valueFrom:
  2303. secretKeyRef:
  2304. name: mastodon-postgresql
  2305. key: postgres-password
  2306. - name: POSTGRES_PASSWORD
  2307. valueFrom:
  2308. secretKeyRef:
  2309. name: mastodon-postgresql
  2310. key: password
  2311. - name: POSTGRES_DB
  2312. value: "bitnami_mastodon"
  2313. # Replication
  2314. # Initdb
  2315. # Standby
  2316. # LDAP
  2317. - name: POSTGRESQL_ENABLE_LDAP
  2318. value: "no"
  2319. # TLS
  2320. - name: POSTGRESQL_ENABLE_TLS
  2321. value: "no"
  2322. # Audit
  2323. - name: POSTGRESQL_LOG_HOSTNAME
  2324. value: "false"
  2325. - name: POSTGRESQL_LOG_CONNECTIONS
  2326. value: "false"
  2327. - name: POSTGRESQL_LOG_DISCONNECTIONS
  2328. value: "false"
  2329. - name: POSTGRESQL_PGAUDIT_LOG_CATALOG
  2330. value: "off"
  2331. # Others
  2332. - name: POSTGRESQL_CLIENT_MIN_MESSAGES
  2333. value: "error"
  2334. - name: POSTGRESQL_SHARED_PRELOAD_LIBRARIES
  2335. value: "pgaudit"
  2336. ports:
  2337. - name: tcp-postgresql
  2338. containerPort: 5432
  2339. livenessProbe:
  2340. failureThreshold: 6
  2341. initialDelaySeconds: 30
  2342. periodSeconds: 10
  2343. successThreshold: 1
  2344. timeoutSeconds: 5
  2345. exec:
  2346. command:
  2347. - /bin/sh
  2348. - -c
  2349. - exec pg_isready -U "bn_mastodon" -d "dbname=bitnami_mastodon" -h 127.0.0.1 -p 5432
  2350. readinessProbe:
  2351. failureThreshold: 6
  2352. initialDelaySeconds: 5
  2353. periodSeconds: 10
  2354. successThreshold: 1
  2355. timeoutSeconds: 5
  2356. exec:
  2357. command:
  2358. - /bin/sh
  2359. - -c
  2360. - -e
  2361. - |
  2362. exec pg_isready -U "bn_mastodon" -d "dbname=bitnami_mastodon" -h 127.0.0.1 -p 5432
  2363. [ -f /opt/bitnami/postgresql/tmp/.initialized ] || [ -f /bitnami/postgresql/.initialized ]
  2364. resources:
  2365. limits: {}
  2366. requests:
  2367. cpu: 250m
  2368. memory: 256Mi
  2369. volumeMounts:
  2370. - name: dshm
  2371. mountPath: /dev/shm
  2372. - name: data
  2373. mountPath: /bitnami/postgresql
  2374. volumes:
  2375. - name: dshm
  2376. emptyDir:
  2377. medium: Memory
  2378. volumeClaimTemplates:
  2379. - metadata:
  2380. name: data
  2381. spec:
  2382. accessModes:
  2383. - "ReadWriteOnce"
  2384. resources:
  2385. requests:
  2386. storage: "8Gi"
  2387. storageClassName: longhorn
  2388. ---
  2389. # Source: mastodon/charts/redis/templates/master/application.yaml
  2390. apiVersion: apps/v1
  2391. kind: StatefulSet
  2392. metadata:
  2393. name: mastodon-redis-master
  2394. namespace: "mastodon"
  2395. labels:
  2396. app.kubernetes.io/name: redis
  2397. helm.sh/chart: redis-17.4.3
  2398. app.kubernetes.io/instance: mastodon
  2399. app.kubernetes.io/managed-by: Helm
  2400. app.kubernetes.io/component: master
  2401. spec:
  2402. replicas: 1
  2403. selector:
  2404. matchLabels:
  2405. app.kubernetes.io/name: redis
  2406. app.kubernetes.io/instance: mastodon
  2407. app.kubernetes.io/component: master
  2408. serviceName: mastodon-redis-headless
  2409. updateStrategy:
  2410. type: RollingUpdate
  2411. template:
  2412. metadata:
  2413. labels:
  2414. app.kubernetes.io/name: redis
  2415. helm.sh/chart: redis-17.4.3
  2416. app.kubernetes.io/instance: mastodon
  2417. app.kubernetes.io/managed-by: Helm
  2418. app.kubernetes.io/component: master
  2419. annotations:
  2420. checksum/configmap: 2f15040384162155f37c5089d1a10352963784fb168a605b339e88c8642e7001
  2421. checksum/health: 0b8c4cf2e9643861c68f5ce94dc34b6497ef911db5da1c59f51d5f172a4b98dd
  2422. checksum/scripts: aaa87d91cbed3dc312c3e5b1dab72400a783834667c43a4d19bba0b89be86c63
  2423. checksum/secret: 7ad58554d69c8ec88bb5547ce91a036e9612e1db4e16b5faad3181c162e3f776
  2424. spec:
  2425. securityContext:
  2426. fsGroup: 1001
  2427. serviceAccountName: mastodon-redis
  2428. affinity:
  2429. podAffinity:
  2430. podAntiAffinity:
  2431. preferredDuringSchedulingIgnoredDuringExecution:
  2432. - podAffinityTerm:
  2433. labelSelector:
  2434. matchLabels:
  2435. app.kubernetes.io/name: redis
  2436. app.kubernetes.io/instance: mastodon
  2437. app.kubernetes.io/component: master
  2438. topologyKey: kubernetes.io/hostname
  2439. weight: 1
  2440. nodeAffinity:
  2441. terminationGracePeriodSeconds: 30
  2442. containers:
  2443. - name: redis
  2444. image: docker.io/bitnami/redis:7.0.8-debian-11-r0
  2445. imagePullPolicy: "IfNotPresent"
  2446. securityContext:
  2447. runAsUser: 1001
  2448. command:
  2449. - /bin/bash
  2450. args:
  2451. - -c
  2452. - /opt/bitnami/scripts/start-scripts/start-master.sh
  2453. env:
  2454. - name: BITNAMI_DEBUG
  2455. value: "false"
  2456. - name: REDIS_REPLICATION_MODE
  2457. value: master
  2458. - name: ALLOW_EMPTY_PASSWORD
  2459. value: "no"
  2460. - name: REDIS_PASSWORD
  2461. valueFrom:
  2462. secretKeyRef:
  2463. name: mastodon-redis
  2464. key: redis-password
  2465. - name: REDIS_TLS_ENABLED
  2466. value: "no"
  2467. - name: REDIS_PORT
  2468. value: "6379"
  2469. ports:
  2470. - name: redis
  2471. containerPort: 6379
  2472. livenessProbe:
  2473. initialDelaySeconds: 20
  2474. periodSeconds: 5
  2475. # One second longer than command timeout should prevent generation of zombie processes.
  2476. timeoutSeconds: 6
  2477. successThreshold: 1
  2478. failureThreshold: 5
  2479. exec:
  2480. command:
  2481. - sh
  2482. - -c
  2483. - /health/ping_liveness_local.sh 5
  2484. readinessProbe:
  2485. initialDelaySeconds: 20
  2486. periodSeconds: 5
  2487. timeoutSeconds: 2
  2488. successThreshold: 1
  2489. failureThreshold: 5
  2490. exec:
  2491. command:
  2492. - sh
  2493. - -c
  2494. - /health/ping_readiness_local.sh 1
  2495. resources:
  2496. limits: {}
  2497. requests: {}
  2498. volumeMounts:
  2499. - name: start-scripts
  2500. mountPath: /opt/bitnami/scripts/start-scripts
  2501. - name: health
  2502. mountPath: /health
  2503. - name: redis-data
  2504. mountPath: /data
  2505. - name: config
  2506. mountPath: /opt/bitnami/redis/mounted-etc
  2507. - name: redis-tmp-conf
  2508. mountPath: /opt/bitnami/redis/etc/
  2509. - name: tmp
  2510. mountPath: /tmp
  2511. volumes:
  2512. - name: start-scripts
  2513. configMap:
  2514. name: mastodon-redis-scripts
  2515. defaultMode: 0755
  2516. - name: health
  2517. configMap:
  2518. name: mastodon-redis-health
  2519. defaultMode: 0755
  2520. - name: config
  2521. configMap:
  2522. name: mastodon-redis-configuration
  2523. - name: redis-tmp-conf
  2524. emptyDir: {}
  2525. - name: tmp
  2526. emptyDir: {}
  2527. volumeClaimTemplates:
  2528. - metadata:
  2529. name: redis-data
  2530. labels:
  2531. app.kubernetes.io/name: redis
  2532. app.kubernetes.io/instance: mastodon
  2533. app.kubernetes.io/component: master
  2534. spec:
  2535. accessModes:
  2536. - "ReadWriteOnce"
  2537. resources:
  2538. requests:
  2539. storage: "8Gi"
  2540. storageClassName: longhorn
  2541. ---
  2542. # Source: mastodon/charts/minio/templates/provisioning-job.yaml
  2543. apiVersion: batch/v1
  2544. kind: Job
  2545. metadata:
  2546. name: mastodon-minio-provisioning
  2547. namespace: "mastodon"
  2548. labels:
  2549. app.kubernetes.io/name: minio
  2550. helm.sh/chart: minio-12.0.0
  2551. app.kubernetes.io/instance: mastodon
  2552. app.kubernetes.io/managed-by: Helm
  2553. app.kubernetes.io/component: minio-provisioning
  2554. annotations:
  2555. helm.sh/hook: post-install,post-upgrade
  2556. helm.sh/hook-delete-policy: before-hook-creation
  2557. spec:
  2558. parallelism: 1
  2559. template:
  2560. metadata:
  2561. labels:
  2562. app.kubernetes.io/managed-by: Helm
  2563. helm.sh/chart: minio-12.0.0
  2564. app.kubernetes.io/component: minio-provisioning
  2565. spec:
  2566. restartPolicy: OnFailure
  2567. terminationGracePeriodSeconds: 0
  2568. securityContext:
  2569. fsGroup: 1001
  2570. serviceAccountName: mastodon-minio
  2571. initContainers:
  2572. - name: wait-for-available-minio
  2573. image: docker.io/bitnami/minio:2023.1.12-debian-11-r0
  2574. imagePullPolicy: "IfNotPresent"
  2575. securityContext:
  2576. runAsNonRoot: true
  2577. runAsUser: 1001
  2578. command:
  2579. - /bin/bash
  2580. - -c
  2581. - >-
  2582. set -e;
  2583. echo "Waiting for Minio";
  2584. wait-for-port \
  2585. --host=mastodon-minio \
  2586. --state=inuse \
  2587. --timeout=120 \
  2588. 80;
  2589. echo "Minio is available";
  2590. resources:
  2591. limits: {}
  2592. requests: {}
  2593. containers:
  2594. - name: minio
  2595. image: docker.io/bitnami/minio:2023.1.12-debian-11-r0
  2596. imagePullPolicy: "IfNotPresent"
  2597. securityContext:
  2598. runAsNonRoot: true
  2599. runAsUser: 1001
  2600. command:
  2601. - /bin/bash
  2602. - -c
  2603. - >-
  2604. set -e;
  2605. echo "Start Minio provisioning";
  2606. function addPolicy() {
  2607. local tmp=$(mc admin $1 info provisioning $2 | sed -n -e 's/^Policy.*: \(.*\)$/\1/p');
  2608. IFS=',' read -r -a CURRENT_POLICIES <<< "$tmp";
  2609. if [[ ! "${CURRENT_POLICIES[*]}" =~ "$3" ]]; then
  2610. mc admin policy update provisioning $3 $1=$2;
  2611. fi;
  2612. };
  2613. function addUsersFromFile() {
  2614. local username=$(grep -oP '^username=\K.+' $1);
  2615. local password=$(grep -oP '^password=\K.+' $1);
  2616. local disabled=$(grep -oP '^disabled=\K.+' $1);
  2617. local policies_list=$(grep -oP '^policies=\K.+' $1);
  2618. local set_policies=$(grep -oP '^setPolicies=\K.+' $1);
  2619. mc admin user add provisioning "${username}" "${password}";
  2620. if [ "${set_policies}" == "true" ]; then
  2621. mc admin policy set provisioning "${policies_list}" user="${username}";
  2622. else
  2623. IFS=',' read -r -a POLICIES <<< "${policies_list}";
  2624. for policy in "${POLICIES[@]}"; do
  2625. addPolicy user "${username}" "${policy}";
  2626. done
  2627. fi;
  2628. local user_status="enable";
  2629. if [[ "${disabled}" != "" && "${disabled,,}" == "true" ]]; then
  2630. user_status="disable";
  2631. fi;
  2632. mc admin user "${user_status}" provisioning "${username}";
  2633. };
  2634. mc alias set provisioning $MINIO_SCHEME://mastodon-minio:80 $MINIO_ROOT_USER $MINIO_ROOT_PASSWORD;
  2635. mc admin service restart provisioning;
  2636. mc anonymous set download provisioning/s3storage;
  2637. echo "End Minio provisioning";
  2638. env:
  2639. - name: MINIO_SCHEME
  2640. value: "http"
  2641. - name: MINIO_ROOT_USER
  2642. valueFrom:
  2643. secretKeyRef:
  2644. name: mastodon-minio
  2645. key: root-user
  2646. - name: MINIO_ROOT_PASSWORD
  2647. valueFrom:
  2648. secretKeyRef:
  2649. name: mastodon-minio
  2650. key: root-password
  2651. envFrom:
  2652. resources:
  2653. limits: {}
  2654. requests: {}
  2655. volumeMounts:
  2656. - name: minio-provisioning
  2657. mountPath: /etc/ilm
  2658. volumes:
  2659. - name: minio-provisioning
  2660. configMap:
  2661. name: mastodon-minio-provisioning
  2662. ---
  2663. # Source: mastodon/templates/init-job/init-job.yaml
  2664. apiVersion: batch/v1
  2665. kind: Job
  2666. metadata:
  2667. name: mastodon-init
  2668. namespace: mastodon
  2669. labels:
  2670. app.kubernetes.io/name: mastodon
  2671. helm.sh/chart: mastodon-1.0.1
  2672. app.kubernetes.io/instance: mastodon
  2673. app.kubernetes.io/managed-by: Helm
  2674. app.kubernetes.io/part-of: mastodon
  2675. annotations:
  2676. helm.sh/hook: post-install, pre-upgrade
  2677. helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
  2678. helm.sh/hook-weight: "10"
  2679. spec:
  2680. backoffLimit: 10
  2681. template:
  2682. metadata:
  2683. labels:
  2684. app.kubernetes.io/name: mastodon
  2685. helm.sh/chart: mastodon-1.0.1
  2686. app.kubernetes.io/instance: mastodon
  2687. app.kubernetes.io/managed-by: Helm
  2688. app.kubernetes.io/component: init
  2689. spec:
  2690. restartPolicy: OnFailure
  2691. securityContext:
  2692. fsGroup: 1001
  2693. seccompProfile:
  2694. type: RuntimeDefault
  2695. containers:
  2696. # We separate the job in multiple containers to be able to run them in parallel. We put everything on the same job
  2697. # as it follows the Job Pattern best practices
  2698. # https://kubernetes.io/docs/concepts/workloads/controllers/job/#job-patterns
  2699. - name: migrate-and-create-admin
  2700. image: docker.io/bitnami/mastodon:4.0.2-debian-11-r18
  2701. imagePullPolicy: IfNotPresent
  2702. command:
  2703. - /bin/bash
  2704. - -ec
  2705. args:
  2706. - /scripts/migrate-and-create-admin.sh
  2707. securityContext:
  2708. allowPrivilegeEscalation: false
  2709. capabilities:
  2710. drop:
  2711. - ALL
  2712. readOnlyRootFilesystem: false
  2713. runAsNonRoot: true
  2714. runAsUser: 1001
  2715. env:
  2716. - name: BITNAMI_DEBUG
  2717. value: "false"
  2718. - name: MASTODON_DATABASE_PASSWORD
  2719. valueFrom:
  2720. secretKeyRef:
  2721. name: mastodon-postgresql
  2722. key: "password"
  2723. # The rake db:migrate job requires access to Redis
  2724. - name: MASTODON_REDIS_PASSWORD
  2725. valueFrom:
  2726. secretKeyRef:
  2727. name: mastodon-redis
  2728. key: "redis-password"
  2729. envFrom:
  2730. - configMapRef:
  2731. name: mastodon-default
  2732. - secretRef:
  2733. name: mastodon-default
  2734. volumeMounts:
  2735. - name: scripts
  2736. mountPath: /scripts
  2737. resources:
  2738. limits: {}
  2739. requests: {}
  2740. - name: mastodon-assets-precompile
  2741. image: docker.io/bitnami/mastodon:4.0.2-debian-11-r18
  2742. imagePullPolicy: IfNotPresent
  2743. command:
  2744. - /bin/bash
  2745. - -ec
  2746. args:
  2747. - /scripts/precompile-assets.sh
  2748. securityContext:
  2749. allowPrivilegeEscalation: false
  2750. capabilities:
  2751. drop:
  2752. - ALL
  2753. readOnlyRootFilesystem: false
  2754. runAsNonRoot: true
  2755. runAsUser: 1001
  2756. env:
  2757. - name: BITNAMI_DEBUG
  2758. value: "false"
  2759. - name: MASTODON_S3_HOSTNAME
  2760. value: "mastodon-minio"
  2761. - name: MASTODON_S3_PORT_NUMBER
  2762. value: "80"
  2763. - name: MASTODON_AWS_ACCESS_KEY_ID
  2764. valueFrom:
  2765. secretKeyRef:
  2766. name: mastodon-minio
  2767. key: "root-user"
  2768. - name: MASTODON_AWS_SECRET_ACCESS_KEY
  2769. valueFrom:
  2770. secretKeyRef:
  2771. name: mastodon-minio
  2772. key: "root-password"
  2773. envFrom:
  2774. - configMapRef:
  2775. name: mastodon-default
  2776. - secretRef:
  2777. name: mastodon-default
  2778. volumeMounts:
  2779. - name: scripts
  2780. mountPath: /scripts
  2781. resources:
  2782. limits: {}
  2783. requests: {}
  2784. volumes:
  2785. - name: scripts
  2786. configMap:
  2787. name: mastodon-init-scripts
  2788. defaultMode: 0755