forked from ocp-power-automation/ocp4-playbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ocp-power-automation#26: deploy powervm-rmc daemonset during ocp-…
…customization (ocp-power-automation#36) Signed-off-by: Sebastien Chabrolles <[email protected]>
- Loading branch information
1 parent
22f8838
commit d9ed193
Showing
4 changed files
with
122 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
workdir: ~/ocp4-workdir | ||
rhcos_kernel_options: [] | ||
sysctl_tuned_options: false | ||
powervm_rmc: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,44 @@ | ||
--- | ||
# tasks file for ocp4 post install customizations | ||
- name: Install openshift python module | ||
pip: | ||
executable: pip3 | ||
name: openshift | ||
|
||
- name: Configure RHCOS kernel options via MachineConfig | ||
when: rhcos_kernel_options | length > 0 | ||
import_tasks: kernel.yaml | ||
- name: | ||
block: | ||
- name: Pause reboot node (Machineconfig) | ||
k8s: | ||
merge_type: merge | ||
kind: MachineConfigPool | ||
name: "{{ item }}" | ||
definition: | ||
spec: | ||
paused: true | ||
loop: | ||
- master | ||
- worker | ||
|
||
- name: Configure Kernel tunables (sysctl) via Tuned Operator | ||
when: sysctl_tuned_options | ||
import_tasks: tuned.yaml | ||
- name: Configure RHCOS kernel options via MachineConfig | ||
when: rhcos_kernel_options | length > 0 | ||
import_tasks: kernel.yaml | ||
|
||
- name: Configure Kernel tunables (sysctl) via Tuned Operator | ||
when: sysctl_tuned_options | ||
import_tasks: tuned.yaml | ||
|
||
- name: Configure PowerVM RMC daemonset | ||
when: powervm_rmc | ||
import_tasks: powervm_rmc.yaml | ||
|
||
always: | ||
- name: UnPause reboot node (Machineconfig) | ||
k8s: | ||
merge_type: merge | ||
kind: MachineConfigPool | ||
name: "{{ item }}" | ||
definition: | ||
spec: | ||
paused: false | ||
loop: | ||
- master | ||
- worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
- name: Create powervm-rmc project | ||
k8s: | ||
name: powervm-rmc | ||
api_version: project.openshift.io/v1 | ||
kind: Project | ||
state: present | ||
|
||
- name: Create powervm-rmc serviceaccount | ||
k8s: | ||
state: present | ||
definition: | ||
api_version: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: powervm-rmc | ||
namespace: powervm-rmc | ||
|
||
- name: Add privileged scc to powervm-rmc serviceaccount | ||
shell: "oc adm policy add-scc-to-user -z powervm-rmc privileged -n powervm-rmc" | ||
|
||
- name: Deploy powervm-rmc DaemonSet | ||
k8s: | ||
state: present | ||
definition: | ||
kind: DaemonSet | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: powervm-rmc | ||
namespace: powervm-rmc | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: powervm-rmc | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app: powervm-rmc | ||
spec: | ||
nodeSelector: | ||
kubernetes.io/arch: ppc64le | ||
node.openshift.io/os_id: rhcos | ||
restartPolicy: Always | ||
serviceAccountName: powervm-rmc | ||
hostNetwork: true | ||
containers: | ||
- name: powervm-rmc | ||
image: 'quay.io/powercloud/rsct-ppc64le:latest' | ||
ports: | ||
- name: rmc-tcp | ||
hostPort: 657 | ||
containerPort: 657 | ||
protocol: TCP | ||
- name: rmc-udp | ||
hostPort: 657 | ||
containerPort: 657 | ||
protocol: UDP | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 500Mi | ||
limits: | ||
memory: 1Gi | ||
volumeMounts: | ||
- name: lib-modules | ||
mountPath: /lib/modules | ||
readOnly: true | ||
securityContext: | ||
privileged: true | ||
runAsUser: 0 | ||
serviceAccount: powervm-rmc | ||
volumes: | ||
- name: lib-modules | ||
hostPath: | ||
path: /lib/modules | ||
tolerations: | ||
- key: node-role.kubernetes.io/master | ||
operator: Exists | ||
effect: NoSchedule |