Skip to content

Commit

Permalink
Future release (#6)
Browse files Browse the repository at this point in the history
* fix create-kind missing docker config file
* fix README ingress tips typo
* update kind config with comment settings for network exposing
* fix wrong scripts patch in README.md files
* fix yamls formatting
* fix chaos-mesh deployment to by containerd by default

---------

Signed-off-by: Tiago Bueno <49003339+tlbueno@users.noreply.github.com>
  • Loading branch information
tlbueno authored Nov 8, 2024
1 parent 2f1bb93 commit ecb8395
Show file tree
Hide file tree
Showing 51 changed files with 235 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

---
version: 2
updates:
- package-ecosystem: "github-actions"
Expand Down
28 changes: 19 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
name: Release

# yamllint disable-line rule:truthy
on:
push:
tags:
Expand Down Expand Up @@ -29,16 +31,24 @@ jobs:
- name: Create release
run: |
set -x -e -o pipefail
RELEASE_ID=$(curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ env.VERSION }}" | jq -r '.id')
REPO_URL="https://api.github.com/repos/${{ github.repository }}"
RELEASE_ID=$(curl -L -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"$REPO_URL/releases/tags/${{ env.VERSION }}" | jq -r '.id')
if [ -n "$RELEASE_ID" ]; then
curl -L -X DELETE -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/${{ github.repository }}/releases/${RELEASE_ID}"
curl -L -X DELETE -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"$REPO_URL/releases/${RELEASE_ID}"
fi
curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/${{ github.repository }}/releases" \
-d "$(jq -c -n --arg tag_name "${{ env.VERSION }}" --arg ref "${GITHUB_SHA}" '{"tag_name":$tag_name,"generate_release_notes":true,"target_commitish":$ref}')"
curl -L -X POST -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"$REPO_URL/releases" \
-d "$(jq -c -n --arg tag_name "${{ env.VERSION }}" \
--arg ref "${GITHUB_SHA}" \
'{"tag_name":$tag_name,"generate_release_notes":true,"target_commitish":$ref}')"
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ ifneq ($(ARTEMISCLOUD_CHART_VERSION),)
ARTEMISCLOUD_CHART_VERSION_PARAM = --version "$(ARTEMISCLOUD_CHART_VERSION)"
endif
INGRESS_CHAT_NAME = ingress-nginx/ingress-nginx
CHAOS_MESH_CONTAINER_RUNTIME = containerd
CHAOS_MESH_CONTAINER_SOCKET_PATH = /run/containerd/containerd.sock

