BlueXP is now NetApp Console
Monitor and run hybrid cloud data services
cccfda65-6983-4229-88b5-9f088a06b66e-0 Welcome everyone and thank you for joining our webinar on cccfda65-6983-4229-88b5-9f088a06b66e-1 deploying Postgres on Kubernetes using operators. d44d5ed9-3f89-42cf-95ea-f28b4911b3a7-0 We have an amazing session for plan for you today, but before d44d5ed9-3f89-42cf-95ea-f28b4911b3a7-1 we get started, we have just a few housekeeping items. 06b060ed-71ca-4dca-ae05-8e4202405e07-0 So this presentation is going to last about 45 minutes. dddc6cbc-6ec6-4824-b368-ef501e9aaa9e-0 Questions are always welcome and we encourage you to type any dddc6cbc-6ec6-4824-b368-ef501e9aaa9e-1 questions you have throughout the webinar into the Q&A dddc6cbc-6ec6-4824-b368-ef501e9aaa9e-2 window on the right hand side of your screen. fa791a38-1ff1-4480-a666-77a360d7c8d5-0 Also, as a reminder, this webinar will be available on fa791a38-1ff1-4480-a666-77a360d7c8d5-1 demand shortly after the session concludes. 447cae5b-2d05-46ba-abfb-e37b20efd0ab-0 All right, so let's get into the fun stuff and the reason all of 447cae5b-2d05-46ba-abfb-e37b20efd0ab-1 you guys joined us today. 1350332c-0704-42a6-9c28-a8cbf43378dc-0 Today's webinar will explore the steps in implementing Postgres 1350332c-0704-42a6-9c28-a8cbf43378dc-1 on Kubernetes. 47e11d16-449c-447e-b4ea-20a64903cb49-0 Our speaker today is Perry Clark, professional services 47e11d16-449c-447e-b4ea-20a64903cb49-1 consultant here at Instacluster. 61ea58a1-8406-457e-898d-b05ffd5bfb2d-0 And with that, I'm going to pass it over to you, Perry. d74a6d57-3766-4778-aa8d-714e3eca576b-0 Hi, my name is Perry Clark, and I've been playing around with d74a6d57-3766-4778-aa8d-714e3eca576b-1 computers for nearly 30 years. 475b236b-0fc1-4e09-b520-1141ed9a6117-0 I first started with Postgres about 15 years ago and I'm here 475b236b-0fc1-4e09-b520-1141ed9a6117-1 today to tell you from a 50,000 foot view about Kubernetes and 475b236b-0fc1-4e09-b520-1141ed9a6117-2 how you can have your own. d1aa9cf9-f9cd-4680-8767-7ab9f630ea2e-0 What is Kubernetes? 8a1cc63c-9194-4991-a834-a48d07cff4b9-0 That's a great question. 3f6c6c9c-afdc-4c3b-89e6-5d28d925df9a-0 I had heard about this about 10 years ago and didn't really have 3f6c6c9c-afdc-4c3b-89e6-5d28d925df9a-1 any idea what it was. c8d504de-7f29-42c5-96b7-4a4e64be9279-0 It mainly it's about orchestration. 505e6b2c-a983-491a-a3f8-476423317763-0 There's a lot of other technologies similar in the 505e6b2c-a983-491a-a3f8-476423317763-1 environment that I was working at. 6b4b493d-f3fc-4254-82f7-bb24eb1f86cb-0 At the time, my road map really had no room for orchestration. 9a1193b9-31cc-41e7-9453-67b20f3ef8a2-0 There are always other file, other fires to put out and every 9a1193b9-31cc-41e7-9453-67b20f3ef8a2-1 single database and server in the environment seemed to be a 9a1193b9-31cc-41e7-9453-67b20f3ef8a2-2 one off instance. f72350ea-102f-43b7-8bc5-8d94b65cb374-0 There was really no homogeneous. 576086e4-5f99-4240-b934-4b578698588f-0 Homogeneous, yeah, there was no common denominator between the 576086e4-5f99-4240-b934-4b578698588f-1 environments other than that they were Postgres databases. 2bf01475-2867-4f27-a0bd-2948f3cf0f8f-0 The model that we were working atthe company that we were 2bf01475-2867-4f27-a0bd-2948f3cf0f8f-1 working at, there was no time to fix code, maintain server 2bf01475-2867-4f27-a0bd-2948f3cf0f8f-2 applications without avoiding annoying the customers or the 2bf01475-2867-4f27-a0bd-2948f3cf0f8f-3 support, etcetera. 7d84b95f-b376-44b5-a850-7cd9621f51dd-0 Things were stable enough that any thoughts of orchestration 7d84b95f-b376-44b5-a850-7cd9621f51dd-1 attempts suggested my me to the developers or management work. 76a9445b-1c9e-491a-9fc7-50cf5b51039f-0 You know, we throw what we throw over the fence and you get to 76a9445b-1c9e-491a-9fc7-50cf5b51039f-1 figure out what to do with it. 012e92c0-48c8-418b-b587-68ee8c2f1455-0 So basically their attitude was it works on my box ship it. 86a64d1f-0f9e-4d22-85b3-ff2fb6e7d563-0 Of course the man developers in this company managed to set up 86a64d1f-0f9e-4d22-85b3-ff2fb6e7d563-1 their own little silo orchestration for their work 86a64d1f-0f9e-4d22-85b3-ff2fb6e7d563-2 flows, but those work flows and pipelines always ended at the 86a64d1f-0f9e-4d22-85b3-ff2fb6e7d563-3 fence, which was me. a6b42d93-f249-4836-ae6a-b462acb2decc-0 So some fun facts about Kubernetes. 5886c320-84e5-4b73-ba1a-f95023e52881-0 It was created quite a while ago by Google, and it was basically 5886c320-84e5-4b73-ba1a-f95023e52881-1 an internal project at Google to manage and orchestrate their 5886c320-84e5-4b73-ba1a-f95023e52881-2 platforms. 5e307600-5276-48e0-9ba5-85294e556faa-0 All of the back ends that they managed were growing by 5e307600-5276-48e0-9ba5-85294e556faa-1 thousands and thousands of machines. eaa94e97-d452-475f-a750-d0280c0a2b54-0 And you know, the question is how do you manage all of that? f3d4ca73-6860-4dc6-9757-65939d58627b-0 So I'm sure what started off as a very small shell script to f3d4ca73-6860-4dc6-9757-65939d58627b-1 restart services across their cluster became what eventually f3d4ca73-6860-4dc6-9757-65939d58627b-2 they named Borg. d5d78886-aa3f-43a4-8ece-da80524bff29-0 And that's a direct reference to Star Trek and theBorg who d5d78886-aa3f-43a4-8ece-da80524bff29-1 strived for perfection and assimilation. f5ba9b38-c086-4675-8acf-d108f5cac6b2-0 In 2015, Borg was spun out and handed over to the Cloud Native f5ba9b38-c086-4675-8acf-d108f5cac6b2-1 Computing Foundation. bfadebe3-9888-4156-9b24-4c3112c9e0b9-0 Their marketing renamed it to an even better name than Borg bfadebe3-9888-4156-9b24-4c3112c9e0b9-1 called Kubernetes. d3f4dade-08a5-4b10-9f67-67e02d2cc05c-0 And it's in theirlore and their literature that the root d3f4dade-08a5-4b10-9f67-67e02d2cc05c-1 of Kubernetes is a mythological oarsman orguide and the root d3f4dade-08a5-4b10-9f67-67e02d2cc05c-2 of the word is cybernetics. 582348d9-90f8-436f-bd75-808178017952-0 And also because the letter K is 8 characters from the letter S 582348d9-90f8-436f-bd75-808178017952-1 we get to say KAS or Kate. 43311200-7aad-4ade-a23f-bef0726ac1dc-0 So what is Kubernetes and what does it do? 2947a0ea-5fc6-4d36-9dac-f6352831b7a8-0 Mostly, it's for orchestrating and managing containerized 2947a0ea-5fc6-4d36-9dac-f6352831b7a8-1 workloads. bc2716d8-7be1-4f1c-9706-50a88ff11e5e-0 It does all of the important infrastructure things that are bc2716d8-7be1-4f1c-9706-50a88ff11e5e-1 normally difficult to set up and maintain. 8d2961b8-d4e8-4599-9c2f-92984a103a05-0 And in my opinion, most importantly, it allows 8d2961b8-d4e8-4599-9c2f-92984a103a05-1 developers to develop and deploy code without involving the OPS 8d2961b8-d4e8-4599-9c2f-92984a103a05-2 team. 074adc13-0206-4abf-bd78-dca718c4915a-0 Because really itnever breaks and it never has any 074adc13-0206-4abf-bd78-dca718c4915a-1 issues. 5cee3529-d936-4c55-8913-bff3f38f96d8-0 So the developers can write all of the infrastructure as code 5cee3529-d936-4c55-8913-bff3f38f96d8-1 that they want, and it will do all of the things they need. 1872ec01-43a1-4753-9d2a-7fd90204276c-0 And if you've been around OPS, you know that there's a bit of 1872ec01-43a1-4753-9d2a-7fd90204276c-1 sarcasm in there, but it does do quite a bit. 70025db0-a119-45f2-8b55-ba4729538944-0 So how does it do all that? 63091a9c-52a7-4da4-bc94-8c436a655b88-0 How does it take this huge infrastructure and manage it 63091a9c-52a7-4da4-bc94-8c436a655b88-1 from code? 329b5f87-b9b1-41ca-bf42-c5047ac51abd-0 Google worked on that problem internally and when they spun 329b5f87-b9b1-41ca-bf42-c5047ac51abd-1 out Kubernetes from Borg, they decided that thebest ideas 329b5f87-b9b1-41ca-bf42-c5047ac51abd-2 that they had baked in to their internal Borg project were 329b5f87-b9b1-41ca-bf42-c5047ac51abd-3 labels, pods, services, and IP per pod labels. 6fb29821-d5dc-404e-b54a-613560bb856c-0 Essentially, because all nodes in a cluster could look 6fb29821-d5dc-404e-b54a-613560bb856c-1 identical, they needed a reliable way to refer to things. 8726cb2a-e728-427d-a89b-ddf7a9cdfe30-0 Let's say you've scaled up to, you know, 10s or even hundreds, 8726cb2a-e728-427d-a89b-ddf7a9cdfe30-1 and all of these systems are fault tolerant, monitoring each 8726cb2a-e728-427d-a89b-ddf7a9cdfe30-2 other machine for if they're alive or not. e5055b5d-c64f-463a-bf76-822996a58591-0 You know, all of their machines could be very identical. 3de07c01-0b3f-423c-a088-146019d9d9b2-0 So labels and tags were the solution for that. bb30a021-4b48-4604-b0da-01ff958d6670-0 Pods. 18d469a4-6307-463f-850b-d6f8c55dac07-0 Pods are essentially an instance. 5a722cf9-d7ce-4b25-89cb-92af654ff0b7-0 It could be a Docker image that's been allocated to do your 5a722cf9-d7ce-4b25-89cb-92af654ff0b7-1 work. 519d3797-ce2a-4ef2-9951-ba21a84a5b47-0 Think of it like peas in a pod or a group of whales. ab0459e2-9a63-435b-b872-646e00c33073-0 It does not necessarily need to be docker a docker image. 1309dfdb-7ae6-4284-a6c9-98f970bddd93-0 Very commonly it is a docker image, but they can also be 1309dfdb-7ae6-4284-a6c9-98f970bddd93-1 micro service. d14fc152-f244-49a5-ad6b-cd49cffebc4b-0 Maybe it's just an engine X service and services. 5b83ee8b-289b-4e2b-80e8-b79eaf60fd72-0 Services handle the load balancing the life cycle of5b83ee8b-289b-4e2b-80e8-b79eaf60fd72-1 all of the things and the most important thing, IP per pod. 6086c597-4bc0-4529-9499-05b0c832d453-0 Kubernetes can assign every pod and service its own IP address. a696bb6b-81d9-4238-9e37-05567e9e89ef-0 This ability removes the complexity of managing the ports a696bb6b-81d9-4238-9e37-05567e9e89ef-1 and allows the developers to choose any ports that they need a696bb6b-81d9-4238-9e37-05567e9e89ef-2 withoutregard to what's going on around their service. ae1037d8-bf57-4990-9db9-e2396856f1b0-0 They can take open source applications like Postgres and ae1037d8-bf57-4990-9db9-e2396856f1b0-1 deploy on Kubernetes with minimal configuration or ae1037d8-bf57-4990-9db9-e2396856f1b0-2 customization to the what it is being launched on or into. 8a2bb8ed-e5b4-4e1d-b01e-e994ebf086ff-0 The applications behave like they are on their own physical 8a2bb8ed-e5b4-4e1d-b01e-e994ebf086ff-1 or virtual machine and they are totally ignorant of the fact 8a2bb8ed-e5b4-4e1d-b01e-e994ebf086ff-2 that you know they are just one small piece in this cluster. 5b870925-90ec-432b-92c7-b1d8c5b65845-0 How can I get it for my enterprise? 8b0b04f5-5675-4af9-b6d1-0567fcaa03e8-0 There's a lot of decisions on if it is a good fit for your 8b0b04f5-5675-4af9-b6d1-0567fcaa03e8-1 enterprise. bfb223d3-bf36-4d0e-a850-6e12c242edac-0 There are quite a few managed Kubernetes providers and bfb223d3-bf36-4d0e-a850-6e12c242edac-1 services. c38fb774-9bc9-4f82-98c9-c01c53d472f3-0 Google Kubernetes is probably one of the most famous ones. 03a9f3aa-9e52-4324-afd0-06af813628ec-0 And then of course there's Amazon EKS, Azure Kubernetes. 3ead0d46-f854-4cf9-aef1-474b3e90330e-0 IBM has a Kubernetes service. 539a924a-80af-449e-a198-1128450cce0e-0 I don't know why theydon't give it a cool name, but maybe 539a924a-80af-449e-a198-1128450cce0e-1 they do internally call it IX which is not great marketing. 62ce7fcc-62b5-49dc-910d-46582df8ccae-0 Red Hat has Openshift, and then there's other smaller ones such 62ce7fcc-62b5-49dc-910d-46582df8ccae-1 as Rancher or Portainer. 1d4047b9-3640-48c2-a0b0-a219b710e494-0 All of those are sponsored by or a part of, you know, much larger 1d4047b9-3640-48c2-a0b0-a219b710e494-1 supportorganizations. 4af80a01-e656-4870-8369-2b6279e62381-0 They're not typically, you know, some guy in his basement. 6b2620e2-abec-45ca-9d26-7b089a6cd18e-0 For the there are an endless amount of Kubernetes options, 6b2620e2-abec-45ca-9d26-7b089a6cd18e-1 which I believe makes for a sometimes confusing ecosystem. 79826bbf-a1de-44a8-a74e-e97c6c3a4bb7-0 There are a lot of decisions to be made on whether or not 79826bbf-a1de-44a8-a74e-e97c6c3a4bb7-1 Kubernetes is right for you, your organization, your 79826bbf-a1de-44a8-a74e-e97c6c3a4bb7-2 workload. 595d32a5-1645-4eb6-84df-b0ef4320e973-0 If you are standing this up for a production application, there 595d32a5-1645-4eb6-84df-b0ef4320e973-1 are going to be a lot of conversations with system 595d32a5-1645-4eb6-84df-b0ef4320e973-2 designers and architects toset it up. 9458658c-fd89-4653-a893-dad6fb343054-0 If you want to do it the right way, maybe you can try it on 9458658c-fd89-4653-a893-dad6fb343054-1 your own, but most of the time they are launched on a 9458658c-fd89-4653-a893-dad6fb343054-2 managed Kubernetes provider. da44848b-c4a4-44a2-b12e-e23724871e45-0 There is a lot that goes in to managing the ecosystem where da44848b-c4a4-44a2-b12e-e23724871e45-1 your apps are going to be deployed. 5557d04d-c143-428c-9043-9ccb263c7a76-0 Spot is a service from that app that monitors your Kubernetes 5557d04d-c143-428c-9043-9ccb263c7a76-1 deployment and can spin up or scale out based on metrics that 5557d04d-c143-428c-9043-9ccb263c7a76-2 you set or can control, based on cost, based on traffic, based on 5557d04d-c143-428c-9043-9ccb263c7a76-3 many metrics and checkpoints that you can set. 0de917d3-e5e9-4cbe-b3e0-1a8608bc2be8-0 Will command your Kubernetes to do those things by inserting 0de917d3-e5e9-4cbe-b3e0-1a8608bc2be8-1 metrics into the Kubernetes controller and that in turn 0de917d3-e5e9-4cbe-b3e0-1a8608bc2be8-2 orchestrates your cluster. e50e2d30-fcb8-411b-ad4d-8e428abb2c1d-0 So if the enterprise installations are not for you e50e2d30-fcb8-411b-ad4d-8e428abb2c1d-1 and you are interested in learning more about Kubernetes, e50e2d30-fcb8-411b-ad4d-8e428abb2c1d-2 you can install a mini Kubernetes on your local e50e2d30-fcb8-411b-ad4d-8e428abb2c1d-3 computer. 29736a7c-2611-4cad-ad5b-18522377035b-0 And that's what we're going to cover today. 6eadfcd9-efd7-4b0e-8e04-3c92df32ba9e-0 There are basically there. 93ef519c-08aa-4404-9327-b37614d4cbe7-0 There are many Kubernetes controllers and, but here are 93ef519c-08aa-4404-9327-b37614d4cbe7-1 are three of the smaller ones that will probably suit the 93ef519c-08aa-4404-9327-b37614d4cbe7-2 needs for local development or experimentation. 61198813-8acb-4f2a-bc91-5f5068fa4e47-0 They are single node Kubernetes clusters that you can install on 61198813-8acb-4f2a-bc91-5f5068fa4e47-1 your computer without a whole lot of complicated steps. c7f153de-f3c3-4da9-b1b9-5916c375e49f-0 The one we're focusing on today is called Mini Cube. ccb2050f-8d4d-4438-8161-9005e8ba9c94-0 It runs inside a virtual machine container or can run directly on ccb2050f-8d4d-4438-8161-9005e8ba9c94-1 hardware. a3f0c6bb-c326-46ad-861a-06b21ae5a0cc-0 The other two kind it is good for local development or CI a3f0c6bb-c326-46ad-861a-06b21ae5a0cc-1 testing pipelines. bf53dacb-2175-41d2-8a81-0556fcb39775-0 And then there's amicro distribution K38K3S, which is bf53dacb-2175-41d2-8a81-0556fcb39775-1 from Rancher. 5c07d5bf-0bfb-4d2a-a070-ec359cfe3d3a-0 It is intended mostly for small headless edge computing, 5c07d5bf-0bfb-4d2a-a070-ec359cfe3d3a-1 Internet of Things, armed devices. 7bf2aa2a-b10f-47a5-94d2-9bb260f83969-0 It can also be used locally for development or CI work. 5238df09-c041-4966-b46c-e325e60c6f76-0 So let's begin the mini cube installation. 8082b941-c56e-4f38-87f0-cd571312932a-0 Of course it worked for me the first time, whichis not a 8082b941-c56e-4f38-87f0-cd571312932a-1 true statement. fdcbc027-d3df-4bc7-845d-569162613931-0 So the Mini Cube website has a very slick installation package. 20d5fca2-8445-4f3a-a029-bafb9be42017-0 Decider to go there and you choose your operating system, 20d5fca2-8445-4f3a-a029-bafb9be42017-1 your architecture and end up telling you howto download 20d5fca2-8445-4f3a-a029-bafb9be42017-2 it. fc7c1453-a397-47aa-9649-f38557e2be96-0 So these are the commands that we're going to run on Linux to fc7c1453-a397-47aa-9649-f38557e2be96-1 install it. 2dd49827-125c-4b0b-994c-95cb157994f2-0 Since I'm using a Fedora system, these are the two commands that 2dd49827-125c-4b0b-994c-95cb157994f2-1 I run to install Kubernetes Mini Cube and this is what it looks 2dd49827-125c-4b0b-994c-95cb157994f2-2 like. de94eee7-4652-4cd9-ba81-ba533b7f519e-0 It's very fast, very painless. b36a3a70-137d-4752-96f0-906702b51c1b-0 There's some other requirements that we need to install for b36a3a70-137d-4752-96f0-906702b51c1b-1 virtualization support on Fedora, and this also happens b36a3a70-137d-4752-96f0-906702b51c1b-2 very fast. 91b42b62-3805-433b-88b0-a6dc0812aaa8-0 It can work with multiple virtualization engines. 7b5b016f-fc80-453a-b421-af38d8d4b594-0 ADMQEMU, VirtualBox. 322b26f1-24dd-4fbb-9634-14e3267362ab-0 The drivers for those offer Mini Cube various abilities. 4d59b7c0-fb58-42bd-a978-b500c21becd4-0 One of the big problems that I had in my installation was with 4d59b7c0-fb58-42bd-a978-b500c21becd4-1 the host networking. f0a1a47a-bf20-4398-a26a-f5334bd8cab9-0 Mini Cube did not let me bridge my network to my local network, f0a1a47a-bf20-4398-a26a-f5334bd8cab9-1 so I was not able to log in from other machines to my mini cubes. fa0cf23a-6823-4d56-8378-030cb55ec412-0 But that may not be a problem for you and it's probably a fa0cf23a-6823-4d56-8378-030cb55ec412-1 problem I could solve. 0d9edfbe-99a7-4fd9-8aaa-389b8eb1cd94-0 So once you start your mini cube, there's 2 commands you'll 0d9edfbe-99a7-4fd9-8aaa-389b8eb1cd94-1 be very familiar. 0cf93f8e-fe7c-4375-bf0d-38dc42b8ffa5-0 You will start to get very familiar with Mini Cube start, 0cf93f8e-fe7c-4375-bf0d-38dc42b8ffa5-1 Mini Cube Start and Mini Cubecontrol. dbcd1f69-91d8-4975-97c5-0df802bf9788-0 And also, if you alias the cube control to Mini cubedbcd1f69-91d8-4975-97c5-0df802bf9788-1 control, you won't need to necessarily install the dbcd1f69-91d8-4975-97c5-0df802bf9788-2 Kubernetes client application. 566f6a3b-a590-4589-9d17-cfecba6ced59-0 It's included with Mini Cube. 2082782c-de5e-4df8-945d-c6f2f2e6da0b-0 So once mini cube starts up, you'll start to see on your 2082782c-de5e-4df8-945d-c6f2f2e6da0b-1 screen all these little emojis scrolling by. 4dd5756b-e308-4645-a0bb-8bcb69399ce8-0 Those emojis are part of the start up sequence. 121bdeeb-73c0-4233-805a-b146a489cfd7-0 And this probably takes about a minute. cdf85aaa-8ddb-4fdb-a273-9a314e1e4848-0 So again this command mini cubecontrol get pod. f864995a-7eae-4f66-8efe-2db407dec3ac-0 Dash A will show you the status of your pods and at first start f864995a-7eae-4f66-8efe-2db407dec3ac-1 up you should see something like what is on the screen here. 0656b7ea-4dea-4449-a6b3-6a70dbc6421e-0 These are all of the pods that Mini Cube has deployed in a 0656b7ea-4dea-4449-a6b3-6a70dbc6421e-1 single virtual machine. 64d92a5d-5a8d-400d-a22d-1abe83a04b50-0 In my case it's running under KVM depending on which 64d92a5d-5a8d-400d-a22d-1abe83a04b50-1 virtualization back end you're using. cdabec7d-6854-4675-986e-fc03eb6b76fe-0 But you should see the seven services running with mini cube. 80bfe958-cbfb-4b56-83cb-21d2c4c69dcb-0 What is an operator? 5a2b7b55-de56-4d47-8a5e-50e908060d91-0 Operators tell Kubernetes what to do. 924ad352-1b87-47b8-a45f-7db56e92e8a4-0 They extend Kubernetes how to with how to handle commands that 924ad352-1b87-47b8-a45f-7db56e92e8a4-1 you send it. aebd3516-6672-45e2-ab2b-54219bcfee8a-0 So you think of an operator, it's basically a package, a aebd3516-6672-45e2-ab2b-54219bcfee8a-1 packaging scheme for your application. ad84f5cb-734f-4b97-b69e-fbac07b68523-0 And the code in the operator extend Kubernetes to tell it how ad84f5cb-734f-4b97-b69e-fbac07b68523-1 to handle your requests. 16488ae6-2ce1-45f3-a213-33580dd3564a-0 So yes. c5c5f010-146f-4362-8f80-2faa1f338d95-0 So they are simply an application. c185ab5a-ef10-4543-ad35-2b8d6eb414e2-0 They're simply an application package in deployment scheme c185ab5a-ef10-4543-ad35-2b8d6eb414e2-1 that extend Kubernetes abilities to manage your complex workload. 174b7a56-e3c7-4fdc-ab0d-f10ebfa801d6-0 They do the work previously done or scripted by people by me to 174b7a56-e3c7-4fdc-ab0d-f10ebfa801d6-1 maintain your infrastructure and eliminate your configuration 174b7a56-e3c7-4fdc-ab0d-f10ebfa801d6-2 drift. cd98b0b7-281f-40a3-87f4-b25bf312fd07-0 You can imagine all of the maintenance things that you have cd98b0b7-281f-40a3-87f4-b25bf312fd07-1 to do to your server infrastructure, and while you cd98b0b7-281f-40a3-87f4-b25bf312fd07-2 strive for everything to be the same, nothing's ever really the cd98b0b7-281f-40a3-87f4-b25bf312fd07-3 same when you are hand maintaining infrastructure. f019389c-4d3c-4e56-833c-e5fcbcfa958a-0 The operators introduce their own objects object types to f019389c-4d3c-4e56-833c-e5fcbcfa958a-1 Kubernetes, and Kubernetes then monitors for changes in the f019389c-4d3c-4e56-833c-e5fcbcfa958a-2 state of those objects when they are added, updated or deleted. e216042a-f355-4ba3-980b-dfc09d694b2e-0 The application state that you want is declared in YAML as a e216042a-f355-4ba3-980b-dfc09d694b2e-1 custom resource definition. a60128f4-f400-4980-8097-63fe84f161e6-0 The state is constantly looped and monitored for any changes. 573ee697-8728-4424-a3dd-d4514c52abb3-0 So if the state says start, the machine is started. 3a7427ad-a737-4462-877c-071c8893e5d0-0 If this machine state is stopped, or disk add or create a 3a7427ad-a737-4462-877c-071c8893e5d0-1 user, any of those things, the operator commands the pods to 3a7427ad-a737-4462-877c-071c8893e5d0-2 perform those actions. 283acd24-baea-48c9-ac64-ea94ee4bc98b-0 There are many Postgres operators. 34942f3c-626f-4256-af7e-179559651e9a-0 Zealando and Percona and Crunchy Data publish some very well 34942f3c-626f-4256-af7e-179559651e9a-1 known PostgreSQL operators. b78ba0d8-c3cc-45e0-a4b2-789ce7428656-0 Generally, the Postgres operators that you come across b78ba0d8-c3cc-45e0-a4b2-789ce7428656-1 will have the same general features. 2dcabe87-78c2-44da-9587-8b42bce211df-0 They'll be able to set up a Postgres cluster, they'll do 2dcabe87-78c2-44da-9587-8b42bce211df-1 health monitoring, they'll do connection pooling. f970ecb4-a133-4fc8-850d-8862701a59f4-0 They all have the same basic abilities. e4f686a5-bb21-46db-a604-423ce33b689b-0 So we've chosen the Crunchy Data Postgres operator. 363734ce-adf4-4796-bd65-78be653526ea-0 Some of the features of their Postgres operator are cloning, 363734ce-adf4-4796-bd65-78be653526ea-1 scheduling, backups, managing your Postgres upgrades, managing 363734ce-adf4-4796-bd65-78be653526ea-2 Postgres extensions. e2a50a0a-a35c-4417-a6f6-307c6d596787-0 It will do Petroni high availability and disaster e2a50a0a-a35c-4417-a6f6-307c6d596787-1 recovery. 77374132-d3ba-44fe-9397-7b6b81f61259-0 It'squite a quite an extensive feature set and it is 77374132-d3ba-44fe-9397-7b6b81f61259-1 all open source. 527eceb5-88d0-4e35-a54b-07bc4209d27a-0 So to install the Crunchy Data Postgres operator, go to GitHub, 527eceb5-88d0-4e35-a54b-07bc4209d27a-1 the link is shown or Google search for crunchy data post 527eceb5-88d0-4e35-a54b-07bc4209d27a-2 press operator, it'll bring you to it. a5a7836c-7361-44c9-8be5-f072ecb2edeb-0 They recommend that you clone that you fork the repo into your a5a7836c-7361-44c9-8be5-f072ecb2edeb-1 personal GitHub. 74bb90ff-969a-4bbd-960b-677255553e50-0 If you don't have GitHub, you can download it. 41b119b9-e66b-4cd4-9e07-ae82c33a825a-0 I think most people attending this webinar would have a 41b119b9-e66b-4cd4-9e07-ae82c33a825a-1 GitHub. 1e1d4c04-107d-4414-86be-b072f168c835-0 That may not be the case, but you can use their Postgres 1e1d4c04-107d-4414-86be-b072f168c835-1 operators examples as a baseline for your own 1e1d4c04-107d-4414-86be-b072f168c835-2 experiments or learning about the technology or making 1e1d4c04-107d-4414-86be-b072f168c835-3 modifications, etcetera. 71ef0120-e9d5-4640-b584-5cde0cfbc5ad-0 So once you've downloaded it, change into the crunchy data 71ef0120-e9d5-4640-b584-5cde0cfbc5ad-1 directory and the first command you're going to run is the cube 71ef0120-e9d5-4640-b584-5cde0cfbc5ad-2 control. 53542fbb-e684-4bc1-83bb-c13ec2cb3c75-0 Apply Now if you've already set up your Kubernetes client 53542fbb-e684-4bc1-83bb-c13ec2cb3c75-1 application or if you have aliased the mini cube command, 53542fbb-e684-4bc1-83bb-c13ec2cb3c75-2 this command should work. d98af3aa-0cda-4c2e-8934-572fc2e56983-0 And what you're doing in this first step is creating the d98af3aa-0cda-4c2e-8934-572fc2e56983-1 namespace. c51de50c-9bc8-40ad-89c5-36dc0fb5dedd-0 So in the previous when we installed mini cube, the c51de50c-9bc8-40ad-89c5-36dc0fb5dedd-1 namespace was mini cube. 4a2578de-99ea-436c-a2f2-5c4fc04b6354-0 When we apply the Postgres operator, it's going to create 4a2578de-99ea-436c-a2f2-5c4fc04b6354-1 its namespace postgres operator. ea517ad9-b451-4a97-ae78-c9d514eeaf03-0 So the first step is to apply the namespace, and then the next ea517ad9-b451-4a97-ae78-c9d514eeaf03-1 step is to install all of the objects required for deploying ea517ad9-b451-4a97-ae78-c9d514eeaf03-2 the Postgres operator in that into that namespace. 425f0d3a-5af9-49fa-931b-2f4294197039-0 This is what tells Kubernetes what to do. 5a10b4d0-a324-43df-a304-41c74c3743b1-0 Again, we check our status with the cube control get pods 5a10b4d0-a324-43df-a304-41c74c3743b1-1 command and you'll see that there is now a Postgres operator 5a10b4d0-a324-43df-a304-41c74c3743b1-2 pod running in your mini cube. 4bd2dc83-3ddc-440b-89e5-39c5dba47961-0 And once you see that everything is running and ready, that'll 4bd2dc83-3ddc-440b-89e5-39c5dba47961-1 indicate that it's working. 50e745fb-be84-4e0f-821c-f3f11bea1900-0 So once the postgres operator is installed, now it's time to 50e745fb-be84-4e0f-821c-f3f11bea1900-1 install postgres. 6339e100-7547-477f-9840-98fd85634a1a-0 We have not done any Postgres installation yet, but that is 6339e100-7547-477f-9840-98fd85634a1a-1 the next step. b291d28a-c90e-4d15-8842-f8c9b1a583ef-0 First we have to install the operator, and now we can install b291d28a-c90e-4d15-8842-f8c9b1a583ef-1 postgres. 854fcc1c-e4fc-4a02-80d2-2db250f1e5dc-0 And the command to do that is cube control apply dash K 854fcc1c-e4fc-4a02-80d2-2db250f1e5dc-1 customize postgres and you can check the status of your 854fcc1c-e4fc-4a02-80d2-2db250f1e5dc-2 PostgreSQL installation with this command here cube control. c53f4eaa-84ff-44cd-ac42-76d39b27c17a-0 And then you just reference the namespace and describe Postgres c53f4eaa-84ff-44cd-ac42-76d39b27c17a-1 clusters, Postgres operator, crunchydata.com space hippo. 4860747f-65aa-4be3-95ed-fd2895a89130-0 The test database that we are installing is called hippo. c551220c-0224-47db-88dd-cc53b7e0fc09-0 And if you check your pod status again, you will see that there c551220c-0224-47db-88dd-cc53b7e0fc09-1 are four. 2d913a8a-13ba-448c-bba9-00abf1e2920d-0 There's the Postgres operator and then three instances or pods 2d913a8a-13ba-448c-bba9-00abf1e2920d-1 for various services offered by the Postgres operator. b75da3ec-a229-4e8f-98a8-7feabe1a2937-0 You can see how this can grow very quickly without doing a b75da3ec-a229-4e8f-98a8-7feabe1a2937-1 whole lot of work. b4884500-2199-490b-9892-6359e626a03b-0 As you can see, the operator has deployed 3 pods, so you might be b4884500-2199-490b-9892-6359e626a03b-1 wondering why does it do that? cd1cc6f5-c984-444d-9da3-c8b0b3af10b3-0 And the reason is in this postgres ammo file. b6eec0d2-fdd8-4f56-aa77-512d1078b653-0 Everything that the postgres operator is doing is defined in b6eec0d2-fdd8-4f56-aa77-512d1078b653-1 this fairly simple yaml file. 7dd572ac-e5f2-4718-8e27-696dd11d7eea-0 Here you can see the instance name and you can also see the 7dd572ac-e5f2-4718-8e27-696dd11d7eea-1 configuration for PG backrest. d8bbf4c5-7d71-4c78-aabd-384a4a5a6cbb-0 So now it's time to connect to the Postgres and see what we can d8bbf4c5-7d71-4c78-aabd-384a4a5a6cbb-1 do. 96b7ea58-4ab3-40c3-b48d-3642b6fb0957-0 And the command to do that is shown here on the screen. 004a373e-18ce-4a71-8f49-10fdfc297393-0 And if you notice, you'll notice that it's doing some things. 9dc64eb5-3c85-4e51-9014-1cd4d5622bfe-0 If you're familiar with Postgres, you know that 9dc64eb5-3c85-4e51-9014-1cd4d5622bfe-1 Postgres needs a Postgres user, postgres port, postgres host 9dc64eb5-3c85-4e51-9014-1cd4d5622bfe-2 name, and the database in order for you to connect to Postgres. 621c3178-999f-4316-9e70-501083d18a5c-0 Let's take a look at the commands that it is doing. da769fc6-197e-4506-aa94-4ee3eeb98c11-0 You can see we're calling, we're calling the PSQL client and da769fc6-197e-4506-aa94-4ee3eeb98c11-1 we're passing in cube control command. e457e1d3-1055-44d2-a680-38f3ecddb8ae-0 We're looking at in the Postgres operator namespace and we're e457e1d3-1055-44d2-a680-38f3ecddb8ae-1 calling get secrets. 0ce36766-a0fb-47c2-9ed7-d2b1c06d9fdb-0 And the secrets we want are for the hippo PG user, hippo and the 0ce36766-a0fb-47c2-9ed7-d2b1c06d9fdb-1 template that we want. f2a72b00-cb80-4aa5-87c6-b6cc00056623-0 So we want the secret for the user and this is the template to f2a72b00-cb80-4aa5-87c6-b6cc00056623-1 interpret that data. 3c4d664f-5de0-4813-8c2f-0d400e5c2379-0 So the other. 72ba860d-62c8-4e90-b2cb-424248b0bb85-0 So once it gets that information it executes the PSQL command. 5e4d6f6a-22dd-430d-91d9-07d4bed82b5c-0 However, in your environment you may or you may not get this 5e4d6f6a-22dd-430d-91d9-07d4bed82b5c-1 error and this is dependent on which virtualization back end 5e4d6f6a-22dd-430d-91d9-07d4bed82b5c-2 you are using. 3d06830c-2b5c-436d-a4f8-e1fec025b310-0 In my particular instance I am not able to bind the 3d06830c-2b5c-436d-a4f8-e1fec025b310-1 network to my LAN, so this runs in isolation, but we can connect 3d06830c-2b5c-436d-a4f8-e1fec025b310-2 to it with port forwarding. 673d230d-d91e-4215-bc7b-7edd062d835f-0 So connecting with port forwarding if you got the error 673d230d-d91e-4215-bc7b-7edd062d835f-1 on the previous screen this should get you connected. 6ff84883-a496-412a-95c8-bb5fc8f4450a-0 So in another terminal window you want to run the following 6ff84883-a496-412a-95c8-bb5fc8f4450a-1 commands. a42ec85d-d358-4998-a470-d84025e55d62-0 And what this is doing it's doing the same thing. dc2fa2e5-e33b-4f70-9a88-1ac2a0623b56-0 It's getting the pod name for thecluster. ecc40140-22b5-483a-8020-63cb190bcf3b-0 So basically your host name or your database name, sorry. 54d34c73-9393-4778-a881-c91ccba7bbf5-0 The first command is GET is evaluating to the host name of 54d34c73-9393-4778-a881-c91ccba7bbf5-1 your POST quest cluster, and the second command is setting up a 54d34c73-9393-4778-a881-c91ccba7bbf5-2 port forward to ports 5432 to that cluster. 614ab14e-c072-4b2a-a319-ba6d9fa1911c-0 So the primary postgres cluster is being passed to the port 614ab14e-c072-4b2a-a319-ba6d9fa1911c-1 forwarding command saying primary cluster is pod hippo 614ab14e-c072-4b2a-a319-ba6d9fa1911c-2 instance one and then a random string after it. ab39d32b-23a2-4b70-bd80-290ec86ed73e-0 And once that's up and running, you should see in your terminal ab39d32b-23a2-4b70-bd80-290ec86ed73e-1 window the following forward commands, forwarding commands. 4b9168db-91b6-47b5-a506-522a68b36def-0 So leave that up and running and let's try to connect again. 5a0a4bb4-d5d4-4ced-bdd6-2701d7236933-0 So once you enter in the following commands that had 5a0a4bb4-d5d4-4ced-bdd6-2701d7236933-1 failed previously and then execute PSQL dash H local host, 5a0a4bb4-d5d4-4ced-bdd6-2701d7236933-2 you should be able to connect. 02810376-d9c4-446d-a935-0c5866aeb8c0-0 Now, once you're connected, you can try to create a table in 02810376-d9c4-446d-a935-0c5866aeb8c0-1 public and you'll notice that it fails, so you may be a little 02810376-d9c4-446d-a935-0c5866aeb8c0-2 discouraged. 08e5e47e-7600-4636-b8b6-f6b0a25a75e0-0 Why did that happen? d694801c-f5de-49cb-b88b-d90b0997b0c9-0 By default the crunchy data postgres operator does not give d694801c-f5de-49cb-b88b-d90b0997b0c9-1 you access to the postgres user, but you can change that. 5e98056e-bdc7-453b-b01b-9356ea3eed0a-0 Also, you can create schemas and you can create tables in that 5e98056e-bdc7-453b-b01b-9356ea3eed0a-1 schema. e47c4a8e-24a0-4a6d-890e-4bd65fcf2f2d-0 You just cannot access objects in the public schema. 8e62b146-7b1d-4031-bc95-bf570b0d029d-0 And we'll get into how to change all that in the postgrescaml 8e62b146-7b1d-4031-bc95-bf570b0d029d-1 file. fd96e0e6-9cc0-46ef-b5bd-5187240d02a8-0 That is all we have time for today. 434bd875-d8cd-4505-9512-2e757a1b4931-0 Awesome, thank you. 78a45523-94db-48f3-b8ca-dfd5b644337b-0 So now we're going to jump into the Q&A section of the 78a45523-94db-48f3-b8ca-dfd5b644337b-1 webinar. df8b9bf2-fa6b-4d8f-a2ca-839e6e56170e-0 So please feel free to drop any questions you have into the df8b9bf2-fa6b-4d8f-a2ca-839e6e56170e-1 right hand side of your screen. 942cc82f-c5b7-4db4-b4ee-b7b3b866eabe-0 One that we did get a lot was will this session be available 942cc82f-c5b7-4db4-b4ee-b7b3b866eabe-1 on demand? f43a36b8-cb1c-48de-be74-cb28ea09727b-0 And yes, we will send out the recording after the session f43a36b8-cb1c-48de-be74-cb28ea09727b-1 concludes. 9804302c-dc27-4b84-9e7a-17f0b4234d7d-0 Another question that we did get was, is Kubernetes and Postgres 9804302c-dc27-4b84-9e7a-17f0b4234d7d-1 free to download and install? 67c5b32d-cf26-4d77-b54a-ec882b5b42e1-0 Yes, Kubernetes and Postgres are both free to download, install 67c5b32d-cf26-4d77-b54a-ec882b5b42e1-1 and use. 9cfc44ca-d075-4c82-bbea-f2110773a771-0 They are both open source. 8312f9ed-80cb-4731-824c-7137dab24ae2-0 Awesome. 03c6a754-70aa-4f85-98f3-665c410fc0f6-0 So we are almost at time. c50872b8-a9e5-4638-a2cd-9e249cce83c2-0 So we have time for about one more question. 550cc6a9-6724-466b-9720-0c84edd7595b-0 Let's see here. e9c07fd2-b270-420c-aaa3-d76e783017bf-0 What are some of the other most popular Postgres operators? 21c8e67d-bc60-4c48-ae83-88c1b08fed42-0 There's primarily 3 Postgres operators, Zalando, Percona, and 21c8e67d-bc60-4c48-ae83-88c1b08fed42-1 of course, Crunchy Data publish Postgres operators for 21c8e67d-bc60-4c48-ae83-88c1b08fed42-2 Kubernetes. 3213053c-a7d5-4205-ac6d-431703b68276-0 Awesome. 7411c9a6-025a-45c8-b4f1-c5d735e41302-0 All right, so we're going to wrap up here. 8090fc75-7d14-4d1e-9a3c-655ffbf29928-0 If you didn't get a chance to ask a question, you can always 8090fc75-7d14-4d1e-9a3c-655ffbf29928-1 feel free to reach out to us at info@instacluster.com or just 8090fc75-7d14-4d1e-9a3c-655ffbf29928-2 head to our website for more additional resources. 671beb9b-d8b6-42e8-9ffe-34f53ec0ee6d-0 If you like what you heard today, we also encourage you to 671beb9b-d8b6-42e8-9ffe-34f53ec0ee6d-1 take a look at our website for more of a upcoming webinars and 671beb9b-d8b6-42e8-9ffe-34f53ec0ee6d-2 workshops. 08a0a28e-c3db-4c20-9b26-f8ee75c0ff9e-0 And with that, we'd like to thank everyone again for joining 08a0a28e-c3db-4c20-9b26-f8ee75c0ff9e-1 and hope to see you again soon. ebc7ee2d-d800-4eb9-9473-c0bfb2597107-0 Thanks.
Explore the steps in implementing Postgres operators on Kubernetes. While there are many managed Kubernetes instances, we will focus on the step-by-step local install of Minikube on Linux and CD Postgres Operators.