Opensourcetechブログ

OpensourcetechによるNGINX/Zabbix/Neo4j/Linuxなどオープンソース技術に関するブログです。

kubernetes(kubectl)のインストール

こんにちは、LinuCエバンジェリストこと、鯨井貴博@opensourcetechです。

 

kubernetes(kubectl)のインストール方法です。

※Mac OSのhomebrewで実施してます。

f:id:opensourcetech:20181031114119p:plain

 

「Homebrewがねぇよ!」って人は、以下を参考にしてください。

Homebrew & Python3(pip3)インストール on MacOS High Sierra - Opensourcetechブログ

 

 

インストール方法

以下のURLに、様々な環境に対応したインストール方法が記載されています。

https://kubernetes.io/docs/tasks/tools/install-kubectl/

Install and Set Up kubectl - Kubernetes

 

 

インストールの実施

XYZ:~ YOSHIKI$ sudo chown -R $(whoami) /usr/local/share/zsh /usr/local/share/zsh/site-functions
XYZ:~ YOSHIKI$ brew install kubernetes-cli
==> Downloading https://homebrew.bintray.com/bottles/kubernetes-cli-1.12.2.mojav
######################################################################## 100.0%
==> Pouring kubernetes-cli-1.12.2.mojave.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d

zsh completions have been installed to:
/usr/local/share/zsh/site-functions
==> Summary
🍺 /usr/local/Cellar/kubernetes-cli/1.12.2: 208 files, 50.6MB
XYZ:~ YOSHIKI$ kubectl version
Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.2", GitCommit:"17c77c7898218073f14c8d573582e8d2313dc740", GitTreeState:"clean", BuildDate:"2018-10-30T21:39:16Z", GoVersion:"go1.11.1", Compiler:"gc", Platform:"darwin/amd64"}
Unable to connect to the server: EOF

 

 

インストールが失敗するパターン

 公式にあるようにいきなり「brew install kubernetes-cli」を叩くと、

「/usr/local/share/zsh /usr/local/share/zsh/site-functionsに手を出せねぇ!!」とpermissionで怒られますw

