Skip to content

Commit

Permalink
feat: changing the docs for consistent experiences (#162)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Carter <[email protected]>
  • Loading branch information
cloudnull authored Mar 19, 2024
1 parent 2bf2f5a commit 732b7df
Show file tree
Hide file tree
Showing 13 changed files with 205 additions and 164 deletions.
2 changes: 1 addition & 1 deletion docs/alertmanager-slack.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The following example describes configuration options to send alerts via alertmanager to slack
using a slack hook.

```yaml
``` yaml
alertmanager:
alertmanagerSpec:
image:
Expand Down
6 changes: 3 additions & 3 deletions docs/grafana.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ In order to avoid putting sensative information on the cli, it is recommended to

example secret file:

```yaml
``` yaml
apiversion: v1
data:
client_id: base64_encoded_client_id
Expand All @@ -37,7 +37,7 @@ If you have specific datasources that should be populated when grafana deploys,
example datasources yaml file:
```yaml
``` yaml
datasources:
datasources.yaml:
apiversion: 1
Expand Down Expand Up @@ -126,7 +126,7 @@ Your cert and key files should look something like the following (cert and key e

## Add repo and install

```shell
``` shell
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
kubectl create ns grafana
Expand Down
2 changes: 1 addition & 1 deletion docs/infrastructure-metallb.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ need to be customized to meet the needs of your environment.

## Example LB manifest

```yaml
``` yaml
metadata:
name: openstack-external
namespace: metallb-system
Expand Down
10 changes: 6 additions & 4 deletions docs/infrastructure-ovn-db-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,18 @@ The directions in the _Kube-OVN_ documentation use `docker run` to get a working

The _Kube-OVN_ documentation directs you to pick the node running the `ovn-central` pod associated with the first IP of the `NODE_IPS` environment variable. You should find the `NODE_IPS` environment variable defined on an `ovn-central` pod or the `ovn-central` _Deployment_. Assuming you can run the `kubectl` commands, the following example gets the node IPs off of one of the the deployment:

```
$ kubectl get deployment -n kube-system ovn-central -o yaml | grep -A1 'name: NODE_IPS'
``` shell
kubectl get deployment -n kube-system ovn-central -o yaml | grep -A1 'name: NODE_IPS'

- name: NODE_IPS
value: 10.130.140.246,10.130.140.250,10.130.140.252
```

Then find the _k8s_ node with the first IP. You can see your _k8s_ nodes and their IPs with the command `kubectl get node -o wide`:

```
$ kubectl get node -o wide | grep 10.130.140.246
``` shell
kubectl get node -o wide | grep 10.130.140.246

k8s-controller01 Ready control-plane 3d17h v1.28.6 10.130.140.246 <none> Ubuntu 22.04.3 LTS 6.5.0-17-generic containerd://1.7.11
root@k8s-controller01:~#
```
Expand Down
4 changes: 2 additions & 2 deletions docs/infrastructure-postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Create Secrets

```shell
``` shell
kubectl --namespace openstack create secret generic postgresql-identity-admin \
--type Opaque \
--from-literal=password="$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)"
Expand All @@ -23,7 +23,7 @@ kubectl --namespace openstack create secret generic postgresql-db-audit \

Consider the PVC size you will need for the environment you're deploying in. Make adjustments as needed near `storage.[pvc|archive_pvc].size` and `volume.backup.size` to your helm overrides.

```shell
``` shell
cd /opt/genestack/submodules/openstack-helm-infra
helm upgrade --install postgresql ./postgresql \
--namespace=openstack \
Expand Down
10 changes: 5 additions & 5 deletions docs/openstack-ceilometer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Create Secrets

```shell
``` shell
kubectl --namespace openstack create secret generic ceilometer-keystone-admin-password \
--type Opaque \
--from-literal=password="$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)"
Expand All @@ -16,7 +16,7 @@ kubectl --namespace openstack create secret generic ceilometer-rabbitmq-password

## Run the package deployment

```shell
``` shell
cd /opt/genestack/submodules/openstack-helm
helm upgrade --install ceilometer ./ceilometer \
--namespace=openstack \
Expand Down Expand Up @@ -59,22 +59,22 @@ Without them, metrics can't be stored, so let's verify they exist. The
output should include named resource types and some attributes for resources
like `instance`, `instance_disk`, `network`, `volume`, etc.

```shell
``` shell
kubectl exec -it openstack-admin-client -n openstack -- openstack metric resource-type list
```

### Verify metric resources

Confirm that resources are populating in Gnocchi

```shell
``` shell
kubectl exec -it openstack-admin-client -n openstack -- openstack metric resource list
```

### Verify metrics

Confirm that metrics can be retrieved from Gnocchi

```shell
``` shell
kubectl exec -it openstack-admin-client -n openstack -- openstack metric list
```
4 changes: 2 additions & 2 deletions docs/openstack-cpu-allocation-ratio.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Example :
No. of Instance per hypervisor (VM) = 60
Overhead on CPU (OCPU) = 8
Formula to calculate CPU allocation ratio:

CAR = VM * VCPU / (PCPU - OPCU)
CAR = 60 * 8 / (72 - 8)
= 480/64
Expand All @@ -42,7 +42,7 @@ Example :
``` shell
No. of CPU dedicated for CPU pinning (RCPUP) : 16
CPU allocation ratio:

CAR = VM * VCPU / (PCPU - RCPUP - OCPU)
CAR = 60 * 8 / (72 - 16 - 8)
= 480/48
Expand Down
18 changes: 9 additions & 9 deletions docs/openstack-floating-ips.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ To read more about Openstack Floating Ips using the [upstream docs](https://docs
#### List and view floating ips

``` shell
$ openstack floating ip list
openstack floating ip list
[--network <network>]
[--port <port>]
[--fixed-ip-address <ip-address>]
Expand All @@ -18,7 +18,7 @@ $ openstack floating ip list
#### Create a floating ip
``` shell
$ openstack floating ip create
openstack floating ip create
[--subnet <subnet>]
[--port <port>]
[--floating-ip-address <ip-address>]
Expand All @@ -36,15 +36,15 @@ $ openstack floating ip create
``` shell
$ openstack floating ip delete <floating-ip> [<floating-ip> ...]
openstack floating ip delete <floating-ip> [<floating-ip> ...]
```
#### Floating ip set
Set floating IP properties
``` shell
$ openstack floating ip set
openstack floating ip set
--port <port>
[--fixed-ip-address <ip-address>]
<floating-ip>
Expand All @@ -53,13 +53,13 @@ $ openstack floating ip set
#### Display floating ip details
``` shell
$ openstack floating ip show <floating-ip>
openstack floating ip show <floating-ip>
```
#### Unset floating IP Properties
``` shell
$ openstack floating ip unset
openstack floating ip unset
--port
<floating-ip>
```
Expand All @@ -71,18 +71,18 @@ You can assign a floating IP address to a project and to an instance.
Associate an IP address with an instance in the project, as follows:
``` shell
$ openstack server add floating ip INSTANCE_NAME_OR_ID FLOATING_IP_ADDRESS
openstack server add floating ip INSTANCE_NAME_OR_ID FLOATING_IP_ADDRESS
```
#### Disassociate floating IP addresses
To disassociate a floating IP address from an instance:
``` shell
$ openstack server remove floating ip INSTANCE_NAME_OR_ID FLOATING_IP_ADDRESS
openstack server remove floating ip INSTANCE_NAME_OR_ID FLOATING_IP_ADDRESS
```
To remove the floating IP address from a project:
``` shell
$ openstack floating ip delete FLOATING_IP_ADDRESS
openstack floating ip delete FLOATING_IP_ADDRESS
```
12 changes: 6 additions & 6 deletions docs/openstack-gnocchi.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Create Secrets

```shell
``` shell
kubectl --namespace openstack create secret generic gnocchi-admin \
--type Opaque \
--from-literal=password="$(< /dev/urandom tr -dc _A-Za-z0-9 | head -c${1:-32};echo;)"
Expand All @@ -22,7 +22,7 @@ options for ceph. The below simply creates the expected `ceph-etc`
ConfigMap with the ceph.conf needed by Gnocchi to establish a connection
to the mon host(s) via the rados client.

```shell
``` shell
kubectl apply -n openstack -f - <<EOF
apiVersion: v1
kind: ConfigMap
Expand All @@ -44,15 +44,15 @@ Below is an example of what you're looking for to verify the configmap was
created as expected - a CSV of the mon hosts, colon seperated with default
mon port, 6789.

```shell
``` shell
(genestack) root@openstack-flex-launcher:/opt/genestack# kubectl get configmap -n openstack ceph-etc -o "jsonpath={.data['ceph\.conf']}"
[global]
mon_host = 172.31.3.7:6789,172.31.1.112:6789,172.31.0.46:6789
```

## Run the package deployment

```shell
``` shell
cd /opt/genestack/submodules/openstack-helm-infra
helm upgrade --install gnocchi ./gnocchi \
--namespace=openstack \
Expand All @@ -78,12 +78,12 @@ helm upgrade --install gnocchi ./gnocchi \

### Pip install gnocchiclient and python-ceilometerclient

```shell
``` shell
kubectl exec -it openstack-admin-client -n openstack -- /var/lib/openstack/bin/pip install python-ceilometerclient gnocchiclient
```

### Verify metric list functionality

```shell
``` shell
kubectl exec -it openstack-admin-client -n openstack -- openstack metric list
```
29 changes: 18 additions & 11 deletions docs/openstack-security-groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@ To read more about Openstack Security Groups using the [upstream docs](https://d
#### List and view current security groups

``` shell
$ openstack security group list
openstack security group list
```

#### Create Security Groups

``` shell
$ openstack security group create SECURITY_GROUP_NAME --description GROUP_DESCRIPTION
openstack security group create SECURITY_GROUP_NAME --description GROUP_DESCRIPTION
```

#### Delete a specific Security Group

``` shell
$ openstack security group delete SECURITY_GROUP_NAME
openstack security group delete SECURITY_GROUP_NAME
```

#### Create and manage security group rules

To list the rules for a security group, run the following command:

``` shell
$ openstack security group rule list SECURITY_GROUP_NAME
openstack security group rule list SECURITY_GROUP_NAME
```

Add a new group rule:

``` shell
$ openstack security group rule create SEC_GROUP_NAME \
openstack security group rule create SEC_GROUP_NAME \
--protocol PROTOCOL --dst-port FROM_PORT:TO_PORT --remote-ip CIDR
```

Expand All @@ -49,51 +49,58 @@ openstack security group rule create global_http \
1. Allow access from all IP addresses, specified as IP subnet 0.0.0.0/0 in CIDR notation:

``` shell
$ openstack security group rule create SECURITY_GROUP_NAME \
openstack security group rule create SECURITY_GROUP_NAME \
--protocol tcp --dst-port 22:22 --remote-ip 0.0.0.0/0
```
2. Allow access only from IP addresses from other security groups (source groups) to access the specified port:

``` shell
$ openstack security group rule create SECURITY_GROUP_NAME \
openstack security group rule create SECURITY_GROUP_NAME \
--protocol tcp --dst-port 22:22 --remote-group SOURCE_GROUP_NAME
```
#### To allow pinging of the instances, choose one of the following options:

1. Allow pinging from all IP addresses, specified as IP subnet 0.0.0.0/0 in CIDR notation

``` shell
$ openstack security group rule create --protocol icmp \
openstack security group rule create --protocol icmp \
SECURITY_GROUP_NAME
```

This allows access to all codes and all types of ICMP traffic.

2. Allow only members of other security groups (source groups) to ping instances.

``` shell
$ openstack security group rule create --protocol icmp \
openstack security group rule create --protocol icmp \
--remote-group SOURCE_GROUP_NAME SECURITY_GROUP
```

#### To allow access through a UDP port, such as allowing access to a DNS server that runs on a VM, choose one of the following options:

1. Allow UDP access from IP addresses, specified as IP subnet 0.0.0.0/0 in CIDR notation.

``` shell
openstack security group rule create --protocol udp \
--dst-port 53:53 SECURITY_GROUP
```

2. Allow only IP addresses from other security groups (source groups) to access the specified port.

``` shell
openstack security group rule create --protocol udp \
--dst-port 53:53 --remote-group SOURCE_GROUP_NAME SECURITY_GROUP
```

#### Allow RDP access only from IP addresses from other security groups

``` shell
$ openstack security group rule create SECURITY_GROUP_NAME \
openstack security group rule create SECURITY_GROUP_NAME \
--protocol tcp --dst-port 33:89 --remote-group SOURCE_GROUP_NAME
```

#### Delete a security group rule

``` shell
$ openstack security group rule delete RULE_ID
openstack security group rule delete RULE_ID
```
Loading

0 comments on commit 732b7df

Please sign in to comment.