| {%- from "kubernetes/map.jinja" import common with context -%} |
| {%- from "kubernetes/map.jinja" import pool with context -%} |
| {%- from "kubernetes/map.jinja" import master with context -%} |
| {%- from "kubernetes/map.jinja" import version %} |
| |
| [Unit] |
| Description=CRI Proxy |
| {%- if common.get('containerd', {}).get('enabled') %} |
| After=containerd.service |
| Requires=containerd.service |
| {%- else %} |
| After=dockershim.service |
| Requires=dockershim.service |
| {%- endif %} |
| |
| [Service] |
| SyslogIdentifier=criproxy |
| User=root |
| ExecStart=/usr/bin/criproxy -alsologtostderr \ |
| {%- if common.get('containerd', {}).get('enabled') %} |
| -connect /run/containerd/containerd.sock,virtlet.cloud:/run/virtlet.sock \ |
| {%- else %} |
| -connect /var/run/dockershim.sock,virtlet.cloud:/run/virtlet.sock \ |
| {%- endif %} |
| -listen /var/run/criproxy.sock \ |
| -v 3 \ |
| -log_dir=/var/log/criproxy \ |
| {%- if salt['pkg.version_cmp'](version,'1.8') < 0 %} |
| -apiVersion {{ version }} \ |
| {%- endif %} |
| {%- if pool.get('enabled', False) %} |
| -streamUrl http://{{ pool.kubelet.address }}:11250 |
| {%- else %} |
| {%- if master.get('enabled', False) %} |
| -streamUrl http://{{ master.kubelet.address }}:11250 |
| {% endif %} |
| {% endif %} |
| Restart=on-failure |
| |
| [Install] |
| WantedBy=kubelet.service |