| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| |
| services: |
| etcd: |
| image: gcr.io/etcd-development/etcd:v3.6.4 |
| ports: |
| - "2379:2379" |
| - "2380:2380" |
| volumes: |
| - ./ca.pem:/etc/etcd/certs/ca.pem:ro |
| - ./server.pem:/etc/etcd/certs/server.pem:ro |
| - ./server-key.pem:/etc/etcd/certs/server-key.pem:ro |
| - ./client-key.pem:/etc/etcd/certs/client-key.pem:ro |
| - ./client.pem:/etc/etcd/certs/client.pem:ro |
| command: |
| - /usr/local/bin/etcd |
| - --name=etcd |
| - --listen-client-urls=https://0.0.0.0:2379 |
| - --advertise-client-urls=https://127.0.0.1:2379 |
| - --max-request-bytes=10485760 |
| - --client-cert-auth |
| - --trusted-ca-file=/etc/etcd/certs/ca.pem |
| - --cert-file=/etc/etcd/certs/server.pem |
| - --key-file=/etc/etcd/certs/server-key.pem |
| healthcheck: |
| test: [ |
| "CMD", |
| "/usr/local/bin/etcdctl", |
| "endpoint", "health", |
| "--endpoints=https://127.0.0.1:2379", |
| "--cacert=/etc/etcd/certs/ca.pem", |
| "--cert=/etc/etcd/certs/client.pem", |
| "--key=/etc/etcd/certs/client-key.pem" |
| ] |
| interval: 30s |
| timeout: 20s |
| retries: 5 |
| start_period: 40s |