# Prepare targets variables
PREPARE_K8S_TARGETS = add-helm-charts-repos \
Expand Down Expand Up @@ -104,6 +106,12 @@ prepare-ocp: .setOCPPrepareTargets .runPrepare ## Deploy all the resources for o
.PHONY: create-kind
create-kind: ## Create Kind cluster
@echo "Using KIND_CLUSTER_NAME as $(KIND_CLUSTER_NAME)"
@if [ ! -f ${HOME}/.docker/config.json ]; then \
mkdir -p ${HOME}/.docker; \
chmod 0700 ${HOME}/.docker; \
touch ${HOME}/.docker/config.json; \
chmod 0600 ${HOME}/.docker/config.json; \
fi
@if [ ! "$(shell kind get clusters | grep $(KIND_CLUSTER_NAME))" ]; then \
tempfile=$(shell mktemp); \
cat $(MK_FILE_DIR)/local-cluster/kind-config.yaml | envsubst > $${tempfile}; \
Expand Down Expand Up @@ -400,6 +408,8 @@ deploy-chaos-mesh: ## Deploy Chaos Mesh
chart=chaos-mesh/chaos-mesh; \
echo -n "Deploying chart $${chart} " && helm show chart $${chart} |grep -E "(^version|^appVersion)" | sort -r | paste -sd ' '; \
helm install --namespace $${namespace_name} --create-namespace --wait \
--set chaosDaemon.runtime=$(CHAOS_MESH_CONTAINER_RUNTIME) \
--set chaosDaemon.socketPath=$(CHAOS_MESH_CONTAINER_SOCKET_PATH) \
chaos-mesh $${chart}; \
$(BIN_DIR)/kubectl-wait-wrapper.sh -n $${namespace_name} \
-t pods \
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ For a local cluster there are also some [tips](#ingress-tips) related to ingress
- deploy-chaos-mesh, ie: `make deploy-chaos-mesh`
- Deploy [chaos-mesh](https://chaos-mesh.org) using [chaos-mesh/chaos-mesh](https://github.com/chaos-mesh/chaos-mesh/tree/master/helm/chaos-mesh).

- `CHAOS_MESH_CONTAINER_RUNTIME` environment variable can be used to specify the cluster container runtime. It defaults to `containerd`. Verify chaos mesh documentation for more details.
- `CHAOS_MESH_CONTAINER_SOCKET_PATH` environment variable can be used to specify the cluster container runtime socket path. It defaults to `/run/containerd/containerd.sock`. Verify chaos mesh documentation for more details.

- configure-inotify, ie: `make configure-inotify`
- Configure sysctl inotify values (requires sudo access). This may be need in some cases for some applications run fine inside the [kind] cluster.

Expand All @@ -130,7 +133,7 @@ sudo dnf install dnsmasq

- Create an dnsmasq configuration, configure dnsmasq to start on system boot and start dnsmasq:
```sh
cat - <<EOF > sudo tee /etc/dnsmasq.d/00-local.conf
cat - <<EOF | sudo tee /etc/dnsmasq.d/00-local.conf
address=/localcluster/127.0.0.1
no-resolv
EOF
Expand All @@ -144,7 +147,7 @@ sudo systemctl start dnsmasq

- Create an systemd-resolved configuration to forward DNS queries to dnsmasq, restart systemd-resolved:
```sh
cat - <<EOF > sudo tee /etc/systemd/resolved.conf
cat - <<EOF | sudo tee /etc/systemd/resolved.conf
[Resolve]
DNS=127.0.0.1
Domains=~localcluster
Expand Down
14 changes: 14 additions & 0 deletions local-cluster/kind-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
# This is an additional configuration to set the api server listen address and port
# It is useful when exposing the api server over the network
#networking:
# apiServerAddress: "0.0.0.0"
# apiServerPort: 6443
nodes:
- role: worker
extraMounts:
Expand Down Expand Up @@ -27,6 +32,15 @@ nodes:
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
# This is an additional configuration to set the api server certificate SANs
# It is useful when exposing the api server over the network
#- |
# kind: ClusterConfiguration
# apiServer:
# certSANs:
# - "api.yourdomain"
# - "0.0.0.0"
# - "localhost"
extraPortMappings:
# port t obe used by ingress-nginx to expose http and https
- containerPort: 80
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
apiVersion: v1
kind: Service
metadata:
name: debugger-svc
spec:
ports:
- port: 5005
protocol: TCP
targetPort: 5005
- port: 5005
protocol: TCP
targetPort: 5005
publishNotReadyAddresses: false
selector:
statefulset.kubernetes.io/pod-name: artemis-single-ss-0
sessionAffinity: None
type: ClusterIP
type: ClusterIP
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -11,4 +12,4 @@ stringData:
criticalAnalyzerTimeout=6000
criticalAnalyzerCheckPeriod=-1
criticalAnalyzerPolicy=LOG
broker-0:
broker-0.properties:
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -43,8 +44,9 @@ data:
logger.core_config.name=org.apache.activemq.artemis.core.config.impl.ConfigurationImpl
logger.core_config.level=TRACE
# CriticalAnalyzer: If you have issues with the CriticalAnalyzer, setting this to TRACE would give
# you extra troubleshooting info, but do not use TRACE regularly as it would incur extra CPU usage.
# CriticalAnalyzer: If you have issues with the CriticalAnalyzer, setting
# this to TRACE would give you extra troubleshooting info, but do not use
# TRACE regularly as it would incur extra CPU usage.
logger.critical_analyzer.name=org.apache.activemq.artemis.utils.critical
logger.critical_analyzer.level=INFO
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
apiVersion: broker.amq.io/v1beta1
kind: ActiveMQArtemis
metadata:
name: artemis-single
spec:
#version: 2.37.0
# version: 2.37.0
adminUser: admin
adminPassword: admin
acceptors:
Expand All @@ -26,10 +27,12 @@ spec:
console:
expose: true
deploymentPlan:
#image: quay.io/artemiscloud/activemq-artemis-broker-kubernetes:snapshot
#initImage: quay.io/artemiscloud/activemq-artemis-broker-init:snapshot
#image: quay.io/artemiscloud/activemq-artemis-broker-kubernetes:artemis.2.36.0
#initImage: quay.io/artemiscloud/activemq-artemis-broker-init:artemis.2.36.0
# image: quay.io/artemiscloud/activemq-artemis-broker-kubernetes:snapshot
# initImage: quay.io/artemiscloud/activemq-artemis-broker-init:snapshot
# image: |
# quay.io/artemiscloud/activemq-artemis-broker-kubernetes:artemis.2.36.0
# initImage: |
# quay.io/artemiscloud/activemq-artemis-broker-init:artemis.2.36.0
clustered: true
enableMetricsPlugin: true
extraMounts:
Expand All @@ -46,6 +49,6 @@ spec:
size: 5G
env:
- name: DEBUG_ARGS
value: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
value: |
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
ingressDomain: localcluster

6 changes: 3 additions & 3 deletions manifests/artemis/01-single-instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ A artemis single instance deployment

Deploy command (executed from the project root directory):
```sh
kustomize build deployments/manifests/artemis/01-single-instance | kubectl apply -f -
kustomize build manifests/artemis/01-single-instance | kubectl apply -f -
```

---
NOTE:

If you are running in the local cluster using KinD deployed using the `create-kind` and `deploy-ingress-controller` you need to update the ingress to expose the acceptor ports of the instance to the host to be allowed to access it from the host. You may do it using the command below from the project root directory, i.e: this command will expose the container 61610 port to the host 51510.:
```sh
deployments/bin/ingress-ngnix-expose-tcp-port.sh --src-port 51510 --namespace artemis-single-instance --dst-service artemis-all-0-svc --dst-port 61610
bin/ingress-ngnix-expose-tcp-port.sh --src-port 51510 --namespace artemis-single-instance --dst-service artemis-all-0-svc --dst-port 61610
```

Another example is to expose java remote debug port 5005, ie:
```sh
deployments/bin/ingress-ngnix-expose-tcp-port.sh --src-port 51511 --namespace artemis-single-instance --dst-service debugger-svc --dst-port 5005
bin/ingress-ngnix-expose-tcp-port.sh --src-port 51511 --namespace artemis-single-instance --dst-service debugger-svc --dst-port 5005
```
---

Expand Down
2 changes: 1 addition & 1 deletion manifests/artemis/01-single-instance/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: artemis-single-instance
Expand All @@ -9,4 +10,3 @@ resources:
- 02-secret-01-base-bp.yaml
- 03-configmap-custom-logging-config.yaml
- 04-activemqartemis-artemis-single.yaml

6 changes: 3 additions & 3 deletions manifests/artemis/02-async-mirror/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ It creates 2 namespaces, east and west and setup 1 artemis instance on each. The

Deploy command (executed from the project root directory):
```sh
kustomize build deployments/manifests/artemis/02-async-mirror | kubectl apply -f -
kustomize build manifests/artemis/02-async-mirror | kubectl apply -f -
```

---
NOTE:

If you are running in the local cluster using KinD deployed using the `create-kind` and `deploy-ingress-controller` you need to update the ingress to expose the acceptor ports of the instance to the host to be allowed to access it from the host. You may do it using the command below from the project root directory, i.e: This command will expose the container 61610 port to the host 51510.:
```sh
deployments/bin/ingress-ngnix-expose-tcp-port.sh --src-port 51510 --namespace artemis-single-instance --dst-service artemis-all-0-svc --dst-port 61610
bin/ingress-ngnix-expose-tcp-port.sh --src-port 51510 --namespace artemis-single-instance --dst-service artemis-all-0-svc --dst-port 61610
```

Another example is to expose java remote debug port 5005, ie:
```sh
deployments/bin/ingress-ngnix-expose-tcp-port.sh --src-port 51511 --namespace artemis-single-instance --dst-service debugger-svc --dst-port 5005
bin/ingress-ngnix-expose-tcp-port.sh --src-port 51511 --namespace artemis-single-instance --dst-service debugger-svc --dst-port 5005

---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
apiVersion: v1
kind: Service
metadata:
name: debugger-svc
spec:
ports:
- port: 5005
protocol: TCP
targetPort: 5005
- port: 5005
protocol: TCP
targetPort: 5005
publishNotReadyAddresses: false
selector:
statefulset.kubernetes.io/pod-name: artemis-east-ss-0
sessionAffinity: None
type: ClusterIP
type: ClusterIP
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -11,4 +12,4 @@ stringData:
criticalAnalyzerTimeout=6000
criticalAnalyzerCheckPeriod=-1
criticalAnalyzerPolicy=LOG
broker-0:
broker-0.properties:
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -13,4 +14,4 @@ stringData:
AMQPConnections.west.connectionElements.mirror.messageAcknowledgements=true
AMQPConnections.west.connectionElements.mirror.queueCreation=true
AMQPConnections.west.connectionElements.mirror.queueRemoval=true
broker-0:
broker-0.properties:
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -43,8 +44,9 @@ data:
logger.core_config.name=org.apache.activemq.artemis.core.config.impl.ConfigurationImpl
logger.core_config.level=TRACE
# CriticalAnalyzer: If you have issues with the CriticalAnalyzer, setting this to TRACE would give
# you extra troubleshooting info, but do not use TRACE regularly as it would incur extra CPU usage.
# CriticalAnalyzer: If you have issues with the CriticalAnalyzer, setting
# this to TRACE would give you extra troubleshooting info, but do not use
# TRACE regularly as it would incur extra CPU usage.
logger.critical_analyzer.name=org.apache.activemq.artemis.utils.critical
logger.critical_analyzer.level=INFO
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
apiVersion: broker.amq.io/v1beta1
kind: ActiveMQArtemis
metadata:
name: artemis-east
spec:
#version: 2.37.0
# version: 2.37.0
adminUser: admin
adminPassword: admin
acceptors:
Expand All @@ -26,10 +27,12 @@ spec:
console:
expose: true
deploymentPlan:
#image: quay.io/artemiscloud/activemq-artemis-broker-kubernetes:snapshot
#initImage: quay.io/artemiscloud/activemq-artemis-broker-init:snapshot
#image: quay.io/artemiscloud/activemq-artemis-broker-kubernetes:artemis.2.36.0
#initImage: quay.io/artemiscloud/activemq-artemis-broker-init:artemis.2.36.0
# image: quay.io/artemiscloud/activemq-artemis-broker-kubernetes:snapshot
# initImage: quay.io/artemiscloud/activemq-artemis-broker-init:snapshot
# image: |
# quay.io/artemiscloud/activemq-artemis-broker-kubernetes:artemis.2.36.0
# initImage: |
# quay.io/artemiscloud/activemq-artemis-broker-init:artemis.2.36.0
clustered: true
enableMetricsPlugin: true
extraMounts:
Expand All @@ -47,6 +50,6 @@ spec:
size: 5G
env:
- name: DEBUG_ARGS
value: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
value: |
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
ingressDomain: localcluster

2 changes: 1 addition & 1 deletion manifests/artemis/02-async-mirror/east/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: artemis-east
Expand All @@ -10,4 +11,3 @@ resources:
- 03-secret-02-mirror-bp.yaml
- 04-configmap-custom-logging-config.yaml
- 05-activemqartemis-artemis-east.yaml

Loading

0 comments on commit ecb8395

Please sign in to comment.