Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REVERT: replace docker to nerdctl #20 #22

Merged
merged 2 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions nertctl.tf

This file was deleted.

5 changes: 1 addition & 4 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ output "systemd_units" {
value = concat([
data.ignition_systemd_unit.etcd_service.rendered,
data.ignition_systemd_unit.etcd_data_mount.rendered,
data.ignition_systemd_unit.init_nerdctl.rendered,
],
var.enable_metrics_proxy ? [
data.ignition_systemd_unit.etcd_metrics_proxy_service.rendered
Expand All @@ -20,9 +19,7 @@ output "files" {
data.ignition_file.etcd_server_cert.rendered,
data.ignition_file.etcd_server_key.rendered,
data.ignition_file.etcd_peer_cert.rendered,
data.ignition_file.etcd_peer_key.rendered,
data.ignition_file.init_nerdctl.rendered,
data.ignition_file.nerdctl.rendered,
data.ignition_file.etcd_peer_key.rendered
],
var.enable_metrics_proxy ? [
data.ignition_file.etcd_metrics_proxy_wrapper_sh.rendered
Expand Down
4 changes: 2 additions & 2 deletions scripts/etcd-metrics-proxy-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ fi

DOCKER_RUN_ARGS="${DOCKER_RUN_ARGS} ${DOCKER_OPTS}"

NERDCTL="${NERDCTL:-/opt/bin/nerdctl}"
DOCKER="${DOCKER:-/usr/bin/docker}"
set -x
exec ${NERDCTL} run \
exec ${DOCKER} run \
-v ${ETCD_CERT_PATH}:${ETCD_CERT_PATH}:ro \
--env-file=/etc/etcd/config.env \
--net=host \
Expand Down
6 changes: 3 additions & 3 deletions scripts/etcd-wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Wrapper for launching etcd via nerdctl.
# Wrapper for launching etcd via docker.

set -e

Expand Down Expand Up @@ -60,9 +60,9 @@ fi

DOCKER_RUN_ARGS="${DOCKER_RUN_ARGS} ${DOCKER_OPTS}"

NERDCTL="${NERDCTL:-/opt/bin/nerdctl}"
DOCKER="${DOCKER:-/usr/bin/docker}"
set -x
exec ${NERDCTL} run \
exec ${DOCKER} run \
-v ${ETCD_DATA_DIR}:${ETCD_DATA_DIR}:rw \
-v /etc/ssl/certs:/etc/ssl/certs:ro \
-v ${ETCD_CERT_PATH}:${ETCD_CERT_PATH}:rw \
Expand Down
8 changes: 0 additions & 8 deletions scripts/init-nerdctl.sh

This file was deleted.

5 changes: 2 additions & 3 deletions templates/etcd-metrics-proxy.service.tpl
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
[Unit]
Description=etcd-metrics-proxy service
After=init-nerdctl.service
Requires=network-online.target

[Service]
Environment="PATH=/opt/bin:/opt/etcd/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
EnvironmentFile=/etc/etcd/config.env
ExecStartPre=-/opt/bin/nerdctl rm -f etcd-metrics-proxy
ExecStartPre=-/usr/bin/docker rm -f etcd-metrics-proxy
ExecStart=/opt/etcd/bin/etcd-metrics-proxy-wrapper
ExecStop=-/opt/bin/nerdctl stop etcd-metrics-proxy
ExecStop=-/usr/bin/docker stop etcd-metrics-proxy

Restart=always
RestartSec=10
Expand Down
5 changes: 2 additions & 3 deletions templates/etcd.service.tpl
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
[Unit]
Description=etcd service
After=init-nerdctl.service
Requires=network-online.target

[Service]
Environment="PATH=/opt/bin:/opt/etcd/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
EnvironmentFile=/etc/etcd/config.env
ExecStartPre=-/opt/bin/nerdctl rm -f etcd
ExecStartPre=-/usr/bin/docker rm -f etcd
ExecStart=/opt/etcd/bin/etcd-wrapper
ExecStop=-/opt/bin/nerdctl stop etcd
ExecStop=-/usr/bin/docker stop etcd

Restart=always
RestartSec=10
Expand Down
18 changes: 0 additions & 18 deletions templates/init-nerdctl.service.tpl

This file was deleted.

9 changes: 0 additions & 9 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ variable "containers" {
default = {}
}

variable "binaries" {
description = "Desired addon binaries url and checksum."
type = map(object({
source = string
checksum = string
}))
default = {}
}

variable "cloud_provider" {
description = "The name of public cloud."
type = string
Expand Down
8 changes: 0 additions & 8 deletions variables_defaults.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,4 @@ locals {
extra_flags = merge({
"log-level" = var.log_level
}, var.extra_flags)

binaries = merge(
{
nerdctl = {
source = "https://github.com/containerd/nerdctl/releases/download/v1.6.0/nerdctl-1.6.0-linux-amd64.tar.gz"
checksum = "sha512-89dcba32badfd1481d88cd5f4179ff99348578af5004a7e96daa05101e99ba7448685596692ada3186f718ffd1166768ac6a22e041c5887e416e6dc7fda97f24"
}
}, var.binaries)
}