...

Text file src/edge-infra.dev/pkg/edge/datasync/controllers/couchctl/readme.md

Documentation: edge-infra.dev/pkg/edge/datasync/controllers/couchctl

     1
     2
     3## test run
     4
     5
     6```
     7
     8just hack/kind/reset
     9
    10kubectl cluster-info --context kind-edge
    11
    12kubectl apply -f test/fixtures/crds/gke-managed-certs/networking.gke.io_managedcertificates.yaml && kubectl apply -f test/fixtures/crds/datasync/
    13
    14kubectl create secret generic couchdb-admin-creds --from-literal=username=foo --from-literal=password=bar -n data-sync-couchdb && kubectl create secret generic couchdb-cookie --from-literal=cookieAuthSecret=baz -n data-sync-couchdb
    15
    16```
    17
    18modify these manifests if you want
    19```
    20
    21kubectl apply -f tmp.yaml
    22
    23or
    24
    25kubectl apply -f controllers/couchctl/test.yaml
    26
    27```
    28
    29
    30run the controller
    31```
    32
    33bazel run //cmd/datasync/couchctl:couchctl | jq
    34
    35```
    36
    37
    38once the pods come up open a new terminal and forward the ports
    39
    40```
    41
    42kubectl port-forward service/data-sync-couchdb 5984:5984 -n data-sync-couchdb
    43
    44```
    45
    46
    47### misc
    48```
    49
    50kubectl get pods -n data-sync-couchdb
    51
    52kubectl get secrets -n data-sync-couchdb
    53
    54kubectl -n data-sync-couchdb get secrets/couchdb-admin-creds --template={{.data.username}} | base64 -d && kubectl -n data-sync-couchdb get secrets/couchdb-admin-creds --template={{.data.password}} | base64 -d
    55
    56kubectl -n data-sync-couchdb get secrets/couchdb-admin-creds --template={{.data.username}} | base64 -d && kubectl -n data-sync-couchdb get secrets/couchdb-admin-creds --template={{.data.password}} | base64 -d
    57
    58curl -x PUT http://foo:bar@localhost:5984/_node/_local/_config/admins/AfbQn9LBGISYCDiJGuXI528pBkCmzFFb
    59
    60curl -X PUT http://foo:bar@127.0.0.1:5984/_node/_local/_config/admins/repl7 -d '"secret"'
    61
    62curl -X PUT http://foo:bar@127.0.0.1:5984/_config/admins/repl2 -d '"secret"'
    63
    64curl -i -u RXZOVTYllHI3efwrxuVk8nNAVwKejdXW:PbvIrdURl47OmMOIpvyhTAt0kOzayeWf \
    65  http://localhost:5984/_cluster_setup
    66
    67
    68curl http://RXZOVTYllHI3efwrxuVk8nNAVwKejdXW:PbvIrdURl47OmMOIpvyhTAt0kOzayeWf@localhost:5984/_cluster_setup
    69
    70curl http://leef9vC2Gn2HQinsgvCmVDlaB0tpnPUs:ch5tOZO3YrCGhF1vZhzoTr4PnIF3s7vV@localhost:5984/_users/org.couchdb.user:somename
    71
    72
    73curl http://foo:bar@localhost:5984/_config/admins
    74
    75curl http://foo:bar@localhost:5984/_cluster_setup
    76
    77
    78```

View as plain text