Fix namespace

This commit is contained in:
ant31 2016-01-14 15:19:45 +01:00
parent b769636435
commit 5d61b5e813
4 changed files with 24 additions and 7 deletions

View file

@ -9,6 +9,7 @@
- { role: apps/k8s-elasticsearch, tags: 'elasticsearch' } - { role: apps/k8s-elasticsearch, tags: 'elasticsearch' }
- { role: apps/k8s-memcached, tags: 'memcached' } - { role: apps/k8s-memcached, tags: 'memcached' }
- { role: apps/k8s-redis, tags: 'redis' } - { role: apps/k8s-redis, tags: 'redis' }
- { role: apps/k8s-mongodb-simple, tags: 'mongodb-simple' }
# Msg Broker # Msg Broker
- { role: apps/k8s-rabbitmq, tags: 'rabbitmq' } - { role: apps/k8s-rabbitmq, tags: 'rabbitmq' }
@ -27,3 +28,6 @@
# ETCD # ETCD
- { role: apps/k8s-etcd, tags: 'etcd'} - { role: apps/k8s-etcd, tags: 'etcd'}
# Chat Apps
- { role: apps/k8s-rocketchat, tags: 'rocketchat'}

@ -1 +1 @@
Subproject commit c69c5f881fe414f6856f811b9bb40cd19bcf83f4 Subproject commit 8abd4ec3bcdc5f36d96c312f3a424724520a12b8

View file

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: kube-system

View file

@ -56,15 +56,24 @@
delay: 10 delay: 10
timeout: 60 timeout: 60
- name: Create 'kube-system' namespace - name: copy 'kube-system' namespace manifest
uri: copy: src=namespace.yml dest=/etc/kubernetes/kube-system-ns.yml
url: http://127.0.0.1:{{ kube_apiserver_insecure_port }}/api/v1/namespaces
method: POST
body: "{{namespace_kubesystem|to_json}}"
status_code: 201,409
run_once: yes run_once: yes
when: inventory_hostname == groups['kube-master'][0] when: inventory_hostname == groups['kube-master'][0]
- name: Check if kube-system exists
command: kubectl get ns kube-system
register: 'kubesystem'
changed_when: False
ignore_errors: yes
run_once: yes
- name: Create 'kube-system' namespace
command: kubectl create -f /etc/kubernetes/kube-system-ns.yml
when: kubesystem|failed
changed_when: False
run_once: yes
- name: Write kube-controller-manager manifest - name: Write kube-controller-manager manifest
template: template:
src: manifests/kube-controller-manager.manifest.j2 src: manifests/kube-controller-manager.manifest.j2