first commits
This commit is contained in:
741
public/2017/11/03/hello-world/index.html
Normal file
741
public/2017/11/03/hello-world/index.html
Normal file
@@ -0,0 +1,741 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313/https://img.zhaohuabing.com/post-bg-2015.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313/https://img.zhaohuabing.com/post-bg-2015.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="Welcome to Zhaohuabing Blog" />
|
||||
<meta property="og:title" content="Welcome to Zhaohuabing Blog" />
|
||||
<meta property="twitter:title" content="Welcome to Zhaohuabing Blog" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Just About Everything">
|
||||
<meta property="og:description" content="Just About Everything" />
|
||||
<meta property="twitter:description" content="Just About Everything" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2017/11/03/hello-world/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>Welcome to Zhaohuabing Blog | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2017/11/03/hello-world/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('https://img.zhaohuabing.com/post-bg-2015.jpg')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
</div>
|
||||
<h1>Welcome to Zhaohuabing Blog</h1>
|
||||
<h2 class="subheading">Hello World, Hello Blog</h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
赵化冰
|
||||
|
||||
on
|
||||
Saturday, November 4, 2017
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<blockquote>
|
||||
<p>“Yeah It’s on. ”</p>
|
||||
</blockquote>
|
||||
<h2 id="hello-world">Hello World!</h2>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2017/11/04/istio-install_and_example/" data-toggle="tooltip" data-placement="top" title="Istio及Bookinfo示例程序安装试用笔记">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2017\/11\/03\/hello-world\/',
|
||||
pageTitle: 'Welcome to Zhaohuabing Blog',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-2 col-lg-offset-0
|
||||
visible-lg-block
|
||||
sidebar-container
|
||||
catalog-container">
|
||||
<div class="side-catalog">
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>
|
||||
<a class="catalog-toggle" href="#">CATALOG</a>
|
||||
</h5>
|
||||
<ul class="catalog-body"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1043
public/2017/11/04/istio-install_and_example/index.html
Normal file
1043
public/2017/11/04/istio-install_and_example/index.html
Normal file
File diff suppressed because it is too large
Load Diff
811
public/2017/11/07/istio-traffic-shifting/index.html
Normal file
811
public/2017/11/07/istio-traffic-shifting/index.html
Normal file
@@ -0,0 +1,811 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/istio-traffic-shifting/crossroads.png">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/istio-traffic-shifting/crossroads.png" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="使用Istio实现应用流量转移" />
|
||||
<meta property="og:title" content="使用Istio实现应用流量转移" />
|
||||
<meta property="twitter:title" content="使用Istio实现应用流量转移" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="本任务将演示如何将应用流量逐渐从旧版本的服务迁移到新版本。通过Istio,可以使用一系列不同权重的规则(10%,20%,··· 100%)将流量平缓地从旧版本服务迁移到新版本服务。">
|
||||
<meta property="og:description" content="本任务将演示如何将应用流量逐渐从旧版本的服务迁移到新版本。通过Istio,可以使用一系列不同权重的规则(10%,20%,··· 100%)将流量平缓地从旧版本服务迁移到新版本服务。" />
|
||||
<meta property="twitter:description" content="本任务将演示如何将应用流量逐渐从旧版本的服务迁移到新版本。通过Istio,可以使用一系列不同权重的规则(10%,20%,··· 100%)将流量平缓地从旧版本服务迁移到新版本服务。" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2017/11/07/istio-traffic-shifting/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>使用Istio实现应用流量转移 | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2017/11/07/istio-traffic-shifting/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('/img/istio-traffic-shifting/crossroads.png')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
<a class="tag" href="/tags/istio" title="Istio">
|
||||
Istio
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h1>使用Istio实现应用流量转移</h1>
|
||||
<h2 class="subheading"> "本文翻译自istio官方文档"</h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
"赵化冰"
|
||||
|
||||
on
|
||||
Tuesday, November 7, 2017
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<p>关于Istio的更多内容请参考<a href="http://istio.doczh.cn/">istio中文文档</a>。</p>
|
||||
<p>原文参见<a href="https://istio.io/docs/tasks/traffic-management/traffic-shifting.html">Traffic Shifting</a>。</p>
|
||||
<p>本任务将演示如何将应用流量逐渐从旧版本的服务迁移到新版本。通过Istio,可以使用一系列不同权重的规则(10%,20%,··· 100%)将流量平缓地从旧版本服务迁移到新版本服务。</p>
|
||||
<p>为简单起见,本任务将采用两步将流量从<code>reviews:v1</code> 迁移到 <code>reviews:v3</code>,权重分别为50%,100%。</p>
|
||||
<h1 id="开始之前">开始之前</h1>
|
||||
<ul>
|
||||
<li>
|
||||
<p>参照文档<a href="http://istio.doczh.cn/docs/setup/kubernetes/index.html">安装指南</a>中的步骤安装Istio。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>部署<a href="http://istio.doczh.cn/docs/guides/bookinfo.html">BookInfo</a> 示例应用程序。</p>
|
||||
</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>请注意:本文档假设示采用kubernetes部署示例应用程序。所有的示例命令行都采用规则yaml文件(例如<code>samples/bookinfo/kube/route-rule-all-v1.yaml</code>)指定的kubernetes版本。如果在不同的环境下运行本任务,请将<code>kube</code>修改为运行环境中相应的目录(例如,对基于Consul的运行环境,目录就是<code>samples/bookinfo/consul/route-rule-all-v1.yaml</code>)。</p>
|
||||
</blockquote>
|
||||
<h1 id="基于权重的版本路由">基于权重的版本路由</h1>
|
||||
<ol>
|
||||
<li>
|
||||
<p>将所有微服务的缺省版本设置为v1.</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>istioctl create -f samples/bookinfo/kube/route-rule-all-v1.yaml
|
||||
</span></span></code></pre></div></li>
|
||||
<li>
|
||||
<p>在浏览器中打开http://$GATEWAY_URL/productpage, 确认<code>reviews</code> 服务目前的活动版本是v1。</p>
|
||||
<p>可以看到浏览器中出现BooInfo应用的productpage页面。
|
||||
注意<code>productpage</code>显示的评价内容不带星级。这是由于<code>reviews:v1</code>不会访问<code>ratings</code>服务。</p>
|
||||
<blockquote>
|
||||
<p>请注意:如果之前执行过 <a href="http://istio.doczh.cn/docs/tasks/traffic-management/request-routing.html">配置请求路由</a>任务,则需要先注销测试用户“jason”或者删除之前单独为该用户创建的测试规则:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>istioctl delete routerule reviews-test-v2
|
||||
</span></span></code></pre></div></li>
|
||||
<li>
|
||||
<p>首先,使用下面的命令把50%的流量从<code>reviews:v1</code>转移到<code>reviews:v3</code>:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>istioctl replace -f samples/bookinfo/kube/route-rule-reviews-50-v3.yaml
|
||||
</span></span></code></pre></div><p>注意这里使用了<code>istioctl replace</code>而不是<code>create</code>。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>在浏览器中多次刷新<code>productpage</code>页面,大约有50%的几率会看到页面中出现带红星的评价内容。</p>
|
||||
<blockquote>
|
||||
<p>请注意:在目前的Envoy sidecar实现中,可能需要刷新<code>productpage</code>很多次才能看到流量分发的效果。在看到页面出现变化前,有可能需要刷新15次或者更多。如果修改规则,将90%的流量路由到v3,可以看到更明显的效果。</p>
|
||||
</blockquote>
|
||||
</li>
|
||||
<li>
|
||||
<p>当v3版本的<code>reviews</code>服务已经稳定运行后,可以将100%的流量路由到<code>reviews:v3</code>:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>istioctl replace -f samples/bookinfo/kube/route-rule-reviews-v3.yaml
|
||||
</span></span></code></pre></div><p>此时,以任何用户登录到<code>productpage</code>页面,都可以看到带红星的评价信息。</p>
|
||||
</li>
|
||||
</ol>
|
||||
<h1 id="理解原理">理解原理</h1>
|
||||
<p>在这个任务中,我们使用了Istio的带权重路由的特性将流量从老版本的<code>reviews</code>服务逐渐迁移到了新版本服务中。</p>
|
||||
<p>注意该方式和使用容器编排平台的部署特性来进行版本迁移是完全不同的。容器编排平台使用了实例scaling来对流量进行管理。而通过Istio,两个版本的<code>reviews</code>服务可以独立地进行scale up和scale down,并不会影响这两个版本服务之间的流量分发。</p>
|
||||
<p>想了解更多支持scaling的按版本路由功能,请查看<a href="https://istio.io/blog/canary-deployments-using-istio.html">Canary Deployments using Istio</a>。</p>
|
||||
<h1 id="清理">清理</h1>
|
||||
<ul>
|
||||
<li>
|
||||
<p>删除路由规则。</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>istioctl delete -f samples/bookinfo/kube/route-rule-all-v1.yaml
|
||||
</span></span></code></pre></div></li>
|
||||
<li>
|
||||
<p>如果不打算尝试后面的任务,请参照<a href="http://istio.doczh.cn/docs/guides/bookinfo.html#cleanup">BookInfo cleanup</a> 中的步骤关闭应用程序。</p>
|
||||
</li>
|
||||
</ul>
|
||||
<h1 id="进阶阅读">进阶阅读</h1>
|
||||
<ul>
|
||||
<li>更多的内容请参见<a href="http://istio.doczh.cn/docs/concepts/traffic-management/rules-configuration.html">请求路由</a>。</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/2017/11/04/istio-install_and_example/" data-toggle="tooltip" data-placement="top" title="Istio及Bookinfo示例程序安装试用笔记">←
|
||||
Previous Post</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2017/11/08/istio-canary-release/" data-toggle="tooltip" data-placement="top" title="采用Istio实现灰度发布(金丝雀发布)">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2017\/11\/07\/istio-traffic-shifting\/',
|
||||
pageTitle: '使用Istio实现应用流量转移',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-2 col-lg-offset-0
|
||||
visible-lg-block
|
||||
sidebar-container
|
||||
catalog-container">
|
||||
<div class="side-catalog">
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>
|
||||
<a class="catalog-toggle" href="#">CATALOG</a>
|
||||
</h5>
|
||||
<ul class="catalog-body"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
992
public/2017/11/08/istio-canary-release/index.html
Normal file
992
public/2017/11/08/istio-canary-release/index.html
Normal file
@@ -0,0 +1,992 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/istio-canary-release/canary_bg.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/istio-canary-release/canary_bg.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="采用Istio实现灰度发布(金丝雀发布)" />
|
||||
<meta property="og:title" content="采用Istio实现灰度发布(金丝雀发布)" />
|
||||
<meta property="twitter:title" content="采用Istio实现灰度发布(金丝雀发布)" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="当应用上线以后,运维面临的一大挑战是如何能在不影响已上线业务的情况下进行升级。本文将介绍如何使用Istio实现应用的灰度发布(金丝雀发布)">
|
||||
<meta property="og:description" content="当应用上线以后,运维面临的一大挑战是如何能在不影响已上线业务的情况下进行升级。本文将介绍如何使用Istio实现应用的灰度发布(金丝雀发布)" />
|
||||
<meta property="twitter:description" content="当应用上线以后,运维面临的一大挑战是如何能在不影响已上线业务的情况下进行升级。本文将介绍如何使用Istio实现应用的灰度发布(金丝雀发布)" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2017/11/08/istio-canary-release/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>采用Istio实现灰度发布(金丝雀发布) | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2017/11/08/istio-canary-release/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<header class="intro-header" style="background-image: url('/img/home-bg-jeep.jpg')">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
|
||||
<div class="site-heading">
|
||||
<h1>David Young </h1>
|
||||
|
||||
<span class="subheading">Bevonovo</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-1
|
||||
col-md-8 col-md-offset-1
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
post-container">
|
||||
|
||||
<h2 id="灰度发布又名金丝雀发布介绍">灰度发布(又名金丝雀发布)介绍</h2>
|
||||
<p>当应用上线以后,运维面临的一大挑战是如何能够在不影响已上线业务的情况下进行升级。做过产品的同学都清楚,不管在发布前做过多么完备的自动化和人工测试,在发布后都会出现或多或少的故障。根据墨菲定律,可能会出错的版本发布一定会出错。</p>
|
||||
<p>“ANYTHING THAN CAN GO WRONG WILL GO WRONG” –MURPHY’S LAW</p>
|
||||
<p>因此我们不能寄希望于在线下测试时发现所有潜在故障。在无法百分百避免版本升级故障的情况下,需要通过一种方式进行可控的版本发布,把故障影响控制在可以接受的范围内,并可以快速回退。</p>
|
||||
<p>可以通过<a href="https://martinfowler.com/bliki/CanaryRelease.html">灰度发布(又名金丝雀发布)</a>来实现业务从老版本到新版本的平滑过渡,并避免升级过程中出现的问题对用户造成的影响。</p>
|
||||
<p>“金丝雀发布”的来源于矿工们用金丝雀对矿井进行空气测试的做法。以前矿工挖煤的时候,矿工下矿井前会先把金丝雀放进去,或者挖煤的时候一直带着金丝雀。金丝雀对甲烷和一氧化碳浓度比较敏感,会先报警。所以大家都用“金丝雀”来搞最先的测试。</p>
|
||||
<p>下图中,左下方的少部分用户就被当作“金丝雀”来用于测试新上线的1.1版本。如果新版本出现问题,“金丝雀”们会报警,但不会影响其他用户业务的正常运行。
|
||||
|
||||
<img src="/img/istio-canary-release/canary-deployment.PNG" alt="Istio灰度发布示意图">
|
||||
|
||||
</p>
|
||||
<p>灰度发布(金丝雀发布)的流程如下:</p>
|
||||
<ul>
|
||||
<li>准备和生产环境隔离的“金丝雀”服务器。</li>
|
||||
<li>将新版本的服务部署到“金丝雀”服务器上。</li>
|
||||
<li>对“金丝雀”服务器上的服务进行自动化和人工测试。</li>
|
||||
<li>测试通过后,将“金丝雀”服务器连接到生产环境,将少量生产流量导入到“金丝雀”服务器中。</li>
|
||||
<li>如果在线测试出现问题,则通过把生产流量从“金丝雀”服务器中重新路由到老版本的服务的方式进行回退,修复问题后重新进行发布。</li>
|
||||
<li>如果在线测试顺利,则逐渐把生产流量按一定策略逐渐导入到新版本服务器中。</li>
|
||||
<li>待新版本服务稳定运行后,删除老版本服务。</li>
|
||||
</ul>
|
||||
<h2 id="istio实现灰度发布金丝雀发布的原理">Istio实现灰度发布(金丝雀发布)的原理</h2>
|
||||
<p>从上面的流程可以看到,如果要实现一套灰度发布的流程,需要应用程序和运维流程对该发布过程进行支持,工作量和难度的挑战是非常大的。虽然面对的问题类似,但每个企业或组织一般采用不同的私有化实现方案来进行灰度发布,为解决该问题导致研发和运维花费了大量的成本。</p>
|
||||
<p>Istio通过高度的抽象和良好的设计采用一致的方式解决了该问题,采用sidecar对应用流量进行了转发,通过Pilot下发路由规则,可以在不修改应用程序的前提下实现应用的灰度发布。</p>
|
||||
<p>备注:采用kubernetes的<a href="https://kubernetes.io/docs/tasks/run-application/rolling-update-replication-controller/">滚动升级(rolling update)</a>功能也可以实现不中断业务的应用升级,但滚动升级是通过逐渐使用新版本的服务来替换老版本服务的方式对应用进行升级,在滚动升级不能对应用的流量分发进行控制,因此无法采用受控地把生产流量逐渐导流到新版本服务中,也就无法控制服务升级对用户造成的影响。</p>
|
||||
<p>采用Istio后,可以通过定制路由规则将特定的流量(如指定特征的用户)导入新版本服务中,在生产环境下进行测试,同时通过渐进受控地导入生产流量,可以最小化升级中出现的故障对用户的影响。并且在同时存在新老版本服务时,还可根据应用压力对不同版本的服务进行独立的缩扩容,非常灵活。采用Istio进行灰度发布的流程如下图所示:
|
||||
|
||||
<img src="/img/istio-canary-release/canary-deployments.gif" alt="Istio灰度发布示意图">
|
||||
|
||||
</p>
|
||||
<h2 id="操作步骤">操作步骤</h2>
|
||||
<p>下面采用Istion自带的BookinfoInfo示例程序来试验灰度发布的流程。</p>
|
||||
<h3 id="测试环境安装">测试环境安装</h3>
|
||||
<p>首先参考<a href="http://zhaohuabing.com/2017/11/04/istio-install_and_example/">手把手教你从零搭建Istio及Bookinfo示例程序</a>安装Kubernetes及Istio控制面。</p>
|
||||
<p>因为本试验并不需要安装全部3个版本的reviews服务,因此如果已经安装了该应用,先采用下面的命令卸载。</p>
|
||||
<pre tabindex="0"><code>istio-0.2.10/samples/bookinfo/kube/cleanup.sh
|
||||
</code></pre><h3 id="部署v1版本的服务">部署V1版本的服务</h3>
|
||||
<p>首先只部署V1版本的Bookinfo应用程序。由于示例中的yaml文件中包含了3个版本的reviews服务,我们先将V2和V3版本的Deployment从yaml文件istio-0.2.10/samples/bookinfo/kube/bookinfo.yaml中删除。</p>
|
||||
<p>从Bookinfo.yaml中删除这部分内容:</p>
|
||||
<pre tabindex="0"><code>apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: reviews-v2
|
||||
spec:
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: reviews
|
||||
version: v2
|
||||
spec:
|
||||
containers:
|
||||
- name: reviews
|
||||
image: istio/examples-bookinfo-reviews-v2:0.2.3
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 9080
|
||||
---
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: reviews-v3
|
||||
spec:
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: reviews
|
||||
version: v3
|
||||
spec:
|
||||
containers:
|
||||
- name: reviews
|
||||
image: istio/examples-bookinfo-reviews-v3:0.2.3
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 9080
|
||||
---
|
||||
</code></pre><p>部署V1版本的Bookinfo程序。</p>
|
||||
<pre tabindex="0"><code>kubectl apply -f <(istioctl kube-inject -f istio-0.2.10/samples/bookinfo/kube/bookinfo.yaml)
|
||||
</code></pre><p>通过kubectl命令行确认pod部署,可以看到只有V1版本的服务。</p>
|
||||
<pre tabindex="0"><code>kubectl get pods
|
||||
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
details-v1-3688945616-nhkqk 2/2 Running 0 2m
|
||||
productpage-v1-2055622944-m3fql 2/2 Running 0 2m
|
||||
ratings-v1-233971408-0f3s9 2/2 Running 0 2m
|
||||
reviews-v1-1360980140-0zs9z 2/2 Running 0 2m
|
||||
</code></pre><p>在浏览器中打开应用程序页面,地址为istio-ingress的External IP。由于V1版本的reviews服务并不会调用rating服务,因此可以看到Product 页面显示的是不带星级的评价信息。</p>
|
||||
<p><code>http://10.12.25.116/productpage</code><br>
|
||||
|
||||
<img src="//img/istio-canary-release/product-page-default.PNG" alt="">
|
||||
|
||||
</p>
|
||||
<p>此时系统中微服务的部署情况如下图所示(下面的示意图均忽略和本例关系不大的details和ratings服务):
|
||||
|
||||
<img src="//img/istio-canary-release/canary-example-only-v1.PNG" alt="">
|
||||
|
||||
</p>
|
||||
<h3 id="部署v2版本的reviews服务">部署V2版本的reviews服务</h3>
|
||||
<p>在部署V2版本的reviews服务前,需要先创建一条缺省路由规则route-rule-default-reviews.yaml,将所有生产流量都导向V1版本,避免对线上用户的影响。</p>
|
||||
<pre tabindex="0"><code>apiVersion: config.istio.io/v1alpha2
|
||||
kind: RouteRule
|
||||
metadata:
|
||||
name: reviews-default
|
||||
spec:
|
||||
destination:
|
||||
name: reviews
|
||||
precedence: 1
|
||||
route:
|
||||
- labels:
|
||||
version: v1
|
||||
</code></pre><p>启用该路由规则。</p>
|
||||
<pre tabindex="0"><code>istioctl create -f route-rule-default-reviews.yaml -n default
|
||||
</code></pre><p>创建一个V2版本的部署文件bookinfo-reviews-v2.yaml,内容如下</p>
|
||||
<pre tabindex="0"><code>apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: reviews-v2
|
||||
spec:
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: reviews
|
||||
version: v2
|
||||
spec:
|
||||
containers:
|
||||
- name: reviews
|
||||
image: istio/examples-bookinfo-reviews-v2:0.2.3
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 9080
|
||||
</code></pre><p>部署V2版本的reviews服务。</p>
|
||||
<pre tabindex="0"><code>kubectl apply -f <(istioctl kube-inject -f bookinfo-reviews-v2.yaml)
|
||||
</code></pre><p>此时系统中部署了V1和V2两个版本的reviews服务,但所有的业务流量都被规则reviews-default导向了V1,如下图所示:
|
||||
|
||||
<img src="/img/istio-canary-release/canary-example-deploy-v2.PNG" alt="">
|
||||
|
||||
</p>
|
||||
<h3 id="将测试流量导入到v2版本的reviews服务">将测试流量导入到V2版本的reviews服务</h3>
|
||||
<p>在进行模拟测试时,由于测试环境和生产环境的网络,服务器,操作系统等环境存在差异,很难完全模拟生产环境进行测试。为了减少环境因素的对测试结果的影响,我们希望能在生产环境中进行上线前的测试,但如果没有很好的隔离措施,可能会导致测试影响已上线的业务,对企业造成损失。</p>
|
||||
<p>通过采用Istio的路由规则,可以在类生产环境中进行测试,又完全隔离了线上用户的生产流量和测试流量,最小化模拟测试对已上线业务的影响。如下图所示:
|
||||
|
||||
<img src="/img/istio-canary-release/canary-example-route-test.PNG" alt="">
|
||||
|
||||
</p>
|
||||
<p>创建一条规则,将用户名为 test-user 的流量导入到V2</p>
|
||||
<pre tabindex="0"><code>apiVersion: config.istio.io/v1alpha2
|
||||
kind: RouteRule
|
||||
metadata:
|
||||
name: reviews-test-user
|
||||
spec:
|
||||
destination:
|
||||
name: reviews
|
||||
precedence: 2
|
||||
match:
|
||||
request:
|
||||
headers:
|
||||
cookie:
|
||||
regex: "^(.*?;)?(user=test-user)(;.*)?$"
|
||||
route:
|
||||
- labels:
|
||||
version: v2
|
||||
</code></pre><p>注意:precedence属性用于设置规则的优先级,在同时存在多条规则的情况下,优先级高的规则将先执行。这条规则的precedence设置为2,以确保其在缺省规则之前运行,将test-user用户的请求导流到V2版本reviews服务中。</p>
|
||||
<p>启用该规则。</p>
|
||||
<pre tabindex="0"><code>istioctl create -f route-rule-test-reviews-v2.yaml -n default
|
||||
</code></pre><p>以test-user用户登录,可以看到V2版本带星级的评价页面。
|
||||
|
||||
<img src="/img/istio-canary-release/product-page-test-user.PNG" alt="">
|
||||
|
||||
</p>
|
||||
<p>注销test-user,只能看到V1版本不带星级的评价页面。如下图所示:
|
||||
|
||||
<img src="/img/istio-canary-release/product-page-default.PNG" alt="">
|
||||
|
||||
</p>
|
||||
<h3 id="将部分生产流量导入到v2版本的reviews服务">将部分生产流量导入到V2版本的reviews服务</h3>
|
||||
<p>在线上模拟测试完成后,如果系统测试情况良好,可以通过规则将一部分用户流量导入到V2版本的服务中,进行小规模的“金丝雀”测试。</p>
|
||||
<p>修改规则route-rule-default-reviews.yaml,将50%的流量导入V2版本。</p>
|
||||
<blockquote>
|
||||
<p>备注:本例只是描述原理,因此为简单起见,将50%流量导入V2版本,在实际操作中,更可能是先导入较少流量,然后根据监控的新版本运行情况将流量逐渐导入,如采用5%,10%,20%,50% …的比例逐渐导入。</p>
|
||||
</blockquote>
|
||||
<pre tabindex="0"><code>apiVersion: config.istio.io/v1alpha2
|
||||
kind: RouteRule
|
||||
metadata:
|
||||
name: reviews-default
|
||||
spec:
|
||||
destination:
|
||||
name: reviews
|
||||
precedence: 1
|
||||
route:
|
||||
- labels:
|
||||
version: v1
|
||||
weight: 50
|
||||
- labels:
|
||||
version: v2
|
||||
weight: 50
|
||||
</code></pre><pre tabindex="0"><code>istioctl replace -f route-rule-default-reviews.yaml -n default
|
||||
</code></pre><p>此时系统部署如下图所示:
|
||||
|
||||
<img src="/img/istio-canary-release/canary-example-route-production-50.PNG" alt="">
|
||||
|
||||
</p>
|
||||
<h3 id="将所有生产流量导入到到v2版本的reviews服务">将所有生产流量导入到到V2版本的reviews服务</h3>
|
||||
<p>如果新版本的服务运行正常,则可以将所有流量导入到V2版本。</p>
|
||||
<pre tabindex="0"><code>apiVersion: config.istio.io/v1alpha2
|
||||
kind: RouteRule
|
||||
metadata:
|
||||
name: reviews-default
|
||||
spec:
|
||||
destination:
|
||||
name: reviews
|
||||
precedence: 1
|
||||
route:
|
||||
- labels:
|
||||
version: v2
|
||||
weight: 100
|
||||
</code></pre><pre tabindex="0"><code>istioctl replace -f route-rule-default-reviews.yaml -n default
|
||||
</code></pre><p>系统部署如下图所示:
|
||||
|
||||
<img src="/img/istio-canary-release/canary-example-route-production-100.PNG" alt="">
|
||||
|
||||
</p>
|
||||
<p>此时不管以任何用户登录,都只能看到V2版本带星级的评价页面,如下图所示:
|
||||
|
||||
<img src="/img/istio-canary-release/product-page-default-v2.PNG" alt="">
|
||||
|
||||
</p>
|
||||
<blockquote>
|
||||
<p>备注:如果灰度发布的过程中新版本的服务出现问题,则可以通过修改路由规则,将流量重新导入到V1版本的服务中,将V2版本故障修复后再进行测试。</p>
|
||||
</blockquote>
|
||||
<h3 id="删除v1版本的reviews服务">删除V1版本的reviews服务</h3>
|
||||
<p>待V2版本上线稳定运行后,删除V1版本的reviews服务和测试规则。</p>
|
||||
<pre tabindex="0"><code>kubectl delete pod reviews-v1-1360980140-0zs9z
|
||||
|
||||
istioctl delete -f route-rule-test-reviews-v2.yaml -n default
|
||||
</code></pre><h2 id="参考">参考</h2>
|
||||
<ul>
|
||||
<li><a href="https://istio.io/docs/">Istio官方文档</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2017\/11\/08\/istio-canary-release\/',
|
||||
pageTitle: '采用Istio实现灰度发布(金丝雀发布)',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-3 col-lg-offset-0
|
||||
col-md-3 col-md-offset-0
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
sidebar-container
|
||||
">
|
||||
|
||||
|
||||
<section class="visible-md visible-lg">
|
||||
|
||||
<div class="short-about">
|
||||
|
||||
<a href="/about">
|
||||
<img src="/img/zhaohuabing.png" alt="avatar" style="cursor: pointer" />
|
||||
</a>
|
||||
|
||||
|
||||
<p>Open Source Enthusiast</p>
|
||||
|
||||
|
||||
<ul class="list-inline">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fa fa-circle fa-stack-2x"></i>
|
||||
<i class="fa fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FEATURED TAGS</h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>LAST POSTS</h5>
|
||||
<ul>
|
||||
|
||||
<li><a href="/2025/07/06/mathematical-formulae/">Authoring mathematical formulae</a></li>
|
||||
|
||||
<li><a href="/post/readme/">Clean White Theme for Hugo</a></li>
|
||||
|
||||
<li><a href="/2018/06/04/introducing-the-istio-v1alpha3-routing-api/">Istio v1aplha3 routing API介绍(译文)</a></li>
|
||||
|
||||
<li><a href="/2018/06/02/istio08/">Istio 0.8 Release发布</a></li>
|
||||
|
||||
<li><a href="/2018/05/24/set_up_my_ubuntu_desktop/">Everything about Setting Up My Ubuntu Desktop</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
970
public/2017/11/28/access-application-from-outside/index.html
Normal file
970
public/2017/11/28/access-application-from-outside/index.html
Normal file
@@ -0,0 +1,970 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313/https://img.zhaohuabing.com/post-bg-2015.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313/https://img.zhaohuabing.com/post-bg-2015.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="如何从外部访问Kubernetes集群中的应用?" />
|
||||
<meta property="og:title" content="如何从外部访问Kubernetes集群中的应用?" />
|
||||
<meta property="twitter:title" content="如何从外部访问Kubernetes集群中的应用?" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="我们知道,kubernetes的Cluster Network属于私有网络,只能在cluster Network内部才能访问部署的应用,那如何才能将Kubernetes集群中的应用暴露到外部网络,为外部用户提供服务呢?本文探讨了从外部网络访问kubernetes cluster中应用的几种实现方式。">
|
||||
<meta property="og:description" content="我们知道,kubernetes的Cluster Network属于私有网络,只能在cluster Network内部才能访问部署的应用,那如何才能将Kubernetes集群中的应用暴露到外部网络,为外部用户提供服务呢?本文探讨了从外部网络访问kubernetes cluster中应用的几种实现方式。" />
|
||||
<meta property="twitter:description" content="我们知道,kubernetes的Cluster Network属于私有网络,只能在cluster Network内部才能访问部署的应用,那如何才能将Kubernetes集群中的应用暴露到外部网络,为外部用户提供服务呢?本文探讨了从外部网络访问kubernetes cluster中应用的几种实现方式。" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2017/11/28/access-application-from-outside/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>如何从外部访问Kubernetes集群中的应用? | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2017/11/28/access-application-from-outside/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('https://img.zhaohuabing.com/post-bg-2015.jpg')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
<a class="tag" href="/tags/kubernetes" title="Kubernetes">
|
||||
Kubernetes
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h1>如何从外部访问Kubernetes集群中的应用?</h1>
|
||||
<h2 class="subheading"></h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
赵化冰
|
||||
|
||||
on
|
||||
Tuesday, November 28, 2017
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<h2 id="前言">前言</h2>
|
||||
<p>我们知道,kubernetes的Cluster Network属于私有网络,只能在cluster Network内部才能访问部署的应用,那如何才能将Kubernetes集群中的应用暴露到外部网络,为外部用户提供服务呢?本文探讨了从外部网络访问kubernetes cluster中应用的几种实现方式。</p>
|
||||
<blockquote>
|
||||
<p>本文尽量试着写得比较容易理解,但要做到“深入浅出”,把复杂的事情用通俗易懂的语言描述出来是非常需要功力的,个人自认尚未达到此境界,唯有不断努力。此外,kubernetes本身是一个比较复杂的系统,无法在本文中详细解释涉及的所有相关概念,否则就可能脱离了文章的主题,因此假设阅读此文之前读者对kubernetes的基本概念如docker,container,pod已有所了解。</p>
|
||||
</blockquote>
|
||||
<p>另外此文中的一些内容是自己的理解,由于个人的知识范围有限,可能有误,如果读者对文章中的内容有疑问或者勘误,欢迎大家指证。</p>
|
||||
<h2 id="pod和service">Pod和Service</h2>
|
||||
<p>我们首先来了解一下Kubernetes中的Pod和Service的概念。</p>
|
||||
<p>Pod(容器组),英文中Pod是豆荚的意思,从名字的含义可以看出,Pod是一组有依赖关系的容器,Pod包含的容器都会运行在同一个host节点上,共享相同的volumes和network namespace空间。Kubernetes以Pod为基本操作单元,可以同时启动多个相同的pod用于failover或者load balance。</p>
|
||||
<p>
|
||||
<img src="/img/access-application-from-outside/pod.PNG" alt="Pod">
|
||||
|
||||
</p>
|
||||
<p>Pod的生命周期是短暂的,Kubernetes根据应用的配置,会对Pod进行创建,销毁,根据监控指标进行缩扩容。kubernetes在创建Pod时可以选择集群中的任何一台空闲的Host,因此其网络地址是不固定的。由于Pod的这一特点,一般不建议直接通过Pod的地址去访问应用。</p>
|
||||
<p>为了解决访问Pod不方便直接访问的问题,Kubernetes采用了Service的概念,Service是对后端提供服务的一组Pod的抽象,Service会绑定到一个固定的虚拟IP上,该虚拟IP只在Kubernetes Cluster中可见,但其实该IP并不对应一个虚拟或者物理设备,而只是IPtable中的规则,然后再通过IPtable将服务请求路由到后端的Pod中。通过这种方式,可以确保服务消费者可以稳定地访问Pod提供的服务,而不用关心Pod的创建、删除、迁移等变化以及如何用一组Pod来进行负载均衡。</p>
|
||||
<p>Service的机制如下图所示,Kube-proxy监听kubernetes master增加和删除Service以及Endpoint的消息,对于每一个Service,kube proxy创建相应的iptables规则,将发送到Service Cluster IP的流量转发到Service后端提供服务的Pod的相应端口上。
|
||||
|
||||
<img src="/img/access-application-from-outside/services-iptables-overview.png" alt="Pod和Service的关系">
|
||||
|
||||
</p>
|
||||
<blockquote>
|
||||
<p>备注:虽然可以通过Service的Cluster IP和服务端口访问到后端Pod提供的服务,但该Cluster IP是Ping不通的,原因是Cluster IP只是iptable中的规则,并不对应到一个网络设备。</p>
|
||||
</blockquote>
|
||||
<h2 id="service的类型">Service的类型</h2>
|
||||
<p>Service的类型(ServiceType)决定了Service如何对外提供服务,根据类型不同,服务可以只在Kubernetes cluster中可见,也可以暴露到Cluster外部。Service有三种类型,ClusterIP,NodePort和LoadBalancer。其中ClusterIP是Service的缺省类型,这种类型的服务会提供一个只能在Cluster内才能访问的虚拟IP,其实现机制如上面一节所述。</p>
|
||||
<h2 id="通过nodeport提供外部访问入口">通过NodePort提供外部访问入口</h2>
|
||||
<p>通过将Service的类型设置为NodePort,可以在Cluster中的主机上通过一个指定端口暴露服务。注意通过Cluster中每台主机上的该指定端口都可以访问到该服务,发送到该主机端口的请求会被kubernetes路由到提供服务的Pod上。采用这种服务类型,可以在kubernetes cluster网络外通过主机IP:端口的方式访问到服务。</p>
|
||||
<blockquote>
|
||||
<p>注意:官方文档中说明了Kubernetes clusterIp的流量转发到后端Pod有Iptable和kube proxy两种方式。但对Nodeport如何转发流量却语焉不详。该图来自网络,从图来看是通过kube proxy转发的,我没有去研究过源码。欢迎了解的同学跟帖说明。</p>
|
||||
</blockquote>
|
||||
<p>
|
||||
<img src="/img/access-application-from-outside/nodeport.PNG" alt="Pod和Service的关系">
|
||||
|
||||
</p>
|
||||
<p>下面是通过NodePort向外暴露服务的一个例子,注意可以指定一个nodePort,也可以不指定。在不指定的情况下,kubernetes会从可用的端口范围内自动分配一个随机端口。</p>
|
||||
<pre tabindex="0"><code>kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: influxdb
|
||||
spec:
|
||||
type: NodePort
|
||||
ports:
|
||||
- port: 8086
|
||||
nodePort: 30000
|
||||
selector:
|
||||
name: influxdb
|
||||
</code></pre><p>通过NodePort从外部访问有下面的一些问题,自己玩玩或者进行测试时可以使用该方案,但不适宜用于生产环境。</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>Kubernetes cluster host的IP必须是一个well-known IP,即客户端必须知道该IP。但Cluster中的host是被作为资源池看待的,可以增加删除,每个host的IP一般也是动态分配的,因此并不能认为host IP对客户端而言是well-known IP。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>客户端访问某一个固定的host IP存在单点故障。假如一台host宕机了,kubernetes cluster会把应用 reload到另一节点上,但客户端就无法通过该host的nodeport访问应用了。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>该方案假设客户端可以访问Kubernetes host所在网络。在生产环境中,客户端和Kubernetes host网络可能是隔离的。例如客户端可能是公网中的一个手机APP,是无法直接访问host所在的私有网络的。</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>因此,需要通过一个网关来将外部客户端的请求导入到Cluster中的应用中,在kubernetes中,这个网关是一个4层的load balancer。</p>
|
||||
<h2 id="通过load-balancer提供外部访问入口">通过Load Balancer提供外部访问入口</h2>
|
||||
<p>通过将Service的类型设置为LoadBalancer,可以为Service创建一个外部Load Balancer。Kubernetes的文档中声明该Service类型需要云服务提供商的支持,其实这里只是在Kubernetes配置文件中提出了一个要求,即为该Service创建Load Balancer,至于如何创建则是由Google Cloud或Amazon Cloud等云服务商提供的,创建的Load Balancer不在Kubernetes Cluster的管理范围中。kubernetes 1.6版本中,WS, Azure, CloudStack, GCE and OpenStack等云提供商已经可以为Kubernetes提供Load Balancer.下面是一个Load balancer类型的Service例子:</p>
|
||||
<pre tabindex="0"><code>kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: influxdb
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 8086
|
||||
selector:
|
||||
name: influxdb
|
||||
</code></pre><p>部署该Service后,我们来看一下Kubernetes创建的内容</p>
|
||||
<pre tabindex="0"><code>$ kubectl get svc influxdb
|
||||
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
influxdb 10.97.121.42 10.13.242.236 8086:30051/TCP 39s
|
||||
</code></pre><p>Kubernetes首先为influxdb创建了一个集群内部可以访问的ClusterIP 10.97.121.42。由于没有指定nodeport端口,kubernetes选择了一个空闲的30051主机端口将service暴露在主机的网络上,然后通知cloud provider创建了一个load balancer,上面输出中的EEXTERNAL-IP就是load balancer的IP。</p>
|
||||
<p>测试使用的Cloud Provider是OpenStack,我们通过neutron lb-vip-show可以查看创建的Load Balancer详细信息。</p>
|
||||
<pre tabindex="0"><code>$ neutron lb-vip-show 9bf2a580-2ba4-4494-93fd-9b6969c55ac3
|
||||
+---------------------+--------------------------------------------------------------+
|
||||
| Field | Value |
|
||||
+---------------------+--------------------------------------------------------------+
|
||||
| address | 10.13.242.236 |
|
||||
| admin_state_up | True |
|
||||
| connection_limit | -1 |
|
||||
| description | Kubernetes external service a6ffa4dadf99711e68ea2fa163e0b082 |
|
||||
| id | 9bf2a580-2ba4-4494-93fd-9b6969c55ac3 |
|
||||
| name | a6ffa4dadf99711e68ea2fa163e0b082 |
|
||||
| pool_id | 392917a6-ed61-4924-acb2-026cd4181755 |
|
||||
| port_id | e450b80b-6da1-4b31-a008-280abdc6400b |
|
||||
| protocol | TCP |
|
||||
| protocol_port | 8086 |
|
||||
| session_persistence | |
|
||||
| status | ACTIVE |
|
||||
| status_description | |
|
||||
| subnet_id | 73f8eb91-90cf-42f4-85d0-dcff44077313 |
|
||||
| tenant_id | 4d68886fea6e45b0bc2e05cd302cccb9 |
|
||||
+---------------------+--------------------------------------------------------------+
|
||||
|
||||
$ neutron lb-pool-show 392917a6-ed61-4924-acb2-026cd4181755
|
||||
+------------------------+--------------------------------------+
|
||||
| Field | Value |
|
||||
+------------------------+--------------------------------------+
|
||||
| admin_state_up | True |
|
||||
| description | |
|
||||
| health_monitors | |
|
||||
| health_monitors_status | |
|
||||
| id | 392917a6-ed61-4924-acb2-026cd4181755 |
|
||||
| lb_method | ROUND_ROBIN |
|
||||
| members | d0825cc2-46a3-43bd-af82-e9d8f1f85299 |
|
||||
| | 3f73d3bb-bc40-478d-8d0e-df05cdfb9734 |
|
||||
| name | a6ffa4dadf99711e68ea2fa163e0b082 |
|
||||
| protocol | TCP |
|
||||
| provider | haproxy |
|
||||
| status | ACTIVE |
|
||||
| status_description | |
|
||||
| subnet_id | 73f8eb91-90cf-42f4-85d0-dcff44077313 |
|
||||
| tenant_id | 4d68886fea6e45b0bc2e05cd302cccb9 |
|
||||
| vip_id | 9bf2a580-2ba4-4494-93fd-9b6969c55ac3 |
|
||||
+------------------------+--------------------------------------+
|
||||
|
||||
$ neutron lb-member-list
|
||||
+--------------------------------------+--------------+---------------+--------+----------------+--------+
|
||||
| id | address | protocol_port | weight | admin_state_up | status |
|
||||
+--------------------------------------+--------------+---------------+--------+----------------+--------+
|
||||
| 3f73d3bb-bc40-478d-8d0e-df05cdfb9734 | 10.13.241.89 | 30051 | 1 | True | ACTIVE |
|
||||
| d0825cc2-46a3-43bd-af82-e9d8f1f85299 | 10.13.241.10 | 30051 | 1 | True | ACTIVE |
|
||||
+--------------------------------------+--------------+---------------+--------+----------------+--------
|
||||
</code></pre><p>可以看到OpenStack使用VIP 10.13.242.236在端口8086创建了一个Load Balancer,Load Balancer对应的Lb pool里面有两个成员10.13.241.89 和 10.13.241.10,正是Kubernetes的host节点,进入Load balancer流量被分发到这两个节点对应的Service Nodeport 30051上。</p>
|
||||
<p>但是如果客户端不在Openstack Neutron的私有子网上,则还需要在load balancer的VIP上关联一个floating IP,以使外部客户端可以连接到load balancer。</p>
|
||||
<p>部署Load balancer后,应用的拓扑结构如下图所示(注:本图假设Kubernetes Cluster部署在Openstack私有云上)。
|
||||
|
||||
<img src="/img/access-application-from-outside/load-balancer.PNG" alt="外部Load balancer">
|
||||
|
||||
</p>
|
||||
<blockquote>
|
||||
<p>备注:如果kubernetes环境在Public Cloud上,Loadbalancer类型的Service创建出的外部Load Balancer已经带有公网IP地址,是可以直接从外部网络进行访问的,不需要绑定floating IP这个步骤。例如在AWS上创建的Elastic Load Balancing (ELB),有兴趣可以看一下这篇文章:<a href="http://docs.heptio.com/content/tutorials/aws-qs-services-elb.html">Expose Services on your AWS Quick Start Kubernetes cluster</a>。</p>
|
||||
</blockquote>
|
||||
<p>如果Kubernetes Cluster是在不支持LoadBalancer特性的cloud provider或者裸机上创建的,可以实现LoadBalancer类型的Service吗?应该也是可以的。Kubernetes本身并不直接支持Loadbalancer,但我们可以通过对Kubernetes进行扩展来实现,可以监听kubernetes Master的service创建消息,并根据消息部署相应的Load Balancer(如Nginx或者HAProxy),来实现Load balancer类型的Service。</p>
|
||||
<p>通过设置Service类型提供的是四层Load Balancer,当只需要向外暴露一个服务的时候,可以直接采用这种方式。但在一个应用需要对外提供多个服务时,采用该方式会为每一个服务(IP+Port)都创建一个外部load balancer。如下图所示
|
||||
|
||||
<img src="/img/access-application-from-outside/multiple-load-balancer.PNG" alt="创建多个Load balancer暴露应用的多个服务">
|
||||
|
||||
|
||||
一般来说,同一个应用的多个服务/资源会放在同一个域名下,在这种情况下,创建多个Load balancer是完全没有必要的,反而带来了额外的开销和管理成本。直接将服务暴露给外部用户也会导致了前端和后端的耦合,影响了后端架构的灵活性,如果以后由于业务需求对服务进行调整会直接影响到客户端。可以通过使用Kubernetes Ingress进行L7 load balancing来解决该问题。</p>
|
||||
<h2 id="采用ingress作为七层load-balancer">采用Ingress作为七层load balancer</h2>
|
||||
<p>首先看一下引入Ingress后的应用拓扑示意图(注:本图假设Kubernetes Cluster部署在Openstack私有云上)。
|
||||
|
||||
<img src="/img/access-application-from-outside/ingress.PNG" alt="采用Ingress暴露应用的多个服务">
|
||||
|
||||
|
||||
这里Ingress起到了七层负载均衡器和Http方向代理的作用,可以根据不同的url把入口流量分发到不同的后端Service。外部客户端只看到foo.bar.com这个服务器,屏蔽了内部多个Service的实现方式。采用这种方式,简化了客户端的访问,并增加了后端实现和部署的灵活性,可以在不影响客户端的情况下对后端的服务部署进行调整。</p>
|
||||
<p>下面是Kubernetes Ingress配置文件的示例,在虚拟主机foot.bar.com下面定义了两个Path,其中/foo被分发到后端服务s1,/bar被分发到后端服务s2。</p>
|
||||
<pre tabindex="0"><code>apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: test
|
||||
annotations:
|
||||
ingress.kubernetes.io/rewrite-target: /
|
||||
spec:
|
||||
rules:
|
||||
- host: foo.bar.com
|
||||
http:
|
||||
paths:
|
||||
- path: /foo
|
||||
backend:
|
||||
serviceName: s1
|
||||
servicePort: 80
|
||||
- path: /bar
|
||||
backend:
|
||||
serviceName: s2
|
||||
servicePort: 80
|
||||
</code></pre><p>注意这里Ingress只描述了一个虚拟主机路径分发的要求,可以定义多个Ingress,描述不同的7层分发要求,而这些要求需要由一个Ingress Controller来实现。Ingress Contorller会监听Kubernetes Master得到Ingress的定义,并根据Ingress的定义对一个7层代理进行相应的配置,以实现Ingress定义中要求的虚拟主机和路径分发规则。Ingress Controller有多种实现,Kubernetes提供了一个<a href="https://github.com/kubernetes/ingress-nginx">基于Nginx的Ingress Controller</a>。需要注意的是,在部署Kubernetes集群时并不会缺省部署Ingress Controller,需要我们自行部署。</p>
|
||||
<p>下面是部署Nginx Ingress Controller的配置文件示例,注意这里为Nginx Ingress Controller定义了一个LoadBalancer类型的Service,以为Ingress Controller提供一个外部可以访问的公网IP。</p>
|
||||
<pre tabindex="0"><code>apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx-ingress
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 80
|
||||
name: http
|
||||
- port: 443
|
||||
name: https
|
||||
selector:
|
||||
k8s-app: nginx-ingress-lb
|
||||
---
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx-ingress-controller
|
||||
spec:
|
||||
replicas: 2
|
||||
revisionHistoryLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
k8s-app: nginx-ingress-lb
|
||||
spec:
|
||||
terminationGracePeriodSeconds: 60
|
||||
containers:
|
||||
- name: nginx-ingress-controller
|
||||
image: gcr.io/google_containers/nginx-ingress-controller:0.8.3
|
||||
imagePullPolicy: Always
|
||||
//----omitted for brevity----
|
||||
</code></pre><blockquote>
|
||||
<p>备注:Google Cloud直接支持Ingress资源,如果应用部署在Google Cloud中,Google Cloud会自动为Ingress资源创建一个7层load balancer,并为之分配一个外部IP,不需要自行部署Ingress Controller。</p>
|
||||
</blockquote>
|
||||
<h2 id="结论">结论</h2>
|
||||
<p>采用Ingress加上Load balancer的方式可以将Kubernetes Cluster中的应用服务暴露给外部客户端。这种方式比较灵活,基本可以满足大部分应用的需要。但如果需要在入口处提供更强大的功能,如有更高的效率要求,需求进行安全认证,日志记录,或者需要一些应用的定制逻辑,则需要考虑采用微服务架构中的API Gateway模式,采用一个更强大的API Gateway来作为应用的流量入口。</p>
|
||||
<h2 id="参考">参考</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<p><a href="http://alesnosek.com/blog/2017/02/14/accessing-kubernetes-pods-from-outside-of-the-cluster/">Accessing Kubernetes Pods from Outside of the Cluster</a></p>
|
||||
</li>
|
||||
<li>
|
||||
<p><a href="https://daemonza.github.io/2017/02/13/kubernetes-nginx-ingress-controller/">Kubernetes nginx-ingress-controller</a></p>
|
||||
</li>
|
||||
<li>
|
||||
<p><a href="https://docs.openstack.org/magnum/ocata/dev/kubernetes-load-balancer.html">Using Kubernetes external load balancer feature</a></p>
|
||||
</li>
|
||||
<li>
|
||||
<p><a href="http://docs.heptio.com/content/tutorials/aws-qs-services-elb.html">Expose Services on your AWS Quick Start Kubernetes cluster</a></p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/2017/11/08/istio-canary-release/" data-toggle="tooltip" data-placement="top" title="采用Istio实现灰度发布(金丝雀发布)">←
|
||||
Previous Post</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2018/01/02/nginmesh-install/" data-toggle="tooltip" data-placement="top" title="Nginx开源Service Mesh组件Nginmesh安装指南">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2017\/11\/28\/access-application-from-outside\/',
|
||||
pageTitle: '如何从外部访问Kubernetes集群中的应用?',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-2 col-lg-offset-0
|
||||
visible-lg-block
|
||||
sidebar-container
|
||||
catalog-container">
|
||||
<div class="side-catalog">
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>
|
||||
<a class="catalog-toggle" href="#">CATALOG</a>
|
||||
</h5>
|
||||
<ul class="catalog-body"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1072
public/2018/01/02/nginmesh-install/index.html
Normal file
1072
public/2018/01/02/nginmesh-install/index.html
Normal file
File diff suppressed because it is too large
Load Diff
684
public/2018/02/09/docker-without-sudo/index.html
Normal file
684
public/2018/02/09/docker-without-sudo/index.html
Normal file
@@ -0,0 +1,684 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/docker.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/docker.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="如何使用非root用户执行docker命令" />
|
||||
<meta property="og:title" content="如何使用非root用户执行docker命令" />
|
||||
<meta property="twitter:title" content="如何使用非root用户执行docker命令" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="如何使用非root用户执行docker命令">
|
||||
<meta property="og:description" content="如何使用非root用户执行docker命令" />
|
||||
<meta property="twitter:description" content="如何使用非root用户执行docker命令" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2018/02/09/docker-without-sudo/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>如何使用非root用户执行docker命令 | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2018/02/09/docker-without-sudo/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('/img/docker.jpg')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
<a class="tag" href="/tags/tips" title="Tips">
|
||||
Tips
|
||||
</a>
|
||||
|
||||
<a class="tag" href="/tags/docker" title="Docker">
|
||||
Docker
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h1>如何使用非root用户执行docker命令</h1>
|
||||
<h2 class="subheading"></h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
赵化冰
|
||||
|
||||
on
|
||||
Friday, February 9, 2018
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<h3 id="add-the-docker-group-if-it-doesnt-already-exist">Add the docker group if it doesn’t already exist:</h3>
|
||||
<p>sudo groupadd docker</p>
|
||||
<h3 id="add-the-connected-user-user-to-the-docker-group-change-the-user-name-to-match-your-preferred-user-if-you-do-not-want-to-use-your-current-user">Add the connected user “$USER” to the docker group. Change the user name to match your preferred user if you do not want to use your current user:</h3>
|
||||
<p>sudo gpasswd -a $USER docker</p>
|
||||
<h3 id="either-do-a-newgrp-docker-or-log-outin-to-activate-the-changes-to-groups">Either do a newgrp docker or log out/in to activate the changes to groups.</h3>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/2018/05/22/user_authentication_authorization/" data-toggle="tooltip" data-placement="top" title="如何构建安全的微服务应用?">←
|
||||
Previous Post</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2018/02/09/vim-tips/" data-toggle="tooltip" data-placement="top" title="Vim Tips">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2018\/02\/09\/docker-without-sudo\/',
|
||||
pageTitle: '如何使用非root用户执行docker命令',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
790
public/2018/02/09/vim-tips/index.html
Normal file
790
public/2018/02/09/vim-tips/index.html
Normal file
@@ -0,0 +1,790 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/2018-02-09-vim-tips/matrix.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/2018-02-09-vim-tips/matrix.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="Vim Tips" />
|
||||
<meta property="og:title" content="Vim Tips" />
|
||||
<meta property="twitter:title" content="Vim Tips" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Vim Tips and tricks">
|
||||
<meta property="og:description" content="Vim Tips and tricks" />
|
||||
<meta property="twitter:description" content="Vim Tips and tricks" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2018/02/09/vim-tips/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>Vim Tips | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2018/02/09/vim-tips/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('/img/2018-02-09-vim-tips/matrix.jpg')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
<a class="tag" href="/tags/tips" title="Tips">
|
||||
Tips
|
||||
</a>
|
||||
|
||||
<a class="tag" href="/tags/vim" title="Vim">
|
||||
Vim
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h1>Vim Tips</h1>
|
||||
<h2 class="subheading"></h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
赵化冰
|
||||
|
||||
on
|
||||
Friday, February 9, 2018
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<h2 id="vim-graphical-cheat-sheet">vim graphical cheat sheet</h2>
|
||||
<p>
|
||||
<img src="//img/2018-02-09-vim-tips/vi-vim-cheat-sheet.svg" alt="">
|
||||
|
||||
</p>
|
||||
<h2 id="vim-jumps">Vim Jumps</h2>
|
||||
<ul>
|
||||
<li>^ — Move to start of line</li>
|
||||
<li>$ — Move to end of line</li>
|
||||
<li>b — Move back a word</li>
|
||||
<li>w — Move forward a word</li>
|
||||
<li>e — Move to the end of the next word</li>
|
||||
<li>Ctrl-o and Ctrl-i to go to the previous/next location you jumped to</li>
|
||||
<li>``(two backticks) jump back to where you were</li>
|
||||
<li>gi go back to the last place you inserted a text and enter insert mode</li>
|
||||
</ul>
|
||||
<h2 id="vim-navigations">Vim Navigations</h2>
|
||||
<ul>
|
||||
<li>{ and } jump paragraph back and forth</li>
|
||||
<li>Ctrl-F/B move one screen back and forth</li>
|
||||
<li>Search the word under cursor, then n/p to jump to next/previous</li>
|
||||
</ul>
|
||||
<h2 id="enable-vim-mode-in-bash">Enable Vim mode in bash</h2>
|
||||
<p>vi ~/.inputrc
|
||||
set editing-mode vi</p>
|
||||
<h2 id="enable-system-clipboard-support">Enable system clipboard support</h2>
|
||||
<p>See if system clipboard is supported:</p>
|
||||
<pre tabindex="0"><code>$ vim --version | grep clipboard
|
||||
-clipboard +iconv +path_extra -toolbar
|
||||
+eval +mouse_dec +startuptime -xterm_clipboard
|
||||
</code></pre><p>Rinstall vim as vim-gnome:</p>
|
||||
<pre tabindex="0"><code>sudo apt-get install vim-gnome
|
||||
</code></pre><p>Select what you want using the mouse - then type to copy to clipboard:</p>
|
||||
<pre tabindex="0"><code>"+y
|
||||
</code></pre><p>To paste to vim from clipboard type:</p>
|
||||
<pre tabindex="0"><code>"+p
|
||||
</code></pre><h2 id="others">Others</h2>
|
||||
<ul>
|
||||
<li>Ex: open the current directory</li>
|
||||
<li>set number: show line number</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/2018/02/09/docker-without-sudo/" data-toggle="tooltip" data-placement="top" title="如何使用非root用户执行docker命令">←
|
||||
Previous Post</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2018/03/13/use-docker-behind-http-proxy/" data-toggle="tooltip" data-placement="top" title="如何配置docker使用HTTP代理">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2018\/02\/09\/vim-tips\/',
|
||||
pageTitle: 'Vim Tips',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-2 col-lg-offset-0
|
||||
visible-lg-block
|
||||
sidebar-container
|
||||
catalog-container">
|
||||
<div class="side-catalog">
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>
|
||||
<a class="catalog-toggle" href="#">CATALOG</a>
|
||||
</h5>
|
||||
<ul class="catalog-body"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
771
public/2018/03/13/use-docker-behind-http-proxy/index.html
Normal file
771
public/2018/03/13/use-docker-behind-http-proxy/index.html
Normal file
@@ -0,0 +1,771 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/docker.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/docker.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="如何配置docker使用HTTP代理" />
|
||||
<meta property="og:title" content="如何配置docker使用HTTP代理" />
|
||||
<meta property="twitter:title" content="如何配置docker使用HTTP代理" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="如何配置docker使用HTTP代理">
|
||||
<meta property="og:description" content="如何配置docker使用HTTP代理" />
|
||||
<meta property="twitter:description" content="如何配置docker使用HTTP代理" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2018/03/13/use-docker-behind-http-proxy/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>如何配置docker使用HTTP代理 | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2018/03/13/use-docker-behind-http-proxy/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('/img/docker.jpg')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
<a class="tag" href="/tags/tips" title="Tips">
|
||||
Tips
|
||||
</a>
|
||||
|
||||
<a class="tag" href="/tags/docker" title="Docker">
|
||||
Docker
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h1>如何配置docker使用HTTP代理</h1>
|
||||
<h2 class="subheading"></h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
赵化冰
|
||||
|
||||
on
|
||||
Tuesday, March 13, 2018
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<h2 id="ubuntu">Ubuntu</h2>
|
||||
<h3 id="设置docker使用http-proxy">设置docker使用http proxy</h3>
|
||||
<pre tabindex="0"><code>sudo /etc/default/docker
|
||||
|
||||
export http_proxy="http://127.0.0.1:3128/"
|
||||
export https_proxy="http://127.0.0.1:3128/"
|
||||
export HTTP_PROXY="http://127.0.0.1:3128/"
|
||||
export HTTPS_PROXY="http://127.0.0.1:3128/"
|
||||
</code></pre><h3 id="加载配置并重启docker">加载配置并重启docker</h3>
|
||||
<pre tabindex="0"><code>sudo service docker restart
|
||||
</code></pre><h2 id="centos">CentOS</h2>
|
||||
<h3 id="设置docker使用http-proxy-1">设置docker使用http proxy</h3>
|
||||
<pre tabindex="0"><code>sudo mkdir -p /etc/systemd/system/docker.service.d
|
||||
|
||||
echo '
|
||||
[Service]
|
||||
Environment="HTTP_PROXY=http://proxy.foo.bar.com:80/"
|
||||
' | sudo tee /etc/systemd/system/docker.service.d/http-proxy.conf
|
||||
</code></pre><h3 id="加载配置并重启docker-1">加载配置并重启docker</h3>
|
||||
<pre tabindex="0"><code>sudo systemctl daemon-reload
|
||||
sudo systemctl restart docker
|
||||
</code></pre>
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/2018/02/09/vim-tips/" data-toggle="tooltip" data-placement="top" title="Vim Tips">←
|
||||
Previous Post</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2018/03/29/what-is-service-mesh-and-istio/" data-toggle="tooltip" data-placement="top" title="谈谈微服务架构中的基础设施:Service Mesh与Istio">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2018\/03\/13\/use-docker-behind-http-proxy\/',
|
||||
pageTitle: '如何配置docker使用HTTP代理',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-2 col-lg-offset-0
|
||||
visible-lg-block
|
||||
sidebar-container
|
||||
catalog-container">
|
||||
<div class="side-catalog">
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>
|
||||
<a class="catalog-toggle" href="#">CATALOG</a>
|
||||
</h5>
|
||||
<ul class="catalog-body"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1022
public/2018/03/29/what-is-service-mesh-and-istio/index.html
Normal file
1022
public/2018/03/29/what-is-service-mesh-and-istio/index.html
Normal file
File diff suppressed because it is too large
Load Diff
790
public/2018/04/11/service-mesh-vs-api-gateway/index.html
Normal file
790
public/2018/04/11/service-mesh-vs-api-gateway/index.html
Normal file
@@ -0,0 +1,790 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/2018-04-11-service-mesh-vs-api-gateway/background.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/2018-04-11-service-mesh-vs-api-gateway/background.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="Service Mesh 和 API Gateway的关系探讨(译文)" />
|
||||
<meta property="og:title" content="Service Mesh 和 API Gateway的关系探讨(译文)" />
|
||||
<meta property="twitter:title" content="Service Mesh 和 API Gateway的关系探讨(译文)" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="API Gateway和Service Mesh的关系是我最近一直在思考的问题,也和同事及社区的朋友之间进行了一些讨论。这篇短文很清晰地总结了两者之间的相似之处以及这两者在微服务架构中的不同用途。">
|
||||
<meta property="og:description" content="API Gateway和Service Mesh的关系是我最近一直在思考的问题,也和同事及社区的朋友之间进行了一些讨论。这篇短文很清晰地总结了两者之间的相似之处以及这两者在微服务架构中的不同用途。" />
|
||||
<meta property="twitter:description" content="API Gateway和Service Mesh的关系是我最近一直在思考的问题,也和同事及社区的朋友之间进行了一些讨论。这篇短文很清晰地总结了两者之间的相似之处以及这两者在微服务架构中的不同用途。" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2018/04/11/service-mesh-vs-api-gateway/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>Service Mesh 和 API Gateway的关系探讨(译文) | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2018/04/11/service-mesh-vs-api-gateway/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('/img/2018-04-11-service-mesh-vs-api-gateway/background.jpg')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
<a class="tag" href="/tags/microservice" title="Microservice">
|
||||
Microservice
|
||||
</a>
|
||||
|
||||
<a class="tag" href="/tags/service-mesh" title="Service Mesh">
|
||||
Service Mesh
|
||||
</a>
|
||||
|
||||
<a class="tag" href="/tags/api-gateway" title="API Gateway">
|
||||
API Gateway
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h1>Service Mesh 和 API Gateway的关系探讨(译文)</h1>
|
||||
<h2 class="subheading"></h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
赵化冰
|
||||
|
||||
on
|
||||
Wednesday, April 11, 2018
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<h2 id="service-mesh-vs-api-gateway">Service Mesh vs API Gateway</h2>
|
||||
<p>在<a href="https://medium.com/microservices-in-practice/service-mesh-for-microservices-2953109a3c9a">前一篇关于Service Mesh的文章</a>中,我提到了几个关于Service Mesh和API Gateway之间关系的问题,在本篇文章中,我打算就Service Mesh和API Gateway的用途进行进一步讨论。</p>
|
||||
<p>为了区分API Gateway和Service Mesh,让我们先分别看看两者各自的关键特征。</p>
|
||||
<h2 id="api-gateway-将服务作为被管理的api向外部暴露">API Gateway: 将服务作为被管理的API向外部暴露</h2>
|
||||
<p>使用API Gateway的主要目的是将微服务作为被管理的API暴露(给外部系统)。因此,我们在API Gateway层开发的API或者边界服务对外提供了业务功能。</p>
|
||||
<p>API/边界服务调用下游的组合或者原子微服务,通过组合/混装多个下游微服务的方式来提供业务逻辑。</p>
|
||||
<p>在API/Edge服务调用下游服务时,需要采用一种可靠的通信方式,应用了断路器,超时,负载均衡/故障转移等可靠性模式。因此大部分的API Gateway解决方案都内置了这些特性。</p>
|
||||
<p>API Gateway也内置了以下特性的支持,包括:服务发现,分析(可见性:性能指标,监控,分布式日志,分布式调用追踪)和安全。</p>
|
||||
<p>API Gateway和API管理生态系统的其他组件的关系紧密,比如: API 市场/商店, API 发布门户。</p>
|
||||
<h2 id="service-mesh微服务的网络通信基础设施">Service Mesh:微服务的网络通信基础设施</h2>
|
||||
<p>现在我们来看看Service Mesh有哪些不同。</p>
|
||||
<p>Service Mesh是一个网络通信基础设施, 可以用于将应用层的网络通信功能从你的服务代码中剥离出来。</p>
|
||||
<p>采用Service Mesh, 你不用在服务代码中实现用于可靠通信的模式如断路,超时等,类似地,Service Mesh也提供了服务发现,服务可见性等其他功能。</p>
|
||||
<h2 id="api-gateway和service-mesh实践">API Gateway和Service Mesh实践</h2>
|
||||
<p>API Gateway和Service Mesh之间的主要不同点:API Gateway是暴露API/边界服务的关键组件,而Service Mesh则仅仅是一个服务间通信的基础设施,并不了解应用中的业务逻辑。</p>
|
||||
<p>下图说明了API Gateway和Service Mesh的关系。如同前面所说,这两者之间也有一些重叠的部分(例如断路器等),但重要的是需要理解这两者是用于完全不同的用途。</p>
|
||||
<p>图1: API Gateway和Service Mesh实践</p>
|
||||
<p>
|
||||
<img src="/img/2018-04-11-service-mesh-vs-api-gateway/service-mesh-vs-api-gateway.png" alt="">
|
||||
|
||||
</p>
|
||||
<p>如上图所示,Service Mesh作为Sidecar(边车)和服务一起部署,它是独立于服务的业务逻辑的。</p>
|
||||
<p>另一方面,API Gateway 提供了所有的API服务(这些API服务有明确定义的业务功能),它是应用业务逻辑的一部分。API Gateway可以具有内建的服务间通信能力,但它也可以使用Service Mesh来调用下游服务(API Gateway->Service Mesh->Microservices)。</p>
|
||||
<p>在API管理层次,你可以使用API Gateway内建的服务间通信能力;也可以通过Service Mesh来调用下游服务,以将应用网络通信功能从应用程序转移到Service Mesh中。</p>
|
||||
<h2 id="译者按">译者按</h2>
|
||||
<p>API Gateway和Service Mesh的关系是我最近一直在思考的问题,也和同事及社区的朋友之间进行了一些讨论。这篇短文很清晰地总结了两者之间的相似之处以及这两者在微服务架构中的不同用途。</p>
|
||||
<p>文章中提到“可以使用API Gateway内建的服务间通信能力;也可以通过Service Mesh来调用下游服务”。在和同事讨论时,大家提到一个比较重要的考虑因素是在API Gateway处引入一个Sidecar可能带来的额外延迟。</p>
|
||||
<p>API Gateway作为微服务引用的流量入口,其对效率要求较高,如果随API Gateway部署一个Sidecar,可能对效率有一定影响。</p>
|
||||
<p>我对此未进行测试,但从理论上来说,服务发现,重试,断路等逻辑无论放到API Gateway还是Service Mesh中耗时应该是差不多的,部署Sidecar只是增加了创建一个本地链接的消耗,如下图所示:
|
||||
|
||||
<img src="/img/2018-04-11-service-mesh-vs-api-gateway/api-gateway-with-service-mesh.png" alt="">
|
||||
|
||||
</p>
|
||||
<p>将API Gateway和Service Mesh的功能进行清晰划分,API Gateway负责应用逻辑,Service Mesh负责服务通讯,Metrics收集等微服务基础设施,这样划分后在架构上更为清晰。对于效率问题,我们可以考虑对API Gateway进行水平扩展来解决。</p>
|
||||
<h2 id="原文">原文</h2>
|
||||
<p>本译文发表已征得原作者同意,原文参见 <a href="https://medium.com/microservices-in-practice/service-mesh-vs-api-gateway-a6d814b9bf56">Service Mesh vs API Gateway</a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/2018/03/29/what-is-service-mesh-and-istio/" data-toggle="tooltip" data-placement="top" title="谈谈微服务架构中的基础设施:Service Mesh与Istio">←
|
||||
Previous Post</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2018/04/16/using-helm-to-deploy-to-kubernetes/" data-toggle="tooltip" data-placement="top" title="Helm介绍">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2018\/04\/11\/service-mesh-vs-api-gateway\/',
|
||||
pageTitle: 'Service Mesh 和 API Gateway的关系探讨(译文)',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-2 col-lg-offset-0
|
||||
visible-lg-block
|
||||
sidebar-container
|
||||
catalog-container">
|
||||
<div class="side-catalog">
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>
|
||||
<a class="catalog-toggle" href="#">CATALOG</a>
|
||||
</h5>
|
||||
<ul class="catalog-body"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1003
public/2018/04/16/using-helm-to-deploy-to-kubernetes/index.html
Normal file
1003
public/2018/04/16/using-helm-to-deploy-to-kubernetes/index.html
Normal file
File diff suppressed because it is too large
Load Diff
889
public/2018/05/01/may-day-jiulonghu/index.html
Normal file
889
public/2018/05/01/may-day-jiulonghu/index.html
Normal file
@@ -0,0 +1,889 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/2018-05-01-may-day-jiulonghu/snowmountain.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/2018-05-01-may-day-jiulonghu/snowmountain.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="川西秘境探险" />
|
||||
<meta property="og:title" content="川西秘境探险" />
|
||||
<meta property="twitter:title" content="川西秘境探险" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Just About Everything">
|
||||
<meta property="og:description" content="Just About Everything" />
|
||||
<meta property="twitter:description" content="Just About Everything" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2018/05/01/may-day-jiulonghu/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>川西秘境探险 | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2018/05/01/may-day-jiulonghu/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('/img/2018-05-01-may-day-jiulonghu/snowmountain.jpg')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
<a class="tag" href="/tags/travel" title="Travel">
|
||||
Travel
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h1>川西秘境探险</h1>
|
||||
<h2 class="subheading">2018五一甘堡藏寨,九龙湖自驾游记</h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
赵化冰
|
||||
|
||||
on
|
||||
Tuesday, May 1, 2018
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<h2 id="寻浮云牧场不遇">寻浮云牧场不遇</h2>
|
||||
<p>五一节前的一周内,几个朋友就纷纷坐不住了,一个二个不再安心上班,开始在微信群里讨论过节要到哪里耍。
|
||||
大家思来想去,最后决定还是去理县方向。因为根据多年自驾的经验,只要出了汶川,沿途都是风景。</p>
|
||||
<p>放假第一天和第二天上午老婆加班,我在家里陪女儿做作业,提前把车油加好,准备路上的衣物。第二天中午老婆上完班,我迫不及待开着小狮子就向都汶高速出发了。虽然加班耽误了一天半,但我们这次也算错峰出行了,一路上畅通无阻,心情自然也比较愉快。 开车1个多点小时就赶到了汶川,这时朋友一家刚在汶川县城吃完午饭,我们在出汶川不远,桃坪羌寨附近胜利会师了。</p>
|
||||
<p>两位领导一起协商了一下,决定先开车去通化乡的“浮云牧场”看看。“浮云牧场”是最近的一个网红酒店,在通化乡山上的一个藏寨旁边。有道是:“浮云牧场”,不放牛羊,只牧浮云和姑娘。</p>
|
||||
<p>“浮云牧场”走的是网红路线,马蜂窝,微信公众号的宣传做得好,知名度较高,房间比较紧俏,在五一期间更是一房难求,而且价格也比较感人。两位领导都持家有方,指示我们上去看看风景,然后下山再找住宿。</p>
|
||||
<p>过了桃坪羌寨大概几公里,317国道右边有一个比较明显的指路牌,往右上山,就是到浮云牧场的路。我们兴冲冲地开车上了山,此时,我们心中向往的浮云牧场是这样子的(取图自网络):
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/fuyunmuchang.jpeg" alt="">
|
||||
|
||||
|
||||
上山的路况还可以,但比较窄,回头弯较多,需要注意对方来车。开了将近1小时后,来到了半山腰,对面来了好几辆下山的车。由于两方相遇的路面较窄,开始堵车了。这时乘机向对方打听了山上的情况,得知酒店封路了,只有预定了房间的人才能进入浮云牧场。</p>
|
||||
<p>得知这个消息,此时我们的内心是崩溃的,已经开了一大半的山路,现在却得知不能进去。没有办法,大家商量后还是决定下山。不过“塞翁失马,焉知非福”,这次没进入浮云牧场,为第二天探秘一个新景点埋下伏笔,现在暂时不表。于是我和朋友调转车头,悻悻下山,败意而回。</p>
|
||||
<h2 id="夜宿甘堡藏寨">夜宿甘堡藏寨</h2>
|
||||
<p>下山后,大家商量晚上的住宿。我觉得桃坪羌寨靠路边,环境也一般,提议去靠近理县的甘堡藏寨。朋友因为在桃坪羌寨住过了,因此也想去另外的地方试试。于是一路向理县方向进发,由于限速较低,车辆也开始多了起来,感觉没多远的距离,开了接近1小时,6点左右来到了甘堡藏寨。</p>
|
||||
<p>最后一个靠小河边的藏家乐入住,一个标间240元,包3个人一顿晚饭,一顿早饭。我和朋友两家分别在二楼和三楼的两间房间住下。这里得表扬一下领导,每次出来耍选择的住宿都挺好,性价比高,住着也舒服。</p>
|
||||
<p>这是一个河边的小院,有三层楼,院子里面种满了各种植物和花卉,老板是个很和气的中年人,把小院收拾得很舒服。房间里挺宽敞,床上套着雪白的床单,非常干净整洁。</p>
|
||||
<p>院子里的洋槐树树冠上开满了白色的小花,配着嫩绿的树叶和攀缘的蔷薇,感觉非常的清新和惬意。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/nongjiale1.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>老板的三层小楼,这里的修房的材料不是砖头,而是就地取材用山上的片状岩石修砌而成的,很有特色。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/nongjiale3.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>窗户旁边挂着金黄色的玉米。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/nongjiale.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>院子里种的玫瑰花。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/rose.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>我们和老板闲聊,提到今天没得进到浮云牧场,老板笑道:这浮云牧场的景色我们这里到处都有,只是浮云牧场有老板投资,宣传做得好罢了。这后面山上就有草场,还有一个九龙湖,就挺好耍。我们听了,赶紧向老板仔细打听线路和路况,跃跃欲试,打算明天去探寻这个尚未开发的野景点。</p>
|
||||
<p>不一会儿,麻利的老板和老板娘就把晚餐准备好了。我们和其他客人一起围桌吃晚饭。晚餐味道不错,好些是城里平时吃不到的东西。例如有老腊肉,核桃花,和一些不知名的野菜,非常爽口开胃。我带了一瓶红酒,和朋友们一起就着这山野美味,好不畅快。</p>
|
||||
<p>晚上小朋友闹着要玩游戏,于是先一起玩了一会儿游戏,洗漱之后,便倒在床上酣然入梦。是夜,半梦半醒之间,窗外潺潺的河水声,院子里淡淡的槐花香仿佛也潜入梦来。</p>
|
||||
<h2 id="甘堡藏寨风情">甘堡藏寨风情</h2>
|
||||
<p>昨晚虽然睡得不是很熟,但藏家院子里空气清新,精神恢复得很快,我没到七点就醒了。起床和大家一起吃了早饭,早饭是烤馍,鸡蛋,咸菜和稀饭。吃完饭后,陪孩子们去寨子里逛了一下。寨子不大,半个小时就能走完,街上摆着一些小摊,售卖一些民族特色的小饰品。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/village2.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>两个小朋友在小摊上找自己喜欢的小饰品,摊主是一个十八九岁的小姑娘,她平时在成都读书,放假回来摆个小摊勤工俭学。最后照顾她生意,给每个小朋友买了一个十多块钱的小玩意。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/village3.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>寨子墙上的石板画,画的是藏族传说中的英雄人物格萨尔王。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/geshaerwang.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<h2 id="探秘九龙湖">探秘九龙湖</h2>
|
||||
<p>我逛完寨子,其余人也收拾妥当了。向老板告辞后,我们准备向九龙湖进发。细心的老板怕我们找不到地方,特意给我们画了一张地图。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/map.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>开车顺着河边一路上山,很快就上了盘山公路。路面是水泥的,有护栏,只是路比较窄,很对地方只能容一车通过。川西山区的路基本都是这样之字形的,回头弯很多,这种回头弯一般有30到40度的坡度。我家的小狮子是1.6的,如果速度开慢点的话,过弯时得用一档。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/road1.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>山路两边的风景很美,低海拔地区有很多樱桃树,核桃树以及开满了花的洋槐树。洋槐花蜜过一段时间就会上市了,很香的。我们摘了一些花带回家,杨槐花焯水后可以炒蛋,也可以和在面里面吃。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/yanghuaihua.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>树上结满了樱桃,别看樱桃树不高,一棵树可以产两百斤樱桃。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/cherry.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>再往上开,到了海拔高一点的地方,乔木就比较少了,路两边多是低矮的绿色灌木,以及不知名的小花。五月间的植物都是嫩绿嫩绿的,煞是好看。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/flower.jpg" alt="">
|
||||
|
||||
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/flower1.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>看到几头牛在路边吃草,看这淡定的眼神!山路边还时不时冒出一群小黑猪,目测就是一只就十多斤重,想给它们拍张照片,飞快地钻进灌木丛里面了,只好作罢。川西山里和草原上这种猪都是这样像牛羊一样放养的。我们流着口水说这个是资格的跑山猪,味道肯定巴适!
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/cattle.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>半山上的几户藏家。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/village1.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>开到最高的一个寨子后,后面的路就是土路了。向寨子里一个大姐打听了一下,大姐信誓旦旦地说这两天没下大雨,轿车开上去没问题,于是我们就继续往上开了。</p>
|
||||
<p>上土路后不久,遇到一个搭车的老爷子,他要去山顶的寺庙烧香。我们的运气也挺好,要不是老人家陪我们一起,后面我们不一定找得到地方。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/oldman.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>开了一段土路后,发现路比较窄,路边就是悬崖,而且没有护栏。老婆娃儿都说还是停下来走路上去算了。于是和朋友找了一个路口把车停到路边,开始走路上山。朋友停车后说,在前面几个转弯的地方,开车时脚趾拇都抓紧了。</p>
|
||||
<p>最后一段就是这种路,地面硬化程度不错,没有下雨的情况下,胆子大点的老师傅可以开上山。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/road.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>老爷子说这个路开车完全没得问题嘛,他看到别人都开车上去的。我们是不敢继续往前开了,他也只好下车和我们一起走。我一边走一边和老人家聊天,得知他已经高寿76了,完全看不出来,腰板硬朗,牙齿健全,走路比我们年轻人还快。老人家自豪地说他寨子阳光好,地肥沃,种什么粮食产量都高。</p>
|
||||
<p>老人家所在的寨子,地里面已经种上了玉米。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/village.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>我继续和老爷子边走边聊,老爷子告诉我,走山路要不紧不慢,快了容易呼吸不畅,引起高原反应。还给我介绍路边的各种植物,哪种可以食用。从聊天中得知,大爷姓何,祖上是从陕西迁移到这里的,到他这里已经是第九代了。家里有四个女儿,都在理县做生意或者打工,寨子的家里就他和老伴。他说他喜欢住在山里,一年也出不了几次山。
|
||||
看得出老爷子很高兴有人能陪他说说话,住在山里虽然空气好,但子女不在身边,老人平时估计也比较寂寞。</p>
|
||||
<p>老爷子说这种野菜煮汤喝很香。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/yecai.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>转过一个弯,听见路边的灌木丛中“噗噗”的声音,飞出一只长尾巴的大鸟来,老爷子说那是野鸡。太快了没能拍到照片。</p>
|
||||
<p>就这么慢慢地走了将近1小时,来到了山顶上。</p>
|
||||
<p>令人惊奇的是,虽然上山的路很陡,但山顶上却非常开阔,有一大片草坝子。从山顶上可以隐约看到对面巍峨的雪山,今天天气不是很好,能见度不高,如果是在晴天的话,肯定非常壮观。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/snowmountain.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>山顶搭建了一个台子和一个草房。大爷说这是举行节日的时候的临时厨房。每年有三个时间山顶的草坝上会举行锅庄舞会。这个木板上标注了山顶上望过去的几座雪山,可以看到最高的大黄峰有将近6000米高。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/snowmountain1.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>山顶还有一个小秋千,两个小孩在上面玩得不亦乐乎。
|
||||
|
||||
<img src="/img/2018-05-01-may-day-jiulonghu/swing.jpg" alt="">
|
||||
|
||||
</p>
|
||||
<p>我对比了网上浮云牧场的图片,感觉这个山顶的雪山比浮云牧场更雄伟。这座山的风景也更好,树木,灌木,草地层次分明;而浮云牧场上山的路上很多地方是光秃秃的。</p>
|
||||
<p>到山顶后,再往前走大约500米,翻过一个小山坡就到了九龙湖,但是湖中长满了草,没有水。大爷说现在水不多,九龙湖一共有九个海子,前面的海子还比较远。此时天空飘起了小雨,由于担心下雨后下山的路湿滑不安全,我们和大爷就此告别,开始下山了。离别时,大爷热情地给我说他家在寨子里面的位置,让我们下次过来耍时再来找他。大爷钻进灌木,很快就不见了,看着他消失的背影,我心想,下次到这边来耍时,希望还能遇到这个开朗乐观的何大爷。</p>
|
||||
<p>下山的路比上山要轻松多了,大家有说有笑,很快就走到了停车的地方,一路开下山。然后走317,都汶,成灌回了成都。路上有一点小堵,但一切都很顺利,回到成都时也才6点左右。</p>
|
||||
<blockquote>
|
||||
<p>请注意:川西地区山路路况复杂,请勿根据博客内容自行前往,否则一切后果自负。</p>
|
||||
</blockquote>
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/2018/04/16/using-helm-to-deploy-to-kubernetes/" data-toggle="tooltip" data-placement="top" title="Helm介绍">←
|
||||
Previous Post</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2018/05/21/algolia-integration-with-jekyll/" data-toggle="tooltip" data-placement="top" title="使用Algolia为Gitpage博客提供站内搜索">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2018\/05\/01\/may-day-jiulonghu\/',
|
||||
pageTitle: '川西秘境探险',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-2 col-lg-offset-0
|
||||
visible-lg-block
|
||||
sidebar-container
|
||||
catalog-container">
|
||||
<div class="side-catalog">
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>
|
||||
<a class="catalog-toggle" href="#">CATALOG</a>
|
||||
</h5>
|
||||
<ul class="catalog-body"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
906
public/2018/05/21/algolia-integration-with-jekyll/index.html
Normal file
906
public/2018/05/21/algolia-integration-with-jekyll/index.html
Normal file
@@ -0,0 +1,906 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/2018-05-06-cryptocurrency_week1/bitcoin_header.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/2018-05-06-cryptocurrency_week1/bitcoin_header.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="使用Algolia为Gitpage博客提供站内搜索" />
|
||||
<meta property="og:title" content="使用Algolia为Gitpage博客提供站内搜索" />
|
||||
<meta property="twitter:title" content="使用Algolia为Gitpage博客提供站内搜索" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Just About Everything">
|
||||
<meta property="og:description" content="Just About Everything" />
|
||||
<meta property="twitter:description" content="Just About Everything" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2018/05/21/algolia-integration-with-jekyll/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>使用Algolia为Gitpage博客提供站内搜索 | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2018/05/21/algolia-integration-with-jekyll/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('/img/2018-05-06-cryptocurrency_week1/bitcoin_header.jpg')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
<a class="tag" href="/tags/jekyllq" title="Jekyll:q">
|
||||
Jekyll:q
|
||||
</a>
|
||||
|
||||
<a class="tag" href="/tags/bitcoin" title="Bitcoin">
|
||||
Bitcoin
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h1>使用Algolia为Gitpage博客提供站内搜索</h1>
|
||||
<h2 class="subheading"></h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
赵化冰
|
||||
|
||||
on
|
||||
Monday, May 21, 2018
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<blockquote>
|
||||
<p>This series of articles are my notes of “Bitcoin and Cryptocurrency Technologies” online course.</p>
|
||||
</blockquote>
|
||||
<h2 id="table-of-content">Table of Content</h2>
|
||||
<p>{:.no_toc}</p>
|
||||
<ul>
|
||||
<li>Table of Content
|
||||
{:toc}</li>
|
||||
</ul>
|
||||
<h2 id="scrooge-coin-transaction">Scrooge Coin Transaction</h2>
|
||||
<p>Scrooge Coin programming assignment is a little bit tricky, the video of this lesson hasn’t explained some implementation details. To help you understand the transaction data structure used in Scrooge Coin, I draw this diagram:
|
||||
|
||||
<img src="/img/2018-5-20-cryptocurrency_week1_scroogecoin/scroogecoin.png" alt="Scrooge Coin">
|
||||
|
||||
</p>
|
||||
<p>Every transaction has a set of inputs and a set of outputs. An input in a transaction must use a hash pointer to refer to its corresponding output in the previous transaction, and it must be signed with the private key of the owner because the owner needs to prove he/she agrees to spend his/her coins.</p>
|
||||
<p>Every output is correlated to the public key of the receiver, which is his/her ScroogeCoin address.</p>
|
||||
<p>In the first transaction, we assume that Scrooge has created 10 coins and assigned them to himself, we don’t doubt that because the system-Scroogecoin has a building rule which says that Scrooge has right to create coins.</p>
|
||||
<p>In the second transaction, Scrooge transferred 3.9 coins to Alice and 5.9 coins to Bob. The sum of the two outputs is 0.2 less than the input because the transaction fee was 0.2 coin.</p>
|
||||
<p>In the third transaction, there were two inputs and one output, Alice and Bob transferred 9.7 coins to mike, and the transaction fee was 0.1 coin.</p>
|
||||
<h2 id="unclaimed-transaction-outputs-pool">Unclaimed transaction outputs pool</h2>
|
||||
<p>Another trick we need to Note when doing the programming assignment is that an UTXOPool is introduced to track the unclaimed outputs (unspent coins), so we can know whether the corresponding output of an input of the transaction is available or not.</p>
|
||||
<h2 id="txhandler-java-code">TxHandler Java Code</h2>
|
||||
<pre tabindex="0"><code>import java.security.PublicKey;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class TxHandler {
|
||||
private UTXOPool utxoPool;
|
||||
|
||||
/**
|
||||
* Creates a public ledger whose current UTXOPool (collection of unspent
|
||||
* transaction outputs) is {@code utxoPool}. This should make a copy of utxoPool
|
||||
* by using the UTXOPool(UTXOPool uPool) constructor.
|
||||
*/
|
||||
public TxHandler(UTXOPool utxoPool) {
|
||||
this.utxoPool = new UTXOPool(utxoPool);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if: (1) all outputs claimed by {@code tx} are in the current
|
||||
* UTXO pool, (2) the signatures on each input of {@code tx} are valid,
|
||||
* (3) no UTXO is claimed multiple times by {@code tx}, (4) all of
|
||||
* {@code tx}s output values are non-negative, and (5) the sum of
|
||||
* {@code tx}s input values is greater than or equal to the sum of its
|
||||
* output values; and false otherwise.
|
||||
*/
|
||||
public boolean isValidTx(Transaction tx) {
|
||||
Set<UTXO> claimedUTXO = new HashSet<UTXO>();
|
||||
double inputSum = 0;
|
||||
double outputSum = 0;
|
||||
|
||||
List<Transaction.Input> inputs = tx.getInputs();
|
||||
for (int i = 0; i < inputs.size(); i++) {
|
||||
Transaction.Input input = inputs.get(i);
|
||||
|
||||
if (!isConsumedCoinAvailable(input)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!verifySignatureOfConsumeCoin(tx, i, input)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isCoinConsumedMultipleTimes(claimedUTXO, input)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
UTXO utxo = new UTXO(input.prevTxHash, input.outputIndex);
|
||||
Transaction.Output correspondingOutput = utxoPool.getTxOutput(utxo);
|
||||
inputSum += correspondingOutput.value;
|
||||
|
||||
}
|
||||
|
||||
List<Transaction.Output> outputs = tx.getOutputs();
|
||||
for (int i = 0; i < outputs.size(); i++) {
|
||||
Transaction.Output output = outputs.get(i);
|
||||
if (output.value <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
outputSum += output.value;
|
||||
}
|
||||
|
||||
// Should the input value and output value be equal? Otherwise the ledger will
|
||||
// become unbalanced.
|
||||
// The difference between inputSum and outputSum is the transaction fee
|
||||
if (outputSum > inputSum) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean isCoinConsumedMultipleTimes(Set<UTXO> claimedUTXO, Transaction.Input input) {
|
||||
UTXO utxo = new UTXO(input.prevTxHash, input.outputIndex);
|
||||
return !claimedUTXO.add(utxo);
|
||||
}
|
||||
|
||||
private boolean verifySignatureOfConsumeCoin(Transaction tx, int index, Transaction.Input input) {
|
||||
UTXO utxo = new UTXO(input.prevTxHash, input.outputIndex);
|
||||
Transaction.Output correspondingOutput = utxoPool.getTxOutput(utxo);
|
||||
PublicKey pk = correspondingOutput.address;
|
||||
return Crypto.verifySignature(pk, tx.getRawDataToSign(index), input.signature);
|
||||
}
|
||||
|
||||
private boolean isConsumedCoinAvailable(Transaction.Input input) {
|
||||
UTXO utxo = new UTXO(input.prevTxHash, input.outputIndex);
|
||||
return utxoPool.contains(utxo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles each epoch by receiving an unordered array of proposed transactions,
|
||||
* checking each transaction for correctness, returning a mutually valid array
|
||||
* of accepted transactions, and updating the current UTXO pool as appropriate.
|
||||
*/
|
||||
public Transaction[] handleTxs(Transaction[] possibleTxs) {
|
||||
List<Transaction> acceptedTx = new ArrayList<Transaction>();
|
||||
for (int i = 0; i < possibleTxs.length; i++) {
|
||||
Transaction tx = possibleTxs[i];
|
||||
if (isValidTx(tx)) {
|
||||
acceptedTx.add(tx);
|
||||
|
||||
removeConsumedCoinsFromPool(tx);
|
||||
addCreatedCoinsToPool(tx);
|
||||
}
|
||||
}
|
||||
|
||||
Transaction[] result = new Transaction[acceptedTx.size()];
|
||||
acceptedTx.toArray(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
private void addCreatedCoinsToPool(Transaction tx) {
|
||||
List<Transaction.Output> outputs = tx.getOutputs();
|
||||
for (int j = 0; j < outputs.size(); j++) {
|
||||
Transaction.Output output = outputs.get(j);
|
||||
UTXO utxo = new UTXO(tx.getHash(), j);
|
||||
utxoPool.addUTXO(utxo, output);
|
||||
}
|
||||
}
|
||||
|
||||
private void removeConsumedCoinsFromPool(Transaction tx) {
|
||||
List<Transaction.Input> inputs = tx.getInputs();
|
||||
for (int j = 0; j < inputs.size(); j++) {
|
||||
Transaction.Input input = inputs.get(j);
|
||||
UTXO utxo = new UTXO(input.prevTxHash, input.outputIndex);
|
||||
utxoPool.removeUTXO(utxo);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</code></pre><h2 id="all-the-example-codes-on-github">All the Example Codes on GitHub</h2>
|
||||
<p>I wrap the codes into a maven project, just run <code>mvn test</code> then the example codes will build and run all the test cases.</p>
|
||||
<p><a href="https://github.com/zhaohuabing/scroogecoin">Scrooge Coin example in Java</a></p>
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/2018/05/01/may-day-jiulonghu/" data-toggle="tooltip" data-placement="top" title="川西秘境探险">←
|
||||
Previous Post</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2018/05/23/istio-auto-injection-with-webhook/" data-toggle="tooltip" data-placement="top" title="Istio Sidecar自动注入原理">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2018\/05\/21\/algolia-integration-with-jekyll\/',
|
||||
pageTitle: '使用Algolia为Gitpage博客提供站内搜索',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-2 col-lg-offset-0
|
||||
visible-lg-block
|
||||
sidebar-container
|
||||
catalog-container">
|
||||
<div class="side-catalog">
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>
|
||||
<a class="catalog-toggle" href="#">CATALOG</a>
|
||||
</h5>
|
||||
<ul class="catalog-body"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
892
public/2018/05/22/user_authentication_authorization/index.html
Normal file
892
public/2018/05/22/user_authentication_authorization/index.html
Normal file
@@ -0,0 +1,892 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/2018-05-22-user_authentication_authorization/background.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/2018-05-22-user_authentication_authorization/background.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="微服务安全沉思录之一" />
|
||||
<meta property="og:title" content="微服务安全沉思录之一" />
|
||||
<meta property="twitter:title" content="微服务安全沉思录之一" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="这段时间对之前微服务安全相关的一些想法进行了进一步总结和归纳,理清在之前文章里面没有想得太清楚的地方,例如服务间的认证与鉴权以及用户身份在服务调用链中的传递。在这一系列博客里面将分为三个部分对微服务安全进行系统阐述:用户访问认证与鉴权,服务间认证与鉴权,外部系统访问控制。">
|
||||
<meta property="og:description" content="这段时间对之前微服务安全相关的一些想法进行了进一步总结和归纳,理清在之前文章里面没有想得太清楚的地方,例如服务间的认证与鉴权以及用户身份在服务调用链中的传递。在这一系列博客里面将分为三个部分对微服务安全进行系统阐述:用户访问认证与鉴权,服务间认证与鉴权,外部系统访问控制。" />
|
||||
<meta property="twitter:description" content="这段时间对之前微服务安全相关的一些想法进行了进一步总结和归纳,理清在之前文章里面没有想得太清楚的地方,例如服务间的认证与鉴权以及用户身份在服务调用链中的传递。在这一系列博客里面将分为三个部分对微服务安全进行系统阐述:用户访问认证与鉴权,服务间认证与鉴权,外部系统访问控制。" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2018/05/22/user_authentication_authorization/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>微服务安全沉思录之一 | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2018/05/22/user_authentication_authorization/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('/img/2018-05-22-user_authentication_authorization/background.jpg')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
<a class="tag" href="/tags/microservice" title="Microservice">
|
||||
Microservice
|
||||
</a>
|
||||
|
||||
<a class="tag" href="/tags/security" title="Security">
|
||||
Security
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h1>微服务安全沉思录之一</h1>
|
||||
<h2 class="subheading">用户访问认证与鉴权</h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
"赵化冰"
|
||||
|
||||
on
|
||||
Wednesday, May 23, 2018
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<blockquote>
|
||||
<p>这段时间对之前微服务安全相关的一些想法进行了进一步总结和归纳,理清了在之前文章里面没有想得太清楚的地方,例如服务间的认证与鉴权以及用户身份在服务调用链中的传递。</p>
|
||||
<p>在这一系列文章里,我将尝试分为三个部分对微服务安全进行系统阐述:用户访问认证与鉴权,服务间认证与鉴权,外部系统访问控制。</p>
|
||||
</blockquote>
|
||||
<h2 id="目录">目录</h2>
|
||||
<p>{:.no_toc}</p>
|
||||
<ul>
|
||||
<li>目录
|
||||
{:toc}</li>
|
||||
</ul>
|
||||
<h2 id="前言">前言</h2>
|
||||
<p>微服务架构的引入为软件应用带来了诸多好处:包括小开发团队,缩短开发周期,语言选择灵活性,增强服务伸缩能力等。与此同时,也引入了分布式系统的诸多复杂问题。其中一个挑战就是如何在微服务架构中实现一个灵活,安全,高效的认证和鉴权方案。</p>
|
||||
<p>相对于传统单体应用,微服务架构下的认证和鉴权涉及到场景更为复杂,涉及到用户访问微服务应用,第三方应用访问微服务应用,应用内多个微服务之间相互访问等多种场景,每种场景下的认证和鉴权方案都需要考虑到,以保证应用程序的安全性。本系列博文将就此问题进行一次比较完整的探讨。
|
||||
|
||||
<img src="//img/2018-02-03-authentication-and-authorization-of-microservice/auth-scenarios.png" alt="微服务认证和鉴权涉及到的三种场景">
|
||||
|
||||
</p>
|
||||
<center>微服务认证和鉴权涉及到的三种场景</center>
|
||||
<h2 id="用户认证和鉴权">用户认证和鉴权</h2>
|
||||
<h3 id="用户身份认证">用户身份认证</h3>
|
||||
<p>一个完整的微服务应用是由多个相互独立的微服务进程组成的,对每个微服务的访问都需要进行用户认证。如果将用户认证的工作放到每个微服务中,存在下面一些问题:</p>
|
||||
<ul>
|
||||
<li>需要在各个微服务中重复实现这部分公共逻辑。虽然我们可以使用代码库复用部分代码,但这又会导致所有微服务对特定代码库及其版本存在依赖,影响微服务语言/框架选择的灵活性。</li>
|
||||
<li>将认证和鉴权的公共逻辑放到微服务实现中违背了单一职责原理,开发人员应重点关注微服务自身的业务逻辑。</li>
|
||||
<li>用户需要分别登录以访问系统中不同的服务。</li>
|
||||
</ul>
|
||||
<p>由于在微服务架构中以API Gateway作为对外提供服务的入口,因此可以在API Gateway处提供统一的用户认证,用户只需要登录一次,就可以访问系统中所有微服务提供的服务。</p>
|
||||
<h3 id="用户状态保持">用户状态保持</h3>
|
||||
<p>HTTP是一个无状态的协议,对服务器来说,用户的每次HTTP请求是相互独立的。互联网是一个巨大的分布式系统,HTTP协议作为互联网上的一个重要协议,在设计之初要考虑到大量应用访问的效率问题。无状态意味着服务端可以把客户端的请求根据需要发送到集群中的任何一个节点,HTTP的无状态设计对负载均衡有明显的好处,由于没有状态,用户请求可以被分发到任意一个服务器,应用也可以在靠近用户的网络边缘部署缓存服务器。对于不需要身份认证的服务,例如浏览新闻网页等,这是没有任何问题的。但HTTP成为企业应用的一个事实标准后,企业应用需要保存用户的登录状态和身份以进行更严格的权限控制。因此需要在HTTP协议基础上采用一种方式保存用户的登录状态,避免用户每发起一次请求都需要进行验证。</p>
|
||||
<p>传统方式是在服务器端采用Cookie来保存用户状态,由于在服务器是有状态的,对服务器的水平扩展有影响。在微服务架构下建议采用Token来记录用户登录状态。</p>
|
||||
<p>Token和Seesion主要的不同点是存储的地方不同。Session是集中存储在服务器中的;而Token是用户自己持有的,一般以cookie的形式存储在浏览器中。Token中保存了用户的身份信息,每次请求都会发送给服务器,服务器因此可以判断访问者的身份,并判断其对请求的资源有没有访问权限。</p>
|
||||
<p>Token用于表明用户身份,因此需要对其内容进行加密,避免被请求方或者第三者篡改。<a href="https://jwt.io">JWT(Json Web Token)</a>是一个定义Token格式的开放标准(RFC 7519),定义了Token的内容,加密方式,并提供了各种语言的lib。</p>
|
||||
<p>JWT Token的结构非常简单,包括三部分:</p>
|
||||
<ul>
|
||||
<li>Header<BR>
|
||||
头部包含类型,为固定值JWT。然后是JWT使用的Hash算法。</li>
|
||||
</ul>
|
||||
<pre tabindex="0"><code>{
|
||||
"alg": "HS256",
|
||||
"typ": "JWT"
|
||||
}
|
||||
</code></pre><ul>
|
||||
<li>Payload<BR>
|
||||
包含发布者,过期时间,用户名等标准信息,也可以添加用户角色,用户自定义的信息。</li>
|
||||
</ul>
|
||||
<pre tabindex="0"><code>{
|
||||
"sub": "1234567890",
|
||||
"name": "John Doe",
|
||||
"admin": true
|
||||
}
|
||||
</code></pre><ul>
|
||||
<li>Signature<BR>
|
||||
Token颁发方的签名,用于客户端验证Token颁发方的身份,也用于服务器防止Token被篡改。
|
||||
签名算法</li>
|
||||
</ul>
|
||||
<pre tabindex="0"><code>HMACSHA256(
|
||||
base64UrlEncode(header) + "." +
|
||||
base64UrlEncode(payload),
|
||||
secret)
|
||||
</code></pre><p>这三部分使用Base64编码后组合在一起,成为最终返回给客户端的Token串,每部分之间采用".“分隔。下图是上面例子最终形成的Token
|
||||
|
||||
<img src="https://cdn.auth0.com/content/jwt/encoded-jwt3.png" alt="xx">
|
||||
|
||||
|
||||
采用Token进行用户认证,服务器端不再保存用户状态,客户端每次请求时都需要将Token发送到服务器端进行身份验证。Token发送的方式<a href="https://tools.ietf.org/html/rfc6750">rfc6750</a>进行了规定,采用一个 Authorization: Bearer HHTP Header进行发送。</p>
|
||||
<pre tabindex="0"><code>Authorization: Bearer mF_9.B5f-4.1JqM
|
||||
</code></pre><p>采用Token方式进行用户认证的基本流程如下图所示:</p>
|
||||
<ol>
|
||||
<li>用户输入用户名,密码等验证信息,向服务器发起登录请求</li>
|
||||
<li>服务器端验证用户登录信息,生成JWT token</li>
|
||||
<li>服务器端将Token返回给客户端,客户端保存在本地(一般以Cookie的方式保存)</li>
|
||||
<li>客户端向服务器端发送访问请求,请求中携带之前颁发的Token</li>
|
||||
<li>服务器端验证Token,确认用户的身份和对资源的访问权限,并进行相应的处理(拒绝或者允许访问)
|
||||
|
||||
<img src="https://cdn.auth0.com/content/jwt/jwt-diagram.png" alt="">
|
||||
|
||||
</li>
|
||||
</ol>
|
||||
<center>采用Token进行用户认证的流程图</center>
|
||||
<h3 id="实现单点登录">实现单点登录</h3>
|
||||
<p>单点登录的理念很简单,即用户只需要登录应用一次,就可以访问应用中所有的微服务。API Gateway提供了客户端访问微服务应用的入口,Token实现了无状态的用户认证。结合这两种技术,可以为微服务应用实现一个单点登录方案。</p>
|
||||
<p>用户的认证流程和采用Token方式认证的基本流程类似,不同之处是加入了API Gateway作为外部请求的入口。</p>
|
||||
<p>用户登录</p>
|
||||
<ol>
|
||||
<li>客户端发送登录请求到API Gateway</li>
|
||||
<li>API Gateway将登录请求转发到Security Service</li>
|
||||
<li>Security Service验证用户身份,并颁发Token</li>
|
||||
</ol>
|
||||
<p>用户请求</p>
|
||||
<ol>
|
||||
<li>客户端请求发送到API Gateway</li>
|
||||
<li>API Gateway调用的Security Service对请求中的Token进行验证,检查用户的身份</li>
|
||||
<li>如果请求中没有Token,Token过期或者Token验证非法,则拒绝用户请求。</li>
|
||||
<li>Security Service检查用户是否具有该操作权(可选,参见下一小节)</li>
|
||||
<li>如果用户具有该操作权限,则把请求发送到后端的Business Service,否则拒绝用户请求
|
||||
|
||||
<img src="/img/2018-05-22-user_authentication_authorization/api-gateway-sso.png" alt="采用API Gateway实现微服务应用的SSO">
|
||||
|
||||
</li>
|
||||
</ol>
|
||||
<center>采用API Gateway和Token实现微服务应用的单点登录</center>
|
||||
<h3 id="用户权限控制">用户权限控制</h3>
|
||||
<p>用户权限控制有两种做法,在API Gateway处统一处理,或者在各个微服务中单独处理。</p>
|
||||
<h4 id="api-gateway处进行统一的权限控制">API Gateway处进行统一的权限控制</h4>
|
||||
<p>客户端发送的HTTP请求中包含有请求的Resource及HTTP Method。如果系统遵循REST规范,以URI资源方式对访问对象进行建模,则API Gateway可以从请求中直接截取到访问的资源及需要进行的操作,然后调用Security Service进行权限判断,根据判断结果决定用户是否有权限对该资源进行操作,并转发到后端的Business Service。</p>
|
||||
<p>假设系统中有三个角色:</p>
|
||||
<ul>
|
||||
<li>order_manager,可以查看,创建,修改,删除订单</li>
|
||||
<li>order_editor, 可以查看,创建,修改订单</li>
|
||||
<li>order_inspector,只能查看订单</li>
|
||||
</ul>
|
||||
<p>这些角色对资源的操作权限都可以映射到HTTP Verb上,如下表所示。</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Role</th>
|
||||
<th>Resource</th>
|
||||
<th>Verbs</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>order_manager</td>
|
||||
<td>/orders</td>
|
||||
<td>‘GET’ ‘POST’ ‘PUT’ ‘DELETE’</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>order_editor</td>
|
||||
<td>/orders</td>
|
||||
<td>‘GET’ ‘POST’ ‘PUT’</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>order_inspector</td>
|
||||
<td>/orders</td>
|
||||
<td>‘GET’</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>这种实现方式在API Gateway处统一处理鉴权逻辑,各个微服务不需要考虑用户鉴权,只需要处理业务逻辑,简化了各微服务的实现。</p>
|
||||
<h4 id="由各个微服务单独进行权限控制">由各个微服务单独进行权限控制</h4>
|
||||
<p>如果微服务未严格遵循REST规范对访问对象进行建模,或者应用需要进行更细粒度的权限控制,则需要在微服务中单独对用户权限进行判断和处理。这种情况下微服务的权限控制更为灵活,但各个微服务需要单独维护用户的授权数据,实现更复杂。</p>
|
||||
<p>由于微服务进行权限判断时需要用户身份信息,该方案需要处理的另一个问题是如何把登录用户的信息从API Gateway传递到微服务中。如果是基于Http,可以采用Http header实现,如果是其他协议,则需要在消息体中增加用户身份相关的字段。</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/2018/05/23/istio-auto-injection-with-webhook/" data-toggle="tooltip" data-placement="top" title="Istio Sidecar自动注入原理">←
|
||||
Previous Post</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2018/05/23/service_2_service_auth/" data-toggle="tooltip" data-placement="top" title="微服务安全沉思录之二">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2018\/05\/22\/user_authentication_authorization\/',
|
||||
pageTitle: '微服务安全沉思录之一',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-2 col-lg-offset-0
|
||||
visible-lg-block
|
||||
sidebar-container
|
||||
catalog-container">
|
||||
<div class="side-catalog">
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>
|
||||
<a class="catalog-toggle" href="#">CATALOG</a>
|
||||
</h5>
|
||||
<ul class="catalog-body"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
809
public/2018/05/23/external_system_auth/index.html
Normal file
809
public/2018/05/23/external_system_auth/index.html
Normal file
@@ -0,0 +1,809 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/2018-05-23-external_system_auth/background.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/2018-05-23-external_system_auth/background.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="微服务安全沉思录之三" />
|
||||
<meta property="og:title" content="微服务安全沉思录之三" />
|
||||
<meta property="twitter:title" content="微服务安全沉思录之三" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="一些外部的第三方系统可能需要访问系统内部的微服务。例如在网上商店的例子中,外部的推荐服务可能需要接入系统,以获取商店的商品目录信息。相对于内部服务之间的访问而言,外部系统的访问需要进行严格的安全控制。">
|
||||
<meta property="og:description" content="一些外部的第三方系统可能需要访问系统内部的微服务。例如在网上商店的例子中,外部的推荐服务可能需要接入系统,以获取商店的商品目录信息。相对于内部服务之间的访问而言,外部系统的访问需要进行严格的安全控制。" />
|
||||
<meta property="twitter:description" content="一些外部的第三方系统可能需要访问系统内部的微服务。例如在网上商店的例子中,外部的推荐服务可能需要接入系统,以获取商店的商品目录信息。相对于内部服务之间的访问而言,外部系统的访问需要进行严格的安全控制。" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2018/05/23/external_system_auth/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>微服务安全沉思录之三 | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2018/05/23/external_system_auth/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('/img/2018-05-23-external_system_auth/background.jpg')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
<a class="tag" href="/tags/microservice" title="Microservice">
|
||||
Microservice
|
||||
</a>
|
||||
|
||||
<a class="tag" href="/tags/security" title="Security">
|
||||
Security
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h1>微服务安全沉思录之三</h1>
|
||||
<h2 class="subheading">外部系统访问控制</h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
"赵化冰"
|
||||
|
||||
on
|
||||
Wednesday, May 23, 2018
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<h2 id="外部系统访问控制">外部系统访问控制</h2>
|
||||
<p>除用户访问和微服务之间的相互访问外,外部的第三方系统也可能需要访问系统内部的微服务。例如在上一篇博客的网上商店例子中,外部的推荐服务可能需要接入系统,以获取商店的商品目录信息。相对于内部服务之间的访问而言,外部系统的访问需要进行严格的安全控制。</p>
|
||||
<h3 id="使用账号进行控制">使用账号进行控制</h3>
|
||||
<p>可以为外部系统创建一个用户账号,类似普通用户一样对外部系统的账号进行管理,并使用该账号对外部系统进行认证和权限控制。</p>
|
||||
<p>采用这种方式的问题是难以处理用户相关的敏感数据。因为外部系统自身也是微服务系统中的一个用户账号,因此该外部系统只能访问该账号自身的数据和一些不敏感的公共数据,而不能访问和用户相关的数据。例如在网上商店的例子中,外部系统可以采用该方式访问商品目录信息,但不应允许访问用户历史购买记录,用户余额等信息。</p>
|
||||
<h3 id="api-token">API Token</h3>
|
||||
<p>是一个API Token(又称API Key)可以控制对用户敏感数据的访问。微服务应用提供一个API Token的生成界面,用户登录后可以生成自己的API Token,并在第三方应用使用该API Token访问微服务的API。在这种情况下,一般只允许第三方应用访问该Token所属用户自身的数据,而不能访问其他用户的敏感私有数据。</p>
|
||||
<p>例如Github就提供了Personal API Token功能,用户可以在<a href="https://github.com/settings/tokens">Github的开发者设置界面</a>中创建Token,然后使用该Token来访问Github的API。在创建Token时,可以设置该Token可以访问用户的哪些数据,如查看Repo信息,删除Repo,查看用户信息,更新用户信息等。</p>
|
||||
<p>使用API Token来访问Github API</p>
|
||||
<pre tabindex="0"><code>curl -u zhaohuabing:fbdf8e8862252ed0f3ba9dba4e328c01ac93aeec https://api.github.com/user
|
||||
</code></pre><blockquote>
|
||||
<p>不用试了,这不是我的真实API Token, just for demonstration :-)</p>
|
||||
</blockquote>
|
||||
<p>使用API Token而不是直接使用用户名/密码来访问API的好处是降低了用户密码暴露的风险,并且可以随时收回Token的权限而不用修改密码。</p>
|
||||
<p>由于API Token只能访问指定用户的数据,因此适合于用户自己开发一些脚本或小程序对应用中自己的数据进行操作。</p>
|
||||
<h3 id="oauth">OAuth</h3>
|
||||
<p>某些第三方应用需要访问不同用户的数据,或者对多个用户的数据进行整合处理,则可以考虑采用OAuth。采用OAuth,当第三方应用访问服务时,应用会提示用户授权第三方应用相应的访问权限,根据用户的授权操作结果生成用于访问的Token,以对第三方应用的操作请求进行访问控制。</p>
|
||||
<p>同样以Github为例,一些第三方应用如Travis CI,GitBook等就是通过OAuth和Github进行集成的。
|
||||
OAuth针对不同场景有不同的认证流程,一个典型的认证流程如下图所示:</p>
|
||||
<ul>
|
||||
<li>用户向OAuth客户端程序发起一个请求,OAuth客户端程序在处理该请求时发现需要访问用户在资源服务器中的数据。</li>
|
||||
<li>客户端程序将用户请求重定向到认证服务器,该请求中包含一个callback的URL。</li>
|
||||
<li>认证服务器返回授权页面,要求用户对OAuth客户端的资源请求进行授权。</li>
|
||||
<li>用户对该操作进行授权后,认证服务器将请求重定向到客户端程序的callback url,将授权码返回给客户端程序。</li>
|
||||
<li>客户端程序将授权码发送给认证服务器,请求token。</li>
|
||||
<li>认证服务器验证授权码后将token颁发给客户端程序。</li>
|
||||
<li>客户端程序采用颁发的token访问资源,完成用户请求。</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>备注:</p>
|
||||
<ol>
|
||||
<li>
|
||||
<p>OAuth中按照功能区分了资源服务器和认证服务器这两个角色,在实现时这两个角色常常是同一个应用。将该流程图中的各个角色对应到Github的例子中,资源服务器和认证服务器都是Github,客户端程序是Travis CI或者GitBook,用户则是使用Travis CI或者GitBook的直接用户。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>有人可能会疑惑在该流程中为何要使用一个授权码(Authorization Code)来申请Token,而不是由认证服务器直接返回Token给客户端。OAuth这样设计的原因是在重定向到客户端Callback URL的过程中会经过用户代理(浏览器),如果直接传递Token存在被窃取的风险。采用授权码的方式,申请Token时客户端直接和认证服务器进行交互,并且认证服务期在处理客户端的Token申请请求时还会对客户端进行身份认证,避免其他人伪造客户端身份来使用认证码申请Token。
|
||||
下面是一个客户端程序采用Authorization Code来申请Token的示例,client_id和client_secret被用来验证客户端的身份。</p>
|
||||
</li>
|
||||
</ol>
|
||||
<pre tabindex="0"><code>POST /oauth/token HTTP/1.1
|
||||
Host: authorization-server.com
|
||||
|
||||
grant_type=authorization_code
|
||||
&code=xxxxxxxxxxx
|
||||
&redirect_uri=https://example-app.com/redirect
|
||||
&client_id=xxxxxxxxxx
|
||||
&client_secret=xxxxxxxxxx
|
||||
</code></pre></blockquote>
|
||||
<p>
|
||||
<img src="/img/2018-05-23-external_system_auth/oauth_web_server_flow.png" alt="OAuth认证流程">
|
||||
|
||||
</p>
|
||||
<center>OAuth认证流程</center>
|
||||
<p>另外在谈及OAuth时,我们需要注意微服务应用作为OAuth客户端和OAuth服务器的两种不同场景:</p>
|
||||
<p>在实现微服务自身的用户认证时,也可以采用OAuth将微服务的用户认证委托给一个第三方的认证服务提供商,例如很多应用都将用户登录和微信或者QQ的OAuth服务进行了集成。</p>
|
||||
<p>第三方应用接入和微服务自身用户认证采用OAuth的目的是不同的,前者是为了将微服务中用户的私有数据访问权限授权给第三方应用,微服务在OAuth架构中是认证和资源服务器的角色;而后者的目的是集成并利用知名认证提供服务商提供的OAuth认证服务,简化繁琐的注册操作,微服务在OAuth架构中是客户端的角色。</p>
|
||||
<p>因此在我们需要区分这两种不同的场景,以免造成误解。</p>
|
||||
<h2 id="后记">后记</h2>
|
||||
<p>前两篇文章在在公众号发布后,有朋友提到还要注意登录密码明文问题、防止重放攻击、防止时间差攻击、防止脱裤后的彩虹表攻击…。的确,安全是一个庞大的话题,本系列文章只阐述了我关于微服务架构对应用安全带来的影响的一点小小思考。在产品开发和运维中,还需要对安全进行全方面的考虑,最好遵循一些业界的最佳实践,如采用完善的防火墙对外部流量进行隔离,采用加盐hash对用户密码进行存储,采用tls进行加密传输,对用户输入进行严格检查防止sql注入,采用经过验证的通用加密算法等等。</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/2018/05/23/service_2_service_auth/" data-toggle="tooltip" data-placement="top" title="微服务安全沉思录之二">←
|
||||
Previous Post</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2018/05/24/set_up_my_ubuntu_desktop/" data-toggle="tooltip" data-placement="top" title="Everything about Setting Up My Ubuntu Desktop">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2018\/05\/23\/external_system_auth\/',
|
||||
pageTitle: '微服务安全沉思录之三',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-2 col-lg-offset-0
|
||||
visible-lg-block
|
||||
sidebar-container
|
||||
catalog-container">
|
||||
<div class="side-catalog">
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>
|
||||
<a class="catalog-toggle" href="#">CATALOG</a>
|
||||
</h5>
|
||||
<ul class="catalog-body"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
826
public/2018/05/23/istio-auto-injection-with-webhook/index.html
Normal file
826
public/2018/05/23/istio-auto-injection-with-webhook/index.html
Normal file
@@ -0,0 +1,826 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/2018-4-25-istio-auto-injection-with-webhook/lion.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/2018-4-25-istio-auto-injection-with-webhook/lion.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="Istio Sidecar自动注入原理" />
|
||||
<meta property="og:title" content="Istio Sidecar自动注入原理" />
|
||||
<meta property="twitter:title" content="Istio Sidecar自动注入原理" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Kubernets 1.9版本引入了Admission Webhook(web 回调)扩展机制,通过Webhook,开发者可以非常灵活地对Kubernets API Server的功能进行扩展,在API Server创建资源时对资源进行验证或者修改。 Istio 0.7版本就利用了Kubernets webhook实现了sidecar的自动注入。">
|
||||
<meta property="og:description" content="Kubernets 1.9版本引入了Admission Webhook(web 回调)扩展机制,通过Webhook,开发者可以非常灵活地对Kubernets API Server的功能进行扩展,在API Server创建资源时对资源进行验证或者修改。 Istio 0.7版本就利用了Kubernets webhook实现了sidecar的自动注入。" />
|
||||
<meta property="twitter:description" content="Kubernets 1.9版本引入了Admission Webhook(web 回调)扩展机制,通过Webhook,开发者可以非常灵活地对Kubernets API Server的功能进行扩展,在API Server创建资源时对资源进行验证或者修改。 Istio 0.7版本就利用了Kubernets webhook实现了sidecar的自动注入。" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2018/05/23/istio-auto-injection-with-webhook/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>Istio Sidecar自动注入原理 | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2018/05/23/istio-auto-injection-with-webhook/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('/img/2018-4-25-istio-auto-injection-with-webhook/lion.jpg')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
<a class="tag" href="/tags/kubernetes" title="Kubernetes">
|
||||
Kubernetes
|
||||
</a>
|
||||
|
||||
<a class="tag" href="/tags/istio" title="Istio">
|
||||
Istio
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h1>Istio Sidecar自动注入原理</h1>
|
||||
<h2 class="subheading">Kubernetes webhook扩展机制解析</h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
"赵化冰"
|
||||
|
||||
on
|
||||
Wednesday, May 23, 2018
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<h2 id="前言">前言</h2>
|
||||
<hr>
|
||||
<p>Kubernets 1.9版本引入了Admission Webhook(web 回调)扩展机制,通过Webhook,开发者可以非常灵活地对Kubernets API Server的功能进行扩展,在API Server创建资源时对资源进行验证或者修改。</p>
|
||||
<p>使用webhook的优势是不需要对API Server的源码进行修改和重新编译就可以扩展其功能。插入的逻辑实现为一个独立的web进程,通过参数方式传入到kubernets中,由kubernets在进行自身逻辑处理时对扩展逻辑进行回调。</p>
|
||||
<p>Istio 0.7版本就利用了Kubernets webhook实现了sidecar的自动注入。</p>
|
||||
<h2 id="什么是admission">什么是Admission</h2>
|
||||
<hr>
|
||||
<p>Admission是Kubernets中的一个术语,指的是Kubernets API Server资源请求过程中的一个阶段。如下图所示,在API Server接收到资源创建请求时,首先会对请求进行认证和鉴权,然后经过Admission处理,最后再保存到etcd。
|
||||
|
||||
<img src="/img/2018-4-25-istio-auto-injection-with-webhook/admission-phase.png" alt="">
|
||||
|
||||
|
||||
从图中看到,Admission中有两个重要的阶段,Mutation和Validation,这两个阶段中执行的逻辑如下:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>Mutation</p>
|
||||
<p>Mutation是英文“突变”的意思,从字面上可以知道在Mutation阶段可以对请求内容进行修改。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Validation</p>
|
||||
<p>在Validation阶段不允许修改请求内容,但可以根据请求的内容判断是继续执行该请求还是拒绝该请求。</p>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 id="admission-webhook">Admission webhook</h2>
|
||||
<hr>
|
||||
<p>通过Admission webhook,可以加入Mutation和Validation两种类型的webhook插件,这些插件和Kubernets提供的预编译的Admission插件具有相同的能力。可以想到的用途包括:</p>
|
||||
<ul>
|
||||
<li>修改资源。例如Istio就通过Admin Webhook在Pod资源中增加了Envoy sidecar容器。</li>
|
||||
<li>自定义校验逻辑,例如对资源名称有一些特殊要求。或者对自定义资源的合法性进行校验。</li>
|
||||
</ul>
|
||||
<h2 id="采用webhook自动注入istio-sidecar">采用Webhook自动注入Istio Sidecar</h2>
|
||||
<hr>
|
||||
<h3 id="kubernets版本要求">Kubernets版本要求</h3>
|
||||
<p>webhook支持需要Kubernets1.9或者更高的版本,使用下面的命令确认kube-apiserver的Admin webhook功能已启用。</p>
|
||||
<pre tabindex="0"><code>kubectl api-versions | grep admissionregistration
|
||||
|
||||
admissionregistration.k8s.io/v1beta1
|
||||
</code></pre><h3 id="生成sidecar-injection-webhook的密钥和证书">生成sidecar injection webhook的密钥和证书</h3>
|
||||
<p>Webhook使用数字证书向kube-apiserver进行身份认证,因此需要先使用工具生成密钥对,并向Istio CA申请数字证书。</p>
|
||||
<pre tabindex="0"><code>./install/kubernetes/webhook-create-signed-cert.sh /
|
||||
--service istio-sidecar-injector /
|
||||
--namespace istio-system /
|
||||
--secret sidecar-injector-certs
|
||||
</code></pre><h3 id="将生成的数字证书配置到webhook中">将生成的数字证书配置到webhook中</h3>
|
||||
<pre tabindex="0"><code>cat install/kubernetes/istio-sidecar-injector.yaml | /
|
||||
./install/kubernetes/webhook-patch-ca-bundle.sh > /
|
||||
install/kubernetes/istio-sidecar-injector-with-ca-bundle.yaml
|
||||
</code></pre><h3 id="创建sidecar-injection-configmap">创建sidecar injection configmap</h3>
|
||||
<pre tabindex="0"><code>kubectl apply -f install/kubernetes/istio-sidecar-injector-configmap-release.yaml
|
||||
</code></pre><h3 id="部署sidecar-injection-webhook">部署sidecar injection webhook</h3>
|
||||
<pre tabindex="0"><code>kubectl apply -f install/kubernetes/istio-sidecar-injector-with-ca-bundle.yaml
|
||||
</code></pre><p>通过命令查看部署好的webhook injector</p>
|
||||
<pre tabindex="0"><code>kubectl -n istio-system get deployment -listio=sidecar-injector
|
||||
Copy
|
||||
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
|
||||
istio-sidecar-injector 1 1 1 1 1d
|
||||
```
|
||||
|
||||
### 开启需要自动注入sidecar的namespace
|
||||
|
||||
```
|
||||
kubectl label namespace default istio-injection=enabled
|
||||
|
||||
kubectl get namespace -L istio-injection
|
||||
|
||||
NAME STATUS AGE ISTIO-INJECTION
|
||||
default Active 1h enabled
|
||||
istio-system Active 1h
|
||||
kube-public Active 1h
|
||||
kube-system Active 1h
|
||||
```
|
||||
|
||||
## 参考
|
||||
|
||||
* [Extensible Admission is Beta](https://kubernetes.io/blog/2018/01/extensible-admission-is-beta)
|
||||
* [Installing the Istio Sidecar](https://istio.io/docs/setup/kubernetes/sidecar-injection.html)
|
||||
</code></pre>
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/2018/05/21/algolia-integration-with-jekyll/" data-toggle="tooltip" data-placement="top" title="使用Algolia为Gitpage博客提供站内搜索">←
|
||||
Previous Post</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2018/05/22/user_authentication_authorization/" data-toggle="tooltip" data-placement="top" title="微服务安全沉思录之一">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2018\/05\/23\/istio-auto-injection-with-webhook\/',
|
||||
pageTitle: 'Istio Sidecar自动注入原理',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-2 col-lg-offset-0
|
||||
visible-lg-block
|
||||
sidebar-container
|
||||
catalog-container">
|
||||
<div class="side-catalog">
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>
|
||||
<a class="catalog-toggle" href="#">CATALOG</a>
|
||||
</h5>
|
||||
<ul class="catalog-body"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
790
public/2018/05/23/service_2_service_auth/index.html
Normal file
790
public/2018/05/23/service_2_service_auth/index.html
Normal file
@@ -0,0 +1,790 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/2018-05-23-service_2_service_auth/background.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/2018-05-23-service_2_service_auth/background.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="微服务安全沉思录之二" />
|
||||
<meta property="og:title" content="微服务安全沉思录之二" />
|
||||
<meta property="twitter:title" content="微服务安全沉思录之二" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="除来自用户的访问请求以外,微服务应用中的各个微服务相互之间还有大量的访问,根据应用系统数据敏感程度不同,对于系统内微服务的访问也需要进行相应的安全控制。">
|
||||
<meta property="og:description" content="除来自用户的访问请求以外,微服务应用中的各个微服务相互之间还有大量的访问,根据应用系统数据敏感程度不同,对于系统内微服务的访问也需要进行相应的安全控制。" />
|
||||
<meta property="twitter:description" content="除来自用户的访问请求以外,微服务应用中的各个微服务相互之间还有大量的访问,根据应用系统数据敏感程度不同,对于系统内微服务的访问也需要进行相应的安全控制。" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2018/05/23/service_2_service_auth/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>微服务安全沉思录之二 | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2018/05/23/service_2_service_auth/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('/img/2018-05-23-service_2_service_auth/background.jpg')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
<a class="tag" href="/tags/microservice" title="Microservice">
|
||||
Microservice
|
||||
</a>
|
||||
|
||||
<a class="tag" href="/tags/security" title="Security">
|
||||
Security
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h1>微服务安全沉思录之二</h1>
|
||||
<h2 class="subheading">服务间认证与鉴权</h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
"赵化冰"
|
||||
|
||||
on
|
||||
Wednesday, May 23, 2018
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<h2 id="服务间认证与鉴权">服务间认证与鉴权</h2>
|
||||
<p>除来自用户的访问请求以外,微服务应用中的各个微服务相互之间还有大量的访问,包括下述场景:</p>
|
||||
<ul>
|
||||
<li>用户间接触发的微服务之间的相互访问<BR>
|
||||
例如在一个网上商店应用中,用户访问购物车微服务进行结算时,购物车微服务可能需要访问用户评级微服务获取用户的会员级别,以得到用户可以享受购物折扣。</li>
|
||||
<li>非用户触发的微服务之间的相互访问<BR>
|
||||
例如数据同步或者后台定时任务导致的微服务之间的相互访问。</li>
|
||||
</ul>
|
||||
<p>根据应用系统的数据敏感程度的不同,对于系统内微服务的相互访问可能有不同的安全要求。</p>
|
||||
<h3 id="对微服务之间的相互访问不进行安全控制">对微服务之间的相互访问不进行安全控制</h3>
|
||||
<p>在某些场景下,可以假设同一应用中微服务之间的相互访问都是可信的。在这种情况下,应用依赖于内部网络的防火墙及其他网络安全措施来保证安全性。在这种情况对入侵者攻击进入内部网络后没有保护措施。入侵者可以对微服务间的通信进行典型的中间人攻击,例如窃听通信内容,伪造和修改通信数据,甚至假装为一个合法的微服务进行通信。</p>
|
||||
<h3 id="采用service-account服务账号进行安全控制">采用Service Account(服务账号)进行安全控制</h3>
|
||||
<p>“内部网络中微服务之间的所有通信都是可信的”这个假设在某些场景下是不成立的,特别是在微服务中保存有用户信息这种非常重要的数据的情况下。将敏感信息直接暴露在内部攻击下的做法是非常危险的。 解决该问题的一种方案是使用服务账号来对微服务之间的相互访问进行控制。</p>
|
||||
<p>用户权限控制的一个普遍方法是使用”用户账号(User Account)”来标识一个系统用户,并对其进行身份认证和操作鉴权。类似地,可以为系统中每一个服务也创建一个账号,称为”服务账号(Service Accout)“。 该服务账号表示了微服务的身份,以用于控制该微服务对系统中其它微服务的访问权限,如可以对哪些微服务的哪些资源进行何种操作。当一个微服务访问另一个微服务时,被访问的微服务需要验证访问者的服务账号,以确定其身份和资源操作权限。</p>
|
||||
<h4 id="spifee标准">SPIFEE标准</h4>
|
||||
<p><a href="https://spiffe.io/">Secure Production Identity Framework For Everyone (SPIFFE)</a>是一套服务之间相互进行身份识别的标准,主要包含以下内容:</p>
|
||||
<ul>
|
||||
<li>SPIFFE ID标准,SPIFFE ID是服务的唯一标识,实现为统一资源标识"Uniform Resource Identifier (URI)”符。</li>
|
||||
<li>SVID(SPIFFE Verifiable Identity Document)标准,将SPIFFE ID编码到一个加密的可验证文档中。</li>
|
||||
<li>颁发/撤销 SVID的一套API标准。</li>
|
||||
</ul>
|
||||
<p>SPIFFE SVID目前支持的实现方式是X.509数字证书,在x.509 SVID中,采用X.509数字证书的SAN(Subject Alternative Name)扩展字段来保存SPIFFE ID。</p>
|
||||
<h4 id="istio-auth开源实现">Istio Auth开源实现</h4>
|
||||
<p>Istio服务网格项目的Auth组件实现了SPIFFE标准,可以为网格中服务颁发符合SPIFFE SVID标准的证书,并为服务提供身份认证,细粒度的操作鉴权以及通信加密。Istio的架构如下图所示:
|
||||
|
||||
<img src="/img/2018-05-23-service_2_service_auth/auth.png" alt="">
|
||||
|
||||
</p>
|
||||
<p>Istio Auth采用了Kubernetes的service account来作为服务标识,其SPIFFE ID的格式为spiffe://<domain>/ns/<namespace>/sa/<serviceaccount>,其中各组成部分如下:</p>
|
||||
<ul>
|
||||
<li>domain 域名</li>
|
||||
<li>namespace kubernetes service account所在的Namespace</li>
|
||||
<li>serviceaccount kubernetes中定义的service account名</li>
|
||||
</ul>
|
||||
<p>Istio Auth提供了一个用于颁发证书的CA。在服务部署时,CA监听Kubernetes API Server, 为集群中的每一个Service Account创建一对密钥和证书。当Pod创建时,Kubernetes根据该Pod关联的Service Account将密钥和证书以Kubernetes Secrets资源的方式加载为Pod的Volume,以供Envoy使用。</p>
|
||||
<p>在服务运行时,服务间的通信被Envoy接管,Envoy使用证书在服务间进行双向SSL握手验证通信双方服务的身份,并提供加密的通信通道。</p>
|
||||
<h3 id="采用用户身份进行安全控制">采用用户身份进行安全控制</h3>
|
||||
<p>采用服务账号进行服务间交互的鉴权不能控制到用户粒度的访问权限,这在某些场景下可能出现数据泄露问题。</p>
|
||||
<p>例如在网上商店应用中,用户访问购物车微服务进行结算时,购物车微服务需要访问另一个微服务中的用户历史购物数据。如果只采用服务账号对购物车微服务进行安全控制,存在用户A通过购物车微服务向后端微服务发起一个获取用户B历史购物数据请求的风险。因为后端的微服务并不能得知发起请求的是哪一个用户,因此会不加判断地返回购物车微服务请求的用户历史购物数据。</p>
|
||||
<p>解决方案是将用户信息从用户直接访问的第一个微服务向后传递到调用链上的每一个微服务,调用链上的每一个微服务都使用该用户信息对用户能访问的资源进行判断。在一个大型的微服务系统中,一个调用链可能会非常长,导致该方案的实现比较复杂。</p>
|
||||
<p>我们需要根据应用的使用场景,每个微服务中数据的敏感程度来决定选择哪一种服务间安全的实施方式。</p>
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/2018/05/22/user_authentication_authorization/" data-toggle="tooltip" data-placement="top" title="微服务安全沉思录之一">←
|
||||
Previous Post</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2018/05/23/external_system_auth/" data-toggle="tooltip" data-placement="top" title="微服务安全沉思录之三">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2018\/05\/23\/service_2_service_auth\/',
|
||||
pageTitle: '微服务安全沉思录之二',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-2 col-lg-offset-0
|
||||
visible-lg-block
|
||||
sidebar-container
|
||||
catalog-container">
|
||||
<div class="side-catalog">
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>
|
||||
<a class="catalog-toggle" href="#">CATALOG</a>
|
||||
</h5>
|
||||
<ul class="catalog-body"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
783
public/2018/05/24/set_up_my_ubuntu_desktop/index.html
Normal file
783
public/2018/05/24/set_up_my_ubuntu_desktop/index.html
Normal file
@@ -0,0 +1,783 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/2018-05-23-service_2_service_auth/background.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/2018-05-23-service_2_service_auth/background.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="Everything about Setting Up My Ubuntu Desktop" />
|
||||
<meta property="og:title" content="Everything about Setting Up My Ubuntu Desktop" />
|
||||
<meta property="twitter:title" content="Everything about Setting Up My Ubuntu Desktop" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Everything about setting up my own ubuntu desktop, it's just a Note in case I need it later">
|
||||
<meta property="og:description" content="Everything about setting up my own ubuntu desktop, it's just a Note in case I need it later" />
|
||||
<meta property="twitter:description" content="Everything about setting up my own ubuntu desktop, it's just a Note in case I need it later" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2018/05/24/set_up_my_ubuntu_desktop/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>Everything about Setting Up My Ubuntu Desktop | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2018/05/24/set_up_my_ubuntu_desktop/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('/img/2018-05-23-service_2_service_auth/background.jpg')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
<a class="tag" href="/tags/ubuntu" title="ubuntu">
|
||||
ubuntu
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h1>Everything about Setting Up My Ubuntu Desktop</h1>
|
||||
<h2 class="subheading"></h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
"赵化冰"
|
||||
|
||||
on
|
||||
Thursday, May 24, 2018
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<h2 id="generate-ssh-key-pair">Generate SSH Key Pair</h2>
|
||||
<pre tabindex="0"><code>ssh-keygen -C "zhaohuabing@gmail.com"
|
||||
</code></pre><h2 id="shadowsocks">Shadowsocks</h2>
|
||||
<p>Install shadowsokcs</p>
|
||||
<pre tabindex="0"><code>sudo apt-get install python3-pip
|
||||
|
||||
sudo pip3 install shadowsocks
|
||||
</code></pre><p>Create config at <code>config/shadowsocks.json</code>, with the following content:</p>
|
||||
<pre tabindex="0"><code>{
|
||||
"server":"remote-shadowsocks-server-ip-addr",
|
||||
"server_port":443,
|
||||
"local_address":"127.0.0.1",
|
||||
"local_port":1080,
|
||||
"password":"your-passwd",
|
||||
"timeout":300,
|
||||
"method":"aes-256-cfb",
|
||||
"fast_open":false,
|
||||
"workers":1
|
||||
}
|
||||
</code></pre><p>Start a local socks proxy</p>
|
||||
<pre tabindex="0"><code>sudo sslocal -c config/shadowsocks.json -d start
|
||||
</code></pre><p>In case there is an openssl error, modify shadowsocks source file.</p>
|
||||
<pre tabindex="0"><code>sudo vi /usr/local/lib/python3.6/dist-packages/shadowsocks/crypto/openssl.py
|
||||
|
||||
:%s/cleanup/reset/gc
|
||||
</code></pre><p>Convert shadowsocks socks proxy to http proxy</p>
|
||||
<pre tabindex="0"><code>sudo apt-get install polipo
|
||||
|
||||
echo "socksParentProxy = localhost:1080" | sudo tee -a /etc/polipo/config
|
||||
sudo service polipo restart
|
||||
</code></pre><p>Http proxy now is available at port 8123</p>
|
||||
<h1 id="set-bing-wallpaper-as-desktop-background">Set bing wallpaper as desktop background</h1>
|
||||
<pre tabindex="0"><code>sudo add-apt-repository ppa:whizzzkid/bingwallpaper
|
||||
sudo apt-get update
|
||||
sudo apt-get install bingwallpaper
|
||||
</code></pre><h1 id="use-vim-mode-in-bash">Use vim mode in bash</h1>
|
||||
<pre tabindex="0"><code>echo 'set -o vi'>> ~/.bashrc
|
||||
</code></pre>
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/2018/05/23/external_system_auth/" data-toggle="tooltip" data-placement="top" title="微服务安全沉思录之三">←
|
||||
Previous Post</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2018/06/02/istio08/" data-toggle="tooltip" data-placement="top" title="Istio 0.8 Release发布">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2018\/05\/24\/set_up_my_ubuntu_desktop\/',
|
||||
pageTitle: 'Everything about Setting Up My Ubuntu Desktop',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-2 col-lg-offset-0
|
||||
visible-lg-block
|
||||
sidebar-container
|
||||
catalog-container">
|
||||
<div class="side-catalog">
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>
|
||||
<a class="catalog-toggle" href="#">CATALOG</a>
|
||||
</h5>
|
||||
<ul class="catalog-body"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
833
public/2018/06/02/istio08/index.html
Normal file
833
public/2018/06/02/istio08/index.html
Normal file
@@ -0,0 +1,833 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/2018-06-02-istio08/background.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/2018-06-02-istio08/background.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="Istio 0.8 Release发布" />
|
||||
<meta property="og:title" content="Istio 0.8 Release发布" />
|
||||
<meta property="twitter:title" content="Istio 0.8 Release发布" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="在6月1日这一天的早上,Istio社区宣布发布0.8 Release,除了常规的故障修复和性能改进外,这个儿童节礼物里面还有什么值得期待内容呢?让我们来看一看:">
|
||||
<meta property="og:description" content="在6月1日这一天的早上,Istio社区宣布发布0.8 Release,除了常规的故障修复和性能改进外,这个儿童节礼物里面还有什么值得期待内容呢?让我们来看一看:" />
|
||||
<meta property="twitter:description" content="在6月1日这一天的早上,Istio社区宣布发布0.8 Release,除了常规的故障修复和性能改进外,这个儿童节礼物里面还有什么值得期待内容呢?让我们来看一看:" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/2018/06/02/istio08/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>Istio 0.8 Release发布 | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/2018/06/02/istio08/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
header.intro-header {
|
||||
background-image: url('/img/2018-06-02-istio08/background.jpg')
|
||||
}
|
||||
</style>
|
||||
|
||||
<header class="intro-header" >
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="post-heading">
|
||||
<div class="tags">
|
||||
|
||||
<a class="tag" href="/tags/istio" title="Istio">
|
||||
Istio
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h1>Istio 0.8 Release发布</h1>
|
||||
<h2 class="subheading">来自Istio的儿童节礼物</h2>
|
||||
<span class="meta">
|
||||
|
||||
Posted by
|
||||
|
||||
"赵化冰"
|
||||
|
||||
on
|
||||
Saturday, June 2, 2018
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
<blockquote>
|
||||
<p>在6月1日这一天的早上,Istio社区宣布发布0.8 Release,除了常规的故障修复和性能改进外,这个儿童节礼物里面还有什么值得期待内容呢?让我们来看一看:</p>
|
||||
</blockquote>
|
||||
<h2 id="networking">Networking</h2>
|
||||
<h3 id="改进的流量管理模型">改进的流量管理模型</h3>
|
||||
<p>0.8版本采用了新的流量管理配置模型<a href="https://istio.io/blog/2018/v1alpha3-routing/">v1alpha3 Route API</a>。新版本的模型添加了一些新的特性,并改善了之前版本模型中的可用性问题。主要的改动包括:</p>
|
||||
<h4 id="gateway">Gateway</h4>
|
||||
<p>新版本中不再使用K8s中的Ingress,转而采用Gateway来统一配置Service Mesh中的各个HTTP/TCP负载均衡器。Gateway可以是处理入口流量的Ingress Gateway,负责Service Mesh内部各个服务间通信的Sidecar Proxy,也可以是负责出口流量的Egress Gateway。</p>
|
||||
<p>Mesh中涉及到的三类Gateway: <br>
|
||||
|
||||
<img src="/img/2018-06-02-istio08/gateways.svg" alt="Gateway">
|
||||
|
||||
</p>
|
||||
<p>该变化的原因是K8s中的Ingress对象功能过于简单,不能满足Istio灵活的路由规则需求。在0.8版本中,L4-L6的配置和L7的配置被分别处理,Gateway中只配置L4-L6的功能,例如暴露的端口,TLS设置。然后用户可以采用VirtualService来配置标准的Istio规则,并和Gateway进行绑定。</p>
|
||||
<h4 id="virtualservice">VirtualService</h4>
|
||||
<p>采用VirtualService代替了alpha2模型中的RouteRule。采用VirtualService有两个优势:</p>
|
||||
<p><strong>可以把一个服务相关的规则放在一起管理</strong></p>
|
||||
<p>例如下面的路由规则,发向reviews的请求流量缺省destination为v1,如果user为jason则路由到v2。在v1模型中需要采用两条规则来实现,采用VirtualService后放到一个规则下就可以实现。</p>
|
||||
<pre tabindex="0"><code>apiVersion: networking.istio.io/v1alpha3
|
||||
kind: VirtualService
|
||||
metadata:
|
||||
name: reviews
|
||||
spec:
|
||||
hosts:
|
||||
- reviews
|
||||
http:
|
||||
- match:
|
||||
- headers:
|
||||
cookie:
|
||||
regex: "^(.*?;)?(user=jason)(;.*)?$"
|
||||
route:
|
||||
- destination:
|
||||
host: reviews
|
||||
subset: v2
|
||||
- route:
|
||||
- destination:
|
||||
host: reviews
|
||||
subset: v1
|
||||
</code></pre><p><strong>可以对外暴露一个并不存在的“虚拟服务”,然后将该“虚拟服务”映射到Istio中的Service上</strong></p>
|
||||
<p>下面规则中的bookinfo.com是对外暴露的“虚拟服务”,bookinfo.com/reviews被映射到了reviews服务,bookinfo.com/ratings被映射到了ratings服务。通过采用VirtualService,极大地增强了Istio路由规则的灵活性,有利于Legacy系统和Istio的集成。</p>
|
||||
<pre tabindex="0"><code>apiVersion: networking.istio.io/v1alpha3
|
||||
kind: VirtualService
|
||||
metadata:
|
||||
name: bookinfo
|
||||
spec:
|
||||
hosts:
|
||||
- bookinfo.com
|
||||
http:
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /reviews
|
||||
route:
|
||||
- destination:
|
||||
host: reviews
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /ratings
|
||||
route:
|
||||
- destination:
|
||||
host: ratings
|
||||
...
|
||||
</code></pre><h3 id="envoy-v2">Envoy V2</h3>
|
||||
<p>控制面和数据面标准接口支持Envoy</p>
|
||||
<h3 id="用gateway代替-ingressengress">用Gateway代替 Ingress/Engress</h3>
|
||||
<p>前面已经介绍到,新的版本中不再支持将Kubernetes的Ingress和Istio路由规则一起使用。Istio 0.8支持平台无关的 Ingress/Egress Gateway,可以在Kubernetes,Cloud Foundry中和Istio路由规则无缝集成。</p>
|
||||
<h3 id="对入站端口进行限制">对入站端口进行限制</h3>
|
||||
<p>0.8版本只允许访问Pod内已声明端口的入站流量。</p>
|
||||
<h2 id="security">Security</h2>
|
||||
<h3 id="安全组件citadel">安全组件Citadel</h3>
|
||||
<p>将Istio的安全组件Istio-Auth/Istio-CA正式命名为Citadel(堡垒)。</p>
|
||||
<h3 id="跨集群支持">跨集群支持</h3>
|
||||
<p>部署在多个Cluster中的Citadel可以共享同一Root Certificate,以支持不同Cluster内的服务可以跨Cluster进行认证。</p>
|
||||
<h3 id="认证策略">认证策略</h3>
|
||||
<p>认证策略既支持Service-to-Service认证,也支持对终端用户进行认证。</p>
|
||||
<h2 id="遥测">遥测</h2>
|
||||
<p>Mixer和Pilot将上报自身的遥测数据,其上报的流程和Mesh中的普通服务相同。</p>
|
||||
<h2 id="安装">安装</h2>
|
||||
<p>按需安装部分组件:支持只安装所需的组件,如果只需要使用Istio的路由规则,可以选择只安装Pilot,而不安装Mixer和Citadel。</p>
|
||||
<h2 id="mixer">Mixer</h2>
|
||||
<p>CloudWatch:增加了一个CloudWatch插件,可以向AWS CloudWatch上报度量数据。</p>
|
||||
<h2 id="已知故障">已知故障:</h2>
|
||||
<ul>
|
||||
<li>如果Gateway绑定的VirtualService指向的是headless service,则该规则不能正常工作。</li>
|
||||
<li>0.8版本和Kubernetes1.10.2存在兼容问题,目前建议采用1.9版本。</li>
|
||||
<li>convert-networking-config工具存在故障,一个其它的namespace可能会被修改为istio-system namespace。可以在允许转换工具后手动修改文件来避免。</li>
|
||||
</ul>
|
||||
<h2 id="总结">总结</h2>
|
||||
<p>0.8版本带来的最大变化是流量配置模型的重构,重构后的模型整合了外部Gateway和内部Sidecar Proxy的路由配置。同时VirtualService的引入使路由规则的配置更为集中和灵活。</p>
|
||||
|
||||
|
||||
|
||||
<div class="entry-shang text-center">
|
||||
|
||||
<p>「真诚赞赏,手留余香」</p>
|
||||
|
||||
<button class="zs show-zs btn btn-bred">赞赏支持</button>
|
||||
</div>
|
||||
<div class="zs-modal-bg"></div>
|
||||
<div class="zs-modal-box">
|
||||
<div class="zs-modal-head">
|
||||
<button type="button" class="close">×</button>
|
||||
<span class="author"><a href="http://localhost:1313/"><img src="/img/favicon.png" />David Young</a></span>
|
||||
|
||||
<p class="tip"><i></i><span>真诚赞赏,手留余香</span></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="zs-modal-body">
|
||||
<div class="zs-modal-btns">
|
||||
<button class="btn btn-blink" data-num="2">2元</button>
|
||||
<button class="btn btn-blink" data-num="5">5元</button>
|
||||
<button class="btn btn-blink" data-num="10">10元</button>
|
||||
<button class="btn btn-blink" data-num="50">50元</button>
|
||||
<button class="btn btn-blink" data-num="100">100元</button>
|
||||
<button class="btn btn-blink" data-num="1">任意金额</button>
|
||||
</div>
|
||||
<div class="zs-modal-pay">
|
||||
<button class="btn btn-bred" id="pay-text">2元</button>
|
||||
<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
|
||||
<img src="/img/reward/wechat-2.png" id="pay-image"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zs-modal-footer">
|
||||
<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
|
||||
<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/js/reward.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
<ul class="pager">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/2018/05/24/set_up_my_ubuntu_desktop/" data-toggle="tooltip" data-placement="top" title="Everything about Setting Up My Ubuntu Desktop">←
|
||||
Previous Post</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/2018/06/04/introducing-the-istio-v1alpha3-routing-api/" data-toggle="tooltip" data-placement="top" title="Istio v1aplha3 routing API介绍(译文)">Next
|
||||
Post →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/2018\/06\/02\/istio08\/',
|
||||
pageTitle: 'Istio 0.8 Release发布',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-2 col-lg-offset-0
|
||||
visible-lg-block
|
||||
sidebar-container
|
||||
catalog-container">
|
||||
<div class="side-catalog">
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>
|
||||
<a class="catalog-toggle" href="#">CATALOG</a>
|
||||
</h5>
|
||||
<ul class="catalog-body"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
898
public/2025/07/06/mathematical-formulae/index.html
Normal file
898
public/2025/07/06/mathematical-formulae/index.html
Normal file
File diff suppressed because one or more lines are too long
524
public/404.html
Normal file
524
public/404.html
Normal file
@@ -0,0 +1,524 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/home-bg-jeep.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/home-bg-jeep.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="" />
|
||||
<meta property="og:title" content="" />
|
||||
<meta property="twitter:title" content="" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Just About Everything">
|
||||
<meta property="og:description" content="Just About Everything" />
|
||||
<meta property="twitter:description" content="Just About Everything" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/404.html" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>404 Page not found | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/404.html">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<header class="intro-header" style="background-image: url('/img/home-bg-jeep.jpg')">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
|
||||
<div class="site-heading">
|
||||
<h1>David Young </h1>
|
||||
|
||||
<span class="subheading">Bevonovo</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<header class="intro-header" style="background-image: url('/img/404-bg.jpg')">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<div class="site-heading" id="tag-heading">
|
||||
<h1>404</h1>
|
||||
<span class="subheading">So Sorry</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<script>
|
||||
document.body.classList.add('page-fullscreen');
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1212
public/about/index.html
Normal file
1212
public/about/index.html
Normal file
File diff suppressed because it is too large
Load Diff
2
public/algolia.json
Normal file
2
public/algolia.json
Normal file
File diff suppressed because one or more lines are too long
996
public/archive/index.html
Normal file
996
public/archive/index.html
Normal file
@@ -0,0 +1,996 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/home-bg-jeep.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/home-bg-jeep.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="Posts Archive" />
|
||||
<meta property="og:title" content="Posts Archive" />
|
||||
<meta property="twitter:title" content="Posts Archive" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Archive of historical posts.">
|
||||
<meta property="og:description" content="Archive of historical posts." />
|
||||
<meta property="twitter:description" content="Archive of historical posts." />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/archive/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>Posts Archive | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/archive/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<header class="intro-header" style="background-image: url('/img/home-bg-jeep.jpg')">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
|
||||
<div class="site-heading">
|
||||
<h1>David Young </h1>
|
||||
|
||||
<span class="subheading">Bevonovo</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div data-pagefind-ignore="all" class="container">
|
||||
<div class="row">
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-1
|
||||
col-md-8 col-md-offset-1
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
post-container
|
||||
">
|
||||
<div class="archive-list">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h1 class="title is-4 has-text-weight-normal">2025</h1>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span>07/06</span> —
|
||||
<a href="/2025/07/06/mathematical-formulae/">
|
||||
Authoring mathematical formulae
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h1 class="title is-4 has-text-weight-normal">2019</h1>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span>01/09</span> —
|
||||
<a href="/post/readme/">
|
||||
Clean White Theme for Hugo
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h1 class="title is-4 has-text-weight-normal">2018</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span>06/04</span> —
|
||||
<a href="/2018/06/04/introducing-the-istio-v1alpha3-routing-api/">
|
||||
Istio v1aplha3 routing API介绍(译文)
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>06/02</span> —
|
||||
<a href="/2018/06/02/istio08/">
|
||||
Istio 0.8 Release发布
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>05/24</span> —
|
||||
<a href="/2018/05/24/set_up_my_ubuntu_desktop/">
|
||||
Everything about Setting Up My Ubuntu Desktop
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>05/23</span> —
|
||||
<a href="/2018/05/23/external_system_auth/">
|
||||
微服务安全沉思录之三
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>05/23</span> —
|
||||
<a href="/2018/05/23/service_2_service_auth/">
|
||||
微服务安全沉思录之二
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>05/23</span> —
|
||||
<a href="/2018/05/22/user_authentication_authorization/">
|
||||
微服务安全沉思录之一
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>05/23</span> —
|
||||
<a href="/2018/05/23/istio-auto-injection-with-webhook/">
|
||||
Istio Sidecar自动注入原理
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>05/21</span> —
|
||||
<a href="/2018/05/21/algolia-integration-with-jekyll/">
|
||||
使用Algolia为Gitpage博客提供站内搜索
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>05/01</span> —
|
||||
<a href="/2018/05/01/may-day-jiulonghu/">
|
||||
川西秘境探险
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>04/16</span> —
|
||||
<a href="/2018/04/16/using-helm-to-deploy-to-kubernetes/">
|
||||
Helm介绍
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>04/11</span> —
|
||||
<a href="/2018/04/11/service-mesh-vs-api-gateway/">
|
||||
Service Mesh 和 API Gateway的关系探讨(译文)
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>03/29</span> —
|
||||
<a href="/2018/03/29/what-is-service-mesh-and-istio/">
|
||||
谈谈微服务架构中的基础设施:Service Mesh与Istio
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>03/13</span> —
|
||||
<a href="/2018/03/13/use-docker-behind-http-proxy/">
|
||||
如何配置docker使用HTTP代理
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>02/09</span> —
|
||||
<a href="/2018/02/09/vim-tips/">
|
||||
Vim Tips
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>02/09</span> —
|
||||
<a href="/2018/02/09/docker-without-sudo/">
|
||||
如何使用非root用户执行docker命令
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>02/03</span> —
|
||||
<a href="/2018/05/22/user_authentication_authorization/">
|
||||
如何构建安全的微服务应用?
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>01/02</span> —
|
||||
<a href="/2018/01/02/nginmesh-install/">
|
||||
Nginx开源Service Mesh组件Nginmesh安装指南
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h1 class="title is-4 has-text-weight-normal">2017</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<span>11/28</span> —
|
||||
<a href="/2017/11/28/access-application-from-outside/">
|
||||
如何从外部访问Kubernetes集群中的应用?
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>11/08</span> —
|
||||
<a href="/2017/11/08/istio-canary-release/">
|
||||
采用Istio实现灰度发布(金丝雀发布)
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>11/07</span> —
|
||||
<a href="/2017/11/07/istio-traffic-shifting/">
|
||||
使用Istio实现应用流量转移
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>11/04</span> —
|
||||
<a href="/2017/11/04/istio-install_and_example/">
|
||||
Istio及Bookinfo示例程序安装试用笔记
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span>11/04</span> —
|
||||
<a href="/2017/11/03/hello-world/">
|
||||
Welcome to Zhaohuabing Blog
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-3 col-lg-offset-0
|
||||
col-md-3 col-md-offset-0
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
sidebar-container
|
||||
">
|
||||
|
||||
|
||||
<section class="visible-md visible-lg">
|
||||
|
||||
<div class="short-about">
|
||||
|
||||
<a href="/about">
|
||||
<img src="/img/zhaohuabing.png" alt="avatar" style="cursor: pointer" />
|
||||
</a>
|
||||
|
||||
|
||||
<p>Open Source Enthusiast</p>
|
||||
|
||||
|
||||
<ul class="list-inline">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fa fa-circle fa-stack-2x"></i>
|
||||
<i class="fa fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FEATURED TAGS</h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>LAST POSTS</h5>
|
||||
<ul>
|
||||
|
||||
<li><a href="/2025/07/06/mathematical-formulae/">Authoring mathematical formulae</a></li>
|
||||
|
||||
<li><a href="/post/readme/">Clean White Theme for Hugo</a></li>
|
||||
|
||||
<li><a href="/2018/06/04/introducing-the-istio-v1alpha3-routing-api/">Istio v1aplha3 routing API介绍(译文)</a></li>
|
||||
|
||||
<li><a href="/2018/06/02/istio08/">Istio 0.8 Release发布</a></li>
|
||||
|
||||
<li><a href="/2018/05/24/set_up_my_ubuntu_desktop/">Everything about Setting Up My Ubuntu Desktop</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
639
public/categories/index.html
Normal file
639
public/categories/index.html
Normal file
@@ -0,0 +1,639 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/home-bg-jeep.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/home-bg-jeep.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="" />
|
||||
<meta property="og:title" content="" />
|
||||
<meta property="twitter:title" content="" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Just About Everything">
|
||||
<meta property="og:description" content="Just About Everything" />
|
||||
<meta property="twitter:description" content="Just About Everything" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/categories/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>Categories | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/categories/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<header class="intro-header" style="background-image: url('/img/home-bg-jeep.jpg')">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
|
||||
<div class="site-heading">
|
||||
<h1>David Young </h1>
|
||||
|
||||
<span class="subheading">Bevonovo</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<article>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
post-container">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="https://xxx.xxx.com/dist/Artalk.css" rel="stylesheet" />
|
||||
<script src="https://xxx.xxx.com/dist/Artalk.js"></script>
|
||||
|
||||
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: 'http:\/\/localhost:1313\/categories\/',
|
||||
pageTitle: 'Categories',
|
||||
server: 'https:\/\/xxx.xxx.com',
|
||||
site: 'xxx blog',
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-2
|
||||
col-md-10 col-md-offset-1
|
||||
sidebar-container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5><a href="/tags/">FEATURED TAGS</a></h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr>
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='/categories/index.xml' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
33
public/categories/index.xml
Normal file
33
public/categories/index.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Categories on David Young</title>
|
||||
<link>http://localhost:1313/categories/</link>
|
||||
<description>Recent content in Categories on David Young</description>
|
||||
<generator>Hugo</generator>
|
||||
<language>en-us</language>
|
||||
<lastBuildDate>Sun, 06 Jul 2025 00:00:00 +0000</lastBuildDate>
|
||||
<atom:link href="http://localhost:1313/categories/index.xml" rel="self" type="application/rss+xml" />
|
||||
<item>
|
||||
<title>Tips</title>
|
||||
<link>http://localhost:1313/categories/tips/</link>
|
||||
<pubDate>Sun, 06 Jul 2025 00:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/categories/tips/</guid>
|
||||
<description></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Tech</title>
|
||||
<link>http://localhost:1313/categories/tech/</link>
|
||||
<pubDate>Mon, 04 Jun 2018 00:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/categories/tech/</guid>
|
||||
<description></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Life</title>
|
||||
<link>http://localhost:1313/categories/life/</link>
|
||||
<pubDate>Tue, 01 May 2018 00:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/categories/life/</guid>
|
||||
<description></description>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
762
public/categories/life/index.html
Normal file
762
public/categories/life/index.html
Normal file
@@ -0,0 +1,762 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/home-bg-jeep.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/home-bg-jeep.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="" />
|
||||
<meta property="og:title" content="" />
|
||||
<meta property="twitter:title" content="" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Just About Everything">
|
||||
<meta property="og:description" content="Just About Everything" />
|
||||
<meta property="twitter:description" content="Just About Everything" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/categories/life/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>Life | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/categories/life/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<header class="intro-header" style="background-image: url('/img/home-bg-jeep.jpg')">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
|
||||
<div class="site-heading">
|
||||
<h1>David Young </h1>
|
||||
|
||||
<span class="subheading">Bevonovo</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<div data-pagefind-ignore="all" class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-1
|
||||
col-md-8 col-md-offset-1
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
post-container
|
||||
">
|
||||
|
||||
<div data-pagefind-ignore="all">
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/05/01/may-day-jiulonghu/">
|
||||
<h2 class="post-title">
|
||||
川西秘境探险
|
||||
</h2>
|
||||
|
||||
<h3 class="post-subtitle">
|
||||
2018五一甘堡藏寨,九龙湖自驾游记
|
||||
</h3>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
寻浮云牧场不遇 五一节前的一周内,几个朋友就纷纷坐不住了,一个二个不再安心上班,开始在微信群里讨论过节要到哪里耍。 大家思来想去,最后决定还是去理县方向。因为根据多年自驾的经验,只要出了汶川,沿途都是风景。
|
||||
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by 赵化冰 on Tuesday, May 1, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-3 col-lg-offset-0
|
||||
col-md-3 col-md-offset-0
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
sidebar-container
|
||||
">
|
||||
|
||||
|
||||
<section class="visible-md visible-lg">
|
||||
|
||||
<div class="short-about">
|
||||
|
||||
<a href="/about">
|
||||
<img src="/img/zhaohuabing.png" alt="avatar" style="cursor: pointer" />
|
||||
</a>
|
||||
|
||||
|
||||
<p>Open Source Enthusiast</p>
|
||||
|
||||
|
||||
<ul class="list-inline">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fa fa-circle fa-stack-2x"></i>
|
||||
<i class="fa fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FEATURED TAGS</h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>LAST POSTS</h5>
|
||||
<ul>
|
||||
|
||||
<li><a href="/2025/07/06/mathematical-formulae/">Authoring mathematical formulae</a></li>
|
||||
|
||||
<li><a href="/post/readme/">Clean White Theme for Hugo</a></li>
|
||||
|
||||
<li><a href="/2018/06/04/introducing-the-istio-v1alpha3-routing-api/">Istio v1aplha3 routing API介绍(译文)</a></li>
|
||||
|
||||
<li><a href="/2018/06/02/istio08/">Istio 0.8 Release发布</a></li>
|
||||
|
||||
<li><a href="/2018/05/24/set_up_my_ubuntu_desktop/">Everything about Setting Up My Ubuntu Desktop</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='/categories/life/index.xml' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
19
public/categories/life/index.xml
Normal file
19
public/categories/life/index.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Life on David Young</title>
|
||||
<link>http://localhost:1313/categories/life/</link>
|
||||
<description>Recent content in Life on David Young</description>
|
||||
<generator>Hugo</generator>
|
||||
<language>en-us</language>
|
||||
<lastBuildDate>Tue, 01 May 2018 00:00:00 +0000</lastBuildDate>
|
||||
<atom:link href="http://localhost:1313/categories/life/index.xml" rel="self" type="application/rss+xml" />
|
||||
<item>
|
||||
<title>川西秘境探险</title>
|
||||
<link>http://localhost:1313/2018/05/01/may-day-jiulonghu/</link>
|
||||
<pubDate>Tue, 01 May 2018 00:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/05/01/may-day-jiulonghu/</guid>
|
||||
<description><h2 id="寻浮云牧场不遇">寻浮云牧场不遇</h2>
<p>五一节前的一周内,几个朋友就纷纷坐不住了,一个二个不再安心上班,开始在微信群里讨论过节要到哪里耍。
大家思来想去,最后决定还是去理县方向。因为根据多年自驾的经验,只要出了汶川,沿途都是风景。</p></description>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
9
public/categories/life/page/1/index.html
Normal file
9
public/categories/life/page/1/index.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<title>http://localhost:1313/categories/life/</title>
|
||||
<link rel="canonical" href="http://localhost:1313/categories/life/">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="refresh" content="0; url=http://localhost:1313/categories/life/">
|
||||
</head>
|
||||
</html>
|
||||
874
public/categories/tech/index.html
Normal file
874
public/categories/tech/index.html
Normal file
@@ -0,0 +1,874 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/home-bg-jeep.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/home-bg-jeep.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="" />
|
||||
<meta property="og:title" content="" />
|
||||
<meta property="twitter:title" content="" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Just About Everything">
|
||||
<meta property="og:description" content="Just About Everything" />
|
||||
<meta property="twitter:description" content="Just About Everything" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/categories/tech/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>Tech | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/categories/tech/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<header class="intro-header" style="background-image: url('/img/home-bg-jeep.jpg')">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
|
||||
<div class="site-heading">
|
||||
<h1>David Young </h1>
|
||||
|
||||
<span class="subheading">Bevonovo</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<div data-pagefind-ignore="all" class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-1
|
||||
col-md-8 col-md-offset-1
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
post-container
|
||||
">
|
||||
|
||||
<div data-pagefind-ignore="all">
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/06/04/introducing-the-istio-v1alpha3-routing-api/">
|
||||
<h2 class="post-title">
|
||||
Istio v1aplha3 routing API介绍(译文)
|
||||
</h2>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
介绍Istio v1alpha3 routing API及其设计原则
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by "赵化冰" on Monday, June 4, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/06/02/istio08/">
|
||||
<h2 class="post-title">
|
||||
Istio 0.8 Release发布
|
||||
</h2>
|
||||
|
||||
<h3 class="post-subtitle">
|
||||
来自Istio的儿童节礼物
|
||||
</h3>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
在6月1日这一天的早上,Istio社区宣布发布0.8 Release,除了常规的故障修复和性能改进外,这个儿童节礼物里面还有什么值得期待内容呢?让我们来看一看:
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by "赵化冰" on Saturday, June 2, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/05/23/external_system_auth/">
|
||||
<h2 class="post-title">
|
||||
微服务安全沉思录之三
|
||||
</h2>
|
||||
|
||||
<h3 class="post-subtitle">
|
||||
外部系统访问控制
|
||||
</h3>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
一些外部的第三方系统可能需要访问系统内部的微服务。例如在网上商店的例子中,外部的推荐服务可能需要接入系统,以获取商店的商品目录信息。相对于内部服务之间的访问而言,外部系统的访问需要进行严格的安全控制。
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by "赵化冰" on Wednesday, May 23, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/05/23/service_2_service_auth/">
|
||||
<h2 class="post-title">
|
||||
微服务安全沉思录之二
|
||||
</h2>
|
||||
|
||||
<h3 class="post-subtitle">
|
||||
服务间认证与鉴权
|
||||
</h3>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
除来自用户的访问请求以外,微服务应用中的各个微服务相互之间还有大量的访问,根据应用系统数据敏感程度不同,对于系统内微服务的访问也需要进行相应的安全控制。
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by "赵化冰" on Wednesday, May 23, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/05/22/user_authentication_authorization/">
|
||||
<h2 class="post-title">
|
||||
微服务安全沉思录之一
|
||||
</h2>
|
||||
|
||||
<h3 class="post-subtitle">
|
||||
用户访问认证与鉴权
|
||||
</h3>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
这段时间对之前微服务安全相关的一些想法进行了进一步总结和归纳,理清在之前文章里面没有想得太清楚的地方,例如服务间的认证与鉴权以及用户身份在服务调用链中的传递。在这一系列博客里面将分为三个部分对微服务安全进行系统阐述:用户访问认证与鉴权,服务间认证与鉴权,外部系统访问控制。
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by "赵化冰" on Wednesday, May 23, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="pager" data-pagefind-ignore="all">
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/categories/tech/page/2/">Older Posts →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-3 col-lg-offset-0
|
||||
col-md-3 col-md-offset-0
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
sidebar-container
|
||||
">
|
||||
|
||||
|
||||
<section class="visible-md visible-lg">
|
||||
|
||||
<div class="short-about">
|
||||
|
||||
<a href="/about">
|
||||
<img src="/img/zhaohuabing.png" alt="avatar" style="cursor: pointer" />
|
||||
</a>
|
||||
|
||||
|
||||
<p>Open Source Enthusiast</p>
|
||||
|
||||
|
||||
<ul class="list-inline">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fa fa-circle fa-stack-2x"></i>
|
||||
<i class="fa fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FEATURED TAGS</h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>LAST POSTS</h5>
|
||||
<ul>
|
||||
|
||||
<li><a href="/2025/07/06/mathematical-formulae/">Authoring mathematical formulae</a></li>
|
||||
|
||||
<li><a href="/post/readme/">Clean White Theme for Hugo</a></li>
|
||||
|
||||
<li><a href="/2018/06/04/introducing-the-istio-v1alpha3-routing-api/">Istio v1aplha3 routing API介绍(译文)</a></li>
|
||||
|
||||
<li><a href="/2018/06/02/istio08/">Istio 0.8 Release发布</a></li>
|
||||
|
||||
<li><a href="/2018/05/24/set_up_my_ubuntu_desktop/">Everything about Setting Up My Ubuntu Desktop</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='/categories/tech/index.xml' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
124
public/categories/tech/index.xml
Normal file
124
public/categories/tech/index.xml
Normal file
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Tech on David Young</title>
|
||||
<link>http://localhost:1313/categories/tech/</link>
|
||||
<description>Recent content in Tech on David Young</description>
|
||||
<generator>Hugo</generator>
|
||||
<language>en-us</language>
|
||||
<lastBuildDate>Mon, 04 Jun 2018 00:00:00 +0000</lastBuildDate>
|
||||
<atom:link href="http://localhost:1313/categories/tech/index.xml" rel="self" type="application/rss+xml" />
|
||||
<item>
|
||||
<title>Istio v1aplha3 routing API介绍(译文)</title>
|
||||
<link>http://localhost:1313/2018/06/04/introducing-the-istio-v1alpha3-routing-api/</link>
|
||||
<pubDate>Mon, 04 Jun 2018 00:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/06/04/introducing-the-istio-v1alpha3-routing-api/</guid>
|
||||
<description><p>到目前为止,Istio提供了一个简单的API来进行流量管理,该API包括了四种资源:RouteRule,DestinationPolicy,EgressRule和Ingress(直接使用了Kubernets的Ingress资源)。借助此API,用户可以轻松管理Istio服务网格中的流量。该API允许用户将请求路由到特定版本的服务,为弹性测试注入延迟和失败,添加超时和断路器等等,所有这些功能都不必更改应用程序本身的代码。</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Istio 0.8 Release发布</title>
|
||||
<link>http://localhost:1313/2018/06/02/istio08/</link>
|
||||
<pubDate>Sat, 02 Jun 2018 00:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/06/02/istio08/</guid>
|
||||
<description><blockquote>
<p>在6月1日这一天的早上,Istio社区宣布发布0.8 Release,除了常规的故障修复和性能改进外,这个儿童节礼物里面还有什么值得期待内容呢?让我们来看一看:</p>
</blockquote></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>微服务安全沉思录之三</title>
|
||||
<link>http://localhost:1313/2018/05/23/external_system_auth/</link>
|
||||
<pubDate>Wed, 23 May 2018 18:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/05/23/external_system_auth/</guid>
|
||||
<description><h2 id="外部系统访问控制">外部系统访问控制</h2>
<p>除用户访问和微服务之间的相互访问外,外部的第三方系统也可能需要访问系统内部的微服务。例如在上一篇博客的网上商店例子中,外部的推荐服务可能需要接入系统,以获取商店的商品目录信息。相对于内部服务之间的访问而言,外部系统的访问需要进行严格的安全控制。</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>微服务安全沉思录之二</title>
|
||||
<link>http://localhost:1313/2018/05/23/service_2_service_auth/</link>
|
||||
<pubDate>Wed, 23 May 2018 15:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/05/23/service_2_service_auth/</guid>
|
||||
<description><h2 id="服务间认证与鉴权">服务间认证与鉴权</h2>
<p>除来自用户的访问请求以外,微服务应用中的各个微服务相互之间还有大量的访问,包括下述场景:</p>
<ul>
<li>用户间接触发的微服务之间的相互访问<BR>
例如在一个网上商店应用中,用户访问购物车微服务进行结算时,购物车微服务可能需要访问用户评级微服务获取用户的会员级别,以得到用户可以享受购物折扣。</li>
<li>非用户触发的微服务之间的相互访问<BR>
例如数据同步或者后台定时任务导致的微服务之间的相互访问。</li>
</ul>
<p>根据应用系统的数据敏感程度的不同,对于系统内微服务的相互访问可能有不同的安全要求。</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>微服务安全沉思录之一</title>
|
||||
<link>http://localhost:1313/2018/05/22/user_authentication_authorization/</link>
|
||||
<pubDate>Wed, 23 May 2018 10:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/05/22/user_authentication_authorization/</guid>
|
||||
<description><blockquote>
<p>这段时间对之前微服务安全相关的一些想法进行了进一步总结和归纳,理清了在之前文章里面没有想得太清楚的地方,例如服务间的认证与鉴权以及用户身份在服务调用链中的传递。</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Istio Sidecar自动注入原理</title>
|
||||
<link>http://localhost:1313/2018/05/23/istio-auto-injection-with-webhook/</link>
|
||||
<pubDate>Wed, 23 May 2018 00:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/05/23/istio-auto-injection-with-webhook/</guid>
|
||||
<description><h2 id="前言">前言</h2>
<hr>
<p>Kubernets 1.9版本引入了Admission Webhook(web 回调)扩展机制,通过Webhook,开发者可以非常灵活地对Kubernets API Server的功能进行扩展,在API Server创建资源时对资源进行验证或者修改。</p>
<p>使用webhook的优势是不需要对API Server的源码进行修改和重新编译就可以扩展其功能。插入的逻辑实现为一个独立的web进程,通过参数方式传入到kubernets中,由kubernets在进行自身逻辑处理时对扩展逻辑进行回调。</p>
<p>Istio 0.7版本就利用了Kubernets webhook实现了sidecar的自动注入。</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>使用Algolia为Gitpage博客提供站内搜索</title>
|
||||
<link>http://localhost:1313/2018/05/21/algolia-integration-with-jekyll/</link>
|
||||
<pubDate>Mon, 21 May 2018 11:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/05/21/algolia-integration-with-jekyll/</guid>
|
||||
<description><blockquote>
<p>This series of articles are my notes of &ldquo;Bitcoin and Cryptocurrency Technologies&rdquo; online course.</p>
</blockquote>
<h2 id="table-of-content">Table of Content</h2>
<p>{:.no_toc}</p>
<ul>
<li>Table of Content
{:toc}</li>
</ul>
<h2 id="scrooge-coin-transaction">Scrooge Coin Transaction</h2>
<p>Scrooge Coin programming assignment is a little bit tricky, the video of this lesson hasn&rsquo;t explained some implementation details. To help you understand the transaction data structure used in Scrooge Coin, I draw this diagram:

 <img src="http://localhost:1313/img/2018-5-20-cryptocurrency_week1_scroogecoin/scroogecoin.png" alt="Scrooge Coin">

</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Helm介绍</title>
|
||||
<link>http://localhost:1313/2018/04/16/using-helm-to-deploy-to-kubernetes/</link>
|
||||
<pubDate>Mon, 16 Apr 2018 15:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/04/16/using-helm-to-deploy-to-kubernetes/</guid>
|
||||
<description><h2 id="前言">前言</h2>
<hr>
<p>Helm是Kubernetes生态系统中的一个软件包管理工具。本文将介绍为何要使用Helm进行Kubernetes软件包管理,澄清Helm中使用到的相关概念,并通过一个具体的示例学习如何使用Helm打包,分发,安装,升级及回退Kubernetes应用。</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Service Mesh 和 API Gateway的关系探讨(译文)</title>
|
||||
<link>http://localhost:1313/2018/04/11/service-mesh-vs-api-gateway/</link>
|
||||
<pubDate>Wed, 11 Apr 2018 09:32:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/04/11/service-mesh-vs-api-gateway/</guid>
|
||||
<description><h2 id="service-mesh-vs-api-gateway">Service Mesh vs API Gateway</h2>
<p>在<a href="https://medium.com/microservices-in-practice/service-mesh-for-microservices-2953109a3c9a">前一篇关于Service Mesh的文章</a>中,我提到了几个关于Service Mesh和API Gateway之间关系的问题,在本篇文章中,我打算就Service Mesh和API Gateway的用途进行进一步讨论。</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>谈谈微服务架构中的基础设施:Service Mesh与Istio</title>
|
||||
<link>http://localhost:1313/2018/03/29/what-is-service-mesh-and-istio/</link>
|
||||
<pubDate>Thu, 29 Mar 2018 12:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/03/29/what-is-service-mesh-and-istio/</guid>
|
||||
<description><h2 id="微服务架构的演进">微服务架构的演进</h2>
<p>作为一种架构模式,微服务将复杂系统切分为数十乃至上百个小服务,每个服务负责实现一个独立的业务逻辑。这些小服务易于被小型的软件工程师团队所理解和修改,并带来了语言和框架选择灵活性,缩短应用开发上线时间,可根据不同的工作负载和资源要求对服务进行独立缩扩容等优势。</p>
<p>另一方面,当应用被拆分为多个微服务进程后,进程内的方法调用变成了了进程间的远程调用。引入了对大量服务的连接、管理和监控的复杂性。</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>如何构建安全的微服务应用?</title>
|
||||
<link>http://localhost:1313/2018/05/22/user_authentication_authorization/</link>
|
||||
<pubDate>Sat, 03 Feb 2018 12:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/05/22/user_authentication_authorization/</guid>
|
||||
<description><h2 id="前言">前言</h2>
<p>微服务架构的引入为软件应用带来了诸多好处:包括小开发团队,缩短开发周期,语言选择灵活性,增强服务伸缩能力等。与此同时,也引入了分布式系统的诸多复杂问题。其中一个挑战就是如何在微服务架构中实现一个灵活,安全,高效的认证和鉴权方案。本文将尝试就此问题进行一次比较完整的探讨。</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Nginx开源Service Mesh组件Nginmesh安装指南</title>
|
||||
<link>http://localhost:1313/2018/01/02/nginmesh-install/</link>
|
||||
<pubDate>Tue, 02 Jan 2018 12:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/01/02/nginmesh-install/</guid>
|
||||
<description><h2 id="前言">前言</h2>
<p>Nginmesh是NGINX的Service Mesh开源项目,用于Istio服务网格平台中的数据面代理。它旨在提供七层负载均衡和服务路由功能,与Istio集成作为sidecar部署,并将以“标准,可靠和安全的方式”使得服务间通信更容易。Nginmesh在今年底已经连续发布了0.2和0.3版本,提供了服务发现,请求转发,路由规则,性能指标收集等功能。</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>如何从外部访问Kubernetes集群中的应用?</title>
|
||||
<link>http://localhost:1313/2017/11/28/access-application-from-outside/</link>
|
||||
<pubDate>Tue, 28 Nov 2017 12:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2017/11/28/access-application-from-outside/</guid>
|
||||
<description><h2 id="前言">前言</h2>
<p>我们知道,kubernetes的Cluster Network属于私有网络,只能在cluster Network内部才能访问部署的应用,那如何才能将Kubernetes集群中的应用暴露到外部网络,为外部用户提供服务呢?本文探讨了从外部网络访问kubernetes cluster中应用的几种实现方式。</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>采用Istio实现灰度发布(金丝雀发布)</title>
|
||||
<link>http://localhost:1313/2017/11/08/istio-canary-release/</link>
|
||||
<pubDate>Wed, 08 Nov 2017 15:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2017/11/08/istio-canary-release/</guid>
|
||||
<description><h2 id="灰度发布又名金丝雀发布介绍">灰度发布(又名金丝雀发布)介绍</h2>
<p>当应用上线以后,运维面临的一大挑战是如何能够在不影响已上线业务的情况下进行升级。做过产品的同学都清楚,不管在发布前做过多么完备的自动化和人工测试,在发布后都会出现或多或少的故障。根据墨菲定律,可能会出错的版本发布一定会出错。</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>使用Istio实现应用流量转移</title>
|
||||
<link>http://localhost:1313/2017/11/07/istio-traffic-shifting/</link>
|
||||
<pubDate>Tue, 07 Nov 2017 00:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2017/11/07/istio-traffic-shifting/</guid>
|
||||
<description><p>关于Istio的更多内容请参考<a href="http://istio.doczh.cn/">istio中文文档</a>。</p>
<p>原文参见<a href="https://istio.io/docs/tasks/traffic-management/traffic-shifting.html">Traffic Shifting</a>。</p>
<p>本任务将演示如何将应用流量逐渐从旧版本的服务迁移到新版本。通过Istio,可以使用一系列不同权重的规则(10%,20%,··· 100%)将流量平缓地从旧版本服务迁移到新版本服务。</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Istio及Bookinfo示例程序安装试用笔记</title>
|
||||
<link>http://localhost:1313/2017/11/04/istio-install_and_example/</link>
|
||||
<pubDate>Sat, 04 Nov 2017 12:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2017/11/04/istio-install_and_example/</guid>
|
||||
<description><h2 id="服务网格简介">服务网格简介</h2>
<p><strong>服务网格</strong>(Service Mesh)是为解决微服务的通信和治理而出现的一种<strong>架构模式</strong>。</p>
<p>服务网格将服务间通讯以及与此相关的管理控制功能从业务程序中下移到一个基础设施层,从而彻底隔离了业务逻辑和服务通讯两个关注点。采用服务网格后,应用开发者只需要关注并实现应用业务逻辑。服务之间的通信,包括服务发现,通讯的可靠性,通讯的安全性,服务路由等由服务网格层进行处理,并对应用程序透明。</p></description>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
9
public/categories/tech/page/1/index.html
Normal file
9
public/categories/tech/page/1/index.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<title>http://localhost:1313/categories/tech/</title>
|
||||
<link rel="canonical" href="http://localhost:1313/categories/tech/">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="refresh" content="0; url=http://localhost:1313/categories/tech/">
|
||||
</head>
|
||||
</html>
|
||||
876
public/categories/tech/page/2/index.html
Normal file
876
public/categories/tech/page/2/index.html
Normal file
@@ -0,0 +1,876 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/home-bg-jeep.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/home-bg-jeep.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="" />
|
||||
<meta property="og:title" content="" />
|
||||
<meta property="twitter:title" content="" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Just About Everything">
|
||||
<meta property="og:description" content="Just About Everything" />
|
||||
<meta property="twitter:description" content="Just About Everything" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/categories/tech/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>Tech | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/categories/tech/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<header class="intro-header" style="background-image: url('/img/home-bg-jeep.jpg')">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
|
||||
<div class="site-heading">
|
||||
<h1>David Young </h1>
|
||||
|
||||
<span class="subheading">Bevonovo</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<div data-pagefind-ignore="all" class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-1
|
||||
col-md-8 col-md-offset-1
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
post-container
|
||||
">
|
||||
|
||||
<div data-pagefind-ignore="all">
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/05/23/istio-auto-injection-with-webhook/">
|
||||
<h2 class="post-title">
|
||||
Istio Sidecar自动注入原理
|
||||
</h2>
|
||||
|
||||
<h3 class="post-subtitle">
|
||||
Kubernetes webhook扩展机制解析
|
||||
</h3>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
Kubernets 1.9版本引入了Admission Webhook(web 回调)扩展机制,通过Webhook,开发者可以非常灵活地对Kubernets API Server的功能进行扩展,在API Server创建资源时对资源进行验证或者修改。 Istio 0.7版本就利用了Kubernets webhook实现了sidecar的自动注入。
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by "赵化冰" on Wednesday, May 23, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/05/21/algolia-integration-with-jekyll/">
|
||||
<h2 class="post-title">
|
||||
使用Algolia为Gitpage博客提供站内搜索
|
||||
</h2>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
This series of articles are my notes of “Bitcoin and Cryptocurrency Technologies” online course.
|
||||
Table of Content {:.no_toc}
|
||||
Table of Content {:toc} Scrooge Coin Transaction Scrooge Coin programming assignment is a little bit tricky, the video of this lesson hasn’t explained some implementation details. To help you understand the transaction data structure used in Scrooge Coin, I draw this diagram:
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by 赵化冰 on Monday, May 21, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/04/16/using-helm-to-deploy-to-kubernetes/">
|
||||
<h2 class="post-title">
|
||||
Helm介绍
|
||||
</h2>
|
||||
|
||||
<h3 class="post-subtitle">
|
||||
强大的Kubernetes包管理工具
|
||||
</h3>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
Helm是Kubernetes生态系统中的一个软件包管理工具。本文将介绍为何要使用Helm进行Kubernetes软件包管理,澄清Helm中使用到的相关概念,并通过一个具体的示例学习如何使用Helm打包,分发,安装,升级及回退Kubernetes应用。
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by 赵化冰 on Monday, April 16, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/04/11/service-mesh-vs-api-gateway/">
|
||||
<h2 class="post-title">
|
||||
Service Mesh 和 API Gateway的关系探讨(译文)
|
||||
</h2>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
API Gateway和Service Mesh的关系是我最近一直在思考的问题,也和同事及社区的朋友之间进行了一些讨论。这篇短文很清晰地总结了两者之间的相似之处以及这两者在微服务架构中的不同用途。
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by 赵化冰 on Wednesday, April 11, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/03/29/what-is-service-mesh-and-istio/">
|
||||
<h2 class="post-title">
|
||||
谈谈微服务架构中的基础设施:Service Mesh与Istio
|
||||
</h2>
|
||||
|
||||
<h3 class="post-subtitle">
|
||||
Service Mesh模式及Istio开源项目介绍
|
||||
</h3>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
作为一种架构模式,微服务将复杂系统切分为数十乃至上百个小服务,每个服务负责实现一个独立的业务逻辑。这些小服务易于被小型的软件工程师团队所理解和修改,并带来了语言和框架选择灵活性,缩短应用开发上线时间,可根据不同的工作负载和资源要求对服务进行独立缩扩容等优势。另一方面,当应用被拆分为多个微服务进程后,进程内的方法调用变成了了进程间的远程调用。引入了对大量服务的连接、管理和监控的复杂性,本文介绍了Service Mesh模式如何应对微服务架构的这些挑战,以及Service Mesh的明星开源项目Istio。
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by 赵化冰 on Thursday, March 29, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="pager" data-pagefind-ignore="all">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/categories/tech/">← Newer Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/categories/tech/page/3/">Older Posts →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-3 col-lg-offset-0
|
||||
col-md-3 col-md-offset-0
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
sidebar-container
|
||||
">
|
||||
|
||||
|
||||
<section class="visible-md visible-lg">
|
||||
|
||||
<div class="short-about">
|
||||
|
||||
<a href="/about">
|
||||
<img src="/img/zhaohuabing.png" alt="avatar" style="cursor: pointer" />
|
||||
</a>
|
||||
|
||||
|
||||
<p>Open Source Enthusiast</p>
|
||||
|
||||
|
||||
<ul class="list-inline">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fa fa-circle fa-stack-2x"></i>
|
||||
<i class="fa fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FEATURED TAGS</h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>LAST POSTS</h5>
|
||||
<ul>
|
||||
|
||||
<li><a href="/2025/07/06/mathematical-formulae/">Authoring mathematical formulae</a></li>
|
||||
|
||||
<li><a href="/post/readme/">Clean White Theme for Hugo</a></li>
|
||||
|
||||
<li><a href="/2018/06/04/introducing-the-istio-v1alpha3-routing-api/">Istio v1aplha3 routing API介绍(译文)</a></li>
|
||||
|
||||
<li><a href="/2018/06/02/istio08/">Istio 0.8 Release发布</a></li>
|
||||
|
||||
<li><a href="/2018/05/24/set_up_my_ubuntu_desktop/">Everything about Setting Up My Ubuntu Desktop</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='/categories/tech/index.xml' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
874
public/categories/tech/page/3/index.html
Normal file
874
public/categories/tech/page/3/index.html
Normal file
@@ -0,0 +1,874 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/home-bg-jeep.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/home-bg-jeep.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="" />
|
||||
<meta property="og:title" content="" />
|
||||
<meta property="twitter:title" content="" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Just About Everything">
|
||||
<meta property="og:description" content="Just About Everything" />
|
||||
<meta property="twitter:description" content="Just About Everything" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/categories/tech/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>Tech | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/categories/tech/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<header class="intro-header" style="background-image: url('/img/home-bg-jeep.jpg')">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
|
||||
<div class="site-heading">
|
||||
<h1>David Young </h1>
|
||||
|
||||
<span class="subheading">Bevonovo</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<div data-pagefind-ignore="all" class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-1
|
||||
col-md-8 col-md-offset-1
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
post-container
|
||||
">
|
||||
|
||||
<div data-pagefind-ignore="all">
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/05/22/user_authentication_authorization/">
|
||||
<h2 class="post-title">
|
||||
如何构建安全的微服务应用?
|
||||
</h2>
|
||||
|
||||
<h3 class="post-subtitle">
|
||||
微服务架构下的认证和鉴权方案探讨
|
||||
</h3>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
微服务架构的引入为软件应用带来了诸多好处:包括小开发团队,缩短开发周期,语言选择灵活性,增强服务伸缩能力等。与此同时,也引入了分布式系统的诸多复杂问题。其中一个挑战就是如何在微服务架构中实现一个灵活,安全,高效的认证和鉴权方案。本文将尝试就此问题进行一次比较完整的探讨。
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by 赵化冰 on Saturday, February 3, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/01/02/nginmesh-install/">
|
||||
<h2 class="post-title">
|
||||
Nginx开源Service Mesh组件Nginmesh安装指南
|
||||
</h2>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
Nginmesh是NGINX的Service Mesh开源项目,用于Istio服务网格平台中的数据面代理。它旨在提供七层负载均衡和服务路由功能,与Istio集成作为sidecar部署,并将以“标准,可靠和安全的方式”使得服务间通信更容易。Nginmesh在今年底已经连续发布了0.2和0.3版本,提供了服务发现,请求转发,路由规则,性能指标收集等功能。本文介绍如何采用kubeadmin安装kubernetes集群并部署Nginmesh sidecar。
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by 赵化冰 on Tuesday, January 2, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2017/11/28/access-application-from-outside/">
|
||||
<h2 class="post-title">
|
||||
如何从外部访问Kubernetes集群中的应用?
|
||||
</h2>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
我们知道,kubernetes的Cluster Network属于私有网络,只能在cluster Network内部才能访问部署的应用,那如何才能将Kubernetes集群中的应用暴露到外部网络,为外部用户提供服务呢?本文探讨了从外部网络访问kubernetes cluster中应用的几种实现方式。
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by 赵化冰 on Tuesday, November 28, 2017
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2017/11/08/istio-canary-release/">
|
||||
<h2 class="post-title">
|
||||
采用Istio实现灰度发布(金丝雀发布)
|
||||
</h2>
|
||||
|
||||
<h3 class="post-subtitle">
|
||||
用户无感知的平滑业务升级
|
||||
</h3>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
当应用上线以后,运维面临的一大挑战是如何能在不影响已上线业务的情况下进行升级。本文将介绍如何使用Istio实现应用的灰度发布(金丝雀发布)
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by 赵化冰 on Wednesday, November 8, 2017
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2017/11/07/istio-traffic-shifting/">
|
||||
<h2 class="post-title">
|
||||
使用Istio实现应用流量转移
|
||||
</h2>
|
||||
|
||||
<h3 class="post-subtitle">
|
||||
"本文翻译自istio官方文档"
|
||||
</h3>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
本任务将演示如何将应用流量逐渐从旧版本的服务迁移到新版本。通过Istio,可以使用一系列不同权重的规则(10%,20%,··· 100%)将流量平缓地从旧版本服务迁移到新版本服务。
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by "赵化冰" on Tuesday, November 7, 2017
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="pager" data-pagefind-ignore="all">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/categories/tech/page/2/">← Newer Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="next">
|
||||
<a href="/categories/tech/page/4/">Older Posts →</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-3 col-lg-offset-0
|
||||
col-md-3 col-md-offset-0
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
sidebar-container
|
||||
">
|
||||
|
||||
|
||||
<section class="visible-md visible-lg">
|
||||
|
||||
<div class="short-about">
|
||||
|
||||
<a href="/about">
|
||||
<img src="/img/zhaohuabing.png" alt="avatar" style="cursor: pointer" />
|
||||
</a>
|
||||
|
||||
|
||||
<p>Open Source Enthusiast</p>
|
||||
|
||||
|
||||
<ul class="list-inline">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fa fa-circle fa-stack-2x"></i>
|
||||
<i class="fa fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FEATURED TAGS</h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>LAST POSTS</h5>
|
||||
<ul>
|
||||
|
||||
<li><a href="/2025/07/06/mathematical-formulae/">Authoring mathematical formulae</a></li>
|
||||
|
||||
<li><a href="/post/readme/">Clean White Theme for Hugo</a></li>
|
||||
|
||||
<li><a href="/2018/06/04/introducing-the-istio-v1alpha3-routing-api/">Istio v1aplha3 routing API介绍(译文)</a></li>
|
||||
|
||||
<li><a href="/2018/06/02/istio08/">Istio 0.8 Release发布</a></li>
|
||||
|
||||
<li><a href="/2018/05/24/set_up_my_ubuntu_desktop/">Everything about Setting Up My Ubuntu Desktop</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='/categories/tech/index.xml' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
770
public/categories/tech/page/4/index.html
Normal file
770
public/categories/tech/page/4/index.html
Normal file
@@ -0,0 +1,770 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/home-bg-jeep.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/home-bg-jeep.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="" />
|
||||
<meta property="og:title" content="" />
|
||||
<meta property="twitter:title" content="" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Just About Everything">
|
||||
<meta property="og:description" content="Just About Everything" />
|
||||
<meta property="twitter:description" content="Just About Everything" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/categories/tech/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>Tech | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/categories/tech/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<header class="intro-header" style="background-image: url('/img/home-bg-jeep.jpg')">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
|
||||
<div class="site-heading">
|
||||
<h1>David Young </h1>
|
||||
|
||||
<span class="subheading">Bevonovo</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<div data-pagefind-ignore="all" class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-1
|
||||
col-md-8 col-md-offset-1
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
post-container
|
||||
">
|
||||
|
||||
<div data-pagefind-ignore="all">
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2017/11/04/istio-install_and_example/">
|
||||
<h2 class="post-title">
|
||||
Istio及Bookinfo示例程序安装试用笔记
|
||||
</h2>
|
||||
|
||||
<h3 class="post-subtitle">
|
||||
手把手教你从零搭建Istio及Bookinfo示例程序
|
||||
</h3>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
Istio是来自Google,IBM和Lyft的一个Service Mesh(服务网格)开源项目,是Google继Kubernetes之后的又一大作,本文将演示如何从裸机开始从零搭建Istio及Bookinfo示例程序。
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by 赵化冰 on Saturday, November 4, 2017
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="pager" data-pagefind-ignore="all">
|
||||
|
||||
<li class="previous">
|
||||
<a href="/categories/tech/page/3/">← Newer Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-3 col-lg-offset-0
|
||||
col-md-3 col-md-offset-0
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
sidebar-container
|
||||
">
|
||||
|
||||
|
||||
<section class="visible-md visible-lg">
|
||||
|
||||
<div class="short-about">
|
||||
|
||||
<a href="/about">
|
||||
<img src="/img/zhaohuabing.png" alt="avatar" style="cursor: pointer" />
|
||||
</a>
|
||||
|
||||
|
||||
<p>Open Source Enthusiast</p>
|
||||
|
||||
|
||||
<ul class="list-inline">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fa fa-circle fa-stack-2x"></i>
|
||||
<i class="fa fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FEATURED TAGS</h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>LAST POSTS</h5>
|
||||
<ul>
|
||||
|
||||
<li><a href="/2025/07/06/mathematical-formulae/">Authoring mathematical formulae</a></li>
|
||||
|
||||
<li><a href="/post/readme/">Clean White Theme for Hugo</a></li>
|
||||
|
||||
<li><a href="/2018/06/04/introducing-the-istio-v1alpha3-routing-api/">Istio v1aplha3 routing API介绍(译文)</a></li>
|
||||
|
||||
<li><a href="/2018/06/02/istio08/">Istio 0.8 Release发布</a></li>
|
||||
|
||||
<li><a href="/2018/05/24/set_up_my_ubuntu_desktop/">Everything about Setting Up My Ubuntu Desktop</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='/categories/tech/index.xml' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
849
public/categories/tips/index.html
Normal file
849
public/categories/tips/index.html
Normal file
@@ -0,0 +1,849 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
|
||||
const autoTheme = false;
|
||||
if (autoTheme) {
|
||||
document.documentElement.setAttribute('data-auto-theme', 'true');
|
||||
}
|
||||
|
||||
const theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
document.documentElement.setAttribute('data-theme', theme);
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<meta property="og:site_name" content="David Young">
|
||||
<meta property="og:type" content="article">
|
||||
|
||||
|
||||
<meta property="og:image" content="http://localhost:1313//img/home-bg-jeep.jpg">
|
||||
<meta property="twitter:image" content="http://localhost:1313//img/home-bg-jeep.jpg" />
|
||||
|
||||
|
||||
|
||||
<meta name="title" content="" />
|
||||
<meta property="og:title" content="" />
|
||||
<meta property="twitter:title" content="" />
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="Just About Everything">
|
||||
<meta property="og:description" content="Just About Everything" />
|
||||
<meta property="twitter:description" content="Just About Everything" />
|
||||
|
||||
|
||||
<meta property="og:url" content="http://localhost:1313/categories/tips/" />
|
||||
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<meta name="keyword" content="Von Balthasar, Scripture, Gravel Riding, Ham Radio, Divine Office, Open Source">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico">
|
||||
|
||||
<title>Tips | David Young Blog</title>
|
||||
|
||||
<link rel="canonical" href="/categories/tips/">
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/hugo-theme-cleanwhite.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/theme-variables.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/zanshang.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/font-awesome.all.min.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/hux-blog.min.js"></script>
|
||||
|
||||
|
||||
<script src="/js/lazysizes.min.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="navbar-header page-scroll">
|
||||
<button type="button" class="navbar-toggle">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">David Young</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="huxblog_navbar">
|
||||
<div class="navbar-collapse">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/">All Posts</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="/categories/life/">life</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tech/">tech</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/categories/tips/">tips</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li><a href="/archive//">ARCHIVE</a></li>
|
||||
|
||||
<li><a href="/notes//">NOTES</a></li>
|
||||
|
||||
<li><a href="/about//">ABOUT</a></li>
|
||||
|
||||
<li>
|
||||
<a href="/search"><i class="fa fa-search"></i></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#" id="theme-toggle" title="Toggle dark mode" style="opacity: 0;">
|
||||
<i class="fa fa-moon"></i>
|
||||
<i class="fa fa-sun" style="display: none;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
var theme = localStorage.getItem('cleanwhite-theme') ||
|
||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
||||
var toggleBtn = document.getElementById('theme-toggle');
|
||||
if (toggleBtn) {
|
||||
var moonIcon = toggleBtn.querySelector('.fa-moon');
|
||||
var sunIcon = toggleBtn.querySelector('.fa-sun');
|
||||
|
||||
if (theme === 'dark') {
|
||||
if (moonIcon) moonIcon.style.display = 'none';
|
||||
if (sunIcon) sunIcon.style.display = 'inline';
|
||||
toggleBtn.setAttribute('title', 'Switch to light mode');
|
||||
} else {
|
||||
if (moonIcon) moonIcon.style.display = 'inline';
|
||||
if (sunIcon) sunIcon.style.display = 'none';
|
||||
toggleBtn.setAttribute('title', 'Switch to dark mode');
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(function() {
|
||||
toggleBtn.style.transition = 'opacity 0.2s ease';
|
||||
toggleBtn.style.opacity = '1';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
var $body = document.body;
|
||||
var $toggle = document.querySelector('.navbar-toggle');
|
||||
var $navbar = document.querySelector('#huxblog_navbar');
|
||||
var $collapse = document.querySelector('.navbar-collapse');
|
||||
|
||||
$toggle.addEventListener('click', handleMagic)
|
||||
function handleMagic(e){
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}else{
|
||||
|
||||
$collapse.style.height = "auto"
|
||||
$navbar.className += " in";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var navLinks = document.querySelectorAll('.navbar-collapse a');
|
||||
navLinks.forEach(function(link) {
|
||||
link.addEventListener('click', function() {
|
||||
if ($navbar.className.indexOf('in') > 0) {
|
||||
|
||||
$navbar.className = " ";
|
||||
setTimeout(function(){
|
||||
if($navbar.className.indexOf('in') < 0) {
|
||||
$collapse.style.height = "0px"
|
||||
}
|
||||
},400)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<header class="intro-header" style="background-image: url('/img/home-bg-jeep.jpg')">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
|
||||
<div class="site-heading">
|
||||
<h1>David Young </h1>
|
||||
|
||||
<span class="subheading">Bevonovo</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
|
||||
<div data-pagefind-ignore="all" class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-8 col-lg-offset-1
|
||||
col-md-8 col-md-offset-1
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
post-container
|
||||
">
|
||||
|
||||
<div data-pagefind-ignore="all">
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2025/07/06/mathematical-formulae/">
|
||||
<h2 class="post-title">
|
||||
Authoring mathematical formulae
|
||||
</h2>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
Cleanwhite theme now has built-in support for authoring mathematical or chemical equations
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by Andreas Deininger on Sunday, July 6, 2025
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/05/24/set_up_my_ubuntu_desktop/">
|
||||
<h2 class="post-title">
|
||||
Everything about Setting Up My Ubuntu Desktop
|
||||
</h2>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
Everything about setting up my own ubuntu desktop, it's just a Note in case I need it later
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by "赵化冰" on Thursday, May 24, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/03/13/use-docker-behind-http-proxy/">
|
||||
<h2 class="post-title">
|
||||
如何配置docker使用HTTP代理
|
||||
</h2>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
如何配置docker使用HTTP代理
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by 赵化冰 on Tuesday, March 13, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/02/09/vim-tips/">
|
||||
<h2 class="post-title">
|
||||
Vim Tips
|
||||
</h2>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
Vim Tips and tricks
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by 赵化冰 on Friday, February 9, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div class="post-preview">
|
||||
<a href="http://localhost:1313/2018/02/09/docker-without-sudo/">
|
||||
<h2 class="post-title">
|
||||
如何使用非root用户执行docker命令
|
||||
</h2>
|
||||
|
||||
<div class="post-content-preview">
|
||||
|
||||
如何使用非root用户执行docker命令
|
||||
|
||||
</div>
|
||||
</a>
|
||||
<p class="post-meta">
|
||||
|
||||
Posted by 赵化冰 on Friday, February 9, 2018
|
||||
|
||||
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="
|
||||
col-lg-3 col-lg-offset-0
|
||||
col-md-3 col-md-offset-0
|
||||
col-sm-12
|
||||
col-xs-12
|
||||
sidebar-container
|
||||
">
|
||||
|
||||
|
||||
<section class="visible-md visible-lg">
|
||||
|
||||
<div class="short-about">
|
||||
|
||||
<a href="/about">
|
||||
<img src="/img/zhaohuabing.png" alt="avatar" style="cursor: pointer" />
|
||||
</a>
|
||||
|
||||
|
||||
<p>Open Source Enthusiast</p>
|
||||
|
||||
|
||||
<ul class="list-inline">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fa fa-circle fa-stack-2x"></i>
|
||||
<i class="fa fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FEATURED TAGS</h5>
|
||||
<div class="tags">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/docker" title="docker">
|
||||
docker
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/istio" title="istio">
|
||||
istio
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/kubernetes" title="kubernetes">
|
||||
kubernetes
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/microservice" title="microservice">
|
||||
microservice
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="/tags/security" title="security">
|
||||
security
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/service-mesh" title="service mesh">
|
||||
service mesh
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a href="/tags/tips" title="tips">
|
||||
tips
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>FRIENDS</h5>
|
||||
<ul class="list-inline">
|
||||
|
||||
<li><a target="_blank" href="https://zhaozhihan.com">Linda的博客</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<hr class="hidden-sm hidden-xs">
|
||||
<h5>LAST POSTS</h5>
|
||||
<ul>
|
||||
|
||||
<li><a href="/2025/07/06/mathematical-formulae/">Authoring mathematical formulae</a></li>
|
||||
|
||||
<li><a href="/post/readme/">Clean White Theme for Hugo</a></li>
|
||||
|
||||
<li><a href="/2018/06/04/introducing-the-istio-v1alpha3-routing-api/">Istio v1aplha3 routing API介绍(译文)</a></li>
|
||||
|
||||
<li><a href="/2018/06/02/istio08/">Istio 0.8 Release发布</a></li>
|
||||
|
||||
<li><a href="/2018/05/24/set_up_my_ubuntu_desktop/">Everything about Setting Up My Ubuntu Desktop</a></li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<ul class="list-inline text-center">
|
||||
|
||||
<li>
|
||||
<a href="mailto:youremail@gmail.com">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="/your%20wechat%20qr%20code%20image">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://github.com/yourgithub">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-github fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a target="_blank" href="https://stackoverflow.com/users/yourstackoverflowid">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<a href='/categories/tips/index.xml' rel="alternate" type="application/rss+xml" title="David Young" >
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fas fa-circle fa-stack-2x"></i>
|
||||
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted">
|
||||
Copyright © David Young 2026
|
||||
|
||||
<br>
|
||||
<a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
|
||||
<iframe
|
||||
style="margin-left: 2px; margin-bottom:-5px;"
|
||||
frameborder="0" scrolling="0" width="100px" height="20px"
|
||||
src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
|
||||
</iframe>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function loadAsync(u, c) {
|
||||
var d = document, t = 'script',
|
||||
o = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
o.src = u;
|
||||
if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
|
||||
s.parentNode.insertBefore(o, s);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
if($('#tag_cloud').length !== 0){
|
||||
loadAsync("/js/jquery.tagcloud.js",function(){
|
||||
$.fn.tagcloud.defaults = {
|
||||
|
||||
color: {start: '#bbbbee', end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
function updateTagcloudColors() {
|
||||
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
const startColor = isDark ? '#808080' : '#bbbbee';
|
||||
if($('#tag_cloud').length !== 0 && $.fn.tagcloud) {
|
||||
$.fn.tagcloud.defaults = {
|
||||
color: {start: startColor, end: '#0085a1'},
|
||||
};
|
||||
$('#tag_cloud a').tagcloud();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
updateTagcloudColors();
|
||||
});
|
||||
|
||||
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.attributeName === 'data-theme') {
|
||||
updateTagcloudColors();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-theme']
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
|
||||
var $nav = document.querySelector("nav");
|
||||
if($nav) FastClick.attach($nav);
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<script src="/js/theme-toggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function generateCatalog(selector) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_containerSelector = 'div.post-container'
|
||||
|
||||
|
||||
|
||||
var P = $(_containerSelector), a, n, t, l, i, c;
|
||||
a = P.find('h1,h2,h3,h4,h5,h6');
|
||||
|
||||
|
||||
$(selector).html('')
|
||||
|
||||
|
||||
a.each(function () {
|
||||
n = $(this).prop('tagName').toLowerCase();
|
||||
i = "#" + $(this).prop('id');
|
||||
t = $(this).text();
|
||||
c = $('<a href="' + i + '" rel="nofollow" title="' + t + '">' + t + '</a>');
|
||||
l = $('<li class="' + n + '_nav"></li>').append(c);
|
||||
$(selector).append(l);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
generateCatalog(".catalog-body");
|
||||
|
||||
|
||||
$(".catalog-toggle").click((function (e) {
|
||||
e.preventDefault();
|
||||
$('.side-catalog').toggleClass("fold")
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
loadAsync("\/js\/jquery.nav.js", function () {
|
||||
$('.catalog-body').onePageNav({
|
||||
currentClass: "active",
|
||||
changeHash: !1,
|
||||
easing: "swing",
|
||||
filter: "",
|
||||
scrollSpeed: 700,
|
||||
scrollOffset: 0,
|
||||
scrollThreshold: .2,
|
||||
begin: null,
|
||||
end: null,
|
||||
scrollChange: null,
|
||||
padding: 80
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
47
public/categories/tips/index.xml
Normal file
47
public/categories/tips/index.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Tips on David Young</title>
|
||||
<link>http://localhost:1313/categories/tips/</link>
|
||||
<description>Recent content in Tips on David Young</description>
|
||||
<generator>Hugo</generator>
|
||||
<language>en-us</language>
|
||||
<lastBuildDate>Sun, 06 Jul 2025 00:00:00 +0000</lastBuildDate>
|
||||
<atom:link href="http://localhost:1313/categories/tips/index.xml" rel="self" type="application/rss+xml" />
|
||||
<item>
|
||||
<title>Authoring mathematical formulae</title>
|
||||
<link>http://localhost:1313/2025/07/06/mathematical-formulae/</link>
|
||||
<pubDate>Sun, 06 Jul 2025 00:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2025/07/06/mathematical-formulae/</guid>
|
||||
<description><h2 id="authoring-mathematical-and-chemical-equations">Authoring mathematical and chemical equations</h2>
<p>Cleanwhite theme now has built-in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mtext>KaTeX</mtext></mrow><annotation encoding="application/x-tex">\KaTeX</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8988em;vertical-align:-0.2155em;"></span><span class="mord text"><span class="mord textrm">K</span><span class="mspace" style="margin-right:-0.17em;"></span><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.6833em;"><span style="top:-2.905em;"><span class="pstrut" style="height:2.7em;"></span><span class="mord"><span class="mord textrm mtight sizing reset-size6 size3">A</span></span></span></span></span></span><span class="mspace" style="margin-right:-0.15em;"></span><span class="mord text"><span class="mord textrm">T</span><span class="mspace" style="margin-right:-0.1667em;"></span><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.4678em;"><span style="top:-2.7845em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord textrm">E</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.2155em;"><span></span></span></span></span><span class="mspace" style="margin-right:-0.125em;"></span><span class="mord textrm">X</span></span></span></span></span></span> support, so that you can easily include
complex mathematical formulae into your web page, either inline or centred
on its own line. The theme uses Hugo&rsquo;s embedded instance of the KaTeX
display engine to render mathematical markup to HTML at build time.
With this server side rendering of formulae, the same output is produced,
regardless of your browser or your environment.</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Everything about Setting Up My Ubuntu Desktop</title>
|
||||
<link>http://localhost:1313/2018/05/24/set_up_my_ubuntu_desktop/</link>
|
||||
<pubDate>Thu, 24 May 2018 00:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/05/24/set_up_my_ubuntu_desktop/</guid>
|
||||
<description><h2 id="generate-ssh-key-pair">Generate SSH Key Pair</h2>
<pre tabindex="0"><code>ssh-keygen -C &#34;zhaohuabing@gmail.com&#34;
</code></pre><h2 id="shadowsocks">Shadowsocks</h2>
<p>Install shadowsokcs</p>
<pre tabindex="0"><code>sudo apt-get install python3-pip

sudo pip3 install shadowsocks
</code></pre><p>Create config at <code>config/shadowsocks.json</code>, with the following content:</p>
<pre tabindex="0"><code>{
	&#34;server&#34;:&#34;remote-shadowsocks-server-ip-addr&#34;,
	&#34;server_port&#34;:443,
	&#34;local_address&#34;:&#34;127.0.0.1&#34;,
	&#34;local_port&#34;:1080,
	&#34;password&#34;:&#34;your-passwd&#34;,
	&#34;timeout&#34;:300,
	&#34;method&#34;:&#34;aes-256-cfb&#34;,
	&#34;fast_open&#34;:false,
	&#34;workers&#34;:1
}
</code></pre><p>Start a local socks proxy</p>
<pre tabindex="0"><code>sudo sslocal -c config/shadowsocks.json -d start
</code></pre><p>In case there is an openssl error, modify shadowsocks source file.</p>
<pre tabindex="0"><code>sudo vi /usr/local/lib/python3.6/dist-packages/shadowsocks/crypto/openssl.py 

:%s/cleanup/reset/gc
</code></pre><p>Convert shadowsocks socks proxy to http proxy</p>
<pre tabindex="0"><code>sudo apt-get install polipo

echo &#34;socksParentProxy = localhost:1080&#34; | sudo tee -a /etc/polipo/config 
sudo service polipo restart
</code></pre><p>Http proxy now is available at port 8123</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>如何配置docker使用HTTP代理</title>
|
||||
<link>http://localhost:1313/2018/03/13/use-docker-behind-http-proxy/</link>
|
||||
<pubDate>Tue, 13 Mar 2018 18:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/03/13/use-docker-behind-http-proxy/</guid>
|
||||
<description><h2 id="ubuntu">Ubuntu</h2>
<h3 id="设置docker使用http-proxy">设置docker使用http proxy</h3>
<pre tabindex="0"><code>sudo /etc/default/docker

export http_proxy=&#34;http://127.0.0.1:3128/&#34;
export https_proxy=&#34;http://127.0.0.1:3128/&#34;
export HTTP_PROXY=&#34;http://127.0.0.1:3128/&#34;
export HTTPS_PROXY=&#34;http://127.0.0.1:3128/&#34;
</code></pre></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Vim Tips</title>
|
||||
<link>http://localhost:1313/2018/02/09/vim-tips/</link>
|
||||
<pubDate>Fri, 09 Feb 2018 11:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/02/09/vim-tips/</guid>
|
||||
<description><h2 id="vim-graphical-cheat-sheet">vim graphical cheat sheet</h2>
<p>
 <img src="//img/2018-02-09-vim-tips/vi-vim-cheat-sheet.svg" alt="">

</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>如何使用非root用户执行docker命令</title>
|
||||
<link>http://localhost:1313/2018/02/09/docker-without-sudo/</link>
|
||||
<pubDate>Fri, 09 Feb 2018 10:00:00 +0000</pubDate>
|
||||
<guid>http://localhost:1313/2018/02/09/docker-without-sudo/</guid>
|
||||
<description><h3 id="add-the-docker-group-if-it-doesnt-already-exist">Add the docker group if it doesn&rsquo;t already exist:</h3>
<p>sudo groupadd docker</p>
<h3 id="add-the-connected-user-user-to-the-docker-group-change-the-user-name-to-match-your-preferred-user-if-you-do-not-want-to-use-your-current-user">Add the connected user &ldquo;$USER&rdquo; to the docker group. Change the user name to match your preferred user if you do not want to use your current user:</h3>
<p>sudo gpasswd -a $USER docker</p>
<h3 id="either-do-a-newgrp-docker-or-log-outin-to-activate-the-changes-to-groups">Either do a newgrp docker or log out/in to activate the changes to groups.</h3></description>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
9
public/categories/tips/page/1/index.html
Normal file
9
public/categories/tips/page/1/index.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us">
|
||||
<head>
|
||||
<title>http://localhost:1313/categories/tips/</title>
|
||||
<link rel="canonical" href="http://localhost:1313/categories/tips/">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="refresh" content="0; url=http://localhost:1313/categories/tips/">
|
||||
</head>
|
||||
</html>
|
||||
8080
public/css/bootstrap.css
vendored
Normal file
8080
public/css/bootstrap.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5
public/css/bootstrap.min.css
vendored
Normal file
5
public/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
2712
public/css/custom.css
Normal file
2712
public/css/custom.css
Normal file
File diff suppressed because it is too large
Load Diff
5
public/css/font-awesome.all.min.css
vendored
Normal file
5
public/css/font-awesome.all.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
public/css/fonts/FontAwesome.otf
Normal file
BIN
public/css/fonts/FontAwesome.otf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_AMS-Regular.ttf
Normal file
BIN
public/css/fonts/KaTeX_AMS-Regular.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_AMS-Regular.woff
Normal file
BIN
public/css/fonts/KaTeX_AMS-Regular.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_AMS-Regular.woff2
Normal file
BIN
public/css/fonts/KaTeX_AMS-Regular.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Caligraphic-Bold.ttf
Normal file
BIN
public/css/fonts/KaTeX_Caligraphic-Bold.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Caligraphic-Bold.woff
Normal file
BIN
public/css/fonts/KaTeX_Caligraphic-Bold.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Caligraphic-Bold.woff2
Normal file
BIN
public/css/fonts/KaTeX_Caligraphic-Bold.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Caligraphic-Regular.ttf
Normal file
BIN
public/css/fonts/KaTeX_Caligraphic-Regular.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Caligraphic-Regular.woff
Normal file
BIN
public/css/fonts/KaTeX_Caligraphic-Regular.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Caligraphic-Regular.woff2
Normal file
BIN
public/css/fonts/KaTeX_Caligraphic-Regular.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Fraktur-Bold.ttf
Normal file
BIN
public/css/fonts/KaTeX_Fraktur-Bold.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Fraktur-Bold.woff
Normal file
BIN
public/css/fonts/KaTeX_Fraktur-Bold.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Fraktur-Bold.woff2
Normal file
BIN
public/css/fonts/KaTeX_Fraktur-Bold.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Fraktur-Regular.ttf
Normal file
BIN
public/css/fonts/KaTeX_Fraktur-Regular.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Fraktur-Regular.woff
Normal file
BIN
public/css/fonts/KaTeX_Fraktur-Regular.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Fraktur-Regular.woff2
Normal file
BIN
public/css/fonts/KaTeX_Fraktur-Regular.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Main-Bold.ttf
Normal file
BIN
public/css/fonts/KaTeX_Main-Bold.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Main-Bold.woff
Normal file
BIN
public/css/fonts/KaTeX_Main-Bold.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Main-Bold.woff2
Normal file
BIN
public/css/fonts/KaTeX_Main-Bold.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Main-BoldItalic.ttf
Normal file
BIN
public/css/fonts/KaTeX_Main-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Main-BoldItalic.woff
Normal file
BIN
public/css/fonts/KaTeX_Main-BoldItalic.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Main-BoldItalic.woff2
Normal file
BIN
public/css/fonts/KaTeX_Main-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Main-Italic.ttf
Normal file
BIN
public/css/fonts/KaTeX_Main-Italic.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Main-Italic.woff
Normal file
BIN
public/css/fonts/KaTeX_Main-Italic.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Main-Italic.woff2
Normal file
BIN
public/css/fonts/KaTeX_Main-Italic.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Main-Regular.ttf
Normal file
BIN
public/css/fonts/KaTeX_Main-Regular.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Main-Regular.woff
Normal file
BIN
public/css/fonts/KaTeX_Main-Regular.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Main-Regular.woff2
Normal file
BIN
public/css/fonts/KaTeX_Main-Regular.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Math-BoldItalic.ttf
Normal file
BIN
public/css/fonts/KaTeX_Math-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Math-BoldItalic.woff
Normal file
BIN
public/css/fonts/KaTeX_Math-BoldItalic.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Math-BoldItalic.woff2
Normal file
BIN
public/css/fonts/KaTeX_Math-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Math-Italic.ttf
Normal file
BIN
public/css/fonts/KaTeX_Math-Italic.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Math-Italic.woff
Normal file
BIN
public/css/fonts/KaTeX_Math-Italic.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Math-Italic.woff2
Normal file
BIN
public/css/fonts/KaTeX_Math-Italic.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_SansSerif-Bold.ttf
Normal file
BIN
public/css/fonts/KaTeX_SansSerif-Bold.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_SansSerif-Bold.woff
Normal file
BIN
public/css/fonts/KaTeX_SansSerif-Bold.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_SansSerif-Bold.woff2
Normal file
BIN
public/css/fonts/KaTeX_SansSerif-Bold.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_SansSerif-Italic.ttf
Normal file
BIN
public/css/fonts/KaTeX_SansSerif-Italic.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_SansSerif-Italic.woff
Normal file
BIN
public/css/fonts/KaTeX_SansSerif-Italic.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_SansSerif-Italic.woff2
Normal file
BIN
public/css/fonts/KaTeX_SansSerif-Italic.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_SansSerif-Regular.ttf
Normal file
BIN
public/css/fonts/KaTeX_SansSerif-Regular.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_SansSerif-Regular.woff
Normal file
BIN
public/css/fonts/KaTeX_SansSerif-Regular.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_SansSerif-Regular.woff2
Normal file
BIN
public/css/fonts/KaTeX_SansSerif-Regular.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Script-Regular.ttf
Normal file
BIN
public/css/fonts/KaTeX_Script-Regular.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Script-Regular.woff
Normal file
BIN
public/css/fonts/KaTeX_Script-Regular.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Script-Regular.woff2
Normal file
BIN
public/css/fonts/KaTeX_Script-Regular.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Size1-Regular.ttf
Normal file
BIN
public/css/fonts/KaTeX_Size1-Regular.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Size1-Regular.woff
Normal file
BIN
public/css/fonts/KaTeX_Size1-Regular.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Size1-Regular.woff2
Normal file
BIN
public/css/fonts/KaTeX_Size1-Regular.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Size2-Regular.ttf
Normal file
BIN
public/css/fonts/KaTeX_Size2-Regular.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Size2-Regular.woff
Normal file
BIN
public/css/fonts/KaTeX_Size2-Regular.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Size2-Regular.woff2
Normal file
BIN
public/css/fonts/KaTeX_Size2-Regular.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Size3-Regular.ttf
Normal file
BIN
public/css/fonts/KaTeX_Size3-Regular.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Size3-Regular.woff
Normal file
BIN
public/css/fonts/KaTeX_Size3-Regular.woff
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Size3-Regular.woff2
Normal file
BIN
public/css/fonts/KaTeX_Size3-Regular.woff2
Normal file
Binary file not shown.
BIN
public/css/fonts/KaTeX_Size4-Regular.ttf
Normal file
BIN
public/css/fonts/KaTeX_Size4-Regular.ttf
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user