XYZ:~ YOSHIKI$ brew install kubernetes-cli
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
aravis i2pd nu-smv shellz
bundletool i386-elf-binutils nwchem smimesign
c-blosc i386-elf-gcc objfw solr@6.6
carla inadyn oclgrind sonobuoy
cgit libcerf opensubdiv stanford-corenlp
create-dmg libvmaf opentracing-cpp tdlib
diceware llvm@6 picat tealdeer
eg-examples mallet resin-cli um
geant4 nng rke vfuse
hyperkit node@10 ruby@2.4
==> Updated Formulae
gdbm ✔ libdazzle
sqlite ✔ libepoxy
abcde libetpan
abyss libgcrypt
ace libgda
advancecomp libgit2
advancemame libgit2-glib
aircrack-ng libheif
alexjs libiscsi
alluxio libjson-rpc-cpp
ammonite-repl libmagic
angular-cli libmatio
anjuta libmxml
annie libopendkim
ansible libopkele
ansible-cmdb libopusenc
ansifilter libphonenumber
antlr libplist
antlr@2 libpq
apache-arrow libproxy
apache-arrow-glib libpst
apache-flink librealsense
apache-geode libressl
apache-spark librsvg
app-engine-java libsecret
apr libsoup
arangodb libspectre
arcade-learning-environment libssh
aria2 libtorrent-rasterbar
ark libuv
armadillo libvirt
arp-scan libvoikko
arpack libwbxml
asciidoc links
asdf livestreamer
aspectj llnode
atdtool llvm
aubio logstash
aurora-cli luaradio
autopep8 luvit
avfs lxc
avrdude lynis
avro-c lz4
awk magic-wormhole
aws-elasticbeanstalk mame
aws-okta mapserver
aws-shell mariadb
awscli mariadb@10.2
awslogs mas
azure-cli mbedtls
b2-tools mdcat
babel mdds
ballerina mdv
bat megatools
bazel memcached
bcal menhir
bde mercurial
beast meson
bento4 metabase
bettercap metaproxy
bind micronaut
binutils mill
binwalk miller
bison minio
bitcoin minio-mc
bitrise minizinc
black mkdocs
blink1 mkvtoolnix
bluepill mmark
blueutil monero
bmake monetdb
bnd mongo-c-driver
brew-gem mongo-orchestration
brogue mongodb
brotli mongodb@3.6
bullet mosquitto
bup mpd
bzt mpv
c-ares mscgen
cabal-install mujs
caffe mupdf
cairo mupdf-tools
cargo-completion mysql@5.5
carthage mysql@5.6
cash-cli mysql@5.7
cassandra n
ccache nano
ccm nats-streaming-server
cern-ndiff nco
cgal ncview
chakra ne
chamber neko
chapel netcdf
cheat nexus
checkbashisms nghttp2
chisel nginx
choose ngspice
chrome-export nifi
circleci nifi-registry
clamav nim
clang-format nnn
clipper node
cloc node-build
clojure nodebrew
closure-compiler nomad
cmake nsd
cmark-gfm nss
cmdshelf ntopng
cmocka numpy
cnats nyx
codemod ocrmypdf
codequery octave
coffeescript opam
collectd open-mpi
commandbox openapi-generator
compcert opencoarrays
conan opencv
consul opensc
container-diff openshift-cli
convox openssh
cookiecutter openvdb
cpmtools opus
cppcheck orc-tools
cpprestsdk ortp
credstash packer
cromwell paket
crosstool-ng pandoc
crowdin pandoc-citeproc
crystal pandoc-crossref
cvs2svn parallel
cython pass
darksky-weather passpie
dartsim payara
dbhash pcl
ddgr pdal
dependency-check pdfpc
dhall-json pdftoedn
diff-pdf pdftoipe
diffoscope pegtl
digdag percol
dita-ot percona-toolkit
dlib pgbadger
dnscrypt-proxy pgformatter
dnsmasq pgrouting
dnstwist phoronix-test-suite
docker-compose php
docker-machine-driver-xhyve php-code-sniffer
docker-machine-nfs php-cs-fixer
docker-squash php@5.6
doctl php@7.0
docutils php@7.1
doitlive phpunit
double-conversion pipenv
dub pius
duck pixz
duo_unix planck
duplicity plantuml
dynare platformio
ejabberd pmd
elasticsearch ponyc
elasticsearch@5.6 poppler
elixir portmidi
elm-format postgis
embulk povray
emscripten pqiv
eralchemy pre-commit
erlang presto
erlang@17 prettier
erlang@18 prips
erlang@19 profanity
erlang@20 proj
eslint prometheus
etcd proselint
euler-py protobuf-swift
evince prototool
exercism pulumi
exiftool pumba
exploitdb puzzles
eye-d3 pwntools
faas-cli pyenv
fabric pygobject3
fail2ban pyinvoke
fd pyside
feh python-markdown
ffmbc qcachegrind
ffmpeg qd
ffmpeg@2.8 qmmp
field3d qt
file-formula quicktype
file-roller rabbitmq
firebase-cli rakudo-star
flake8 rancher-cli
flann ranger
flatbuffers rclone
flow re2
flyway rebar3
fmpp redis
fmsx remarshal
fn restic
fobis restview
folly rom-tools
fonttools root
ford roswell
fortio rst-lint
fossil rtags
fpc ruby
freetds ruby-build
freexl ruby@2.3
frugal rust
fselect rustup-init
fuseki s-search
futhark s3cmd
fzf safe
fzy saxon
gandi.cli sbcl
gauge sbt
gcc@6 scala
gdb sceptre
geckodriver scipy
gecode scour
gedit selenium-server-standalone
genometools serverless
geos shellharden
getdns shocco
ghc shogun
ghostscript shpotify
git simutrans
git-annex skaffold
git-archive-all skafos
git-cola sleuthkit
git-credential-manager smlnj
git-lfs softhsm
git-open solr
git-review sops
git-sizer sourcery
git-standup spades
gitfs sphinx-doc
gitg spotbugs
gitlab-runner sqldiff
gitless sqlite-analyzer
gjs sqlparse
glances sratoolkit
glib ssh-copy-id
glide sshconfigfs
glm sshuttle
global sslmate
gloox stellar-core
gmime stlink
gmt stormpath-cli
gmt@4 stormssh
gnome-latex streamlink
gnu-units strongswan
gnuplot stubby
go stunnel
gocr sundials
godep suricata
goenv svgo
golang-migrate swift-protobuf
googler swiftformat
goolabs swiftgen
gpa tarantool
gpgme tarsnapper
gprof2dot tbb
gradle tcpflow
grafana telegraf
grakn teleport
grip tepl
groovy termius
grpc terraform
grunt-completion terraform-docs
grv terragrunt
gst-editing-services tesseract
gst-libav testssl
gst-plugins-bad texmath
gst-plugins-base tgui
gst-plugins-good tiger-vnc
gst-plugins-ugly tika
gst-python tinc
gst-rtsp-server tippecanoe
gst-validate tmux
gstreamer tomcat@7
gtk-mac-integration tomcat@8
gtkspell3 topgrade
gucharmap tox
gwyddion translate-toolkit
hapi-fhir-cli trash-cli
haproxy tvnamer
harfbuzz twarc
hashpump twine-pypi
hbase typescript
hcloud ucloud
hdf5 uhd
hdf5@1.8 unbound
helmfile unoconv
help2man unp64
highlight unrar
hiredis urh
hledger uriparser
hmmer urweb
homebank v8
honcho vagrant-completion
howdoi vala
httpd valgrind
hugo vapoursynth
hwloc varnish
hyperfine vault
i2p vegeta
iamy vert.x
icdiff vice
ice vim
idris vips
imagemagick vnu
imagemagick@6 vorbis-tools
imageworsener vte3
imapfilter vtk
immortal wabt
influxdb wakatime-cli
internetarchive wallpaper
iproute2mac watchman
ipv6calc watson
ipython wdiff
jbake weaver
jenkins webpack
jenkins-job-builder when
jenkins-lts whois
jerasure wine
jetty wireguard-go
jetty-runner wireguard-tools
jflex wireshark
jfrog-cli-go wtf
jhipster x265
jmeter xcodegen
joplin xctool
jrnl xerces-c
json-fortran xmake
json-glib xmrig
jsonrpc-glib xonsh
juju xtensor
kakoune yamllint
kallisto yara
kerl yarn
kibana yasm
kibana@5.6 yaz
konoha ydcv
kotlin yelp-tools
krakend ykman
kubernetes-cli yle-dl
kubernetes-helm youtube-dl
kubernetes-service-catalog-client yq
kumo yubico-piv-tool
kustomize z3
landscaper zanata-client
languagetool zenity
lasso zig
ldc zookeeper
legit zpython
libbi zsh
libbtbb zsh-completions
libcouchbase zstd
==> Renamed Formulae
gtksourceview@4 -> gtksourceview4
==> Deleted Formulae
asciinema2gif ib opensyobon sickbeard
casperjs juju-quickstart pxz sonarlint
corebird lsh qt@5.5 submarine
datomic mimms queequeg taylor
gjstest nesemu2 reclass tcptrack
hachoir-metadata onepass redis@2.8
heroku open-vcdiff sary

Error: Failed to link all completions, docs and manpages:
Permission denied @ rb_file_s_symlink - (../../../Homebrew/completions/zsh/_brew, /usr/local/share/zsh/site-functions/_brew)
Error: The following directories are not writable by your user:
/usr/local/share/zsh
/usr/local/share/zsh/site-functions

You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/share/zsh /usr/local/share/zsh/site-functions

 

 

 

 

www.slideshare.net

github.com

www.facebook.com

twitter.com

www.instagram.com

 

 

にほんブログ村 IT技術ブログ Linuxへ
Linux

にほんブログ村 IT技術ブログ オープンソースへ
オープンソース

 

 

Opensourcetech by Takahiro Kujirai