aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrung LĂȘ <trung.le@ruby-journal.com>2020-07-22 23:27:17 +1000
committerFrancesco Colista <fcolista@alpinelinux.org>2020-07-23 12:13:52 +0000
commitc00abf27f40b0475686eb15d1ea9d060ad6f0587 (patch)
tree2d9a5da3a2fb7817cc119e7fd9602ee7cc085860
parentd2ad16dcff9215d9dc6673e726ad941a82044a42 (diff)
testing/etcd: remove --data-dir flag
-rw-r--r--testing/etcd/APKBUILD15
-rw-r--r--testing/etcd/etcd.confd17
-rw-r--r--testing/etcd/etcd.initd8
-rw-r--r--testing/etcd/etcd.yaml-3.4.10140
4 files changed, 155 insertions, 25 deletions
diff --git a/testing/etcd/APKBUILD b/testing/etcd/APKBUILD
index ee010e80da9..f85f1dfeaac 100644
--- a/testing/etcd/APKBUILD
+++ b/testing/etcd/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=etcd
pkgver=3.4.10
-pkgrel=0
+pkgrel=1
pkgdesc="A highly-available key value store for shared configuration and service discovery"
options="chmod-clean"
url="https://github.com/coreos/etcd"
@@ -10,11 +10,11 @@ arch="x86_64 ppc64le"
license="Apache-2.0"
makedepends="go bash"
install="$pkgname.pre-install"
-pkgusers="$pkgname"
-pkggroups="$pkgname"
+pkgusers="etcd"
+pkggroups="etcd"
subpackages="$pkgname-doc $pkgname-ctl $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/coreos/etcd/archive/v$pkgver.tar.gz
- $pkgname.yaml-$pkgver::https://raw.githubusercontent.com/etcd-io/etcd/release-${pkgver%.*}/etcd.conf.yml.sample
+ $pkgname.yaml-$pkgver
$pkgname.confd
$pkgname.initd
"
@@ -37,6 +37,7 @@ build() {
package() {
mkdir -p "$pkgdir"/var/lib/$pkgname
chown -R $pkgusers:$pkggroups "$pkgdir"/var/lib/$pkgname
+ chmod 700 "$pkgdir"/var/lib/$pkgname
install -Dm755 bin/etcd "$pkgdir"/usr/bin/etcd
install -Dm644 $srcdir/$pkgname.yaml-$pkgver "$pkgdir"/etc/etcd/conf.yml
install -Dm644 $srcdir/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
@@ -55,6 +56,6 @@ ctl() {
}
sha512sums="104bfce77778df4704caafc45b731bb440060be1d802a42642f33cc6c2ad11b7f94c237c1b8a47c38d1e109b71b31cc6cd8a666796fe2dbc925722fee1c2c4da etcd-3.4.10.tar.gz
-aa42b93eb4bf762173563ffd0b93dd82f3aafdf277248ca356daa4aaf82da945d5f740c07db7e95d05895bb44a2bb303041f0a7b3329f7ce483d2785df011f9e etcd.yaml-3.4.10
-e2c178b376dc05de7daee6ca3b38cc289e7c73106055dcccde08fe36a392224edf9f98203d50f14c7abeea74552675ff73a061ba20c56628eb657fa15dcd8942 etcd.confd
-c251f63cbaee2d5edaed3f82b4d0b8918ecee977ee459b59f0b9fef02cfe69f0de997e9a59ad29732c58782c224591b0d27378b24435f1bac0e77a35d8886bba etcd.initd"
+86f726d77a3fbe87908c5a5b6e3c5b81f0b428de05a211fd1ea82058285c1a64898ca8a79ef8458db5ed5fd53d72e3a457eb55c0c297981363edf60d2d28b4af etcd.yaml-3.4.10
+8b917d2b3a136a97dd9565a91377420ce1f812bfb10bb0caa95f1024dd366cb78ebb0539f16ddfbc399325d41a6664b856d49c5c9aa67bc27e36040f2227356e etcd.confd
+b4fbaa1529a2150f2ff9d0665c4b86e1f48839dbc16556c0054aad9eda07943ff6d80f759232ce4550b4eddb4944cf44af9566d03ddc148e72e4a3b57a4ae0da etcd.initd"
diff --git a/testing/etcd/etcd.confd b/testing/etcd/etcd.confd
index 0656d612e19..1f916ee40bc 100644
--- a/testing/etcd/etcd.confd
+++ b/testing/etcd/etcd.confd
@@ -1,17 +1,2 @@
LOGPATH=/var/log/${RC_SVCNAME}
-USER=$RC_SVCNAME
-
-ETCD_CONFIG=/etc/etcd/conf.yml
-
-# Path to the data directory.
-#
-# default: "${name}.etcd"
-# distribution default: "/var/lib/etcd"
-#
-ETCD_DATA_DIR="/var/lib/etcd"
-
-# Any additional command-line options
-#
-# default: ""
-#
-#ETCD_OPTS=""
+ETCD_CONFIG_FILE=/etc/etcd/conf.yml
diff --git a/testing/etcd/etcd.initd b/testing/etcd/etcd.initd
index 779ab2990e7..15efa7697c1 100644
--- a/testing/etcd/etcd.initd
+++ b/testing/etcd/etcd.initd
@@ -7,10 +7,14 @@ supervisor=supervise-daemon
name="$RC_SVCNAME"
description="Highly-available key-value store"
+ETCD_DATA_DIR=$(sed -n 's/^data-dir:./\1/p' $ETCD_CONFIG_FILE)
+
command=/usr/bin/etcd
-command_args="--config-file=$ETCD_CONFIG --data-dir=$ETCD_DATA_DIR $ETCD_OPTS"
+command_args="--config-file=${ETCD_CONFIG_FILE}"
+: ${output_log:=$LOGPATH/$RC_SVCNAME.log}
+: ${error_log:=$LOGPATH/$RC_SVCNAME.log}
-command_user="$USER:$USER"
+command_user="etcd:etcd"
supervise_daemon_args="--chdir $ETCD_DATA_DIR"
diff --git a/testing/etcd/etcd.yaml-3.4.10 b/testing/etcd/etcd.yaml-3.4.10
new file mode 100644
index 00000000000..dce0c51131d
--- /dev/null
+++ b/testing/etcd/etcd.yaml-3.4.10
@@ -0,0 +1,140 @@
+# This is the configuration file for the etcd server.
+
+# Human-readable name for this member.
+name: 'default'
+
+# Path to the data directory.
+data-dir: /var/lib/etcd
+
+# Path to the dedicated wal directory.
+wal-dir:
+
+# Number of committed transactions to trigger a snapshot to disk.
+snapshot-count: 10000
+
+# Time (in milliseconds) of a heartbeat interval.
+heartbeat-interval: 100
+
+# Time (in milliseconds) for an election to timeout.
+election-timeout: 1000
+
+# Raise alarms when backend size exceeds the given quota. 0 means use the
+# default quota.
+quota-backend-bytes: 0
+
+# List of comma separated URLs to listen on for peer traffic.
+listen-peer-urls: http://localhost:2380
+
+# List of comma separated URLs to listen on for client traffic.
+listen-client-urls: http://localhost:2379
+
+# Maximum number of snapshot files to retain (0 is unlimited).
+max-snapshots: 5
+
+# Maximum number of wal files to retain (0 is unlimited).
+max-wals: 5
+
+# Comma-separated white list of origins for CORS (cross-origin resource sharing).
+cors:
+
+# List of this member's peer URLs to advertise to the rest of the cluster.
+# The URLs needed to be a comma-separated list.
+initial-advertise-peer-urls: http://localhost:2380
+
+# List of this member's client URLs to advertise to the public.
+# The URLs needed to be a comma-separated list.
+advertise-client-urls: http://localhost:2379
+
+# Discovery URL used to bootstrap the cluster.
+discovery:
+
+# Valid values include 'exit', 'proxy'
+discovery-fallback: 'proxy'
+
+# HTTP proxy to use for traffic to discovery service.
+discovery-proxy:
+
+# DNS domain used to bootstrap initial cluster.
+discovery-srv:
+
+# Initial cluster configuration for bootstrapping.
+initial-cluster:
+
+# Initial cluster token for the etcd cluster during bootstrap.
+initial-cluster-token: 'etcd-cluster'
+
+# Initial cluster state ('new' or 'existing').
+initial-cluster-state: 'new'
+
+# Reject reconfiguration requests that would cause quorum loss.
+strict-reconfig-check: false
+
+# Accept etcd V2 client requests
+enable-v2: true
+
+# Enable runtime profiling data via HTTP server
+enable-pprof: true
+
+# Valid values include 'on', 'readonly', 'off'
+proxy: 'off'
+
+# Time (in milliseconds) an endpoint will be held in a failed state.
+proxy-failure-wait: 5000
+
+# Time (in milliseconds) of the endpoints refresh interval.
+proxy-refresh-interval: 30000
+
+# Time (in milliseconds) for a dial to timeout.
+proxy-dial-timeout: 1000
+
+# Time (in milliseconds) for a write to timeout.
+proxy-write-timeout: 5000
+
+# Time (in milliseconds) for a read to timeout.
+proxy-read-timeout: 0
+
+client-transport-security:
+ # Path to the client server TLS cert file.
+ cert-file:
+
+ # Path to the client server TLS key file.
+ key-file:
+
+ # Enable client cert authentication.
+ client-cert-auth: false
+
+ # Path to the client server TLS trusted CA cert file.
+ trusted-ca-file:
+
+ # Client TLS using generated certificates
+ auto-tls: false
+
+peer-transport-security:
+ # Path to the peer server TLS cert file.
+ cert-file:
+
+ # Path to the peer server TLS key file.
+ key-file:
+
+ # Enable peer client cert authentication.
+ client-cert-auth: false
+
+ # Path to the peer server TLS trusted CA cert file.
+ trusted-ca-file:
+
+ # Peer TLS using generated certificates.
+ auto-tls: false
+
+# Enable debug-level logging for etcd.
+debug: false
+
+logger: zap
+
+# Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd.
+log-outputs: [stderr]
+
+# Force to create a new one member cluster.
+force-new-cluster: false
+
+auto-compaction-mode: periodic
+auto-compaction-retention: "1"