Skip to content

Commit

Permalink
Merge pull request #9 from 3scale/feature/update-zync-controller
Browse files Browse the repository at this point in the history
Feature/Update zync controller
  • Loading branch information
slopezz authored Jun 29, 2020
2 parents 51e4eea + c58ebb5 commit 3f85345
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 60 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ else ifeq (${UNAME}, Darwin)
INPLACE_SED=sed -i ""
endif

TAG ?= v0.3.0
TAG ?= v0.3.1
REGISTRY ?= quay.io
ORG ?= 3scale
PROJECT ?= 3scale-saas-operator
Expand Down
2 changes: 0 additions & 2 deletions deploy/crds/saas.3scale.net_v1alpha1_zync_cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,5 @@ spec:
resources:
limits:
cpu: "1"
env:
dbWaitSleepSeconds: 1
que:
replicas: 1
9 changes: 0 additions & 9 deletions deploy/crds/saas.3scale.net_zyncs_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ spec:
env:
type: object
properties:
dbWaitSleepSeconds:
type: integer
description: Sleep delay while waiting for the zync database
railsLogsToStdout:
type: boolean
description: Rails log to std output toggle for zync
railsEnv:
type: string
description: Rails environment for zync
Expand Down Expand Up @@ -137,9 +131,6 @@ spec:
env:
type: object
properties:
railsLogsToStdout:
type: boolean
description: Rails log to std output toggle for zync
railsEnv:
type: string
description: Rails environment for zync
Expand Down
16 changes: 4 additions & 12 deletions docs/zync-crd-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ spec:
vaultPath: secret/data/openshift/dev-example-4-3/3scale-zync
zync:
replicas: 1
env:
dbWaitSleepSeconds: 60
resources:
limits:
cpu: "1"
Expand All @@ -41,9 +39,7 @@ spec:
zync:
replicas: 2
env:
dbWaitSleepSeconds: 10
railsEnv: dev
railsLogsToStdout: true
railsEnv: development
resources:
requests:
cpu: "300m"
Expand All @@ -66,8 +62,7 @@ spec:
que:
replicas: 2
env:
railsEnv: dev
railsLogsToStdout: true
railsEnv: development
resources:
requests:
cpu: "250m"
Expand Down Expand Up @@ -101,9 +96,7 @@ spec:
| `image.tag` | `string` | No | `nightly` | Image tag for zync |
| `image.pullSecretName` | `string` | No | - | Pull secret for private container repository if required |
| `secret.vaultPath` | `string` | Yes | - | Vault path with the zync secrets |
| `zync.env.dbWaitSleepSeconds ` | `int` | No | `30` | Sleep delay while waiting for the zync database |
| `zync.env.railsEnv` | `string` | No | `dev` | Rails environment for zync |
| `zync.env.railsLogsToStdout` | `string` | No | `false` | Rails log to std output toggle for zync |
| `zync.env.railsEnv` | `string` | No | `development` | Rails environment for zync (test/development/production) |
| `zync.replicas` | `int` | No | `2` | Number of replicas for zync |
| `zync.resources.requests.cpu` | `string` | No | `250m` | Override CPU requests for zync |
| `zync.resources.requests.memory` | `string` | No | `250Mi` | Override Memory requests for zync |
Expand All @@ -120,8 +113,7 @@ spec:
| `zync.readinessProbe.successThreshold` | `int` | No | `1` | Override readiness success threshold for zync |
| `zync.readinessProbe.failureThreshold` | `int` | No | `3` | Override readiness failure threshold for zync |
| `que.replicas` | `int` | No | `2` | Number of replicas for zync-que |
| `que.env.railsEnv` | `string` | No | `dev` | Rails environment for zync-que |
| `que.env.railsLogsToStdout` | `string` | No | `false` | Rail log to std output toggle for zync-que |
| `que.env.railsEnv` | `string` | No | `development` | Rails environment for zync-que (test/development/production) |
| `que.resources.requests.cpu` | `string` | No | `250m` | Override CPU requests for zync-que |
| `que.resources.requests.memory` | `string` | No | `250Mi` | Override Memory requests for zync-que |
| `que.resources.limits.cpu` | `string` | No | `750m` | Override CPU limits for zync-que |
Expand Down
11 changes: 4 additions & 7 deletions roles/zync/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ image_name: "quay.io/3scale/zync"
image_tag: "nightly"

## Zync Deployment
zync_replicas: 3
zync_replicas: 2
### Zync Deployment Env
zync_env_rails_log_to_stdout: false
zync_env_rails_env: dev
zync_env_db_wait_sleep_seconds: 30
zync_env_rails_env: "development"
### Zync Deployment Resources
zync_resources_requests_cpu: "250m"
zync_resources_requests_memory: "250Mi"
Expand All @@ -28,10 +26,9 @@ zync_readiness_probe_success_threshold: 1
zync_readiness_probe_failure_threshold: 3

## Zync-Que Deployment
que_replicas: 3
que_replicas: 2
### Zync Deployment Env
que_env_rails_log_to_stdout: false
que_env_rails_env: dev
que_env_rails_env: "development"
### Zync-Que Deployment Resources
que_resources_requests_cpu: "250m"
que_resources_requests_memory: "250Mi"
Expand Down
29 changes: 1 addition & 28 deletions roles/zync/templates/zync-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,6 @@ spec:
imagePullSecrets:
- name: "{{ image.pull_secret_name }}"
{% endif %}
initContainers:
# initContainers > zync-db-svc
- name: zync-db-svc
image: "{{ image.name | default(image_name) }}:{{ image.tag | default(image_tag) }}"
imagePullPolicy: Always
command:
- bash
- -c
- bundle exec sh -c "until rake boot:db; do sleep $SLEEP_SECONDS; done"
## initContainers > zync-db-svc > env
env:
- name: SLEEP_SECONDS
value: "{{ zync.env.db_wait_sleep_seconds | default(zync_env_db_wait_sleep_seconds) }}"
### secret/zync
- name: DATABASE_URL
valueFrom:
secretKeyRef:
key: DB_URL
name: zync
## initContainers > zync-db-svc > resources
resources:
requests:
memory: "{{ zync.resources.requests.memory | default(zync_resources_requests_memory) }}"
cpu: "{{ zync.resources.requests.cpu | default(zync_resources_requests_cpu) }}"
limits:
memory: "{{ zync.resources.limits.memory | default(zync_resources_limits_memory) }}"
cpu: "{{ zync.resources.limits.cpu | default(zync_resources_limits_cpu) }}"
containers:
# containers > zync
- name: zync
Expand Down Expand Up @@ -101,7 +74,7 @@ spec:
## containers > zync > env
env:
- name: RAILS_LOG_TO_STDOUT
value: "{{ zync.env.rails_log_to_stdout | default(zync_env_rails_log_to_stdout) }}"
value: "true"
- name: RAILS_ENV
value: "{{ zync.env.rails_env | default(zync_env_rails_env) }}"
- name: POD_NAME
Expand Down
2 changes: 1 addition & 1 deletion roles/zync/templates/zync-que-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
## containers > zync-que > env
env:
- name: RAILS_LOG_TO_STDOUT
value: "{{ que.env.rails_log_to_stdout | default(que_env_rails_log_to_stdout) }}"
value: "true"
- name: RAILS_ENV
value: "{{ que.env.rails_env | default(que_env_rails_env) }}"
- name: POD_NAME
Expand Down

0 comments on commit 3f85345

Please sign in to comment.