質問編集履歴
1
kubernetes設定を追加しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -325,3 +325,151 @@
|
|
325
325
|
COPY . /myapp
|
326
326
|
|
327
327
|
```
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
k8s yaml
|
332
|
+
|
333
|
+
```
|
334
|
+
|
335
|
+
---
|
336
|
+
|
337
|
+
# コンテナ
|
338
|
+
|
339
|
+
apiVersion: apps/v1
|
340
|
+
|
341
|
+
kind: Deployment
|
342
|
+
|
343
|
+
metadata:
|
344
|
+
|
345
|
+
name: mybotapp
|
346
|
+
|
347
|
+
spec:
|
348
|
+
|
349
|
+
replicas: 1
|
350
|
+
|
351
|
+
selector:
|
352
|
+
|
353
|
+
matchLabels:
|
354
|
+
|
355
|
+
app: mybotapp
|
356
|
+
|
357
|
+
template:
|
358
|
+
|
359
|
+
metadata:
|
360
|
+
|
361
|
+
labels:
|
362
|
+
|
363
|
+
app: mybotapp
|
364
|
+
|
365
|
+
spec:
|
366
|
+
|
367
|
+
containers:
|
368
|
+
|
369
|
+
- name: rails-container
|
370
|
+
|
371
|
+
image: rails-app:latest
|
372
|
+
|
373
|
+
imagePullPolicy: Never
|
374
|
+
|
375
|
+
volumeMounts:
|
376
|
+
|
377
|
+
- mountPath: /app/tmp/sockets
|
378
|
+
|
379
|
+
name: web-sock
|
380
|
+
|
381
|
+
- mountPath: /app
|
382
|
+
|
383
|
+
name: src
|
384
|
+
|
385
|
+
command: ["/bin/sh","-c"]
|
386
|
+
|
387
|
+
args: ["bundle exec pumactl start"]
|
388
|
+
|
389
|
+
env:
|
390
|
+
|
391
|
+
- name: TZ
|
392
|
+
|
393
|
+
value: Asia/Tokyo
|
394
|
+
|
395
|
+
- name: nginx-container
|
396
|
+
|
397
|
+
image: nginx:1.13.3
|
398
|
+
|
399
|
+
imagePullPolicy: Never
|
400
|
+
|
401
|
+
ports:
|
402
|
+
|
403
|
+
- name: http-server
|
404
|
+
|
405
|
+
containerPort: 80
|
406
|
+
|
407
|
+
- name: https-server
|
408
|
+
|
409
|
+
containerPort: 443
|
410
|
+
|
411
|
+
volumeMounts:
|
412
|
+
|
413
|
+
- mountPath: /app/tmp/sockets
|
414
|
+
|
415
|
+
name: web-sock
|
416
|
+
|
417
|
+
- mountPath: /maintenance
|
418
|
+
|
419
|
+
name: nginx-maintenance-volume
|
420
|
+
|
421
|
+
#- mountPath: /etc/nginx/params
|
422
|
+
|
423
|
+
# readOnly: true
|
424
|
+
|
425
|
+
# name: nginx-params-config
|
426
|
+
|
427
|
+
imagePullSecrets:
|
428
|
+
|
429
|
+
- name: ap-northeast-1-ecr-registry
|
430
|
+
|
431
|
+
volumes:
|
432
|
+
|
433
|
+
- name: web-assets
|
434
|
+
|
435
|
+
emptyDir: {}
|
436
|
+
|
437
|
+
- name: web-sock
|
438
|
+
|
439
|
+
emptyDir: {}
|
440
|
+
|
441
|
+
- name: nginx-maintenance-volume
|
442
|
+
|
443
|
+
hostPath:
|
444
|
+
|
445
|
+
# 作業者にあわせてパスを変更
|
446
|
+
|
447
|
+
path: $PWD/myapp/public
|
448
|
+
|
449
|
+
type: Directory
|
450
|
+
|
451
|
+
#- name: nginx-params-config
|
452
|
+
|
453
|
+
# configMap:
|
454
|
+
|
455
|
+
# name: nginx-params-config
|
456
|
+
|
457
|
+
# items:
|
458
|
+
|
459
|
+
# - key: ip-allow
|
460
|
+
|
461
|
+
# path: ip-allow
|
462
|
+
|
463
|
+
- name: src
|
464
|
+
|
465
|
+
hostPath:
|
466
|
+
|
467
|
+
# 作業者にあわせてパスを変更
|
468
|
+
|
469
|
+
path: "$PWD/myapp"
|
470
|
+
|
471
|
+
type: DirectoryOrCreate
|
472
|
+
|
473
|
+
コード
|
474
|
+
|
475
|
+
```
|