cb2e5ac776
* Drop linux capabilities for unprivileged containerized worlkoads Kargo configures for deployments. * Configure required securityContext/user/group/groups for kube components' static manifests, etcd, calico-rr and k8s apps, like dnsmasq daemonset. * Rework cloud-init (etcd) users creation for CoreOS. * Fix nologin paths, adjust defaults for addusers role and ensure supplementary groups membership added for users. * Add netplug user for network plugins (yet unused by privileged networking containers though). * Grant the kube and netplug users read access for etcd certs via the etcd certs group. * Grant group read access to kube certs via the kube cert group. * Remove priveleged mode for calico-rr and run it under its uid/gid and supplementary etcd_cert group. * Adjust docs. * Align cpu/memory limits and dropped caps with added rkt support for control plane. Signed-off-by: Bogdan Dobrelya <bogdando@mail.ru>
61 lines
1.6 KiB
YAML
61 lines
1.6 KiB
YAML
---
|
|
apiVersion: extensions/v1beta1
|
|
kind: DaemonSet
|
|
metadata:
|
|
name: dnsmasq
|
|
namespace: "{{system_namespace}}"
|
|
labels:
|
|
k8s-app: dnsmasq
|
|
spec:
|
|
template:
|
|
metadata:
|
|
labels:
|
|
k8s-app: dnsmasq
|
|
spec:
|
|
containers:
|
|
- name: dnsmasq
|
|
image: "{{ dnsmasq_image_repo }}:{{ dnsmasq_image_tag }}"
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
|
command:
|
|
- dnsmasq
|
|
args:
|
|
- -k
|
|
- "-7"
|
|
- /etc/dnsmasq.d
|
|
securityContext:
|
|
capabilities:
|
|
add:
|
|
- NET_ADMIN
|
|
drop:
|
|
{% for c in dnsmasq_drop_cap %}
|
|
- {{ c.upper() }}
|
|
{% endfor %}
|
|
imagePullPolicy: IfNotPresent
|
|
resources:
|
|
limits:
|
|
cpu: {{ dns_cpu_limit }}
|
|
memory: {{ dns_memory_limit }}
|
|
requests:
|
|
cpu: {{ dns_cpu_requests }}
|
|
memory: {{ dns_memory_requests }}
|
|
ports:
|
|
- name: dns
|
|
containerPort: 53
|
|
protocol: UDP
|
|
- name: dns-tcp
|
|
containerPort: 53
|
|
protocol: TCP
|
|
volumeMounts:
|
|
- name: etcdnsmasqd
|
|
mountPath: /etc/dnsmasq.d
|
|
- name: etcdnsmasqdavailable
|
|
mountPath: /etc/dnsmasq.d-available
|
|
|
|
volumes:
|
|
- name: etcdnsmasqd
|
|
hostPath:
|
|
path: /etc/dnsmasq.d
|
|
- name: etcdnsmasqdavailable
|
|
hostPath:
|
|
path: /etc/dnsmasq.d-available
|
|
dnsPolicy: Default # Don't use cluster DNS.
|