52 lines
1.1 KiB
YAML
52 lines
1.1 KiB
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: insecure-registry-config
|
|
namespace: kube-system
|
|
data:
|
|
daemon.json: |
|
|
{
|
|
"insecure-registries": ["192.168.1.123:80"]
|
|
}
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: DaemonSet
|
|
metadata:
|
|
name: configure-insecure-registry
|
|
namespace: kube-system
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
name: configure-insecure-registry
|
|
template:
|
|
metadata:
|
|
labels:
|
|
name: configure-insecure-registry
|
|
spec:
|
|
hostPID: true
|
|
initContainers:
|
|
- name: configure
|
|
image: alpine:latest
|
|
command: ["/bin/sh", "-c"]
|
|
args:
|
|
- |
|
|
cp /config/daemon.json /host/etc/docker/daemon.json
|
|
nsenter -t 1 -m -u -i -n systemctl restart docker
|
|
volumeMounts:
|
|
- name: host
|
|
mountPath: /host
|
|
- name: config
|
|
mountPath: /config
|
|
securityContext:
|
|
privileged: true
|
|
containers:
|
|
- name: pause
|
|
image: gcr.io/google_containers/pause:3.2
|
|
volumes:
|
|
- name: host
|
|
hostPath:
|
|
path: /
|
|
- name: config
|
|
configMap:
|
|
name: insecure-registry-config
|