github.com/lingyao2333/mo-zero@v1.4.1/core/discov/kubernetes/etcd.yaml (about)

     1  apiVersion: v1
     2  kind: Service
     3  metadata:
     4    name: etcd
     5    namespace: discov
     6  spec:
     7    ports:
     8      - name: etcd-port
     9        port: 2379
    10        protocol: TCP
    11        targetPort: 2379
    12    selector:
    13      app: etcd
    14  
    15  ---
    16  
    17  apiVersion: v1
    18  kind: Pod
    19  metadata:
    20    labels:
    21      app: etcd
    22      etcd_node: etcd0
    23    name: etcd0
    24    namespace: discov
    25  spec:
    26    containers:
    27      - command:
    28          - /usr/local/bin/etcd
    29          - --name
    30          - etcd0
    31          - --initial-advertise-peer-urls
    32          - http://etcd0:2380
    33          - --listen-peer-urls
    34          - http://0.0.0.0:2380
    35          - --listen-client-urls
    36          - http://0.0.0.0:2379
    37          - --advertise-client-urls
    38          - http://etcd0.discov:2379
    39          - --initial-cluster
    40          - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380,etcd4=http://etcd4:2380
    41          - --initial-cluster-state
    42          - new
    43          - --auto-compaction-retention=1
    44        image: quay.io/coreos/etcd:latest
    45        name: etcd0
    46        ports:
    47          - containerPort: 2379
    48            name: client
    49            protocol: TCP
    50          - containerPort: 2380
    51            name: server
    52            protocol: TCP
    53    affinity:
    54      podAntiAffinity:
    55        requiredDuringSchedulingIgnoredDuringExecution:
    56          - labelSelector:
    57              matchExpressions:
    58                - key: app
    59                  operator: In
    60                  values:
    61                    - etcd
    62            topologyKey: "kubernetes.io/hostname"
    63    restartPolicy: Always
    64  
    65  ---
    66  
    67  apiVersion: v1
    68  kind: Service
    69  metadata:
    70    labels:
    71      etcd_node: etcd0
    72    name: etcd0
    73    namespace: discov
    74  spec:
    75    ports:
    76      - name: client
    77        port: 2379
    78        protocol: TCP
    79        targetPort: 2379
    80      - name: server
    81        port: 2380
    82        protocol: TCP
    83        targetPort: 2380
    84    selector:
    85      etcd_node: etcd0
    86  
    87  ---
    88  
    89  apiVersion: v1
    90  kind: Pod
    91  metadata:
    92    labels:
    93      app: etcd
    94      etcd_node: etcd1
    95    name: etcd1
    96    namespace: discov
    97  spec:
    98    containers:
    99      - command:
   100          - /usr/local/bin/etcd
   101          - --name
   102          - etcd1
   103          - --initial-advertise-peer-urls
   104          - http://etcd1:2380
   105          - --listen-peer-urls
   106          - http://0.0.0.0:2380
   107          - --listen-client-urls
   108          - http://0.0.0.0:2379
   109          - --advertise-client-urls
   110          - http://etcd1.discov:2379
   111          - --initial-cluster
   112          - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380,etcd4=http://etcd4:2380
   113          - --initial-cluster-state
   114          - new
   115          - --auto-compaction-retention=1
   116        image: quay.io/coreos/etcd:latest
   117        name: etcd1
   118        ports:
   119          - containerPort: 2379
   120            name: client
   121            protocol: TCP
   122          - containerPort: 2380
   123            name: server
   124            protocol: TCP
   125    affinity:
   126      podAntiAffinity:
   127        requiredDuringSchedulingIgnoredDuringExecution:
   128          - labelSelector:
   129              matchExpressions:
   130                - key: app
   131                  operator: In
   132                  values:
   133                    - etcd
   134            topologyKey: "kubernetes.io/hostname"
   135    restartPolicy: Always
   136  
   137  ---
   138  
   139  apiVersion: v1
   140  kind: Service
   141  metadata:
   142    labels:
   143      etcd_node: etcd1
   144    name: etcd1
   145    namespace: discov
   146  spec:
   147    ports:
   148      - name: client
   149        port: 2379
   150        protocol: TCP
   151        targetPort: 2379
   152      - name: server
   153        port: 2380
   154        protocol: TCP
   155        targetPort: 2380
   156    selector:
   157      etcd_node: etcd1
   158  
   159  ---
   160  
   161  apiVersion: v1
   162  kind: Pod
   163  metadata:
   164    labels:
   165      app: etcd
   166      etcd_node: etcd2
   167    name: etcd2
   168    namespace: discov
   169  spec:
   170    containers:
   171      - command:
   172          - /usr/local/bin/etcd
   173          - --name
   174          - etcd2
   175          - --initial-advertise-peer-urls
   176          - http://etcd2:2380
   177          - --listen-peer-urls
   178          - http://0.0.0.0:2380
   179          - --listen-client-urls
   180          - http://0.0.0.0:2379
   181          - --advertise-client-urls
   182          - http://etcd2.discov:2379
   183          - --initial-cluster
   184          - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380,etcd4=http://etcd4:2380
   185          - --initial-cluster-state
   186          - new
   187          - --auto-compaction-retention=1
   188        image: quay.io/coreos/etcd:latest
   189        name: etcd2
   190        ports:
   191          - containerPort: 2379
   192            name: client
   193            protocol: TCP
   194          - containerPort: 2380
   195            name: server
   196            protocol: TCP
   197    affinity:
   198      podAntiAffinity:
   199        requiredDuringSchedulingIgnoredDuringExecution:
   200          - labelSelector:
   201              matchExpressions:
   202                - key: app
   203                  operator: In
   204                  values:
   205                    - etcd
   206            topologyKey: "kubernetes.io/hostname"
   207    restartPolicy: Always
   208  
   209  ---
   210  
   211  apiVersion: v1
   212  kind: Service
   213  metadata:
   214    labels:
   215      etcd_node: etcd2
   216    name: etcd2
   217    namespace: discov
   218  spec:
   219    ports:
   220      - name: client
   221        port: 2379
   222        protocol: TCP
   223        targetPort: 2379
   224      - name: server
   225        port: 2380
   226        protocol: TCP
   227        targetPort: 2380
   228    selector:
   229      etcd_node: etcd2
   230  
   231  ---
   232  
   233  apiVersion: v1
   234  kind: Pod
   235  metadata:
   236    labels:
   237      app: etcd
   238      etcd_node: etcd3
   239    name: etcd3
   240    namespace: discov
   241  spec:
   242    containers:
   243      - command:
   244          - /usr/local/bin/etcd
   245          - --name
   246          - etcd3
   247          - --initial-advertise-peer-urls
   248          - http://etcd3:2380
   249          - --listen-peer-urls
   250          - http://0.0.0.0:2380
   251          - --listen-client-urls
   252          - http://0.0.0.0:2379
   253          - --advertise-client-urls
   254          - http://etcd3.discov:2379
   255          - --initial-cluster
   256          - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380,etcd4=http://etcd4:2380
   257          - --initial-cluster-state
   258          - new
   259          - --auto-compaction-retention=1
   260        image: quay.io/coreos/etcd:latest
   261        name: etcd3
   262        ports:
   263          - containerPort: 2379
   264            name: client
   265            protocol: TCP
   266          - containerPort: 2380
   267            name: server
   268            protocol: TCP
   269    affinity:
   270      podAntiAffinity:
   271        requiredDuringSchedulingIgnoredDuringExecution:
   272          - labelSelector:
   273              matchExpressions:
   274                - key: app
   275                  operator: In
   276                  values:
   277                    - etcd
   278            topologyKey: "kubernetes.io/hostname"
   279    restartPolicy: Always
   280  
   281  ---
   282  
   283  apiVersion: v1
   284  kind: Service
   285  metadata:
   286    labels:
   287      etcd_node: etcd3
   288    name: etcd3
   289    namespace: discov
   290  spec:
   291    ports:
   292      - name: client
   293        port: 2379
   294        protocol: TCP
   295        targetPort: 2379
   296      - name: server
   297        port: 2380
   298        protocol: TCP
   299        targetPort: 2380
   300    selector:
   301      etcd_node: etcd3
   302  
   303  ---
   304  
   305  apiVersion: v1
   306  kind: Pod
   307  metadata:
   308    labels:
   309      app: etcd
   310      etcd_node: etcd4
   311    name: etcd4
   312    namespace: discov
   313  spec:
   314    containers:
   315      - command:
   316          - /usr/local/bin/etcd
   317          - --name
   318          - etcd4
   319          - --initial-advertise-peer-urls
   320          - http://etcd4:2380
   321          - --listen-peer-urls
   322          - http://0.0.0.0:2380
   323          - --listen-client-urls
   324          - http://0.0.0.0:2379
   325          - --advertise-client-urls
   326          - http://etcd4.discov:2379
   327          - --initial-cluster
   328          - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380,etcd4=http://etcd4:2380
   329          - --initial-cluster-state
   330          - new
   331          - --auto-compaction-retention=1
   332        image: quay.io/coreos/etcd:latest
   333        name: etcd4
   334        ports:
   335          - containerPort: 2379
   336            name: client
   337            protocol: TCP
   338          - containerPort: 2380
   339            name: server
   340            protocol: TCP
   341    affinity:
   342      podAntiAffinity:
   343        requiredDuringSchedulingIgnoredDuringExecution:
   344          - labelSelector:
   345              matchExpressions:
   346                - key: app
   347                  operator: In
   348                  values:
   349                    - etcd
   350            topologyKey: "kubernetes.io/hostname"
   351    restartPolicy: Always
   352  
   353  ---
   354  
   355  apiVersion: v1
   356  kind: Service
   357  metadata:
   358    labels:
   359      etcd_node: etcd4
   360    name: etcd4
   361    namespace: discov
   362  spec:
   363    ports:
   364      - name: client
   365        port: 2379
   366        protocol: TCP
   367        targetPort: 2379
   368      - name: server
   369        port: 2380
   370        protocol: TCP
   371        targetPort: 2380
   372    selector:
   373      etcd_node: etcd4