Update README

Add default action
Use yml file extension
This commit is contained in:
Sam Doran 2017-07-13 11:35:50 -04:00
parent 48d7f6d314
commit ef2632b6a8
5 changed files with 85 additions and 24 deletions

38
README.md Normal file
View File

@ -0,0 +1,38 @@
K8S MariaDB
=========
[![Galaxy](https://img.shields.io/badge/galaxy-tripleo.k8s--mariadb-blue.svg?style=flat)](https://galaxy.ansible.com/tripleo/k8s-mariadb)
[![Build Status](https://travis-ci.org/tripleo/ansible-role-k8s-mariadb.svg?branch=master)](https://travis-ci.org/tripleo/ansible-role-k8s-mariadb)
Install MariaDB in a Kubernetes cluster.
Requirements
------------
Access to Kubernetes cluster
Role Variables
--------------
| Name | Default Value | Description |
|-------------------|---------------------|----------------------|
| `core_host` | `https://rhev-i32c-03.mpc.lab.eng.bos.redhat.com:6443` | |
| `kube_context` | `kubernetes-admin@kubernetes` | |
| `config_file` | `/root/.kube/config` | |
Dependencies
------------
- `ansible.kubernetes-modules`
Example Playbook
----------------
- hosts: all
roles:
- tripleo.k8s-mariadb
License
-------
MIT

View File

@ -1,3 +0,0 @@
coe_host: "https://rhev-i32c-03.mpc.lab.eng.bos.redhat.com:6443"
kube_context: "kubernetes-admin@kubernetes"
config_file: /root/.kube/config

4
defaults/main.yml Normal file
View File

@ -0,0 +1,4 @@
coe_host: https://rhev-i32c-03.mpc.lab.eng.bos.redhat.com:6443
kube_context: kubernetes-admin@kubernetes
config_file: /root/.kube/config
action: provision

20
meta/main.yml Normal file
View File

@ -0,0 +1,20 @@
galaxy_info:
author: Sam Doran, Flavio Percoco
description:
company: Red Hat
license: MIT
min_ansible_version: 2.3
platforms:
- name: EL
versions:
- 7
galaxy_tags:
- openstack
- kubernetes
- mysql
- database
- mariadb
dependencies: []

View File

@ -1,15 +1,15 @@
- name: Create mariadb configmaps - name: Create mariadb configmaps
ignore_errors: yes ignore_errors: yes
k8s_v1_config_map: k8s_v1_config_map:
host: "{{coe_host}}" host: "{{coe_host}}"
context: "{{kube_context}}" context: "{{kube_context}}"
kubeconfig: "{{config_file}}" kubeconfig: "{{config_file}}"
name: mariadb name: mariadb
namespace: openstack namespace: openstack
state: present state: present
debug: yes debug: yes
labels: labels:
service: mariadb service: mariadb
data: data:
kolla-config: | kolla-config: |
{ {
@ -20,48 +20,50 @@
[mysqld] [mysqld]
pid-file=/var/lib/mysql/mariadb.pid pid-file=/var/lib/mysql/mariadb.pid
- name: Create mariadb service - name: Create mariadb service
k8s_v1_service: k8s_v1_service:
host: "{{coe_host}}" host: "{{coe_host}}"
context: "{{kube_context}}" context: "{{kube_context}}"
kubeconfig: "{{config_file}}" kubeconfig: "{{config_file}}"
name: mariadb name: mariadb
namespace: openstack namespace: openstack
state: present state: present
ports: ports:
- port: 3306 - port: 3306
name: db name: db
selector: selector:
app: mariadb app: mariadb
labels: labels:
app: mariadb app: mariadb
debug: yes debug: yes
annotations: annotations:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "false" service.alpha.kubernetes.io/tolerate-unready-endpoints: "false"
register: create_service register: create_service
- debug: var=create_service - debug:
var: create_service
verbose: 2
- name: Create mariadb deployment - name: Create mariadb deployment
k8s_v1beta1_stateful_set: k8s_v1beta1_stateful_set:
host: "{{coe_host}}" host: "{{coe_host}}"
context: "{{kube_context}}" context: "{{kube_context}}"
kubeconfig: "{{config_file}}" kubeconfig: "{{config_file}}"
name: mariadb name: mariadb
namespace: openstack namespace: openstack
state: present state: present
debug: yes debug: yes
spec_service_name: mariadb spec_service_name: mariadb
spec_template_metadata_name: mariadb spec_template_metadata_name: mariadb
spec_template_metadata_labels: spec_template_metadata_labels:
app: mariadb app: mariadb
galera: enabled galera: enabled
containers: containers:
- name: mariadb - name: mariadb
image: tripleoupstream/centos-binary-mariadb image: tripleoupstream/centos-binary-mariadb
ports: ports:
- container_port: 3306 - container_port: 3306
- container_port: 4567 - container_port: 4567
- container_port: 4444 - container_port: 4444
env: env:
- name: KOLLA_CONFIG_STRATEGY - name: KOLLA_CONFIG_STRATEGY
@ -129,9 +131,9 @@
config_map: config_map:
name: mariadb name: mariadb
items: items:
- key: server-cnf - key: server-cnf
path: server.cnf path: server.cnf
register: create_deployment register: create_deployment
tags: tags:
- statefulset - statefulset