-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added dry-run functionality and restart pods after configmap change
- Loading branch information
Showing
25 changed files
with
298 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
.venv | ||
inventory | ||
secret.txt | ||
vaultfile.yaml | ||
inventory | ||
group_vars/cluster*.yaml | ||
*-bundle*.yaml | ||
.DS_store |
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
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 |
---|---|---|
@@ -1,2 +1,19 @@ | ||
--- | ||
# handlers file for install-sysdig-agent | ||
- name: Restart sysdig-agent pods | ||
kubernetes.core.k8s: | ||
kind: Pod | ||
namespace: "{{ sysdig_agent_namespace }}" | ||
state: absent | ||
kubeconfig: "{{ kube_config_path }}" | ||
label_selectors: | ||
- 'app=sysdig-agent' | ||
|
||
- name: Restart sysdig NIA pods | ||
kubernetes.core.k8s: | ||
kind: Pod | ||
namespace: "{{ sysdig_agent_namespace }}" | ||
state: absent | ||
kubeconfig: "{{ kube_config_path }}" | ||
label_selectors: | ||
- 'app=sysdig-node-analyzer' |
65 changes: 65 additions & 0 deletions
65
roles/install-sysdig-agent/tasks/agent-install-k8s-dry-run.yml
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,65 @@ | ||
--- | ||
|
||
- name: Delete old bundles | ||
delegate_to: localhost | ||
file: | ||
path: "k8s-bundle-{{ group_names[0] }}.yaml" | ||
state: absent | ||
|
||
- name: Creating new bundle | ||
delegate_to: localhost | ||
file: | ||
path: "k8s-bundle-{{ group_names[0] }}.yaml" | ||
state: touch | ||
|
||
- name: Create {{ sysdig_agent_namespace }} namespace | ||
delegate_to: localhost | ||
lineinfile: | ||
line: "{{ lookup('template', 'sysdig-agent-namespace.yaml.j2')}}" | ||
dest: "k8s-bundle-{{ group_names[0] }}.yaml" | ||
|
||
- name: Create Service Account for sysdig agent | ||
delegate_to: localhost | ||
lineinfile: | ||
line: "{{ lookup('template', 'sysdig-agent-serviceaccount.yaml.j2')}}" | ||
dest: "k8s-bundle-{{ group_names[0] }}.yaml" | ||
|
||
- name: Create ClusterRole for sysdig-agent account | ||
delegate_to: localhost | ||
lineinfile: | ||
line: "{{ lookup('template', 'sysdig-agent-clusterrole.yaml.j2')}}" | ||
dest: "k8s-bundle-{{ group_names[0] }}.yaml" | ||
|
||
- name: Create ClusterRoleBinding for cluster-reader for sysdig-agent account | ||
delegate_to: localhost | ||
lineinfile: | ||
line: "{{ lookup('template', 'sysdig-agent-clusterrolebinding.yaml.j2')}}" | ||
dest: "k8s-bundle-{{ group_names[0] }}.yaml" | ||
|
||
- name: Create secret for sysdig-agent | ||
delegate_to: localhost | ||
lineinfile: | ||
line: "{{ lookup('template', 'sysdig-agent-secret.yaml.j2')}}" | ||
dest: "k8s-bundle-{{ group_names[0] }}.yaml" | ||
|
||
- name: Configure agent configmap, service and daemonset | ||
delegate_to: localhost | ||
lineinfile: | ||
line: "{{ lookup('template', '{{item}}.yaml.j2')}}" | ||
dest: "k8s-bundle-{{ group_names[0] }}.yaml" | ||
loop: | ||
- sysdig-agent-configmap | ||
- sysdig-agent-service | ||
- sysdig-agent-daemonset-v2 | ||
|
||
- name: Configure NIA configmap and daemonset | ||
delegate_to: localhost | ||
lineinfile: | ||
line: "{{ lookup('template', '{{item}}.yaml.j2')}}" | ||
dest: "k8s-bundle-{{ group_names[0] }}.yaml" | ||
loop: | ||
- sysdig-node-image-analyzer-configmap | ||
- sysdig-node-image-analyzer-daemonset | ||
- sysdig-node-benchmark-runner-configmap | ||
- sysdig-node-host-analyzer-configmap | ||
when: nia_enabled |
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
65 changes: 65 additions & 0 deletions
65
roles/install-sysdig-agent/tasks/agent-install-ocp-dry-run.yml
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,65 @@ | ||
--- | ||
|
||
- name: Delete old bundles | ||
delegate_to: localhost | ||
file: | ||
path: "openshift-bundle-{{ group_names[0] }}.yaml" | ||
state: absent | ||
|
||
- name: Creating new bundle | ||
delegate_to: localhost | ||
file: | ||
path: "openshift-bundle-{{ group_names[0] }}.yaml" | ||
state: touch | ||
|
||
- name: Create {{ sysdig_agent_namespace }} namespace | ||
delegate_to: localhost | ||
lineinfile: | ||
line: "{{ lookup('template', 'sysdig-agent-namespace.yaml.j2')}}" | ||
dest: "openshift-bundle-{{ group_names[0] }}.yaml" | ||
|
||
- name: Create Service Account for sysdig agent | ||
delegate_to: localhost | ||
lineinfile: | ||
line: "{{ lookup('template', 'sysdig-agent-serviceaccount.yaml.j2')}}" | ||
dest: "openshift-bundle-{{ group_names[0] }}.yaml" | ||
|
||
- name: Create RoleBinding for privileged scc for sysdig-agent account | ||
delegate_to: localhost | ||
lineinfile: | ||
line: "{{ lookup('template', 'sysdig-agent-privileged-rolebinding.yaml.j2')}}" | ||
dest: "openshift-bundle-{{ group_names[0] }}.yaml" | ||
|
||
- name: Create ClusterRoleBinding for cluster-reader for sysdig-agent account | ||
delegate_to: localhost | ||
lineinfile: | ||
line: "{{ lookup('template', 'cluster-reader-sysdig-agent-clusterrolebinding.yaml.j2')}}" | ||
dest: "openshift-bundle-{{ group_names[0] }}.yaml" | ||
|
||
- name: Create secret for sysdig-agent | ||
delegate_to: localhost | ||
lineinfile: | ||
line: "{{ lookup('template', 'sysdig-agent-secret.yaml.j2')}}" | ||
dest: "openshift-bundle-{{ group_names[0] }}.yaml" | ||
|
||
- name: Configure agent configmap, service and daemonset | ||
delegate_to: localhost | ||
lineinfile: | ||
line: "{{ lookup('template', '{{item}}.yaml.j2')}}" | ||
dest: "openshift-bundle-{{ group_names[0] }}.yaml" | ||
loop: | ||
- sysdig-agent-configmap | ||
- sysdig-agent-service | ||
- sysdig-agent-daemonset-v2 | ||
|
||
- name: Configure NIA configmap and daemonset | ||
delegate_to: localhost | ||
lineinfile: | ||
line: "{{ lookup('template', '{{item}}.yaml.j2')}}" | ||
dest: "openshift-bundle-{{ group_names[0] }}.yaml" | ||
loop: | ||
- sysdig-node-image-analyzer-configmap | ||
- sysdig-node-image-analyzer-daemonset | ||
- sysdig-node-benchmark-runner-configmap | ||
- sysdig-node-host-analyzer-configmap | ||
when: nia_enabled |
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
Oops, something went wrong.