Browse Source

Add an ARCH parameter to handle arch specific things

Add an ARCH parameter to handle arch specific things, mostly are the
docker image repo names.

Because not all the docker images magnum used support multi-arch
manifest[1] like kubernetes-dashboard, it will need to specific the
arch name in the docker image repo name.

[1]
https://kubernetes.io/docs/concepts/containers/images/#building-multi-architecture-images-with-manifests

Change-Id: Iccb3a030aefd2d4e55a455d1a0401cbc4eb7fd14
Task: 37884
Story: 2007026
changes/65/700565/4
Xinliang Liu 3 years ago
parent
commit
5ee27cfb42
  1. 2
      magnum/drivers/common/templates/kubernetes/fragments/core-dns-service.sh
  2. 4
      magnum/drivers/common/templates/kubernetes/fragments/flannel-service.sh
  3. 8
      magnum/drivers/common/templates/kubernetes/fragments/kube-dashboard-service.sh
  4. 15
      magnum/drivers/common/templates/kubernetes/fragments/write-heat-params-master.sh
  5. 15
      magnum/drivers/common/templates/kubernetes/fragments/write-heat-params.sh
  6. 2
      magnum/drivers/common/templates/kubernetes/helm/metrics-server.sh
  7. 2
      magnum/drivers/common/templates/kubernetes/helm/prometheus-adapter.sh

2
magnum/drivers/common/templates/kubernetes/fragments/core-dns-service.sh

@ -270,7 +270,7 @@ spec:
priorityClassName: system-cluster-critical
containers:
- name: autoscaler
image: ${_autoscaler_prefix}cluster-proportional-autoscaler-amd64:1.1.2
image: ${_autoscaler_prefix}cluster-proportional-autoscaler-${ARCH}:1.1.2
resources:
requests:
cpu: "20m"

4
magnum/drivers/common/templates/kubernetes/fragments/flannel-service.sh

@ -159,7 +159,7 @@ data:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kube-flannel-ds-amd64
name: kube-flannel-ds-${ARCH}
namespace: kube-system
labels:
tier: node
@ -182,7 +182,7 @@ spec:
type: "spc_t"
hostNetwork: true
nodeSelector:
beta.kubernetes.io/arch: amd64
beta.kubernetes.io/arch: ${ARCH}
tolerations:
- operator: Exists
effect: NoSchedule

8
magnum/drivers/common/templates/kubernetes/fragments/kube-dashboard-service.sh

@ -12,8 +12,8 @@ do
done
if [ "$(echo $KUBE_DASHBOARD_ENABLED | tr '[:upper:]' '[:lower:]')" == "true" ]; then
KUBE_DASH_IMAGE="${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}kubernetes-dashboard-amd64:${KUBE_DASHBOARD_VERSION}"
HEAPSTER_IMAGE="${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}heapster-amd64:v1.4.2"
KUBE_DASH_IMAGE="${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}kubernetes-dashboard-${ARCH}:${KUBE_DASHBOARD_VERSION}"
HEAPSTER_IMAGE="${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}heapster-${ARCH}:v1.4.2"
KUBE_DASH_DEPLOY=/srv/magnum/kubernetes/kubernetes-dashboard.yaml
@ -209,8 +209,8 @@ EOF
# Deploy INFLUX AND GRAFANA
if [ "$(echo $INFLUX_GRAFANA_DASHBOARD_ENABLED | tr '[:upper:]' '[:lower:]')" == "true" ]; then
INFLUX_SINK=" - --sink=influxdb:http://monitoring-influxdb.kube-system.svc:8086"
INFLUX_IMAGE="${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}heapster-influxdb-amd64:v1.3.3"
GRAFANA_IMAGE="${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}heapster-grafana-amd64:v4.4.3"
INFLUX_IMAGE="${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}heapster-influxdb-${ARCH}:v1.3.3"
GRAFANA_IMAGE="${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}heapster-grafana-${ARCH}:v4.4.3"
INFLUX_DEPLOY=/srv/magnum/kubernetes/influxdb.yaml
GRAFANA_DEPLOY=/srv/magnum/kubernetes/grafana.yaml

15
magnum/drivers/common/templates/kubernetes/fragments/write-heat-params-master.sh

@ -2,11 +2,26 @@
echo "START: write-heat-params"
arch=$(uname -m)
case "$arch" in
aarch64)
ARCH=arm64
;;
x86_64)
ARCH=amd64
;;
*)
ARCH=$arch
;;
esac
HEAT_PARAMS=/etc/sysconfig/heat-params
[ -f ${HEAT_PARAMS} ] || {
echo "Writing File: $HEAT_PARAMS"
mkdir -p "$(dirname ${HEAT_PARAMS})"
cat > ${HEAT_PARAMS} <<EOF
ARCH="$ARCH"
INSTANCE_NAME="$INSTANCE_NAME"
HEAPSTER_ENABLED="$HEAPSTER_ENABLED"
METRICS_SERVER_ENABLED="$METRICS_SERVER_ENABLED"

15
magnum/drivers/common/templates/kubernetes/fragments/write-heat-params.sh

@ -2,11 +2,26 @@
echo "START: write-heat-params"
arch=$(uname -m)
case "$arch" in
aarch64)
ARCH=arm64
;;
x86_64)
ARCH=amd64
;;
*)
ARCH=$arch
;;
esac
HEAT_PARAMS=/etc/sysconfig/heat-params
[ -f ${HEAT_PARAMS} ] || {
echo "Writing File: $HEAT_PARAMS"
mkdir -p "$(dirname ${HEAT_PARAMS})"
cat > ${HEAT_PARAMS} <<EOF
ARCH="$ARCH"
INSTANCE_NAME="$INSTANCE_NAME"
HEAPSTER_ENABLED="$HEAPSTER_ENABLED"
METRICS_SERVER_ENABLED="$METRICS_SERVER_ENABLED"

2
magnum/drivers/common/templates/kubernetes/helm/metrics-server.sh

@ -50,7 +50,7 @@ data:
install-${CHART_NAME}-values.yaml: |
image:
repository: ${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}metrics-server-amd64
repository: ${CONTAINER_INFRA_PREFIX:-gcr.io/google_containers/}metrics-server-${ARCH}
args:
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
---

2
magnum/drivers/common/templates/kubernetes/helm/prometheus-adapter.sh

@ -52,7 +52,7 @@ data:
install-${CHART_NAME}-values.yaml: |
image:
repository: ${CONTAINER_INFRA_PREFIX:-docker.io/directxman12/}k8s-prometheus-adapter-amd64
repository: ${CONTAINER_INFRA_PREFIX:-docker.io/directxman12/}k8s-prometheus-adapter-${ARCH}
priorityClassName: "system-cluster-critical"

Loading…
Cancel
Save