Mount hostname file of host to contrail containers
Related-Bug: PROD-26298
Quick fix for deployment with containerD.
Containers with host network expect same hostname as host has.
Change-Id: I4aa4cf3516279689d05c91378ff1887b9e77db30
diff --git a/kubernetes/files/kube-addons/contrail/contrail.yaml b/kubernetes/files/kube-addons/contrail/contrail.yaml
index a3a263b..2adef76 100644
--- a/kubernetes/files/kube-addons/contrail/contrail.yaml
+++ b/kubernetes/files/kube-addons/contrail/contrail.yaml
@@ -44,6 +44,10 @@
fi;
rabbitmqctl set_policy ha-all "." '{"ha-mode":"exactly","ha-params":3,"ha-sync-mode":"automatic"}'
{% endraw %}
+ volumeMounts:
+ - name: etc-hostname
+ mountPath: /etc/hostname
+ readOnly: true
env:
- name: RABBITMQ_ERLANG_COOKIE
value: {{ common.addons.get('contrail',{}).get('rabbitmq_erlang_cookie',"YTQMGYEHFATZPDKPOCXX") }}
@@ -100,7 +104,9 @@
mountPath: /var/log/contrail
- name: journal-controller
mountPath: /var/log/journal
-
+ - name: etc-hostname
+ mountPath: /etc/hostname
+ readOnly: true
- name: opencontrail-analyticsdb
image: {{ common.addons.opencontrail.analyticsdb.image }}
@@ -142,6 +148,9 @@
mountPath: /var/log/contrail
- name: journal-analyticsdb
mountPath: /var/log/journal
+ - name: etc-hostname
+ mountPath: /etc/hostname
+ readOnly: true
- name: opencontrail-analytics
image: {{ common.addons.opencontrail.analytics.image }}
@@ -154,6 +163,10 @@
mountPath: /var/log/contrail
- name: journal-analytics
mountPath: /var/log/journal
+ - name: etc-hostname
+ mountPath: /etc/hostname
+ readOnly: true
+
securityContext:
privileged: true
env:
@@ -172,6 +185,10 @@
hostPath:
path: /var/log/contrail
type: DirectoryOrCreate
+ - name: etc-hostname
+ hostPath:
+ path: /etc/hostname
+ type: File
# controller
- name: var-lib-configdb
diff --git a/kubernetes/files/kube-addons/contrail/kube-manager.yaml b/kubernetes/files/kube-addons/contrail/kube-manager.yaml
index 2775380..be55727 100644
--- a/kubernetes/files/kube-addons/contrail/kube-manager.yaml
+++ b/kubernetes/files/kube-addons/contrail/kube-manager.yaml
@@ -48,6 +48,9 @@
mountPath: /var/log/contrail
- name: journal-kube-manager
mountPath: /var/log/journal
+ - name: etc-hostname
+ mountPath: /etc/hostname
+ readOnly: true
volumes:
- name: etc-kubernetes
@@ -65,6 +68,10 @@
hostPath:
path: /var/log/journal/contrail-kube-manager
type: DirectoryOrCreate
+ - name: etc-hostname
+ hostPath:
+ path: /etc/hostname
+ type: File
nodeSelector:
"node-role.kubernetes.io/master": "true"