-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
192 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ name: E2E tests | |
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
# The branches below must be a subset of the branches above | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
test: | ||
|
@@ -21,14 +21,12 @@ jobs: | |
- name: Build Dockerfile | ||
run: docker build . --file Dockerfile --tag rocketmq-operator:e2e | ||
|
||
- name: Install chainsaw | ||
uses: kyverno/chainsaw/.github/actions/[email protected] | ||
with: | ||
release: v0.1.2 | ||
- name: Install Chainsaw | ||
uses: kyverno/[email protected] | ||
|
||
- name: Check install | ||
run: chainsaw version | ||
|
||
- name: Install kubectl | ||
run: | | ||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json | ||
|
||
apiVersion: chainsaw.kyverno.io/v1alpha1 | ||
kind: Test | ||
metadata: | ||
name: rocketmq-cluster | ||
spec: | ||
steps: | ||
- name: Create RocketMQ Cluster | ||
try: | ||
- apply: | ||
file: cluster.yaml | ||
- assert: | ||
file: ready-cluster.yaml | ||
- assert: | ||
file: ready-sts.yaml | ||
- assert: | ||
file: ready-svc.yaml | ||
- assert: | ||
file: ready-pvc.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: broker-config | ||
namespace: default | ||
data: | ||
# BROKER_MEM sets the broker JVM, if set to "" then Xms = Xmx = max(min(1/2 ram, 1024MB), min(1/4 ram, 8GB)) | ||
BROKER_MEM: " -Xms2g -Xmx2g -Xmn1g " | ||
broker-common.conf: | | ||
# brokerClusterName, brokerName, brokerId are automatically generated by the operator and do not set it manually!!! | ||
deleteWhen=04 | ||
fileReservedTime=48 | ||
flushDiskType=ASYNC_FLUSH | ||
# set brokerRole to ASYNC_MASTER or SYNC_MASTER. DO NOT set to SLAVE because the replica instance will automatically be set!!! | ||
brokerRole=ASYNC_MASTER | ||
--- | ||
apiVersion: rocketmq.apache.org/v1alpha1 | ||
kind: Broker | ||
metadata: | ||
name: broker | ||
namespace: default | ||
spec: | ||
size: 1 | ||
nameServers: "" | ||
replicaPerGroup: 1 | ||
brokerImage: apacherocketmq/rocketmq-broker:4.5.0-alpine-operator-0.3.0 | ||
imagePullPolicy: Always | ||
resources: | ||
requests: | ||
memory: "2048Mi" | ||
cpu: "250m" | ||
limits: | ||
memory: "12288Mi" | ||
cpu: "500m" | ||
allowRestart: true | ||
storageMode: StorageClass | ||
scalePodName: broker-0-master-0 | ||
env: | ||
- name: BROKER_MEM | ||
valueFrom: | ||
configMapKeyRef: | ||
name: broker-config | ||
key: BROKER_MEM | ||
volumes: | ||
- name: broker-config | ||
configMap: | ||
name: broker-config | ||
items: | ||
- key: broker-common.conf | ||
path: broker-common.conf | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: broker-storage | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
storageClassName: rocketmq-storage | ||
resources: | ||
requests: | ||
storage: 8Gi | ||
--- | ||
apiVersion: rocketmq.apache.org/v1alpha1 | ||
kind: NameService | ||
metadata: | ||
name: name-service | ||
namespace: default | ||
spec: | ||
size: 1 | ||
nameServiceImage: apacherocketmq/rocketmq-nameserver:4.5.0-alpine-operator-0.3.0 | ||
imagePullPolicy: Always | ||
hostNetwork: false | ||
dnsPolicy: ClusterFirstWithHostNet | ||
resources: | ||
requests: | ||
memory: "512Mi" | ||
cpu: "250m" | ||
limits: | ||
memory: "1024Mi" | ||
cpu: "500m" | ||
storageMode: StorageClass | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: namesrv-storage | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
storageClassName: rocketmq-storage | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
--- | ||
apiVersion: rocketmq.apache.org/v1alpha1 | ||
kind: Console | ||
metadata: | ||
name: console | ||
namespace: default | ||
spec: | ||
nameServers: "" | ||
consoleDeployment: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: rocketmq-console | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: rocketmq-console | ||
template: | ||
metadata: | ||
labels: | ||
app: rocketmq-console | ||
spec: | ||
containers: | ||
- name: console | ||
image: apacherocketmq/rocketmq-console:2.0.0 | ||
ports: | ||
- containerPort: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: rocketmq.apache.org/v1alpha1 | ||
kind: Broker | ||
metadata: | ||
name: broker | ||
namespace: default | ||
status: | ||
nodes: | ||
- broker-0-master-0 | ||
- broker-0-replica-1-0 | ||
size: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: broker-0-master | ||
namespace: default | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: broker | ||
broker_cr: broker | ||
template: | ||
metadata: | ||
labels: | ||
app: broker | ||
broker_cr: broker | ||
status: | ||
readyReplicas: 1 | ||
replicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: broker-0-replica-1 | ||
namespace: default | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: broker | ||
broker_cr: broker | ||
template: | ||
metadata: | ||
labels: | ||
app: broker | ||
broker_cr: broker | ||
status: | ||
readyReplicas: 1 | ||
replicas: 1 |