Skip to content

Commit

Permalink
Merge pull request #706 from shiftstack/merge-bot-master
Browse files Browse the repository at this point in the history
  • Loading branch information
openshift-merge-robot committed Oct 24, 2022
2 parents 41afbfe + b252745 commit e51d274
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
19 changes: 14 additions & 5 deletions devstack/lib/kubernetes
@@ -1,5 +1,18 @@
#!/bin/bash

# Ugly hack for the image repository. Kubernetes team switched to new registry
# starting from 1.25 version.
# TODO(gryf): Remove this when kubernetes version will be bumped beyond 1.24.
MINOR=${KURYR_KUBERNETES_VERSION#*.}
MINOR=${MINOR%.*}

if [[ $MINOR -gt 23 ]]; then
KURYR_KUBEADMIN_IMAGE_REPOSITORY="registry.k8s.io"
else
KURYR_KUBEADMIN_IMAGE_REPOSITORY="k8s.gcr.io"
PULLARGS="--image-repository=${KURYR_KUBEADMIN_IMAGE_REPOSITORY}"
fi

function get_k8s_log_level {
if [[ ${ENABLE_DEBUG_LOG_LEVEL} == "True" ]]; then
echo "4"
Expand Down Expand Up @@ -107,8 +120,6 @@ localAPIEndpoint:
nodeRegistration:
criSocket: "$cri_socket"
kubeletExtraArgs:
cni-bin-dir: "$CNI_PLUGIN_DIR"
cni-conf-dir: "$CNI_CONF_DIR"
enable-server: "true"
taints:
[]
Expand All @@ -120,7 +131,7 @@ address: "0.0.0.0"
enableServer: true
cgroupDriver: $cgroup_driver
EOF
sudo kubeadm config images pull --image-repository=${KURYR_KUBEADMIN_IMAGE_REPOSITORY}
sudo kubeadm config images pull ${PULLARGS}
args="--config ${output_dir}/kubeadm-init.yaml"
# NOTE(gryf): skip installing kube proxy, kuryr will handle services.
args+=" --skip-phases=addon/kube-proxy"
Expand Down Expand Up @@ -177,8 +188,6 @@ kind: JoinConfiguration
nodeRegistration:
criSocket: "$cri_socket"
kubeletExtraArgs:
cni-bin-dir: "$CNI_PLUGIN_DIR"
cni-conf-dir: "$CNI_CONF_DIR"
enable-server: "true"
taints:
[]
Expand Down
8 changes: 3 additions & 5 deletions devstack/lib/kuryr_kubernetes
Expand Up @@ -607,8 +607,6 @@ EOF
function generate_cni_daemon_set {
output_dir=$1
cni_health_server_port=$2
cni_bin_dir=${3:-/opt/cni/bin}
cni_conf_dir=${4:-/etc/cni/net.d}
local var_run=${VAR_RUN_PATH:-/var/run}
mkdir -p "$output_dir"
rm -f "${output_dir}/cni_ds.yml"
Expand Down Expand Up @@ -704,10 +702,10 @@ EOF
volumes:
- name: bin
hostPath:
path: ${cni_bin_dir}
path: ${CNI_PLUGIN_DIR}
- name: net-conf
hostPath:
path: ${cni_conf_dir}
path: ${CNI_CONF_DIR}
- name: config-volume
configMap:
name: kuryr-config
Expand Down Expand Up @@ -1101,7 +1099,7 @@ function _generate_containerized_kuryr_resources {
generate_kuryr_certificates_secret $output_dir $SSL_BUNDLE_FILE
generate_kuryr_service_account $output_dir
generate_controller_deployment $output_dir $KURYR_HEALTH_SERVER_PORT $KURYR_CONTROLLER_HA
generate_cni_daemon_set $output_dir $KURYR_CNI_HEALTH_SERVER_PORT $CNI_PLUGIN_DIR $CNI_CONF_DIR
generate_cni_daemon_set $output_dir $KURYR_CNI_HEALTH_SERVER_PORT
}

function run_containerized_kuryr_resources {
Expand Down
7 changes: 2 additions & 5 deletions devstack/settings
@@ -1,6 +1,6 @@
KURYR_HOME=${KURYR_HOME:-$DEST/kuryr-kubernetes}
CNI_PLUGIN_DIR=${CNI_PLUGIN_DIR:-${CNI_BIN_DIR:-/opt/cni/bin}}
CNI_CONF_DIR=${CNI_CONF_DIR:-$DEST/cni/conf}
CNI_PLUGIN_DIR=${CNI_PLUGIN_DIR:-/opt/cni/bin}
CNI_CONF_DIR=${CNI_CONF_DIR:-/etc/cni/net.d}

KURYR_CONFIG_DIR=${KURYR_CONFIG_DIR:-/etc/kuryr}
KURYR_CONFIG=${KURYR_CONFIG:-${KURYR_CONFIG_DIR}/kuryr.conf}
Expand Down Expand Up @@ -96,6 +96,3 @@ KURYR_OVERCLOUD_VM_PORT=${KURYR_OVERCLOUD_VM_PORT:-port0}
KURYR_IPV6=${KURYR_IPV6:-False}
KURYR_DUAL_STACK=${KURYR_DUAL_STACK:-False}
SUBNETPOOL_KURYR_NAME_V6=${SUBNETPOOL_KURYR_NAME_V6:-"shared-kuryr-subnetpool-v6"}

# Kubeadmin
KURYR_KUBEADMIN_IMAGE_REPOSITORY=${KURYR_KUBEADMIN_IMAGE_REPOSITORY:-"k8s.gcr.io"}

0 comments on commit e51d274

Please sign in to comment.