From 51e25192aa6355333655d579d45c3f90ad1b01f6 Mon Sep 17 00:00:00 2001 From: lauk001 Date: Mon, 11 Sep 2023 16:41:57 +0800 Subject: [PATCH] add spec file --- housekeeper/files/housekeeper-daemon.service | 26 ++++++++++++ nkd.spec | 42 ++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100755 housekeeper/files/housekeeper-daemon.service create mode 100644 nkd.spec diff --git a/housekeeper/files/housekeeper-daemon.service b/housekeeper/files/housekeeper-daemon.service new file mode 100755 index 0000000..35a21f8 --- /dev/null +++ b/housekeeper/files/housekeeper-daemon.service @@ -0,0 +1,26 @@ +# Copyright 2023 KylinSoft Co., Ltd. + +# Licensed 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. + + +[Unit] +Description=daemon of the housekeeper + +[Service] +ExecStart=/opt/nkd/bin/housekeeper-daemon +Restart=on-failure +KillMode=process + +[Install] +WantedBy=multi-user.target + diff --git a/nkd.spec b/nkd.spec new file mode 100644 index 0000000..dd8a0fc --- /dev/null +++ b/nkd.spec @@ -0,0 +1,42 @@ +Name: nkd +Version: 1.0.0 +Release: 1 +Summary: A platform to deploy and operate k8s clusters +License: Apache-2.0 +Source0: https://gitee.com/openeuler/nestos-kubernetes-deployer/ +BuildRequires: make +BuildRequires: golang >= 1.13 +%description +This is the deployment of kubernetes cluster O&M platform based on NestOS. +The goal is to provide services such as deployment, update, and configuration management of the cluster infrastructure outside the cluster. + +%package housekeeper +Summary: nkd housekeeper +Provides: nkd-housekeeper = %{version}-%{release} + +%description housekeeper +Upgrade the os or k8s version module. + +%build +# nkd +GO111MODULE=on go build -mod=vendor -o nkd nkd.go +# housekeeper +cd ./housekeeper +make + +%install +install -d -m 0740 %{buildroot}/opt/nkd/bin +install -p -m 0500 nkd %{buildroot}/opt/nkd/bin +install -p -m 0500 ./housekeeper/bin/housekeeper-daemon %{buildroot}/opt/nkd/bin +install -p -m 0600 ./housekeeper/daemon/files/housekeeper-daemon.service %{buildroot}/etc/systemd/system/ + +%files +%attr(0500,root,root) /opt/nkd/bin/nkd +%attr(0500,root,root) /opt/nkd/bin/housekeeper-daemon + +%clean +rm -rfv %{buildroot} + +%changelog +* Thu Sep 14 2023 liukuo - 1.0.0-1 +- First release NKD in rpm package -- Gitee