Skip to content

Instantly share code, notes, and snippets.

$ cat <<EOF | kubectl apply -n nginx-demo -f -
---
apiVersion: v1
kind: Secret
metadata:
name: keda-rabbitmq-secret
data:
host: YW1xcDovL2RlbW86ZGVtb0AxOTIuMTY4LjIuMTAxOjU2NzIv # echo -n amqp://demo:demo@192.168.2.101:5672/ | base64
---
apiVersion: keda.sh/v1alpha1
$ /usr/local/sbin/rabbitmqadmin -H 192.168.2.101 -u demo -p demo \
list queues
+------------+----------+
| name | messages |
+------------+----------+
| demo_queue | 0 |
+------------+----------+
$ /usr/local/sbin/rabbitmqadmin --host 127.0.0.1 -u guest -p guest \
declare user name=demo password=demo tags=administrator
user declared
$ /usr/local/sbin/rabbitmqadmin --host 127.0.0.1 -u guest -p guest \
declare permission vhost=/ user=demo configure=".*" write=".*" read=".*"
permission declared
$ /usr/local/sbin/rabbitmqadmin --host 127.0.0.1 -u guest -p guest \
declare queue name=demo_queue
$ /usr/local/sbin/rabbitmqadmin -H 127.0.0.1 -u guest -p guest \
list connections
No items
$ brew install rabbitmq
$ RABBITMQ_NODE_IP_ADDRESS=0.0.0.0 /usr/local/sbin/rabbitmq-server
...
## ## RabbitMQ 3.8.19
## ##
########## Copyright (c) 2007-2021 VMware, Inc. or its affiliates.
###### ##
########## Licensed under the MPL 2.0. Website: https://rabbitmq.com
...
Starting broker... completed with 6 plugins.
$ ipconfig getifaddr en0
192.168.2.101
$ kg po -n nginx-demo
NAME READY STATUS RESTARTS AGE
nginx-deployment-66b6c48dd5-2g24q 1/1 Running 0 36s
nginx-deployment-66b6c48dd5-67kgv 1/1 Running 0 36s
nginx-deployment-66b6c48dd5-fj4lq 1/1 Running 0 36s
$ kubectl create ns nginx-demo
$ kubectl apply -n nginx-demo -f https://raw.githubusercontent.com/kubernetes/website/main/content/en/examples/controllers/nginx-deployment.yaml
$ kubectl get po -n keda
NAME READY STATUS RESTARTS AGE
keda-operator-7fc5699d47-ng7rk 1/1 Running 0 75s
keda-operator-metrics-apiserver-57fc85685f-zqnzr 1/1 Running 0 75s
$ kubectl get apiservices v1beta1.external.metrics.k8s.io
NAME SERVICE AVAILABLE AGE
v1beta1.external.metrics.k8s.io keda/keda-operator-metrics-apiserver True
$ helm repo add kedacore https://kedacore.github.io/charts
$ helm repo update
$ helm install keda kedacore/keda --namespace keda --create-namespace