惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Security Affairs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Jina AI
Jina AI
P
Palo Alto Networks Blog
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
S
Schneier on Security
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
雷峰网
雷峰网
T
Tenable Blog
人人都是产品经理
人人都是产品经理
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
AWS News Blog
AWS News Blog
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Scott Helme
Scott Helme
SecWiki News
SecWiki News
C
CERT Recently Published Vulnerability Notes
Recorded Future
Recorded Future
I
InfoQ
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
Cloudbric
Cloudbric
C
Check Point Blog
Engineering at Meta
Engineering at Meta
TaoSecurity Blog
TaoSecurity Blog
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
腾讯CDC
量子位
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
Kaspersky official blog
Vercel News
Vercel News
F
Full Disclosure
T
Troy Hunt's Blog
Forbes - Security
Forbes - Security
S
Security @ Cisco Blogs

清江 林影 – 魔帆博客

Linux Tomcat 开机启动 | 魔帆博客 CentOS 7.0关闭默认防火墙启用iptables防火墙 | 魔帆博客 如何修改linux系统主机名称 | 魔帆博客 尘 埃 | 魔帆博客 倦 | 魔帆博客 荷塘 | 魔帆博客 无题 | 魔帆博客 闲想 | 魔帆博客 月光下的玫瑰 | 魔帆博客 清晨的小鸟 | 魔帆博客 矛盾 | 魔帆博客 雨夜 | 魔帆博客 竹林幻梦 | 魔帆博客 因为认识了你 | 魔帆博客 爱情打油诗 | 魔帆博客
Google Docker 初探 | 魔帆博客
清江 林影 · 2017-08-13 · via 清江 林影 – 魔帆博客

系统环境为 macOS Sierra 10.12.6

工具安装

1.kubectl command line

https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-with-homebrew-on-macos

2.gcloud command line

https://cloud.google.com/sdk/docs/quickstart-mac-os-x?hl=zh-CN

gcloud 配置

1.设置 gcloud 用户

$ gcloud config set account [ACCOUNT]

2.授权

授权操作,执行命令后,浏览器自动打开,登录用户后授权既可。

$ gcloud auth login

or

使用 --no-launch-browser 参数执行上面命令,将 url 粘贴到浏览器中访问,登录用户并授权后,将 verification code 复制,在命令行粘贴继续。

$ gcloud auth login --no-launch-browser

3.设置projectId

$ gcloud config set project [PROJECT_ID]

4.查看信息

$ gcloud info

连接到集群

通过运行以下命令来配置 kubectl 命令行访问权限

$ gcloud container clusters get-credentials [CLUSTER_NAME] \
    --zone [ZONE] --project [PROJECT]

可以使用 --log-http 查看http日志:

$ gcloud --log-http container clusters get-credentials [CLUSTER_NAME] \
    --zone [ZONE] --project [PROJECT]

然后启动代理以连接到 Kubernetes 控制平面:

$ kubectl proxy

接着,通过浏览器访问以下位置,以打开“信息中心”界面:

http://localhost:8001/ui

发布一个简单的Hello 应用

google 官方文档 https://cloud.google.com/container-engine/docs/quickstart

$ kubectl run hello-node --image=gcr.io/google-samples/node-hello:1.0 --port=8080

$ kubectl expose deployment hello-node --type="LoadBalancer"

$ kubectl get service hello-node

查看应用程序(将EXTERNAL-IP替换为上一步中获取的外部IP地址)。

http://EXTERNAL-IP:8080