Skip to content

Commit

Permalink
add update functionality with data preservation
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontleon committed Dec 19, 2017
1 parent 9331ae9 commit 5eb4318
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 124 deletions.
57 changes: 29 additions & 28 deletions Dockerfile-canary
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,35 @@ byBuYW1lIGFuZCBsYWJlbCByZXNvdXJjZXMKICAgIHR5cGU6IHN0cmluZwogICAgZGVmYXVsdDog\
bXlzcWwKICAgIHJlcXVpcmVkOiB0cnVlCiAgLSBuYW1lOiBteXNxbF92ZXJzaW9uCiAgICBkZXNj\
cmlwdGlvbjogVmVyc2lvbiBvZiBNeVNRTCB0byBkZXBsb3kKICAgIHR5cGU6IGVudW0KICAgIGVu\
dW06IFsiNS42IiwgIjUuNyJdCiAgICBkZWZhdWx0OiAiNS43IgogICAgcmVxdWlyZWQ6IHRydWUK\
ICAtIG5hbWU6IG15c3FsX2RhdGFiYXNlCiAgICBkZXNjcmlwdGlvbjogVGhlIG5hbWUgb2YgdGhl\
IE15U1FMIGRhdGFiYXNlCiAgICB0eXBlOiBzdHJpbmcKICAgIGRlZmF1bHQ6IGRldmVsCiAgICBy\
ZXF1aXJlZDogdHJ1ZQogIC0gbmFtZTogbXlzcWxfdXNlcgogICAgZGVzY3JpcHRpb246IFVzZXJu\
YW1lIHRoYXQgd2lsbCBiZSB1c2VkIHRvIGNvbm5lY3QgdG8gTXlTUUwKICAgIHR5cGU6IHN0cmlu\
ZwogICAgZGVmYXVsdDogZGV2ZWwKICAgIHJlcXVpcmVkOiB0cnVlCiAgLSBuYW1lOiBteXNxbF9w\
YXNzd29yZAogICAgZGVzY3JpcHRpb246IFBhc3N3b3JkIHRvIGNvbm5lY3QgdG8gTXlTUUwgKGdl\
bmVyYXRlZCBpZiBibGFuaykKICAgIHR5cGU6IHN0cmluZwogICAgcmVxdWlyZWQ6IGZhbHNlCiAg\
ICBkaXNwbGF5X3R5cGU6IH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ICAgICAgY29zdDogJDAuMDAKICAgIHVw\
ZGF0ZXNfdG86CiAgICAgIC0gcHJvZAogICAgcGFyYW1ldGVyczogKl9wYXJhbXMKICAtIG5hbWU6\
IHByb2QKICAgIGRlc2NyaXB0aW9uOiBBIE15U1FMIHNlcnZlciB3aXRoIHBlcnNpc3RlbnQgc3Rv\
cmFnZQogICAgZnJlZTogZmFsc2UKICAgIG1ldGFkYXRhOgogICAgICBkaXNwbGF5TmFtZTogUHJv\
ZHVjdGlvbgogICAgICBsb25nRGVzY3JpcHRpb246IFRoaXMgcGxhbiBwcm92aWRlcyBhIHNpbmds\
ZSBub24tSEEgTXlTUUwgc2VydmVyIHdpdGggMTAgR2lCIG9mIHBlcnNpc3RlbnQgc3RvcmFnZQog\
ICAgICBjb3N0OiAkNS45OSBtb250aGx5CiAgICBwYXJhbWV0ZXJzOiAqX3BhcmFtcwogICAgdXBk\
YXRlc190bzoKICAgICAgLSBkZXYK"


