Skip to content

Commit 03423b5

Browse files
authored
Merge pull request #36 from jglick/daemonset-CBSDA-98
[CBSDA-98] Documenting DaemonSet approach
2 parents 8c16be8 + 522b086 commit 03423b5

File tree

2 files changed

+97
-1
lines changed

2 files changed

+97
-1
lines changed

cloudbees-cd/kubernetes/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CloudBees CD examples
22

3-
Files in this folder complement mentions in [CloudBees CD product documentation](https://https://docs.cloudbees.com/docs/cloudbees-flow/latest/). As such, they are not standalone.
3+
Files in this folder complement mentions in [CloudBees CD product documentation](https://docs.cloudbees.com/docs/cloudbees-cd/latest/). As such, they are not standalone.
44

55
## In this folder
66
This folder contains example values `.yaml` files for the CloudBees CD Helm Chart.
@@ -11,3 +11,4 @@ This folder contains example values `.yaml` files for the CloudBees CD Helm Char
1111
- `cloudbees-cd-agent-defaults.yaml`: Example .yaml file for installing a CloudBees CD agent on standard Kubernetes.
1212
- `cloudbees-cd-defaults.yaml` ( was `values.yaml`): Default parameter values for CloudBees CD on standard Kubernetes. Springboard from this file to create your own custom values.yaml file.
1313
- `values-filebeat.yaml`: Sample values file to configure Filebeat log shipper to capture logs from CloudBees CD services and pods.
14+
- `tune-max-map-count.yaml`: One way to set the kernel parameter `vm.max_map_count` high enough to run DevOps Insight.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# https://docs.cloudbees.com/docs/cloudbees-cd/latest/install-trad/before-install#_checking_the_virtual_memory_areas_setting
2+
apiVersion: apps/v1
3+
kind: DaemonSet
4+
metadata:
5+
name: tune-max-map-count
6+
spec:
7+
selector:
8+
matchLabels:
9+
name: tune-max-map-count
10+
template:
11+
metadata:
12+
labels:
13+
name: tune-max-map-count
14+
spec:
15+
nodeSelector:
16+
kubernetes.io/os: linux
17+
serviceAccount: tune-max-map-count # if using PSP (below)
18+
terminationGracePeriodSeconds: 3
19+
containers:
20+
- name: tune
21+
image: busybox:stable
22+
securityContext:
23+
privileged: true
24+
runAsUser: 0
25+
resources:
26+
requests:
27+
cpu: 1m
28+
memory: 1Mi
29+
command:
30+
- sh
31+
- -c
32+
- |
33+
set -ex
34+
sysctl -w vm.max_map_count=262144
35+
sleep infinity
36+
# Delete the rest (and delete serviceAccount above) unless your cluster uses --enable-pod-security-policy:
37+
---
38+
apiVersion: policy/v1beta1
39+
kind: PodSecurityPolicy
40+
metadata:
41+
name: privileged-tune-max-map-count
42+
annotations:
43+
seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*'
44+
spec:
45+
privileged: true
46+
allowPrivilegeEscalation: true
47+
allowedCapabilities:
48+
- '*'
49+
volumes:
50+
- '*'
51+
hostNetwork: true
52+
hostPorts:
53+
- min: 0
54+
max: 65535
55+
hostIPC: true
56+
hostPID: true
57+
runAsUser:
58+
rule: 'RunAsAny'
59+
seLinux:
60+
rule: 'RunAsAny'
61+
supplementalGroups:
62+
rule: 'RunAsAny'
63+
fsGroup:
64+
rule: 'RunAsAny'
65+
---
66+
apiVersion: v1
67+
kind: ServiceAccount
68+
metadata:
69+
name: tune-max-map-count
70+
---
71+
kind: Role
72+
apiVersion: rbac.authorization.k8s.io/v1
73+
metadata:
74+
name: tune-max-map-count
75+
rules:
76+
- apiGroups:
77+
- extensions
78+
resources:
79+
- podsecuritypolicies
80+
verbs:
81+
- use
82+
resourceNames:
83+
- privileged-tune-max-map-count
84+
---
85+
apiVersion: rbac.authorization.k8s.io/v1
86+
kind: RoleBinding
87+
metadata:
88+
name: tune-max-map-count
89+
roleRef:
90+
apiGroup: rbac.authorization.k8s.io
91+
kind: Role
92+
name: tune-max-map-count
93+
subjects:
94+
- kind: ServiceAccount
95+
name: tune-max-map-count

0 commit comments

Comments
 (0)