首页 > 系统相关 >istio shell

istio shell

时间:2023-04-05 09:22:18浏览次数:42  
标签:shell Istio istio ISTIO VERSION printf ARCH

#!/bin/sh

# Copyright Istio Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# This file will be fetched as: curl -L https://git.io/getLatestIstio | sh -
# so it should be pure bourne shell, not bash (and not reference other scripts)
#
# The script fetches the latest Istio release candidate and untars it.
# You can pass variables on the command line to download a specific version
# or to override the processor architecture. For example, to download
# Istio 1.6.8 for the x86_64 architecture,
# run curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.6.8 TARGET_ARCH=x86_64 sh -.

set -e

# Determines the operating system.
OS="$(uname)"
if [ "${OS}" = "Darwin" ] ; then
  OSEXT="osx"
else
  OSEXT="linux"
fi

# Determine the latest Istio version by version number ignoring alpha, beta, and rc versions.
if [ "${ISTIO_VERSION}" = "" ] ; then
  ISTIO_VERSION="$(curl -sL https://github.com/istio/istio/releases | \
                  grep -o 'releases/[0-9]*.[0-9]*.[0-9]*/' | sort -V | \
                  tail -1 | awk -F'/' '{ print $2}')"
  ISTIO_VERSION="${ISTIO_VERSION##*/}"
fi

LOCAL_ARCH=$(uname -m)
if [ "${TARGET_ARCH}" ]; then
    LOCAL_ARCH=${TARGET_ARCH}
fi

case "${LOCAL_ARCH}" in
  x86_64|amd64)
    ISTIO_ARCH=amd64
    ;;
  armv8*|aarch64*|arm64)
    ISTIO_ARCH=arm64
    ;;
  armv*)
    ISTIO_ARCH=armv7
    ;;
  *)
    echo "This system's architecture, ${LOCAL_ARCH}, isn't supported"
    exit 1
    ;;
esac

if [ "${ISTIO_VERSION}" = "" ] ; then
  printf "Unable to get latest Istio version. Set ISTIO_VERSION env var and re-run. For example: export ISTIO_VERSION=1.0.4"
  exit 1;
fi

NAME="istio-$ISTIO_VERSION"
URL="https://github.com/istio/istio/releases/download/${ISTIO_VERSION}/istio-${ISTIO_VERSION}-${OSEXT}.tar.gz"
ARCH_URL="https://github.com/istio/istio/releases/download/${ISTIO_VERSION}/istio-${ISTIO_VERSION}-${OSEXT}-${ISTIO_ARCH}.tar.gz"

with_arch() {
  printf "\nDownloading %s from %s ...\n" "$NAME" "$ARCH_URL"
  if ! curl -o /dev/null -sIf "$ARCH_URL"; then
    printf "\n%s is not found, please specify a valid ISTIO_VERSION and TARGET_ARCH\n" "$ARCH_URL"
    exit 1
  fi
  curl -fsLO "$ARCH_URL"
  filename="istio-${ISTIO_VERSION}-${OSEXT}-${ISTIO_ARCH}.tar.gz"
  tar -xzf "${filename}"
  rm "${filename}"
}

without_arch() {
  printf "\nDownloading %s from %s ..." "$NAME" "$URL"
  if ! curl -o /dev/null -sIf "$URL"; then
    printf "\n%s is not found, please specify a valid ISTIO_VERSION\n" "$URL"
    exit 1
  fi
  curl -fsLO "$URL"
  filename="istio-${ISTIO_VERSION}-${OSEXT}.tar.gz"
  tar -xzf "${filename}"
  rm "${filename}"
}

# Istio 1.6 and above support arch
# Istio 1.5 and below do not have arch support
ARCH_SUPPORTED="1.6"
# Istio 1.10 and above support arch for osx arm64
ARCH_SUPPORTED_OSX="1.10"

if [ "${OS}" = "Linux" ] ; then
  # This checks if ISTIO_VERSION is less than ARCH_SUPPORTED (version-sort's before it)
  if [ "$(printf '%s\n%s' "${ARCH_SUPPORTED}" "${ISTIO_VERSION}" | sort -V | head -n 1)" = "${ISTIO_VERSION}" ]; then
    without_arch
  else
    with_arch
  fi
elif [ "${OS}" = "Darwin" ] ; then
  # This checks if ISTIO_VERSION is less than ARCH_SUPPORTED_OSX (version-sort's before it) or ISTIO_ARCH not equal to arm64
  if [ "$(printf '%s\n%s' "${ARCH_SUPPORTED_OSX}" "${ISTIO_VERSION}" | sort -V | head -n 1)" = "${ISTIO_VERSION}" ] || [ "${ISTIO_ARCH}" != "arm64" ]; then
    without_arch
  else
    with_arch
  fi
else
  printf "\n\n"
  printf "Unable to download Istio %s at this moment!\n" "$ISTIO_VERSION"
  printf "Please verify the version you are trying to download.\n\n"
  exit 1
