2019-09-11 03:06:55 +08:00
|
|
|
apiVersion: apps/v1
|
2017-04-14 16:49:16 +08:00
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: netchecker-server
|
2019-09-11 03:06:55 +08:00
|
|
|
namespace: {{ netcheck_namespace }}
|
|
|
|
labels:
|
|
|
|
app: netchecker-server
|
2017-04-14 16:49:16 +08:00
|
|
|
spec:
|
|
|
|
replicas: 1
|
2019-09-11 03:06:55 +08:00
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: netchecker-server
|
2017-04-14 16:49:16 +08:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
name: netchecker-server
|
|
|
|
labels:
|
|
|
|
app: netchecker-server
|
|
|
|
spec:
|
2023-07-05 11:36:54 +08:00
|
|
|
priorityClassName: {% if netcheck_namespace == 'kube-system' %}system-cluster-critical{% else %}k8s-cluster-critical{% endif %}{{ '' }}
|
2021-10-20 01:17:04 +08:00
|
|
|
volumes:
|
|
|
|
- name: etcd-data
|
|
|
|
emptyDir: {}
|
2017-04-14 16:49:16 +08:00
|
|
|
containers:
|
|
|
|
- name: netchecker-server
|
2018-12-04 02:29:42 +08:00
|
|
|
image: "{{ netcheck_server_image_repo }}:{{ netcheck_server_image_tag }}"
|
2017-04-14 16:49:16 +08:00
|
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpu: {{ netchecker_server_cpu_limit }}
|
|
|
|
memory: {{ netchecker_server_memory_limit }}
|
|
|
|
requests:
|
|
|
|
cpu: {{ netchecker_server_cpu_requests }}
|
|
|
|
memory: {{ netchecker_server_memory_requests }}
|
2018-08-23 00:16:13 +08:00
|
|
|
securityContext:
|
2022-10-18 10:11:18 +08:00
|
|
|
allowPrivilegeEscalation: false
|
|
|
|
capabilities:
|
|
|
|
drop: ['ALL']
|
2018-08-23 00:16:13 +08:00
|
|
|
runAsUser: {{ netchecker_server_user | default('0') }}
|
|
|
|
runAsGroup: {{ netchecker_server_group | default('0') }}
|
2022-10-18 10:11:18 +08:00
|
|
|
runAsNonRoot: true
|
|
|
|
seccompProfile:
|
|
|
|
type: RuntimeDefault
|
2017-04-14 16:49:16 +08:00
|
|
|
ports:
|
|
|
|
- containerPort: 8081
|
|
|
|
args:
|
2024-07-29 14:57:56 +08:00
|
|
|
- -v={{ netchecker_server_log_level }}
|
2021-10-20 01:17:04 +08:00
|
|
|
- -logtostderr
|
|
|
|
- -kubeproxyinit=false
|
|
|
|
- -endpoint=0.0.0.0:8081
|
|
|
|
- -etcd-endpoints=http://127.0.0.1:2379
|
|
|
|
- name: etcd
|
|
|
|
image: "{{ etcd_image_repo }}:{{ netcheck_etcd_image_tag }}"
|
|
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
2024-07-29 14:57:56 +08:00
|
|
|
env:
|
|
|
|
- name: ETCD_LOG_LEVEL
|
|
|
|
value: "{{ netchecker_etcd_log_level }}"
|
2021-10-20 01:17:04 +08:00
|
|
|
command:
|
|
|
|
- etcd
|
|
|
|
- --listen-client-urls=http://127.0.0.1:2379
|
|
|
|
- --advertise-client-urls=http://127.0.0.1:2379
|
|
|
|
- --data-dir=/var/lib/etcd
|
|
|
|
- --enable-v2
|
|
|
|
- --force-new-cluster
|
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /var/lib/etcd
|
|
|
|
name: etcd-data
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpu: {{ netchecker_etcd_cpu_limit }}
|
|
|
|
memory: {{ netchecker_etcd_memory_limit }}
|
|
|
|
requests:
|
|
|
|
cpu: {{ netchecker_etcd_cpu_requests }}
|
|
|
|
memory: {{ netchecker_etcd_memory_requests }}
|
|
|
|
securityContext:
|
2022-10-18 10:11:18 +08:00
|
|
|
allowPrivilegeEscalation: false
|
|
|
|
capabilities:
|
|
|
|
drop: ['ALL']
|
2021-10-20 01:17:04 +08:00
|
|
|
runAsUser: {{ netchecker_server_user | default('0') }}
|
|
|
|
runAsGroup: {{ netchecker_server_group | default('0') }}
|
2022-10-18 10:11:18 +08:00
|
|
|
runAsNonRoot: true
|
|
|
|
seccompProfile:
|
|
|
|
type: RuntimeDefault
|
2017-09-04 16:29:40 +08:00
|
|
|
tolerations:
|
|
|
|
- effect: NoSchedule
|
|
|
|
operator: Exists
|
2017-07-17 19:28:09 +08:00
|
|
|
serviceAccountName: netchecker-server
|