COPY playbooks /opt/apb/actions
Expand Down
57 changes: 29 additions & 28 deletions Dockerfile-latest
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,35 @@ byBuYW1lIGFuZCBsYWJlbCByZXNvdXJjZXMKICAgIHR5cGU6IHN0cmluZwogICAgZGVmYXVsdDog\
bXlzcWwKICAgIHJlcXVpcmVkOiB0cnVlCiAgLSBuYW1lOiBteXNxbF92ZXJzaW9uCiAgICBkZXNj\
cmlwdGlvbjogVmVyc2lvbiBvZiBNeVNRTCB0byBkZXBsb3kKICAgIHR5cGU6IGVudW0KICAgIGVu\
dW06IFsiNS42IiwgIjUuNyJdCiAgICBkZWZhdWx0OiAiNS43IgogICAgcmVxdWlyZWQ6IHRydWUK\
ICAtIG5hbWU6IG15c3FsX2RhdGFiYXNlCiAgICBkZXNjcmlwdGlvbjogVGhlIG5hbWUgb2YgdGhl\
IE15U1FMIGRhdGFiYXNlCiAgICB0eXBlOiBzdHJpbmcKICAgIGRlZmF1bHQ6IGRldmVsCiAgICBy\
ZXF1aX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XNxbC01Ny1yaGVsNycKICBwcm92aWRlckRpc3BsYXlOYW1lOiAiUmVkIEhh\
dCwgSW5jLiIKcGxhbnM6CiAgLSBuYW1lOiBkZXYKICAgIGRlc2NyaXB0aW9uOiBBIE15U1FMIHNl\
cnZlciB3aXRoIGVwaGVtZXJhbCBzdG9yYWdlCiAgICBmcmVlOiB0cnVlCiAgICBkZWZhdWx0OiB0\
cnVlCiAgICBtZXRhZGF0YToKICAgICAgZGlzcGxheU5hbWU6IERldmVsb3BtZW50CiAgICAgIGxv\
bmdEZXNjcmlwdGlvbjogVGhpcyBwbGFuIHByb3ZpZGVzIGEgc2luZ2xlIG5vbi1IQSBNeVNRTCBz\
ZXJ2ZXIgd2l0aG91dCBwZXJzaXN0ZW50IHN0b3JhZ2UKICAgICAgY29zdDogJDAuMDAKICAgIHVw\
ZGF0ZXNfdG86CiAgICAgIC0gcHJvZAogICAgcGFyYW1ldGVyczogKl9wYXJhbXMKICAtIG5hbWU6\
IHByb2QKICAgIGRlc2NyaXB0aW9uOiBBIE15U1FMIHNlcnZlciB3aXRoIHBlcnNpc3RlbnQgc3Rv\
cmFnZQogICAgZnJlZTogZmFsc2UKICAgIG1ldGFkYXRhOgogICAgICBkaXNwbGF5TmFtZTogUHJv\
ZHVjdGlvbgogICAgICBsb25nRGVzY3JpcHRpb246IFRoaXMgcGxhbiBwcm92aWRlcyBhIHNpbmds\
ZSBub24tSEEgTXlTUUwgc2VydmVyIHdpdGggMTAgR2lCIG9mIHBlcnNpc3RlbnQgc3RvcmFnZQog\
ICAgICBjb3N0OiAkNS45OSBtb250aGx5CiAgICBwYXJhbWV0ZXJzOiAqX3BhcmFtcwogICAgdXBk\
YXRlc190bzoKICAgICAgLSBkZXYK"


RUN yum -y install mysql-apb-role && yum clean all
Expand Down
57 changes: 29 additions & 28 deletions Dockerfile-nightly
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,35 @@ byBuYW1lIGFuZCBsYWJlbCByZXNvdXJjZXMKICAgIH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wbGF5TmFtZTogUHJv\
ZHVjdGlvbgogICAgICBsb25nRGVzY3JpcHRpb246IFRoaXMgcGxhbiBwcm92aWRlcyBhIHNpbmds\
ZSBub24tSEEgTXlTUUwgc2VydmVyIHdpdGggMTAgR2lCIG9mIHBlcnNpc3RlbnQgc3RvcmFnZQog\
ICAgICBjb3N0OiAkNS45OSBtb250aGx5CiAgICBwYXJhbWV0ZXJzOiAqX3BhcmFtcwogICAgdXBk\
YXRlc190bzoKICAgICAgLSBkZXYK"


RUN yum -y install mysql-apb-role && yum clean all
Expand Down
27 changes: 5 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,16 @@ There are 2 plans available:

You need to provide the OpenShift API URL and authentication token, as well as the target namespace:

openshift_url=https://my.openshift.example.com:8443
token=$(oc whoami -t)
namespace="myproject"

With that you can:

docker run -e "OPENSHIFT_TARGET=$openshift_url" \
-e "OPENSHIFT_TOKEN=$token" \
-e "namespace=$namespace" \
ansibleplaybookbundle/mysql-apb provision
docker run --rm --net=host -v $HOME/.kube:/opt/apb/.kube:z -u $UID docker.io/ansibleplaybookbundle/mysql-apb provision

