Advertisement
Guest User

commands

a guest
Nov 17th, 2021
71
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. [root@dbaasjump002 percona_postgresql_operator]# git clone -b v1.0.0 https://github.com/percona/percona-postgresql-operator
  4. Cloning into 'percona-postgresql-operator'...
  5. remote: Enumerating objects: 56573, done.
  6. remote: Counting objects: 100% (14133/14133), done.
  7. remote: Compressing objects: 100% (4587/4587), done.
  8. remote: Total 56573 (delta 11293), reused 11017 (delta 9273), pack-reused 42440
  9. Receiving objects: 100% (56573/56573), 53.79 MiB | 5.25 MiB/s, done.
  10. Resolving deltas: 100% (37220/37220), done.
  11. Note: switching to '49501850e228931904294a34886f1d3c1f17ebd9'.
  12.  
  13. You are in 'detached HEAD' state. You can look around, make experimental
  14. changes and commit them, and you can discard any commits you make in this
  15. state without impacting any branches by switching back to a branch.
  16.  
  17. If you want to create a new branch to retain commits you create, you may
  18. do so (now or later) by using -c with the switch command. Example:
  19.  
  20.   git switch -c <new-branch-name>
  21.  
  22. Or undo this operation with:
  23.  
  24.   git switch -
  25.  
  26. Turn off this advice by setting config variable advice.detachedHead to false
  27.  
  28. [root@dbaasjump002 percona_postgresql_operator]# cd percona-postgresql-operator
  29.  
  30. [root@dbaasjump002 percona_postgresql_operator]# kubectl create namespace pgo
  31. namespace/pgo created
  32.  
  33. [root@dbaasjump002 percona_postgresql_operator]# kubectl config set-context $(kubectl config current-context) --namespace=pgo
  34. Context "xxx-admin@xxxx" modified.
  35.  
  36. [root@dbaasjump002 percona-postgresql-operator]# kubectl apply -f deploy/operator.yaml
  37. serviceaccount/pgo-deployer-sa created
  38. clusterrole.rbac.authorization.k8s.io/pgo-deployer-cr unchanged
  39. configmap/pgo-deployer-cm created
  40. clusterrolebinding.rbac.authorization.k8s.io/pgo-deployer-crb unchanged
  41. job.batch/pgo-deploy created
  42.  
  43. [root@dbaasjump002 percona-postgresql-operator]# kubectl get pods
  44. NAME                                READY   STATUS    RESTARTS   AGE
  45. pgo-deploy-lqtdf                    1/1     Running   0          55s
  46. postgres-operator-bf9d88f79-zgjfh   4/4     Running   0          26s
  47.  
  48. [root@dbaasjump002 percona-postgresql-operator]# kubectl apply -f deploy/cr.yaml
  49. perconapgcluster.pg.percona.com/cluster1 created
  50.  
  51. [root@dbaasjump002 percona-postgresql-operator]# kubectl get pods
  52. NAME                                             READY   STATUS      RESTARTS   AGE
  53. backrest-backup-cluster1-btqxk                   0/1     Completed   0          2m34s
  54. cluster1-566f8f9977-tzqlm                        1/1     Running     0          3m16s
  55. cluster1-backrest-shared-repo-7b5bb89b87-xbbq5   1/1     Running     0          4m22s
  56. cluster1-pgbouncer-5b59b7dc67-4x4kg              1/1     Running     0          2m38s
  57. cluster1-repl1-5d88984f58-ggj26                  1/1     Running     0          2m
  58. cluster1-repl2-7bc7bfc65b-vkmf9                  1/1     Running     0          2m
  59. pgo-deploy-lqtdf                                 0/1     Completed   0          5m33s
  60. postgres-operator-bf9d88f79-zgjfh                4/4     Running     0          5m4s
  61.  
  62. ###
  63. ### PostgreSQL cluster seems to work in pgo namespace just fine
  64. ### Trying next to deploy on another namespace
  65. ###
  66.  
  67. [root@dbaasjump002 percona-postgresql-operator]# kubectl create namespace possu2
  68. namespace/possu2 created
  69.  
  70. Edit cr.yaml, operator.yaml
  71. "To use different namespace, you should edit all occurrences of the namespace: pgo line in both deploy/cr.yaml and deploy/operator.yaml configuration files."
  72.  
  73. [root@dbaasjump002 deploy]# kubectl apply -f operator_possu.yaml -n possu2
  74. serviceaccount/pgo-deployer-sa created
  75. clusterrole.rbac.authorization.k8s.io/pgo-deployer-cr unchanged
  76. configmap/pgo-deployer-cm created
  77. clusterrolebinding.rbac.authorization.k8s.io/pgo-deployer-crb configured
  78. job.batch/pgo-deploy created
  79.  
  80. [root@dbaasjump002 deploy]# kubectl get pods -n possu2
  81. NAME                                READY   STATUS      RESTARTS   AGE
  82. pgo-deploy-zdqjm                    0/1     Completed   0          65s
  83. postgres-operator-bcddf4647-pnsz5   4/4     Running     0          36s
  84.  
  85. [root@dbaasjump002 deploy]# kubectl apply -f cr_possu.yaml -n possu2
  86. perconapgcluster.pg.percona.com/cluster1 created
  87.  
  88. [root@dbaasjump002 deploy]# kubectl get all -n possu2
  89. NAME                                    READY   STATUS      RESTARTS   AGE
  90. pod/pgo-deploy-zdqjm                    0/1     Completed   0          8m3s
  91. pod/postgres-operator-bcddf4647-pnsz5   4/4     Running     0          7m34s
  92.  
  93. NAME                        TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
  94. service/postgres-operator   ClusterIP   10.255.17.201   <none>        8443/TCP,4171/TCP,4150/TCP   7m36s
  95.  
  96. NAME                                READY   UP-TO-DATE   AVAILABLE   AGE
  97. deployment.apps/postgres-operator   1/1     1            1           7m34s
  98.  
  99. NAME                                          DESIRED   CURRENT   READY   AGE
  100. replicaset.apps/postgres-operator-bcddf4647   1         1         1       7m34s
  101.  
  102. NAME                   COMPLETIONS   DURATION   AGE
  103. job.batch/pgo-deploy   1/1           61s        8m3s
  104.  
  105. [root@dbaasjump002 deploy]# kubectl get PerconaPGCluster -n pgo
  106. NAME       AGE
  107. cluster1   17m
  108. [root@dbaasjump002 deploy]# kubectl get PerconaPGCluster -n possu2
  109. NAME       AGE
  110. cluster1   8m16s
  111. [root@dbaasjump002 deploy]# kubectl describe PerconaPGCluster cluster1 -n possu2
  112. Name:         cluster1
  113. Namespace:    possu2
  114. Labels:       crunchy-pgha-scope=cluster1
  115.               deployment-name=cluster1
  116.               name=cluster1
  117.               pg-cluster=cluster1
  118.               pgo-version=1.0.0
  119.               pgouser=admin
  120. Annotations:  current-primary: cluster1
  121. API Version:  pg.percona.com/v1
  122. Kind:         PerconaPGCluster
  123. Metadata:
  124.   Creation Timestamp:  2021-11-17T11:14:02Z
  125.   Generation:          1
  126.   Managed Fields:
  127.     API Version:  pg.percona.com/v1
  128.     Fields Type:  FieldsV1
  129.     fieldsV1:
  130.       f:metadata:
  131.         f:annotations:
  132.           .:
  133.           f:current-primary:
  134.           f:kubectl.kubernetes.io/last-applied-configuration:
  135.         f:labels:
  136.           .:
  137.           f:crunchy-pgha-scope:
  138.           f:deployment-name:
  139.           f:name:
  140.           f:pg-cluster:
  141.           f:pgo-version:
  142.           f:pgouser:
  143.       f:spec:
  144.         .:
  145.         f:backup:
  146.           .:
  147.           f:backrestRepoImage:
  148.           f:image:
  149.           f:resources:
  150.             .:
  151.             f:requests:
  152.               .:
  153.               f:memory:
  154.           f:schedule:
  155.           f:volumeSpec:
  156.             .:
  157.             f:accessmode:
  158.             f:size:
  159.             f:storageclass:
  160.             f:storagetype:
  161.         f:database:
  162.         f:disableAutofail:
  163.         f:namespace:
  164.         f:pause:
  165.         f:pgBadger:
  166.           .:
  167.           f:enabled:
  168.           f:image:
  169.           f:port:
  170.         f:pgBouncer:
  171.           .:
  172.           f:expose:
  173.             .:
  174.             f:serviceType:
  175.           f:image:
  176.           f:resources:
  177.             .:
  178.             f:limits:
  179.               .:
  180.               f:cpu:
  181.               f:memory:
  182.             f:requests:
  183.               .:
  184.               f:cpu:
  185.               f:memory:
  186.           f:size:
  187.         f:pgPrimary:
  188.           .:
  189.           f:expose:
  190.             .:
  191.             f:serviceType:
  192.           f:image:
  193.           f:resources:
  194.             .:
  195.             f:requests:
  196.               .:
  197.               f:memory:
  198.           f:tolerations:
  199.           f:volumeSpec:
  200.             .:
  201.             f:accessmode:
  202.             f:size:
  203.             f:storageclass:
  204.             f:storagetype:
  205.         f:pgReplicas:
  206.           .:
  207.           f:hotStandby:
  208.             .:
  209.             f:enableSyncStandby:
  210.             f:expose:
  211.               .:
  212.               f:serviceType:
  213.             f:resources:
  214.               .:
  215.               f:requests:
  216.                 .:
  217.                 f:memory:
  218.             f:size:
  219.             f:volumeSpec:
  220.               .:
  221.               f:accessmode:
  222.               f:size:
  223.               f:storageclass:
  224.               f:storagetype:
  225.         f:pmm:
  226.           .:
  227.           f:enabled:
  228.           f:image:
  229.           f:pmmSecret:
  230.           f:resources:
  231.             .:
  232.             f:requests:
  233.               .:
  234.               f:cpu:
  235.               f:memory:
  236.           f:serverHost:
  237.           f:serverUser:
  238.         f:port:
  239.         f:standby:
  240.         f:tlsOnly:
  241.         f:user:
  242.         f:userLabels:
  243.           .:
  244.           f:pgo-version:
  245.     Manager:         kubectl-client-side-apply
  246.     Operation:       Update
  247.     Time:            2021-11-17T11:14:02Z
  248.   Resource Version:  92375238
  249.   UID:               c69882a6-bff6-4c96-b2bf-57cd7c0abf42
  250. Spec:
  251.   Backup:
  252.     Backrest Repo Image:  percona/percona-postgresql-operator:1.0.0-ppg13-pgbackrest-repo
  253.     Image:                percona/percona-postgresql-operator:1.0.0-ppg13-pgbackrest
  254.     Resources:
  255.       Requests:
  256.         Memory:  48Mi
  257.     Schedule:
  258.       Keep:      3
  259.       Name:      sat-night-backup
  260.       Schedule:  0 0 * * 6
  261.       Storage:   local
  262.       Type:      full
  263.     Volume Spec:
  264.       Accessmode:    ReadWriteOnce
  265.       Size:          1G
  266.       Storageclass:
  267.       Storagetype:   dynamic
  268.   Database:          pgdb
  269.   Disable Autofail:  false
  270.   Namespace:         possu2
  271.   Pause:             false
  272.   Pg Badger:
  273.     Enabled:  false
  274.     Image:    percona/percona-postgresql-operator:1.0.0-ppg13-pgbadger
  275.     Port:     10000
  276.   Pg Bouncer:
  277.     Expose:
  278.       Service Type:  ClusterIP
  279.     Image:           percona/percona-postgresql-operator:1.0.0-ppg13-pgbouncer
  280.     Resources:
  281.       Limits:
  282.         Cpu:     2
  283.         Memory:  512Mi
  284.       Requests:
  285.         Cpu:     1
  286.         Memory:  128Mi
  287.     Size:        1
  288.   Pg Primary:
  289.     Expose:
  290.       Service Type:  ClusterIP
  291.     Image:           percona/percona-postgresql-operator:1.0.0-ppg13-postgres-ha
  292.     Resources:
  293.       Requests:
  294.         Memory:  128Mi
  295.     Tolerations:
  296.     Volume Spec:
  297.       Accessmode:    ReadWriteOnce
  298.       Size:          1G
  299.       Storageclass:
  300.       Storagetype:   dynamic
  301.   Pg Replicas:
  302.     Hot Standby:
  303.       Enable Sync Standby:  false
  304.       Expose:
  305.         Service Type:  ClusterIP
  306.       Resources:
  307.         Requests:
  308.           Memory:  128Mi
  309.       Size:        2
  310.       Volume Spec:
  311.         Accessmode:    ReadWriteOnce
  312.         Size:          1G
  313.         Storageclass:
  314.         Storagetype:   dynamic
  315.   Pmm:
  316.     Enabled:     false
  317.     Image:       percona/pmm-client:2.15.1
  318.     Pmm Secret:  cluster1-pmm-secret
  319.     Resources:
  320.       Requests:
  321.         Cpu:      500m
  322.         Memory:   200M
  323.     Server Host:  monitoring-service
  324.     Server User:  admin
  325.   Port:           5432
  326.   Standby:        false
  327.   Tls Only:       false
  328.   User:           pguser
  329.   User Labels:
  330.     Pgo - Version:  1.0.0
  331. Events:             <none>
Advertisement
RAW Paste Data Copied
Advertisement