diff --git a/kustomize/base/deployments/calert.yaml b/kustomize/base/deployments/calert.yaml index 8a049d0..b87210f 100644 --- a/kustomize/base/deployments/calert.yaml +++ b/kustomize/base/deployments/calert.yaml @@ -18,9 +18,10 @@ spec: ports: - containerPort: 6000 volumeMounts: - - mountPath: /etc/calert/ + - mountPath: /etc/calert/config.toml name: config-dir + subPath: config.toml volumes: - name: config-dir configMap: - name: app-config \ No newline at end of file + name: app-config diff --git a/kustomize/base/deployments/redis.yaml b/kustomize/base/deployments/redis.yaml deleted file mode 100644 index c3514a3..0000000 --- a/kustomize/base/deployments/redis.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: redis -spec: - replicas: 1 - selector: - matchLabels: - service: redis - template: - metadata: - labels: - service: redis - spec: - containers: - - name: redis - image: redis:5.0-alpine - ports: - - containerPort: 6379 \ No newline at end of file diff --git a/kustomize/base/kustomization.yaml b/kustomize/base/kustomization.yaml index 10924d7..d275ccb 100644 --- a/kustomize/base/kustomization.yaml +++ b/kustomize/base/kustomization.yaml @@ -1,6 +1,4 @@ resources: - deployments/calert.yaml -- deployments/redis.yaml - services/calert.yaml -- services/redis.yaml namePrefix: calert- diff --git a/kustomize/base/services/redis.yaml b/kustomize/base/services/redis.yaml deleted file mode 100644 index aff39f0..0000000 --- a/kustomize/base/services/redis.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: redis-calert -spec: - selector: - service: redis - tier: cache - ports: - - protocol: TCP - port: 6379 diff --git a/kustomize/build/deploy.yaml b/kustomize/build/deploy.yaml deleted file mode 100644 index 7fedbea..0000000 --- a/kustomize/build/deploy.yaml +++ /dev/null @@ -1,159 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - labels: - env: prod - group: calert - name: calert ---- -apiVersion: v1 -data: - config.toml: | - # All timeouts and durations are in milliseconds. - - [server] - address = ":6000" - socket = "/tmp/calert.sock" - name = "calert" - - # WARNING If these timeouts are less than 1s, - # the server connection breaks. - read_timeout=5000 - write_timeout=5000 - keepalive_timeout=300000 - - [app] - template_file = "message.tmpl" - - [app.http_client] - max_idle_conns = 100 - request_timeout = 8000 - - [app.chat.alertManagerTestRoom] - notification_url = "https://chat.googleapis.com/v1/spaces/xxx/messages?key=abc-xyz&token=token-unique-key%3D" - - [app.chat.awesomeRoomTwo] - notification_url = "https://chat.googleapis.com/v1/spaces/xxx/messages?key=abc-xyz&token=token-unique-key%3D" -kind: ConfigMap -metadata: - labels: - env: prod - group: calert - name: app-config-kf68kdh2b8 - namespace: calert ---- -apiVersion: v1 -kind: Service -metadata: - labels: - env: prod - group: calert - name: calert-redis-calert - namespace: calert -spec: - ports: - - port: 6379 - protocol: TCP - selector: - env: prod - group: calert - service: redis - tier: cache ---- -apiVersion: v1 -kind: Service -metadata: - labels: - env: prod - group: calert - name: calert-service - namespace: calert -spec: - ports: - - port: 6000 - protocol: TCP - selector: - app: calert - env: prod - group: calert - tier: api - type: NodePort ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - env: prod - group: calert - name: calert-app - namespace: calert -spec: - replicas: 1 - selector: - matchLabels: - env: prod - group: calert - service: app - template: - metadata: - labels: - env: prod - group: calert - service: app - tier: api - spec: - containers: - - image: mrkaran/calert:1.8.0-stable - name: calert - ports: - - containerPort: 6000 - resources: - limits: - cpu: 500m - memory: 400Mi - requests: - cpu: 250m - memory: 200Mi - volumeMounts: - - mountPath: /etc/calert/ - name: config-dir - volumes: - - configMap: - name: app-config-kf68kdh2b8 - name: config-dir ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - env: prod - group: calert - name: calert-redis - namespace: calert -spec: - replicas: 1 - selector: - matchLabels: - env: prod - group: calert - service: redis - template: - metadata: - labels: - env: prod - group: calert - service: redis - tier: cache - spec: - containers: - - image: redis:5.0-alpine - name: redis - ports: - - containerPort: 6379 - resources: - limits: - cpu: 300m - memory: 200Mi - requests: - cpu: 150m - memory: 100Mi diff --git a/kustomize/overlays/prod/kustomization.yaml b/kustomize/overlays/prod/kustomization.yaml index 562a961..8e75d3d 100644 --- a/kustomize/overlays/prod/kustomization.yaml +++ b/kustomize/overlays/prod/kustomization.yaml @@ -9,25 +9,11 @@ resources: - ../../base patchesStrategicMerge: - patches/resource-limits.yaml -# - patches/service-calert.yaml - patches/add-labels.yaml images: - name: mrkaran/calert newTag: 1.0.0-stable -# patchesJson6902: -# - target: -# group: apps -# version: v1 -# kind: Deployment -# name: app -# path: patches/add-redis-labels.yaml -# - target: -# group: apps -# version: v1 -# kind: Deployment -# name: app -# path: patches/add-labels.yaml configMapGenerator: - name: app-config files: diff --git a/kustomize/overlays/prod/patches/add-labels.yaml b/kustomize/overlays/prod/patches/add-labels.yaml index 9be5f98..cb7e63d 100644 --- a/kustomize/overlays/prod/patches/add-labels.yaml +++ b/kustomize/overlays/prod/patches/add-labels.yaml @@ -7,13 +7,3 @@ spec: metadata: labels: tier: api ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: redis -spec: - template: - metadata: - labels: - tier: cache diff --git a/kustomize/overlays/prod/patches/resource-limits.yaml b/kustomize/overlays/prod/patches/resource-limits.yaml index 3fe6497..93058de 100644 --- a/kustomize/overlays/prod/patches/resource-limits.yaml +++ b/kustomize/overlays/prod/patches/resource-limits.yaml @@ -14,20 +14,3 @@ spec: limits: memory: "400Mi" cpu: "500m" ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: redis -spec: - template: - spec: - containers: - - name: redis - resources: - requests: - memory: "100Mi" - cpu: "150m" - limits: - memory: "200Mi" - cpu: "300m" \ No newline at end of file