<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>kuebrnetes | 伪架构师</title>
    <link>/tags/kuebrnetes/</link>
      <atom:link href="/tags/kuebrnetes/index.xml" rel="self" type="application/rss+xml" />
    <description>kuebrnetes</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>zh</language><lastBuildDate>Wed, 25 May 2016 07:27:37 +0800</lastBuildDate>
    <image>
      <url>/img/logo-wide.png</url>
      <title>kuebrnetes</title>
      <link>/tags/kuebrnetes/</link>
    </image>
    
    <item>
      <title>Kubernetes 服务定义示例</title>
      <link>/post/kubernetes-service-sample/</link>
      <pubDate>Wed, 25 May 2016 07:27:37 +0800</pubDate>
      <guid>/post/kubernetes-service-sample/</guid>
      <description>&lt;pre&gt;&lt;code class=&#34;language-yaml&#34;&gt;---
kind: List
apiVersion: v1
items:
- kind: ReplicationController
  apiVersion: v1
  metadata:
    name: rc-nginx-meta
    labels:
      name: rc-nginx
  spec:
    replicas: 1
    # 必须跟 template 里面的 labels 匹配
    selector:
      name: pod-nginx
    template:
      metadata:
        labels:
          name: pod-nginx
      spec:
        containers:
        - name: nginx-docker-images
          image: nginx:1.10
          # 开放端口数组
          ports:
          - containerPort: 80
            protocol: TCP
          # 环境变量数组
          env:
          - name: NGINX_PORT
            value: &amp;quot;888&amp;quot;
          # 加载卷数组，容器内不存在的路径会被新建
          volumeMounts:
            - mountPath: /test-pd
              name: test-volume
        volumes:
          - name: test-volume
            # 这里用主机路径类型的卷
            hostPath:
              path: /tmp
- kind: Service
  apiVersion: v1
  metadata:
    name: svc-nginx-meta
    labels:
      name: svc-nginx
  spec:
    type: NodePort
    ports:
    - protocol: TCP
      # 集群内端口
      port: 80
      # 容器端口，对应上面的 containerPort
      targetPort: 80
      # 在所有 Node 上都开放此端口
      nodePort: 32000
    selector:
      # 匹配 Pod 的标签
      name: pod-nginx
&lt;/code&gt;&lt;/pre&gt;
</description>
    </item>
    
  </channel>
</rss>
