title
stringlengths 3
46
| content
stringlengths 0
1.6k
|
---|---|
20:801 | When the installation is complete, you should see an entry for the installed Ingress Controller among the installed services if you type kubectl get service. The entry should contain a public IP. Please make a note of this IP since it will be the public IP of the application. |
20:802 | Open the frontend.yaml file and remove the type: LoadBalancer line. Save and upload this to Azure Cloud Shell. We changed the service type of the frontend application from LoadBalancer to ClusterIP (the default). This service will be connected to the new Ingress you are going to define. |
20:803 | Deploy redis-master.yaml, redis-slave.yaml, and frontend.yaml with kubectl, as detailed in the Deploying the demo Guestbook application subsection. Create a frontend-ingress.yaml file and place the following code in it: |
20:804 | apiVersion: extensions/v1beta1 |
20:805 | kind: Ingress |
20:806 | metadata: |
20:807 | name: simple-frontend-ingress |
20:808 | spec: |
20:809 | rules: |
20:810 | - http: |
20:811 | paths: |
20:812 | - path:/ |
20:813 | backend: |
20:814 | serviceName: frontend |
20:815 | servicePort: 80 |
20:816 | |
20:817 | |
20:818 | Upload frontend-ingress.yaml to Azure Cloud Shell and deploy it with the following command: |
20:819 | kubectl apply -f frontend-ingress.yaml |
20:820 | |
20:821 | |
20:822 | Open the browser and navigate to the public IP you made a note of in step 3. There, you should see the application running. |
20:823 | |
20:824 | The public IP allocated to the Ingress-Controller at Step 3 is listed also in the Azure Public IP Addresses section of Azure. You can find it by searching for this section in the Azure search box. Once in this section, you should see this IP address listed. There you can also assign it a hostname of the type <a name you can choose>.<your Azure region>.cloudeapp.com. |
20:825 | We recommend studying the https://letsencrypt.org/ documentation on how to require a certificate, assign a hostname to the application’s public IP, and then use this hostname to get a free HTTPS certificate from https://letsencrypt.org/. Unfortunately, we can’t give more details since the procedure to require a certificate is too extensive. Once you get a certificate, you can generate a secret from it with the following command: |
20:826 | kubectl create secret tls guestbook-tls --key=`tls.key` --cert=`tls.crt` |
20:827 | |
20:828 | Then you can add the preceding secret to your frontend-ingress.yaml Ingress by adding the following spec->tls section to it: |
20:829 | ... |
20:830 | spec: |
20:831 | ... |
20:832 | tls: |
20:833 | - hosts: |
20:834 | - <chosen name>.<your Azure region>.cloudeapp.com |
20:835 | secretName: guestbook-tls |
20:836 | |
20:837 | Following the correction, upload the file to your Azure Cloud Shell instance and update the previous Ingress definition with the following: |
20:838 | kubectl apply –f frontend-ingress.yaml |
20:839 | |
20:840 | At this point, you should be able to access the Guestbook application with HTTPS. |
20:841 | When you are done experimenting, please don’t forget to delete everything from your cluster to avoid wasting your free Azure credit. You can do this by means of the following commands: |
20:842 | kubectl delete –f frontend-ingress.yaml |
20:843 | kubectl delete –f frontend.yaml |
20:844 | kubectl delete –f redis-slave.yaml |
20:845 | kubectl delete –f redis-master.yaml |
20:846 | helm delete ingress |
20:847 | |
20:848 | Summary |
20:849 | In this chapter, we described Kubernetes’ basic concepts and objects, and then we explained how to create an AKS cluster. We also showed how to deploy applications and how to monitor and inspect the state of your cluster with a simple demo application. |
20:850 | The chapter also described more advanced Kubernetes features that have fundamental roles in practical applications, including how to provide persistent storage to the containers running on Kubernetes, how to inform Kubernetes of the health state of your containers, and how to offer advanced HTTP services, such as HTTPS and name-based virtual hosting. |
20:851 | Finally, we reviewed how to install complex applications with Helm, and gave a short description of Helm and Helm commands. |
20:852 | Up next, we have the book’s case study. |
20:853 | Questions |
20:854 | |
20:855 | Why are Services needed? |
20:856 | Why is an Ingress needed? |
20:857 | Why is Helm needed? |
20:858 | Is it possible to define several Kubernetes objects in the same .yaml file? If yes, how? |
20:859 | How does Kubernetes detect container faults? |
20:860 | Why are persistent volume claims needed? |
20:861 | What is the difference between a ReplicaSet and a StatefulSet? |
20:862 | |
20:863 | Further reading |
20:864 | |
20:865 | A good book for extending the knowledge acquired in this chapter is the following: https://www.packtpub.com/product/hands-on-kubernetes-on-azure-second-edition/9781800209671. |
20:866 | The official documentation for Kubernetes and .yaml files can be found here: https://kubernetes.io/docs/home/. |
20:867 | More information on Helm and Helm charts can be found in the official documentation. This is extremely well written and contains some good tutorials: https://helm.sh/. |
20:868 | The official documentation for Azure Kubernetes can be found here: https://docs.microsoft.com/en-US/azure/aks/. |
20:869 | The official documentation on the Azure Application Gateway-based Ingress Controller is available here: https://github.com/Azure/application-gateway-kubernetes-ingress. |
20:870 | Ingress certificate release and renewal can be automated as explained here: https://docs.microsoft.com/azure/application-gateway/ingress-controller-letsencrypt-certificate-application-gateway. While the procedure specifies an Azure Application Gateway-based ingress controller, it is adequate for any Ingress Controller. |
20:871 | |
20:872 | Leave a review! |
20:873 | Enjoying this book? Help readers like you by leaving an Amazon review. Scan the QR code below for a 20% discount code. |
20:874 | |
20:875 | *Limited Offer |
20:876 | |
20:877 | |
21:1 | Case Study |
21:2 | As mentioned during the previous chapters, for this new edition, we reformulated the way we present the case study of the book – World Wild Travel Club (WWTravelClub). This case study will take you through the process of creating the software architecture for a travel agency. |
21:3 | The purpose of this case study is not to furnish a production-ready application, but just to help you understand the theory explained in each chapter and to provide an example of how to develop an enterprise application with Azure, Azure DevOps, C# 12, .NET 8, ASP.NET Core, and all other technologies introduced in this book. |
21:4 | Let’s start with a description of what our case study application is. Then, we will gradually move to formal specifications. |
21:5 | Introducing World Wild Travel Club |
21:6 | WWTravelClub is a travel agency that was created to revolutionize vacation planning and travel experiences globally. To do so, they are developing an online service, where each aspect of a trip is meticulously curated and supported by a dedicated team of destination-specific experts. |
21:7 | The concept of this platform is that you can be both a visitor and a destination expert at the same time. The more you participate as an expert in a destination, the more points you score. These points can then be redeemed for tickets that people buy online using the platform. |
21:8 | The responsible for the WWTravelClub project came with the following requirements list for the platform: |
21:9 | |
21:10 | Common user view: |
21:11 | Promotional packages on the home page |
21:12 | Get a recommendation |
21:13 | Search for packages |
21:14 | Details for each package: |
21:15 | Buy a package |
21:16 | Buy a package with a club of experts included |
21:17 | Comment on your experience |
21:18 | Ask an expert |
21:19 | Evaluate an expert |
21:20 | Register as a common user |
21:21 | |
21:22 | |
21:23 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.