+++ /dev/null
----
-# Copyright 2019 Nokia
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# cmframework.requires: kubedns.yaml
-- hosts: caas_master
- strategy: free
- become: true
- become_user: "{{ users.admin_user_name }}"
- roles:
- - role: kubernetes_ceph
- when: (ceph_configured | default(False))
+++ /dev/null
----
-# Copyright 2019 Nokia
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-auth_tokens:
- - name: admin
- secret_name: ceph-admin
- namespace: kube-system
- - name: caas
- secret_name: ceph-user
- namespace: kube-system
- - name: caas
- secret_name: ceph-user
- namespace: default
+++ /dev/null
----
-# Copyright 2019 Nokia
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-dependencies:
- - role: manifests
+++ /dev/null
----
-# Copyright 2019 Nokia
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
- - name: get auth token
- become: true
- become_user: root
- shell: "ceph auth -f json get client.{{ token.name }}"
- register: get_auth_token
-
- - name: extract auth token
- set_fact:
- ceph_auth_token: "{{ get_auth_token.stdout | from_json | map(attribute='key') | first }}"
-
- - name: template secret manifest
- template:
- src: ceph-secret.yaml.j2
- dest: "{{ caas.manifests_directory }}/ceph-{{ token.name }}-secret.yaml"
- vars:
- name: "{{ token.name }}"
- namespace: "{{ token.namespace }}"
-
- - name: create ceph-{{ token.name }} secret
- kubectl:
- manifest: "{{ caas.manifests_directory }}/ceph-{{ token.name }}-secret.yaml"
- state: present
- when: ( nodename | search("caas_master1") )
+++ /dev/null
----
-# Copyright 2019 Nokia
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
- - name: get ceph mons
- become: true
- become_user: root
- shell: "ceph mon dump -f json"
- register: get_ceph_mons
-
- - name: parse mons command output
- set_fact:
- ceph_mons_dump: "{{ get_ceph_mons.stdout | from_json }}"
- - name: assemble mons list string
- set_fact:
- ceph_mons_list: "{{ ceph_mons_dump.mons | map(attribute='addr') | join(',')}}"
-
- - name: get auth tokens
- set_fact:
- ceph_admin_token: "{{ auth_tokens | selectattr('name', 'search', 'admin') | first }}"
- ceph_user_token: "{{ auth_tokens | selectattr('name', 'search', 'caas') | first }}"
-
- - name: template storage class manifets
- template:
- src: ceph-storageclass.yaml.j2
- dest: "{{ caas.manifests_directory }}/ceph-storageclass.yaml"
- vars:
- name: ceph-storage-class
- pool: caas
-
- - name: create kubernetes storage class
- kubectl:
- manifest: "{{ caas.manifests_directory }}/ceph-storageclass.yaml"
- state: present
- when: ( nodename | search("caas_master1") )
+++ /dev/null
----
-# Copyright 2019 Nokia
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
- - name: create kubernetes secret for Ceph auth tokens
- include_tasks: create_ceph_auth_secret.yaml
- with_items: "{{ auth_tokens }}"
- loop_control:
- loop_var: token
-
- - name: create kubernetes storage class
- import_tasks: create_ceph_storage_class.yaml
+++ /dev/null
-{#
-Copyright 2019 Nokia
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-#}
----
-apiVersion: v1
-kind: Secret
-metadata:
- name: ceph-{{ name }}
- namespace: {{ namespace }}
-type: kubernetes.io/rbd
-data:
- key: {{ ceph_auth_token | b64encode }}
+++ /dev/null
-{#
-Copyright 2019 Nokia
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-#}
----
-kind: StorageClass
-apiVersion: storage.k8s.io/v1
-metadata:
- annotations:
- storageclass.kubernetes.io/is-default-class: "true"
- name: "{{ name }}"
-provisioner: kubernetes.io/rbd
-parameters:
- monitors: "{{ ceph_mons_list }}"
- adminId: "{{ ceph_admin_token.name }}"
- adminSecretName: "ceph-{{ ceph_admin_token.name }}"
- adminSecretNamespace: "{{ ceph_admin_token.namespace }}"
- pool: "{{ pool }}"
- userId: "{{ ceph_user_token.name }}"
- userSecretName: "ceph-{{ ceph_user_token.name }}"
- fsType: ext4
- imageFormat: "2"
- imageFeatures: "layering"
-reclaimPolicy: Retain
-mountOptions:
- - debug
%define COMPONENT kubernetes
%define RPM_NAME caas-%{COMPONENT}
%define RPM_MAJOR_VERSION 1.16.2
-%define RPM_MINOR_VERSION 2
+%define RPM_MINOR_VERSION 3
%define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
%define KUBERNETESPAUSE_VERSION 3.1
ln -s %{_playbooks_path}/kube_secret_key_distribution.yaml %{_postconfig_path}/
ln -s %{_playbooks_path}/kube_token_creation.yaml %{_postconfig_path}/
ln -s %{_playbooks_path}/kube_token_distribution.yaml %{_postconfig_path}/
-ln -s %{_playbooks_path}/kubernetes_ceph.yaml %{_postconfig_path}/
ln -s %{_playbooks_path}/master_kube_proxy.yaml %{_postconfig_path}/
ln -s %{_playbooks_path}/master_kubelet.yaml %{_postconfig_path}/
ln -s %{_playbooks_path}/service_account_creation.yaml %{_postconfig_path}/
rm -f %{_postconfig_path}/kube_secret_key_distribution.yaml
rm -f %{_postconfig_path}/kube_token_creation.yaml
rm -f %{_postconfig_path}/kube_token_distribution.yaml
- rm -f %{_postconfig_path}/kubernetes_ceph.yaml
rm -f %{_postconfig_path}/master_kube_proxy.yaml
rm -f %{_postconfig_path}/master_kubelet.yaml
rm -f %{_postconfig_path}/service_account_creation.yaml