You can pass additional parameters to `ansible-playbook` by adding them at the end; for example, you can request more verbose output with one or more `-v` and pass additional variables with `--extra-vars`.

For example, this will request a *prod* plan and specify a custom database name and volume size:

docker run -e "OPENSHIFT_TARGET=$openshift_url" \
-e "OPENSHIFT_TOKEN=$token" \
-e "namespace=$namespace" \
ansibleplaybookbundle/rhscl-mysql-apb provision \
--extra-vars mysql_database=prod \
--extra-vars _apb_plan_id=prod \
--extra-vars volume_size=2Gi
docker run --rm --net=host -v $HOME/.kube:/opt/apb/.kube:z -u $UID docker.io/ansibleplaybookbundle/mysql-apb provision \
--extra-vars mysql_database=prod --extra-vars _apb_plan_id=prod --extra-vars volume_size=2Gi


## Tearing down the application

docker run -e "OPENSHIFT_TARGET=$openshift_url" \
-e "OPENSHIFT_TOKEN=$token" \
-e "namespace=$namespace" \
--extra-vars _apb_plan_id=prod \
ansibleplaybookbundle/rhscl-mysql-apb deprovision
docker run --rm --net=host -v $HOME/.kube:/opt/apb/.kube:z -u $UID docker.io/ansibleplaybookbundle/mysql-apb deprovision
5 changes: 5 additions & 0 deletions apb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ _params: &_params
enum: ["5.6", "5.7"]
default: "5.7"
required: true
updatable: true
- name: mysql_database
description: The name of the MySQL database
type: string
Expand Down Expand Up @@ -54,6 +55,8 @@ plans:
displayName: Development
longDescription: This plan provides a single non-HA MySQL server without persistent storage
cost: $0.00
updates_to:
- prod
parameters: *_params
- name: prod
description: A MySQL server with persistent storage
Expand All @@ -63,3 +66,5 @@ plans:
longDescription: This plan provides a single non-HA MySQL server with 10 GiB of persistent storage
cost: $5.99 monthly
parameters: *_params
updates_to:
- dev
12 changes: 12 additions & 0 deletions playbooks/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: mysql-apb playbook to provision the application
hosts: localhost
gather_facts: false
connection: local
vars:
update: true
roles:
- role: ansible.kubernetes-modules
install_python_requirements: no
- role: ansibleplaybookbundle.asb-modules
- role: rhscl-mysql-apb-openshift
playbook_debug: false
1 change: 0 additions & 1 deletion roles/rhscl-mysql-apb-openshift/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ volume_size: "{{ lookup('env','VOLUME_SIZE') | default('10Gi', true) }}"
mysql_user: "{{ lookup('env','MYSQL_USER') | default('devel', true) }}"
mysql_database: "{{ lookup('env','MYSQL_DATABASE') | default('devel', true) }}"
mysql_version: "{{ lookup('env','MYSQL_VERSION') | default('5.7', true) }}"
mysql_password: "{{ lookup('password', '/tmp/pass chars=ascii_letters,digits') }}"
image: "registry.access.redhat.com/rhscl/mysql-{{ mysql_version | replace('.', '')}}-rhel7"
state: present
8 changes: 4 additions & 4 deletions roles/rhscl-mysql-apb-openshift/tasks/dev.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
- name: set MySQL deployment with ephemeral storage to {{ state }}
openshift_v1_deployment_config:
name: "{{ service_name }}"
name: "{{ service_name }}-{{ mysql_version }}-{{ _apb_plan_id }}"
namespace: "{{ namespace }}"
labels:
app: rhscl-mysql-apb
service: "{{ service_name }}"
service: "{{ service_name }}-{{ mysql_version }}-{{ _apb_plan_id }}"
replicas: 1
selector:
app: rhscl-mysql-apb
service: "{{ service_name }}"
service: "{{ service_name }}-{{ mysql_version }}-{{ _apb_plan_id }}"
spec_template_metadata_labels:
app: rhscl-mysql-apb
service: "{{ service_name }}"
service: "{{ service_name }}-{{ mysql_version }}-{{ _apb_plan_id }}"
containers:
- name: mysql
image: "{{ image }}"
Expand Down
Loading

0 comments on commit 5eb4318

Please sign in to comment.