Skip to content

Commit

Permalink
rename to k8s-openstack-node-upgrade-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
lu1as committed Jan 31, 2022
1 parent e257fa2 commit b765ae2
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@

# End of https://www.toptal.com/developers/gitignore/api/go

k8s-node-upgrade-agent
k8s-openstack-node-upgrade-agent
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ compile:
stage: compile
image: golang:1.16-alpine
script:
- GOOS=linux CGO_ENABLED=0 go build -o k8s-node-upgrade-agent
- GOOS=linux CGO_ENABLED=0 go build -o k8s-openstack-node-upgrade-agent
artifacts:
name: ${CI_PROJECT_NAME}-${CI_COMMIT_REF_NAME}
paths:
- k8s-node-upgrade-agent
- k8s-openstack-node-upgrade-agent
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM alpine:3

COPY k8s-node-upgrade-agent /k8s-node-upgrade-agent
COPY k8s-openstack-node-upgrade-agent /k8s-openstack-node-upgrade-agent

ENTRYPOINT ["/k8s-node-upgrade-agent"]
ENTRYPOINT ["/k8s-openstack-node-upgrade-agent"]
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# k8s-node-upgrade-agent
# k8s-openstack-node-upgrade-agent

Upgrade agent for OpenStack-based Kubernetes nodes, which are based on regular updated Glance images.
It uses [rancher/system-upgrade-controller](https://github.com/rancher/system-upgrade-controller) to drain the Kubernetes nodes one by one and rebuild the OpenStack instance with the latest image revision. It's also possible to migrate to another operating system by switching to a new image.
Expand All @@ -8,7 +8,7 @@ The upgrade process assumes that the OpenStack instances will provision itself v
## Usage

```sh
./k8s-node-upgrade-agent --help
./k8s-openstack-node-upgrade-agent --help
-duration duration
duration for verify option (default 1m0s)
-instanceUpgrade
Expand All @@ -23,9 +23,9 @@ The upgrade process assumes that the OpenStack instances will provision itself v

First deploy the [rancher/system-upgrade-controller](https://github.com/rancher/system-upgrade-controller#deploying):
```sh
helm repo add nimbolus-k8s-node-upgrade-agent https://nimbolus.github.io/k8s-node-upgrade-agent
helm repo add nimbolus-k8s-openstack-node-upgrade-agent https://nimbolus.github.io/k8s-openstack-node-upgrade-agent
helm repo update
helm install -n system-upgrade --create-namespace system-upgrade-controller nimbolus-k8s-node-upgrade-agent/system-upgrade-controller
helm install -n system-upgrade --create-namespace system-upgrade-controller nimbolus-k8s-openstack-node-upgrade-agent/system-upgrade-controller
```

### Upgrade cluster to a given image version
Expand All @@ -36,11 +36,11 @@ Then checkout [examples/instance-upgrade-manual.yaml](./examples/instance-upgrad

### Use a channel for regular upgrades

On OpenStack clouds where images get rebuild regularly to include the latest kernels and security patches, the system-upgrade-controller needs a channel endpoint to check for new image IDs. The k8s-node-upgrade-agent can also fullfil this requirement by serving an HTTP endpoint, which returns the latest ID for a given OpenStack image name.
On OpenStack clouds where images get rebuild regularly to include the latest kernels and security patches, the system-upgrade-controller needs a channel endpoint to check for new image IDs. The k8s-openstack-node-upgrade-agent can also fullfil this requirement by serving an HTTP endpoint, which returns the latest ID for a given OpenStack image name.

After the system-upgrade-controller is ready, deploy the node-upgrade-channel, remember to set the OpenStack credentials in the Helm values:
```sh
helm install -n system-upgrade -f value_overrides.yaml system-upgrade-controller nimbolus-k8s-node-upgrade-agent/node-upgrade-channel
helm install -n system-upgrade -f value_overrides.yaml system-upgrade-controller nimbolus-k8s-openstack-node-upgrade-agent/node-upgrade-channel
```

Finally checkout [examples/instance-upgrade-channel.yaml](./examples/instance-upgrade-channel.yaml) for an example upgrade plan.
2 changes: 1 addition & 1 deletion charts/node-upgrade-channel/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ version: 0.1.0
# It is recommended to use it with quotes.
appVersion: "0.2.0"

home: https://github.com/nimbolus/k8s-node-upgrade-agent
home: https://github.com/nimbolus/k8s-openstack-node-upgrade-agent
2 changes: 1 addition & 1 deletion charts/node-upgrade-channel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
replicaCount: 1

image:
repository: registry.zotha.de/nimbolus/k8s-node-upgrade-agent
repository: registry.zotha.de/nimbolus/k8s-openstack-node-upgrade-agent
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
Expand Down
4 changes: 2 additions & 2 deletions examples/instance-upgrade-channel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ spec:
drain:
force: true
prepare:
image: registry.zotha.de/nimbolus/k8s-node-upgrade-agent
image: registry.zotha.de/nimbolus/k8s-openstack-node-upgrade-agent
args: ["-verify", "-duration=30s"]
upgrade:
image: registry.zotha.de/nimbolus/k8s-node-upgrade-agent
image: registry.zotha.de/nimbolus/k8s-openstack-node-upgrade-agent
args: ["-instanceUpgrade"]
envs:
# set image name for upgrade process (remember to update it in the channel URL also)
Expand Down
4 changes: 2 additions & 2 deletions examples/instance-upgrade-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ spec:
drain:
force: true
prepare:
image: registry.zotha.de/nimbolus/k8s-node-upgrade-agent
image: registry.zotha.de/nimbolus/k8s-openstack-node-upgrade-agent
# verify cluster health for one minute before upgrading the next node
args: ["-verify", "-duration=1m"]
upgrade:
image: registry.zotha.de/nimbolus/k8s-node-upgrade-agent
image: registry.zotha.de/nimbolus/k8s-openstack-node-upgrade-agent
args: ["-instanceUpgrade"]
envs:
- name: OPENSTACK_IMAGE_NAME
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/nimbolus/k8s-node-upgrade-agent
module github.com/nimbolus/k8s-openstack-node-upgrade-agent

go 1.17

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"os"
"time"

"github.com/nimbolus/k8s-node-upgrade-agent/pkg/health"
"github.com/nimbolus/k8s-node-upgrade-agent/pkg/openstack"
"github.com/nimbolus/k8s-openstack-node-upgrade-agent/pkg/health"
"github.com/nimbolus/k8s-openstack-node-upgrade-agent/pkg/openstack"
)

const (
Expand Down

0 comments on commit b765ae2

Please sign in to comment.