<commit_before>* RabbitMQ cluster on kubernetes

It's fork and modify from https://github.com/binarin/rabbit-on-k8s-standalone.git

  - New features of this version
    #+BEGIN_SRC sh
      Enabled rabbitmq management plugins
      Add kubernetes services used node port type
      Modify deb source used 163 mirrors
      Used rabbitmq offine-line file replace online download
    #+END_SRC

  - Make some etcd installation available under ~etcd~ name
    #+BEGIN_SRC sh
      kubectl run etcd --image=microbox/etcd --port=4001 -- --name etcd
      kubectl --namespace=demo expose deployment etcd
    #+END_SRC

  - Build a Docker image
    #+BEGIN_SRC sh
      eval $(minikube docker-env)
      docker build . -t rabbitmq-autocluster
    #+END_SRC

  - Initialize k8s secret for erlang cookie
    #+BEGIN_SRC sh
      kubectl create secret generic erlang.cookie --from-file=./erlang.cookie
    #+END_SRC

  - Deploy RabbitMQ cluster
    #+BEGIN_SRC sh
      kubectl create -f rabbitmq-cluster.yaml
    #+END_SRC

  - Config RabbitMQ cluster
    #+BEGIN_SRC sh
      rabbitmqctl add_user admin 1
      rabbitmqctl set_user_tags admin administrator
      rabbitmqctl set_permissions admin ".\*" ".\*" ".\*"
    #+END_SRC

  - Check cluster
    #+BEGIN_EXAMPLE
      kubectl get pods
      kubectl exec rabbitmq-autocluster-2840882472-8sar0 rabbitmqctl cluster_status
      Cluster status of node 'rabbit@172.24.7.9' ...
[{nodes,[{disc,['rabbit@172.24.6.5','rabbit@172.24.7.8',
                'rabbit@172.24.7.9']}]},
 {running_nodes,['rabbit@172.24.6.5','rabbit@172.24.7.8','rabbit@172.24.7.9']},
 {cluster_name,<<"rabbit@rabbitmq-autocluster-2840882472-lkp61">>},
 {partitions,[]},
 {alarms,[{'rabbit@172.24.6.5',[]},
          {'rabbit@172.24.7.8',[]},
          {'rabbit@172.24.7.9',[]}]}]

    #+END_EXAMPLE
    ![image](https://github.com/swqmaven/kubernetes-rabbitmq-cluster/rabbit_mq.png)<commit_msg>for error style<commit_after>* RabbitMQ cluster on kubernetes

It's fork and modify from https://github.com/binarin/rabbit-on-k8s-standalone.git

  - New features of this version
  ```
     Enabled rabbitmq management plugins
     Add kubernetes services used node port type
     Modify deb source used 163 mirrors
     Used rabbitmq offine-line file replace online download
  ```

  - Make some etcd installation available under ~etcd~ name
    ```
      kubectl run etcd --image=microbox/etcd --port=4001 -- --name etcd
      kubectl --namespace=demo expose deployment etcd
    ```

  - Build a Docker image
    ```
      eval $(minikube docker-env)
      docker build . -t rabbitmq-autocluster
    ```

  - Initialize k8s secret for erlang cookie
    ```
      kubectl create secret generic erlang.cookie --from-file=./erlang.cookie
    ```

  - Deploy RabbitMQ cluster
    ```
      kubectl create -f rabbitmq-cluster.yaml
    ```

  - Config RabbitMQ cluster
    ```
      rabbitmqctl add_user admin 1
      rabbitmqctl set_user_tags admin administrator
      rabbitmqctl set_permissions admin ".\*" ".\*" ".\*"
    ```

  - Check cluster
    ```
      kubectl get pods
      kubectl exec rabbitmq-autocluster-2840882472-8sar0 rabbitmqctl cluster_status
      Cluster status of node 'rabbit@172.24.7.9' ...
[{nodes,[{disc,['rabbit@172.24.6.5','rabbit@172.24.7.8',
                'rabbit@172.24.7.9']}]},
 {running_nodes,['rabbit@172.24.6.5','rabbit@172.24.7.8','rabbit@172.24.7.9']},
 {cluster_name,<<"rabbit@rabbitmq-autocluster-2840882472-lkp61">>},
 {partitions,[]},
 {alarms,[{'rabbit@172.24.6.5',[]},
          {'rabbit@172.24.7.8',[]},
          {'rabbit@172.24.7.9',[]}]}]

    ```
    ![image](https://github.com/swqmaven/kubernetes-rabbitmq-cluster/blob/master/rabbit_mq.png)
{'fraction_non_alphanumeric': 0.13737155219037317, 'fraction_numerical': 0.056246619794483504, 'mean_word_length': 2.930924548352816, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 20, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2292038', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1229, 'n_words': 277}