Skip to content

Commit

Permalink
#820 Node settings
Browse files Browse the repository at this point in the history
  • Loading branch information
fketelaars committed Nov 1, 2024
1 parent 4ba36f3 commit a51b0a2
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@
src: cp4d-container-runtime-config.j2
dest: "{{ status_dir }}/openshift/cp4d-container-runtime-config.yaml"

- include_role:
name: log-deployer-activity
vars:
_p_activity_description: "Create Container Runtime Configuration"
_p_activity_yaml: "{{ status_dir }}/openshift/cp4d-container-runtime-config.yaml"

- name: Apply Container Runtime configuration
shell: oc apply -f {{ status_dir }}/openshift/cp4d-container-runtime-config.yaml
shell: |
oc apply -f {{ status_dir }}/openshift/cp4d-container-runtime-config.yaml
when: not cpd_dry_run
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,27 @@
- name: Delete KubeletConfig cpd-crio-kubeletconfig if it exists
shell: |
oc delete KubeletConfig cpd-crio-kubeletconfig --ignore-not-found
when: not cpd_dry_run

- name: Create KubeletConfig yaml
template:
src: cp4d-kubeletconfig.j2
dest: "{{ status_dir }}/openshift/cp4d-kubeletconfig.yaml"

- include_role:
name: log-deployer-activity
vars:
_p_activity_description: "Create KubeletConfig"
_p_activity_yaml: "{{ status_dir }}/openshift/cp4d-kubeletconfig.yaml"

- name: Create KubeletConfig {{ kubelet_config_name }}
shell: oc apply -f {{ status_dir }}/openshift/cp4d-kubeletconfig.yaml
shell: |
oc apply -f {{ status_dir }}/openshift/cp4d-kubeletconfig.yaml
when: not cpd_dry_run

- name: Label worker machine config pool to allow KubeletConfig
shell: oc label machineconfigpool worker db2u-kubelet=sysctl --overwrite
when: _existing_ocp_infra_type != 'aws-rosa'
shell: |
oc label machineconfigpool worker db2u-kubelet=sysctl --overwrite
when:
- _existing_ocp_infra_type != 'aws-rosa'
- not cpd_dry_run
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
src: cp4d-apply-kubelet-config.j2
dest: "{{ status_dir }}/openshift/cp4d-apply-kubelet-config.sh"

- include_role:
name: log-deployer-activity
vars:
_p_activity_description: "Create KubeletConfig for cluster without MCO"
_p_activity_script: "{{ status_dir }}/openshift/cp4d-apply-kubelet-config.sh"

- name: Put cp4d-apply-kubelet-config.sh script into config map
shell:
oc set data -n kube-system cm/cloud-pak-node-fix-scripts \
--from-file={{ status_dir }}/openshift/cp4d-apply-kubelet-config.sh
--from-file={{ status_dir }}/openshift/cp4d-apply-kubelet-config.sh
when: not cpd_dry_run
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
--mem-limit {{ _compute_node_memory_gb }} \
-f {{ status_dir }}/openshift/cp4d-tuned.yaml
- include_role:
name: log-deployer-activity
vars:
_p_activity_description: "Create Tuned resource"
_p_activity_yaml: "{{ status_dir }}/openshift/cp4d-tuned.yaml"

- name: Create Tuned cp4d_ipc
shell: |
oc apply -f {{ status_dir }}/openshift/cp4d-tuned.yaml
oc apply -f {{ status_dir }}/openshift/cp4d-tuned.yaml
when: not cpd_dry_run
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@

- name: Uninstall scheduling service from project {{ _scheduler_project }}
shell: |
{{ _delete_scheduluer_command }}
{{ _delete_scheduler_command }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
- name: Write deployer script file to {{ status_dir }}/log/deployer-actitivies.log
blockinfile:
path: "{{ status_dir }}/log/deployer-actitivies.log"
create: True
insertafter: EOF
marker: ""
block: |
# ---
#
# Activity timestamp: {{ now(utc=true,fmt='%Y-%m-%d %H:%M:%S') }}
# Deployer activity: {{ _deployer_activity_sequence }}
# Description: {{ _p_activity_description | default("") }}
# Script
{{ lookup('file',_p_activity_script) }}
# ---
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@
when: _p_activity_command | default('') != ''

- include_tasks: log-deployer-yaml-file.yml
when: _p_activity_yaml | default('') != ''
when: _p_activity_yaml | default('') != ''

- include_tasks: log-deployer-script-file.yml
when: _p_activity_script | default('') != ''

0 comments on commit a51b0a2

Please sign in to comment.