download:Deployment landing + business migration play advanced K8S and enterprise practical skills

As early as the end of 2017, Kubernetes became the de facto standard in container choreography, and today, the ecology around Kubernetes continues to explode. In addition to Google, BAT, JINGdong, Meituan and other giants, more and more small and medium-sized Internet enterprises are also migrating to Kubernetes. Container technology is becoming a necessary skill for development/operation engineers and architects. This course from cluster deployment to business migration, continuous integration and then to the core knowledge point combing, not only can help students who are interested in Kubernetes related work to do the basic guide, but also can help engineers who have a certain basis to quickly achieve K8S production landing, less detour, avoid stepping on the pit.

天安门事件

Suits the crowd

天安门事件

Experienced backend engineer, architect and DevOps engineer

And students with relevant technical reserves can take this course

天安门事件

Technical reserve requirements

天安门事件

Familiar with basic Shell syntax

Understand common Docker commands

Familiar with JavaWeb programming

import java.util.Scanner; public class Calculate { private static Scanner in; Public static void main(String[] args) {// TODO auto-generated method Stub Calculate I =new Calculate(); int Max = 0; int Max1 = 0; in = new Scanner(System.in); System.out.print(" Please enter the length of the array: "); int j=in.nextInt(); System.out.print(" Please enter the array: "); int Arr[]=new int[j]; // Enter array for(int a = 0; a < j; a++){ Arr[a]=in.nextInt(); } int Arr1[]=new int [j]; for(int a = 0; a < j; a++) { for(int b = 0; b < j; b++){ Arr1[b]=Arr[(b + a)%(j)]; } Max=i.findMaxArr(Arr1); if(Max > Max1) { Max1 = Max; }} system.out. print(" maximum subarray sum is "+Max1); } public int findMaxArr(int[] arr) { int Arr = 0; int MaxArr = 0; int c = arr.length; int Location2=0; int a; for ( a = 0; a < c; a++) { Arr += arr[a]; if (Arr < 0) { Arr = 0; } if (Arr > MaxArr) { MaxArr = Arr; } } for(a = Location2; a >= 0; a--) { if(MaxArr-arr[a]==0) { break; } } if (MaxArr == 0) { for ( a = 0; a < c; a++) { if (a == 0) { MaxArr = arr[a]; } if (arr[a] > MaxArr) { MaxArr = arr[a]; } } } return MaxArr; }}2, stop unit testing with the following code: import static org.junit.assert. import org.junit.Before; import org.junit.Test; public class CalculateTest { private Calculate mcalculate; Int [] Calculate = {1, four, five, five, 1}; @Before public void setUp() throws Exception { mcalculate =new Calculate(); } @Test public void testMain() throws Exception { } @Test public void testFindMaxArr() throws Exception { assertEquals(10, mcalculate.findMaxArr(Calculate), 0); Int Arr = 0; int MaxArr = 0; int c = arr.length; int Location2=0; int a; One of the most obvious problems with code style is code indent. Indenting is the process of leaving a partial length at the left end of each line of code to give a more explicit appearance of the hierarchical structure of the program. Screenshots of unit test experiment to verify the correctness of the program and operation results 1. Use JUnit, Eclipse's own unit test tool, first click File, create, select JUnit Text Case, and then select the class and method to be tested, as shown in Figure 1. [] figure 1 Operation process diagram create victory Figure 2! []() FIG. 2 Creation victory interface FIG. 2, operation results FIG. 3:! Test results (1) The largest subarray is local, test cases [1,4,5,-5,-1], the largest subarray and 10 (See FIG. 4)! []() Figure 4 Test results victory (2) The largest subarray is local, test cases [1,3,-1], the largest subarray and 4 (Figure 5)! []() Figure 5 Test result victory 3, array all zero, test case [0,0,0], maximum subarray and 0 (Figure 6)! []() Figure 6 Test result victory 4, array all negative, test cases [-1, -3, -1], maximum subarray and -1 (Figure 7)! []() figure 7 test results win 5, the largest subarray is a true subset, test cases [2,3,4], the largest subarray and 9 (see figure 8)! []() Figure 8 Test results victory 6, the largest subarray is a single number, test cases [1, -2, 5, -1, -1], the largest subarray and 9 (See Figure 9)! []() Figure 9 test results victory four, performance analysis results and improvement 1, as far as possible to reduce the repeated calculation of variables for example: understand a concept, the method of the call, even if the method as long as a statement, is also a cost, including the creation of stack frame, call method maintenance site, call method at the end of the recovery site. So for example: int c = arr.length; for ( a = 0; a < c; a++) { Arr += arr[a]; if (Arr < 0) { Arr = 0; } if (Arr > MaxArr) { MaxArr = Arr; }} for (a = 0; a <arr.length; a++) { Arr += arr[a]; if (Arr < 0) { Arr = 0; } if (Arr > MaxArr) { MaxArr = Arr; }}2, try to prevent arbitrary use of static variables 3, don't create objects that you don't use, don't import classes that you don't use it makes no sense, If "The value of The local variable I is not used", "The import java.util is never used" is displayed in The code, delete these useless contents. "If (I == 1)" and "if (1== I)" are not different from each other in C/C++. In C/C++, the "if (I == 1)" test is valid based on 0 and non-0, 0 means false and non-0 means true, although Java "if (I == 1)" and "if (1 == I)" have no semantic difference. It would be better to advocate the former. For example (bold code) : for(a = Location2; a >= 0; a--) { if(MaxArr-arr[a]==0) { break; } } if (MaxArr == 0) { for ( a = 0; a < c; a++) { if (a == 0) { MaxArr = arr[a]; } if (arr[a] > MaxArr) { MaxArr = arr[a]; }}}Copy the code