fi

printf ""
printf "\nIstio %s Download Complete!\n" "$ISTIO_VERSION"
printf "\n"
printf "Istio has been successfully downloaded into the %s folder on your system.\n" "$NAME"
printf "\n"
BINDIR="$(cd "$NAME/bin" && pwd)"
printf "Next Steps:\n"
printf "See https://istio.io/latest/docs/setup/install/ to add Istio to your Kubernetes cluster.\n"
printf "\n"
printf "To configure the istioctl client tool for your workstation,\n"
printf "add the %s directory to your environment path variable with:\n" "$BINDIR"
printf "\t export PATH=\"\$PATH:%s\"\n" "$BINDIR"
printf "\n"
printf "Begin the Istio pre-installation check by running:\n"
printf "\t istioctl x precheck \n"
printf "\n"
printf "Need more information? Visit https://istio.io/latest/docs/setup/install/ \n"

标签:shell,Istio,istio,ISTIO,VERSION,printf,ARCH
From: https://www.cnblogs.com/gaoyanbing/p/17288830.html

相关文章

  • 使用PowerShell 连接Exchange及Lync/Skype服务器
    需求背景在运维Exchange/Lync/Skype时,我们经常会遇到需要创建很多自动化任务来代替我们完成重复的工作,就需要能够使用脚本连接至对应应用服务器进行自动化处理。此时我们可以使用PowerShell的方式来完成。那么我们应该如何连接到对应服务器呢?操作步骤创建PowerShell.ps1脚本:$UserC......
  • Redis未授权访问Getshell
    漏洞成因有些redis绑在0.0.0.0:6379,没有开启验证或者没有设置对未知ip来源进行限制以及默认的空密码就导致了redis默认访问但是这个普遍的漏洞极可能造成后门植入getshell,也可能造成反弹shell权限维持,甚至会造成ssh直接免密连接服务器开始复现搭建环境服务器操作系统为ubuntu......
  • 查看shell使用版本&配置环境变量
    引用:https://blog.csdn.net/a374519711/article/details/128596411系统中可能会安装多个shell比如/bin/bash、/bin/zsh等,找到shells的配置文件查看安装了多少shell查看shell   查看当前使用的shellecho$SHELL   如果,我用的是zsh配置环境变量配置环......
  • PowerShell
    WindowsPowerShell是微软发布的一种命令行外壳程序和脚本环境,使命令行用户和脚本编写者可以利用 .NETFramework的强大功能。它引入了许多非常有用的新概念,从而进一步扩展了您在Windows 命令提示符和WindowsScriptHost环境中获得的知识和创建的脚本。Windows PowerShe......
  • Impala003-Impala shell
    本文主要介绍Impalashell命令1、-h外能帮助格式:$impala-shell-h2、-r 刷新整个元数据*(RefreshImpalacatalogafterconnecting,默认为false)2.1在hive创建表t1hive>createtablet1(idint,namestring);OKTimetaken:0.423seconds......
  • 1005--HBase操作实战(HBase Shell命令行模式)
    通过HBase命令行,创建一张表,用户存储用户信息,其中包括基本信息和额外信息HBaseshell下所有命令可以使用:help“cmd”进行了解1、创建表create't_person',{NAME=>'basic_info'},{NAME=>'extra_info'}2、表中存储数据put't_person','g201425001','ba......
  • shell命令调用http接口(curl方式)
    shell命令调用http接口(curl方式) 样例1、curl-H"Content-Length:0"-XGET"http://127.0.0.1:8080"2、curl-H"Content-Type:application/json"-H"connection:Keep-Alive"-s-XPOST-d'{"id":"1"......
  • Service Mesh之Istio基础入门
    技术背景分布式服务治理所谓分布式服务治理就是对服务不断增长的复杂度的管控和管理;管控及管理包含网络拓扑变动、网络延时、通信安全、API网关、服务注册和发现、服务熔断容错、服务超时重试、服务部署、数据调用、分布式链路追踪等等;服务治理历程第一代......
  • shellcode获取MessageBoxA的地址
    _asm{pushebpmoveax,fs:[30h];获得PEB地址moveax,[eax+0ch];获得LDR地址moveax,[eax+14h];获得PEB_LDR_DATA中InMemoryOrderModuleList的Flinkmovecx,eax;因为eax中的Flink也就是等于LDR_DATA_TABLE_ENTRY......
  • 如何XShell 通过中转服务器直接连接目标服务器
    一、使用代理方式首先填写连接信息填写用户身份验证信息添加ssh隧道(注意此处的端口要是未用的端口)添加代理服务器(此处的端口与隧道端口一致)连接代理服务器这时就可以连接到目标服务器了,但是要注意的是,如果目标服务器有设置防火墙规则,对端口要加入出入栈规则才可以正常使用。......