Skip to content

Commit

Permalink
Merge pull request #19 from gboutry/feat/ubuntu@24.04
Browse files Browse the repository at this point in the history
Migrate base to ubuntu@24.04
  • Loading branch information
javacruft authored Oct 10, 2024
2 parents 50f5757 + 3e32732 commit 0e5a690
Show file tree
Hide file tree
Showing 10 changed files with 213 additions and 186 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
provider: microk8s
channel: 1.26-strict/stable
juju-channel: 3.1/stable
juju-channel: 3/stable
microk8s-addons: hostpath-storage dns rbac metallb:10.64.140.40-10.64.140.49
- name: Install snaps
run: |
Expand Down
112 changes: 0 additions & 112 deletions actions.yaml

This file was deleted.

179 changes: 169 additions & 10 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,180 @@
type: "charm"
bases:
- build-on:
- name: "ubuntu"
channel: "22.04"
run-on:
- name: "ubuntu"
channel: "22.04"
type: charm
name: rabbitmq-k8s
summary: RabbitMQ charmed operator for Kubernetes
description: RabbitMQ
links:
documentation: https://discourse.charmhub.io/t/thedac-rabbitmq-operator-docs-index/4630

base: ubuntu@24.04
platforms:
amd64:

config:
options:
minimum-replicas:
default: 3
description:
Minimum number of queues replicas, set to 0 to disable charm automatically
managing queue replicas
type: int
auto-ha-frequency:
default: 30
description: Frequency in minutes to check for queues that need HA members added
type: int

actions:
get-operator-info:
description: |
Get information on the operator user for rabbitmq management.
get-service-account:
description: |
Generate credentials and access for an external service.
params:
username:
type: string
description: The username for the service account.
vhost:
type: string
description: The RabbitMQ virtual host to use for the account.
required:
- username
- vhost
additionalProperties: false
ensure-queue-ha:
description: |
Check for queues that have insufficent members for high
availability and, if possible, add members to them.
params:
dry-run:
type: boolean
default: false
description: |
Report on what memberships would change if the command was
run and warn about any queues that cannot be fixed.
rebalance-quorum:
description: |
Rebalance queue leaders to that they are evenly balanced
across the cluster.
add-member:
description: Add member to queue
params:
queue-name:
type: string
description: |
Name of queue to add the member to.
unit-name:
type: string
description: |
Juju unit name of the node to be added to the queue
vhost:
type: string
description: |
vhost that the queue resides in.
required:
- queue-name
- unit-name
delete-member:
description: Remove member from queue
params:
queue-name:
type: string
description: |
Name of queue to remove the member from.
unit-name:
type: string
description: |
Juju unit name of the node to be removed from the queue
vhost:
type: string
description: |
vhost that the queue resides in.
required:
- queue-name
- unit-name
grow:
description: |
Adds a new replica on the given node for all or a half
of matching quorum queues.
params:
selector:
type: string
description: |
Valid values are "all" or even"
unit-name:
type: string
description: |
Juju unit name of the node to have queues added
vhost-pattern:
type: string
description: |
Match vhosts to be added to the node
queue-pattern:
type: string
description: |
Match queues to be added to the node
required:
- unit-name
- selector
shrink:
description: |
Shrinks quorum queue clusters by removing any members (replicas)
on the given node.
params:
unit-name:
type: string
description: |
Juju unit name of the node to have queues added
error-only:
type: boolean
default: false
description: |
Only list queues which reported an error
required:
- unit-name

containers:
rabbitmq:
resource: rabbitmq-image
mounts:
- storage: rabbitmq-data
location: /var/lib/rabbitmq

resources:
rabbitmq-image:
type: oci-image
description: OCI image for rabbitmq
upstream-source: ghcr.io/canonical/rabbitmq:3.12.1

storage:
rabbitmq-data:
type: filesystem

requires:
ingress:
interface: ingress
limit: 1
logging:
interface: loki_push_api
optional: true

provides:
amqp:
interface: rabbitmq

peers:
peers:
interface: rabbitmq-peer

parts:
update-certificates:
plugin: nil
override-build: |
apt update
apt install -y ca-certificates
update-ca-certificates
charm:
after: [update-certificates]
after:
- update-certificates
build-packages:
- git
- libffi-dev
Expand Down
12 changes: 0 additions & 12 deletions config.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions metadata.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions rename.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

if [[ -f "rabbitmq-k8s.charm" ]]; then
echo "Removing existing rabbitmq-k8s.charm"
rm rabbitmq-k8s.charm
fi

for f in rabbitmq-k8s*.charm; do
echo "Renaming $f to rabbitmq-k8s.charm"
mv "$f" "rabbitmq-k8s.charm"
break
done
Loading

0 comments on commit 0e5a690

Please sign in to comment.