Amen. So keep your place in 2 Samuel chapter 12. We'll get there in a minute. We'll be all over that chapter this evening. Tonight we're starting a three-part series and we're going to be looking at the life of King David in the next three sermons. We're going to be looking specifically at why King David. What I mean by that is why King David is one of the people in the Bible that he's one of the most documented characters in the Bible. You know the entire chapters of 1st and 2nd Samuel are about King David's life, about David's life. David himself wrote most of the Psalms. If you read the Psalms, the author of those is mostly King David. It's clear in the Bible when you read through these chapters about King David, David as a young man. We see that we see David as a young man all the way through his life as a king before he's a king, as a king, and then as he dies and someone else takes over the kingdom. We see that whole window of his life which is a rare thing as far as characters in the Bible. The Bible tells us a lot of detail about his life. And one thing that's clear in the Bible is God's affinity towards David. If you look and you read the chapters in the Bible that are about David, you can just tell that God has a real affinity towards this man. And that's what I want to really look at in this series in the next few weeks. Keep in mind, you know, David was chosen by God a couple of different times. David was chosen by God, number one to be king, to be the physical king of Israel that would replace Saul. And then God also chose David, and this is a big one, but God chose David to be the lineage of the Messiah. He chose his family to be the heritage of Jesus Christ himself. Go back to 2 Samuel chapter 7. Go back to 2 Samuel chapter 7 and let's look at that just for a moment. But you know, God had a very specific attitude towards King David and towards David in his entire life throughout the Bible. And that's really what I want to look at throughout these next three weeks and figure out what those things were so we can, you know, reflect that in our own lives because it was a very special relationship between God and David. Look at 2 Samuel chapter 7. Look at verse number 8. The Bible says this. This was David, he was thinking about building a temple, building the temple himself for God. And 2 Samuel chapter 7. Look at verse number 8.  And he goes through the prophet Nathan in verse number 80. He says, now therefore thou shalt say unto my servant David, thus sayeth the Lord of hosts, I took thee from a sheep coat and from following the sheep to be ruler over my people over Israel. They're showing that God chose David to be the king. And I was with thee wherever, with or so ever thou went, wentest, and have cut off all thine enemies out of thy sight, and have made thee a great name, like unto the name of the great men that are on the earth. They're right there. Verse number 9. You can just circle that verse and just, I mean, that just shows you right there. In one verse, though, the love that God had towards David. I mean, he was with him wherever he went. Think about that. I mean, wouldn't you want to say that about God? Wouldn't you want God to be with you wherever you went in your life?  And look, he says, I've made thee a great name. Wouldn't you like to have God bless the things that you do, like unto the name of the great men that are in the earth? God has a special relationship with this man. Look at verse number 10. Moreover, I will appoint a place for my people Israel and will plant them, that they may dwell in a place of their own, and move no more, neither shall the children of wickedness afflict them anymore as before time. And as sense the time that I commanded judges to be over the people of Israel, and have caused thee to rest from all thine enemies, also the Lord telleth thee that he will make thee an house. And when thy days be fulfilled, and thou shalt sleep with thy fathers, I will set up thy seed after thee, speaking to David, which shall proceed out of thy bowels, and I will establish his kingdom. And he shall build an house for my name, and will establish the throne of his kingdom, and I will establish the throne of his kingdom forever. I will be his father, and he shall be my son.  Verse 14 is also very interesting. So basically God is telling David here just the whole context of what I'm reading to you.  But in the whole text of that, he's also saying to David, I'm going to establish your son to build this house. And look at verse 14. He says, this is proof of free will right here because we know how it worked out with Solomon. Solomon did not do well. He did not finish well in his life.  And we know the story. King Solomon did commit iniquity. He multiplied wives, they worshiped other gods. He built all these altars to other gods. I mean, he failed. But this is proof of our free will to follow God or not in our lives here. But even that being said, he says, if he commit iniquity, I'll chasten him with the rod of men. But look at verse 15. But my mercy shall not depart from him as I took it from Saul, whom I put away before thee. And thine house, now he's still talking to David, don't forget.  This is the context of the whole conversation.  If he commits iniquity, I'll chasten him. I will punish him. He's like, but I will not take the kingdom from him. I mean, that's a pretty big promise right there. And it's for the sake of David that God is doing that. I'll prove that to you a little bit later. But look at verse 16. It gets even better. So he promises David right here. He won't take the kingdom from his son. He will not take the kingdom from his son. Look, he'll chasten him, but he won't take the kingdom from him. Look, he took the kingdom from Saul. He just ripped it right from him. Look at verse 16. It gets even better for David. And thine house and thy kingdom, your kingdom, David, shall be established forever before thee. And thy throne shall be established forever. So not only does he say that your son is going to build the temple, your, your son is going to build the Lord's house, but he says I will establish your kingdom, David, forever. And we know how he did that. He did that through the line of the kingdoms of Judah, kings of Judah. And then he did that. He sealed that into eternity with Jesus Christ himself. I mean, that's quite a promise that he gave to David. Look at verse 17. And according to all these words and according to all his vision, so did Nathan speak on to David. So God chose David's heritage to rule the world here, basically through his sons. And then also, you know, to usher in the Messiah through his lineage. Turn to 1 Kings chapter 11. But more than that, more than that, you say, okay, you know, maybe that was just, you know, kind of a God had to choose somebody. But look, more than that, turn to 1 Kings chapter 11. God shows mercy for generations. For generations. I'm just going to show you one example. There's several in the Bible, but he shows mercy for generations. Pearl for David's sake. Think about this. Look at this. 1 Kings chapter 11. Look at verse number 30. Look at verse number 30. So the kingdom, of course, we know was taken from Solomon's son. Look at 1 Kings chapter 11 in verse number 30. Look what the Bible says. And the hyza caught the new garment that was on him and rented in 12 pieces. And he said to Jeroboam, take thee 10 pieces for thus say at the Lord, the God of Israel, behold, I will rend the kingdom out of the hand of Solomon and give it to the 10, give the 10 tribes to thee. But he shall have one tribe for my servant David's sake. And for Jerusalem's sake, the city which I have chosen out of all the tribes of Israel. So he says, even when, when Rehoboam is going to lose the kingdom, he's not going to take everything from him. He's still going to give him Judah, you know, a little bit of Benjamin and some Levites in there. But he says, he's like, I'm still going to grant him mercy. Why? Because Rehoboam is great. He said, no, for David's sake. David's gone. David's gone. Turn to Isaiah chapter 37. It's quite different than the reaction that the Lord had towards Saul. He just took it from him, period, from Saul. Look at Isaiah chapter 37. Isaiah chapter 37. This is Hezekiah, a king, several generations down of Judah, who is also of the lineage of David, by the way. And Hezekiah is praying to the Lord here for protection against an invading Syrian, a Syrian army. Look at Isaiah chapter 37 in verse number 33. The Bible says this. It says, therefore thus saith the Lord concerning the king of Assyria. So that God responds to Hezekiah in this way. Hezekiah prays for protection from the Lord. Therefore thus saith the Lord concerning the king of Assyria. He shall not come into this city, nor shoot an arrow there, nor come before it with shields, nor cast a bank against it. By the way that he came, by the same hit shall he return. It shall not come into the city, saith the Lord. For I will defend this city and save it for my own sake and for my servant David's sake. David's been dead and gone for 300 years at this point. And God literally says, I'm saving you, Hezekiah. I'm saving this city. I'm answering your prayer in an affirmative way for David's sake. That's impressive. Then the angel of the Lord went forth and smote in the camp of the Assyrians at 104 score and 5000. And when they arose early in the morning, behold, they were all dead corpses. For David's sake, for David's sake, David has been dead for centuries at this point and God is still, is still granting mercy to David. He's still granting grace to David, to people for David's sake. Look, this is something that we need to study. This is something that we need to know the answer to. Why, why did God show so much mercy to this man? That is the question of the next three sermons. You know, why did he have such an affinity for this man? I mean, it seems like he loved him an awful lot. So let's, let's, let's try it this way. Let's do a process of elimination first. Maybe God did this and maybe God had this extra love, this extra grace, this extra mercy for David because he was perfect. Maybe that's it. Let's look at that. Turn to 2 Samuel chapter 11. 2 Samuel chapter 11. Look, that's not it.  The thing is, David made huge mistakes. David made huge mistakes. Mistakes so huge, I hope that none of you ever make these types of mistakes, these massive mistakes. Look at 2 Samuel chapter 11. Look at verse number one. Look at 2 Samuel chapter 11 and verse number one. This is the context of what Nathan came to talk to David about in 2 Samuel chapter 12 that we just read. But let's look at it. 2 Samuel chapter 11. Look at verse number one. And it came to pass after the year was expired at the time when Keynes go forth to battle that David sent Joab and his servants with him and all Israel and they destroyed the children of Ammon and besieged Rabbah. But David tarried still at Jerusalem. He stayed back while the men went to war. And it came to pass in an evening tide at night in the evening that David arose off from off his bed and walked upon the roof of the King's house. And from the roof he saw a woman washing herself and the woman was very beautiful to look upon. And David sent an inquired after the woman and once said is this not Bathsheba the daughter of Eliam the wife of Uriah the Hittite. And David sent messengers and took her and she came in unto him and he lay with her for she was purified from her uncleanness and she returned unto her house. Now we know the rest of the story that she becomes you know he basically commits adultery with Uriah's wife. She becomes pregnant and he tries to cover it up by basically getting Uriah to come back from the battle and go home to his wife. But Uriah is too honorable to do that.  Uriah is not playing along with it because he's just too honorable of a man. Uriah one of the mighty men by the way. One of the one of the strongest best warriors in the Bible and an extremely honorable man. And his honor is what got him killed in David's little wicked scheme that he had going here. And David ends up sending Joab to murder Uriah in the battle. Sending him to the front part of the battle and leaving him by himself and he ends up you know to cover up his sin. So once again it's a lesson in you know sin leading to more sin leading to worse sin. He commits adultery and ends up committing murder to cover that up and then that is what we see. That is what we see in 2 Samuel chapter 12 when Nathan comes to confront him. When he comes to confront him. So the first the title of the first sermon. All these things being said and we'll look at a couple more of David's mistakes but let me just tell you it's not because David was without fault or that he had you know few faults in his life. David made a lot of mistakes and several of them were big mistakes and several of them had major consequences. As a matter of fact most of David's life was dealing with the consequences of his sin. Most of his life. Most of his life most of the things that he did in his life. Most of the battles that he fought in his life were because of his sin. Where judgments upon him from God. But the first sermon and the first reason that David found so much affinity with God was this. He was able to own his mistakes. That's the first thing. Look at 2 Samuel chapter 12 and look at verse number seven. So Nathan has just told David the story of the Lamb. You have the poor man and he has one you lamb and this rich man comes in and you know he needs a lamb to feed you know his friends and visitors and things and he steals the poor man's lamb when he has a lot of lambs himself and David's all mad and he says that man that rich man should you know they should be paid pay it back four fold and he should be killed. You know David's just like he's not connecting the dots. Look at 2 Samuel chapter 12 and verse number seven and Nathan said to David now he tells David the answer. He says thou art the man. He says you are the man. He says you are the rich man that took the one you lamb. He's comparing David. David has all these wives. David you know he liked a woman and he married her and he had multiple wives and here he had to take your eye as one wife and then murder the man on top of it. He says thou art the man. Thus saith the Lord God of Israel I anointed thee king over Israel and I delivered thee out of the hand of Saul and I gave thee thy master's house and thy master's wives into thy bosom and I gave thee the house of Israel and of Judah and if that had been too little I would have more over of given thee unto such and such things. He said if that wasn't enough you should have just asked me and I'd have given you more. That's what God is saying to David here. He says wherefore has thou despised the commandment of the Lord to do evil in his sight. Thou has killed Uriah the Hittite with the sword. You know what God loved Uriah too. And has taken his wife to be thy wife and has slain him with the sword of the children of Amon. Now therefore the sword shall never depart from thine house because thou hast despised me and has taken the wife of Uriah the Hittite to be thy wife. Thus saith the Lord behold I will raise up evil against thee out of thine own house. He's like your own family is going to betray you and this will be of the Lord and I will take thy wives before thine eyes and give them unto thy neighbor and he shall lie with thy wives in the sight of this son. For thou disses secretly but I will do this thing before all Israel and before the son.  And God just lays out I mean look this is some harsh judgment right here and you know if you've read the Bible that all these things came to pass. All this judgment came down on David's head but look at verse 13. Look at verse 13. In verse 13 you see you see an exchange between God and David right here in verse 13 and David said unto Nathan look Nathan has just called out his sin number one and then he says all the terrible things that are going to happen to David. So he doesn't just call out his sin and leave it open on what's going to happen to David. He says no I call out your sin and here's all the horrible things that are going to happen to you for the rest of your life because of this sin. And look what David says and David said in a nation I have sinned against the Lord. Right away I mean was this a long was that a monologue? Was that a monologue on well you know here's what was going on there. I was lonely. Well you know you know here's it just I was just you know I whatever there's no monologue here. I have sinned against the Lord. Bam right there and then look at what Nathan says. Nathan speaks for the Lord here. You have a very quick exchange this is how two men should deal with each other right here. I've sinned against the Lord. Nathan said unto David the Lord has put away thy sin. Done. That's how men should deal with each other. Thou shall not die. I mean look the judgment's already there.  I mean I don't think I deserve all that. He's like yeah okay I sinned against the Lord but whatever whatever. No I've sinned against the Lord. I put away your sin. Right there. That's it and thou shalt not die.  God granted grace here you say well there was harsh judgment. Look the first words that David said tell the entire story. The first words that he said. David blames no one. Turn to 1st Samuel chapter 15. 1st Samuel chapter 15. 1st Samuel chapter 15. Saul. Saul on the other hand. Saul on the other hand. 1st Samuel he was all he was supposed to do was go out and fight these people and destroy everybody. That's it. Simple command. Destroy everybody. Destroy the cattle. Destroy all the people. Destroy everything. That's all he was supposed to do. He didn't do it. He didn't do it. They kept some of the good cattle and they kept the king and look you know and he gets confronted by Samuel and look at verse 20. We're not going to spend a lot of time on this but what are the first words? What are the first words that Saul said? And Saul said unto Samuel. Yeah I've obeyed the voice of the Lord. I mean I'm not even God and I want to throw my Bible across the room when I read that. He's like he didn't do it. He's like yeah I did. Twice in this verse, yeah I've obeyed the voice of the Lord and have gone out the way the Lord sent me and have brought Agag the king of Amalek. That's not. Did he say bring me the king of Amalek? No he said destroy everybody. And have utterly destroyed the amicalites. And then so he denies it twice basically. His first words are denying it twice and then blaming the people. Look at the next verse but the people took of the spoil. He's like no I didn't. No I didn't. The people made me do it. That was Saul's first words. The kingdom was immediately ripped from him. The kingdom was immediately taken from Saul. So look he's the opposite of King David in this sense as far as owning your mistakes. Turn to 2 Samuel chapter 16. 2 Samuel chapter 16. So now let's go back to David. Well you say okay David owned his sin. David owned his sin but surely when this judgment comes on David, David is then you know he's gonna he's gonna tell God this is too much. He's gonna tell God you know what I don't deserve this. You know what I did wasn't that bad. This is way worse than I just don't deserve all this judgment. David never said that. As you look at all the judgments especially in 2 Samuel chapter 12 that we just read. The first judgment was that his child died.  He's in there and he's praying. He's like God don't take the child. Don't take the child. Don't take the child. He's praying. He's got sackcloth and ashes and he's fasting and he's begging God not to take the child. God took the child. What's the first thing he did? He went and worshiped. He didn't say it. He wasn't mad at God. He wasn't angry at God. He's like I deserved it. He went and worshiped right away. That's the first thing that he does in 2 Samuel chapter 12. Here's another one. Look at 2 Samuel chapter 16. David owned his mistakes like no one I've ever seen. 2 Samuel chapter 15. Look at verse number 5. And when now Absalom is taking over the kingdom and David is fleeing. This is another judgment that his own house would turn on him. And this is happening in 2 Samuel chapter 16. And when King David came to Baruchim, behold, thence came out a man of the family of the house of Saul whose name was Shimei, the son of Gerah. He came forth and cursed still as he came. And he cast stones at David. And all the servants of the King David and all the people and all the mighty men were on his right hand and on his left.  He's literally David is fleeing and he's got all the mighty men with him. Go read on the mighty men sometime. And this guy's cursing and throwing rocks at David. Look at verse 7.   The Lord hath returned upon thee all the blood of the house of Saul. And whos stead thou hath thou reigned? And the Lord hath delivered the kingdom into the hand of Absalom thy son. First of all, is that true? That's not why Absalom took over. This is a Zariah. And behold, thou art taken in mischief because thou art a bloody man.    And the King said, what do I have to do with you?  So Abashai is just, you know, it's an interesting study in itself. But Joab, Abashai and Asahel were brothers. Asahel is dead at this point. But they're David's nephews. They're David's nephews and they were by his side, you know, through good and bad through his entire life. And Abashai is saying they cause David a lot of trouble too. And that's kind of where you can see the comment here.  So let him curse because the Lord has said unto him curse David. Who shall then say wherefore has thou done so?  How much morbid is Benjamin might do it. Let him alone and let him curse for the Lord have bitten him. David here is saying this is on me. He's saying this is my judgment. Let him curse. Even at this point when David is running for his life when Absalom has taken over the kingdom from him, he's remembering the words of Nathan. He's remembering the words of the Lord. And he's saying this is just my judgment. And he took it like a man. He owned his mistakes. Turn to First Chronicles chapter 21. First Chronicles chapter 21. David, another huge mistake David made towards the end of his life was he numbered the people. He went out and he took a census of the people which is a big no-no. And if you're like why is that a big no-no? That's a big no-no because if you're studying through Joshua with us you know that it doesn't matter how many people you have because the Lord fights for you. Because God fights for you. So me going out as a king of Israel and numbering the people is a lack of faith in the Lord. All I need to do is have faith in the Lord and I can have 300 men. And it's fine because the Lord fights for us. So we have to be right with the Lord is the main thing. I don't need to go out and take a census of the people. But David did it. Joab, even Joab. I mean when Joab's correcting you you have problems. But Joab told him hey, don't do this don't do this. David did it anyway. He had a crisis of faith there. But look at first Chronicles chapter 21.  He gives them, you can have three years of famine. You can have three months where men take over your kingdom. And he's like or I can just give you three days of pestilence. He's like I'm going to choose the quickest. He's like I'm going to choose the quickest. He never argues the judgment. He's like just give me the quickest. The quickest judgment.  Look at first Chronicles chapter 21. But look at what David says. Look what David says. Does David say God you know I didn't deserve this. God you're being unreasonable. Look what he says. And David said none of God. He said is it not I even I is it that I have sinned and done evil indeed. But as for these sheep what have they done? Let thine hand I pray thee oh Lord God be on me and my father's house but not on thy people. Not on your people God. That they should be plagued.  You remember that when people would count that stuff? Because he just so obsessed with himself he just like I'm great and I am awesome and I am this and me me me I I. David's like I'm terrible I'm the one that made the mistake I did it. Not these people me me me I'm horrible. That's what David's doing. That's a leader right there. That's somebody that's owning his mistakes. Turn to Psalm 38. David wrote the Psalms. Look at Psalm 38. Look in general David was excellent at taking responsibility for his actions and look somebody that messed up so much maybe you could say it's because he had a lot of practice but boy he was good at it. He was good at owning everything. Look at Psalm 38. We could go we could read a lot of Psalms along this line but look at Psalm 38 and look at verse number 4. These are some good ones right here some of my favorites right here. Psalm 38 and verse number 4.  He's like I am in so much sin that I am in over my head. Listen look at this verse 5. My wounds stink and are corrupt because of my foolishness. I am troubled. I am bound down greatly. I go morning all the day long. First of all folks David understood how God looks at us. God looks at us God looks down at us and on our sin and he's like you stink. He's like you reek of iniquity. That's what God sees when he looks at us in our sin and David saw that. He saw what God saw. When David looked at his life he didn't see some great man. When he looked at his sin he saw a person laying on the ground in over their head stinking of iniquity. And you know what? That's why God loved him so much because that's exactly what God's like. He's like man I can relate to that. I see the same thing.   That must be such a relief to the Lord that somebody actually recognized that about themselves. You have to understand how God sees you. When you're all like I'm not that bad when you're all like somebody else got me into this when you're all like it just angers God. Because he sees the iniquity.   Somebody else made me do it. So here's the bottom line folks. David owned his mistakes. You need to own your mistakes if you want to have this type of look there is nothing on this earth. There is nothing in your life that is stopping you from having a type of relationship that King David had with the Lord. Nothing. Only you. Nothing. Nothing stopping you. Somebody said the other day to me that oh I tell people that when they're born that their life is set and the day of their death is just set and it's all great. It's not anything to worry about. I'm just like what in the world did you just make that up? That has nothing to do with what's actually true. I could take this life that God gave me and I could ruin this life with sin. I could take 30 years off my life. I could be a saved man that turns my life into a train wreck to the point where God says you know what? You're done buddy. I'm taking you home. I'm taking you home early. That's why the whole coronavirus thing started and I'm just like whatever. I'm just going to do what God wants me to do and you know if God takes me home through this whole thing he must have somebody better for this. He must not want me doing it. But look, our choices define our relationship with the Lord. And that relationship can be this great affinity this great love or great wrath upon us.  That's what people need to understand and that's what David was so good at. But here's the thing to own your own mistakes you first need to be able to realize when you're wrong. Turn to James chapter 4. Can you imagine? Can you imagine a disease or a sickness setting in on you where you didn't even realize you were wrong?  Look prideful people, you know prideful people will literally not know that they're in the wrong. That's a terrible place to be because you have no chance of achieving what we're talking about this evening if you don't even know you're wrong. You have no chance. Look at James chapter 4 and verse number 6. Look this is David right here. James chapter 4 and verse number 6. The Bible says, but he giveth more grace. Wherefore he said God resisteth the proud but giveth grace unto the humble. Hey, you want real trouble? You want real trouble in your life? Argue with the Lord over your iniquity.  I don't think you realize how bad everybody else is. God, you know I was in all this sin but God, 85% of people out there are way worse than I am go have that relationship with the Lord and call me in six months and let me know how that's going for you.  That's how pride will destroy you. This person right here that God giveth grace to is humble. David, this is what truly shows David's humility. The fact that he could own everything that he did and that's why he received so much grace from God. He just took his judgment and then God gave him grace. Here's the thing folks hanging on to sin is like hanging on to a bad idea. You ever seen somebody hang on to a bad idea? There's a time factor there. There's a time, like hanging on to a bad idea I think about it from like an engineering perspective. I've seen people do this in my career. So you have some engineer has, I've had an idea. Say I have an idea and I find out I have an idea for a machine system and I'm like okay I go and I study things out and I'm like okay it's too expensive or oh it won't work how I thought it was going to work. If I just hang on to that idea it will do incredible damage to the people that I work for or to the people that have hired me to come up with ideas and whatever. They'll spend tens of millions I've seen people do this. They will spend tens of millions of dollars on an idea that will never work. I mean physics is physics. I mean if you find out that the math doesn't work and a machine's not going to work you carried a decimal wrong or something let go of that idea as soon as possible because there's a time factor in there. If you hang on to that thing you know it's like hanging on to the sinking ship. It's like the rat that won't leave the sinking ship. It's the same thing. Look sin is the same way. As soon as you realize that you are in the wrong own it right there right there. James chapter 5 and verse 16 look at James chapter 5 and verse 16 look as soon as you realize and look you realize when you're wrong you realize as soon as you realize that you just own it right there and just own and make it right with all parties. Look at James chapter 5 and verse 16 look what the Bible says James chapter 5 and verse 16 confess your faults one to another and pray for one another. Why? Why? This is talking about Christian brothers and sisters dealing with each other. It's not talking about just coming in and telling your brother random things that you've done wrong in your life it's talking about confessing things that you've done wrong to each other in your life and why? That you may be healed and the effectual fervent prayer of a righteous man availeth much effectual means it's sincere it means you mean it it means it's from the heart and availeth much means it has great benefit so it means a sincere prayer has great benefit to who? To everybody to everybody involved but the more you hang on the longer you hang on the less in David's life the opposite of it because he never hung on for a minute for a second he was just like thou art the man I have sinned get that thing off me because he realized he's like I stink he's like I stink but look you say you say well what about you get in an argument with your brother or your sister in Christ and you're like well they started it they did more to me than I did to them here's the thing it doesn't matter here's the thing own your fault own your own fault that's your job we talked about the other side of this over the last couple weeks how forgiveness is a one way street this is the other side of forgiveness this is the other side of it look as soon as I don't know any conflict between two Christians or two anybody where only one person is at fault I don't know any conflict there is no such thing you will never convince me that there's a divorce on planet earth that has ever happened that was the fault of only one party you will never convince me that never own your own faults clear your faults look get God off your case get God on your side as soon as possible look people in general and there's a reason that David was so special here because people in general as the general population goes people that you will meet in your life they're terrible at this they're terrible at it this one thing that we're talking about tonight is one of the main reasons that God's granted so much grace and mercy to king David period this one thing most of you most of you I hope none of you will make the level of mistakes that David made or suffer the consequences that he suffered yet he came out of it shining that should give you hope that should give you great hope because you're like well I didn't make those kind of mistakes but guess what that means that you don't have as much ground to cover just own your mistakes that you have made but look folks not understanding what I'm talking about and this is why I said this morning that if you listen to this sermon and you apply this sermon in your life it'll change your life your relationship with the Lord because guess what not understanding this sermon can literally destroy your life I'm not kidding it can literally destroy your entire life especially as a saved person not understanding this one thing you say how you say how first of all it can ruin your relationship with the Lord I mean it can ruin your relationship with the words look if you're blessed from the Bible of the first words the first words that Saul said and the first words that David said you know the first words of Saul invoked the wrath of God upon him think about I mean think about Psalm chapter 38 think about God seeing you and seeing you for what you are and seeing your sin for what it is there's no hiding anything from the Lord you're sitting there and you're saying well you know God maybe she shouldn't have been up on the house and bathing in public I mean what was that all about you know or maybe this or maybe that look God sees the stench of your sin and if you start making excuses you're just going to invoke his wrath right away be careful the first words that you use with the Lord you say okay that's the relationship with God but you know what it'll also destroy your life and your relationship with people particularly your brothers and sisters in Christ look people think they can fool men this is so unfortunate people think that they can fool men they think that they can come up with a story and excuses and they they can fool men but when you are talking about making things right between your brothers and sisters in Christ be careful of the first words that you use because if you come in yet you know they've done studies on the first few seconds of a conversation and how important the first seven seconds of a conversation are the first 30 seconds of a conversation these are big studies and you'll find these in sales books and business books everywhere the first look it's important out soul winning too you're out soul winning you know that somebody decides to talk to you or not talk to you in the first seven seconds of the conversation that's why I always tell you guys don't knock on the door and be like we're from I don't know we're high or whatever you know kind of frowning you're having a bad day people are going to be like yeah whatever cook and ramen noodles get out of here but if people can tell if you're excited like hi they look at your face and they're like I want to talk to this person they decide if they want to talk to you in the first seven seconds people can you know why it's so important because people can see your heart in the first few seconds of a conversation people imagine what the Lord can see get a relationship right in your life come into that conversation in the first few seconds you just be disingenuous or just be you know try to make excuses or whatever look if you come in look here's the bottom line folks pick up your trash in your life don't come in and say I'm going to pick up 40% of my trash I'm going to pick up 80% of my trash you're just going to bring wrath upon yourself it's better not to say anything because honestly look at first Samuel chapter 15 and verse 17 look honestly if you're only at the 40% level where you're going to come in and you're going to talk to somebody and own 40% of your trash you need the wrath look at first Samuel chapter 15 and verse 17 and Samuel said Samuel's telling Saul this and Samuel says you know what he's like you know what Saul when that was little in nine own sight was that not make the head of the tribes of Israel and the Lord anointed the king over Israel he's just like how dumb are you he's like how dumb are you to get prideful like this he's like when you were little in your own sight you know what he's saying he's like when you had humility he's like that's when God made you king he's like God made you king when you were small in your own sight he's like now look at you kingdom gone look get small folks get small stay small in your life and then own your own trash think about this technically there should never be a conflict between Christians right I mean am I wrong here if every Christian think about the relationship between two Christians think about two brothers having a conflict you know think about two brothers that just like they've both been in sin and they're like their relationship between each other is just a twisted pile of trash it's just this huge mess of trash they can't even tell who put the first piece of trash down it's so messed up but guess what if two things happen if they both come in first of all forgiveness is one way if they both forgive one way regardless of what the other one does that's already done that's a sermon for another time but then talking about the sermon tonight they both come in and pick up every single piece of trash that has to do with them there will be no problems it will be a completely reconciled situation because look there should be no trash remaining and the forgiveness has already happened so theoretically there should never I mean we know this doesn't happen because we're all in the flesh and people are not as good at this this is why we're preaching about this tonight because people are not as good at this as David was it has nothing to do with the amount of sin that David had in his life he was just really good at owning his trash and picking it up he was really good at it I mean think about your marriage I mean think about your marriage I mean I have a perfect marriage so I'm talking about your marriages I'm just kidding but think about an argument with your spouse say I came home from work and you young people that want to get married someday this might happen to you one day who knows say I come home from work one day I kind of like the way my wife responds to me or she you know I'm like hey what's her name she's like get your own dinner punk and that's not respectful and then I just get mad at my wife and I just say a bunch Meow meow meow,.  She's the first one to put the trash in there. Look, first of all, are we in fifth grade? You know, this is why two Christians should never have an argument, including between you and your spouse. Not an argument, but she never have a long lasting, you know, relationship because it doesn't matter. Just get in there and pick up your own garbage. Own your own trash right away. Turn to Ephesians chapter 4. Ephesians chapter 4. Just own all your stuff right away, no questions asked. And look, it doesn't depend.   Look at Ephesians chapter 4 in verse number 26. Ephesians chapter 4 in verse 20, let's look at verse 25. We're for putting away lying, speaking every man truth with his neighbor. This is talking about your relationship with your neighbor, for we are members one of another. Be angry and sin not.  See, you know what? There's that time factor that I told you about right there. So the Bible is saying when you have a conflict in your life, this is why it puts this in the Bible. It's trying to protect you from that T in the equation where if you let that T get really big, it's like sin to the T. The longer you let the T go, maybe I'm getting too mathematical. The worse it gets, like exponentially, right, it gets way worse the longer you let that T go. That's why the Bible says here, hey, don't even let the sun go down on it. Get in there, pick it up and make it right away. He was like, oh, but she didn't pick up her trash. Get your stuff out of there. Just get your trash out of there. Get your trash out of there. Get your forgiveness done.  And she's listening to the same Bible or he's listening to the same Bible. You are. This is how it's supposed to work, folks. This is why the Bible is so beautiful because everybody listens to it. There's no issues. It's just going to work out. But look, the point of the sermon this evening to just close is that one of the reasons, one of the main reasons, it's the first, it's the first sermon, one of the main reasons. It is not because David was the most righteous. It's not because David had the least amount of sin. Look, David is a great man in the Bible, but he's a great man for a different reason than like Daniel was a great man. Because Daniel was, Daniel was like Job was a great man. It's for different reasons. His heart is what got him where it got him. And what we're talking about this evening is he was great at owning his sin. And God, look, just look at how God responded to that. He had a lot of garbage. But man, he picked it up himself. All right. Let's bow our heads and have a word of prayer.


In the following hyper-connective and the super-intelligent society, we would realize robot service, self-driving car, and drone in everywhere by controlling the internet of things. This advanced technology would be operated from the eco-friendly energy storage system, especially the battery. Lithium ion batteries have received much attention as the portable electronic industry has been developed. However, during the last 20 years, the battery size has very slowly increased, which cannot compete with the memory size now. Nevertheless, the technology is continuously growing up and also moving toward a new market, especially for automotive batteries. The scale of the battery market for hybrid vehicles has incredibly increased during the last five years. Well, the challenge is driving range, which is still less than 100 miles, very far away from the target of the 500 miles, which will achieve for the full battery-powered car we call an electric vehicle. So the current and tentative way to increasing driving range is just loading a very large package of the battery series to the order of the bottom of the car, which are very expensive and also heavy. Therefore, it is highly required to invent a new battery system from the new electro chemistry, which will fulfill more than five times higher energy density than the current one. The lithium oxygen battery is one of the promising candidates. Oxygen gas is green, abundant, and lightweight energy source. When the battery is breathing in during discharging, the car is driving, and the driving range is more than three times longer than the current one. Inside of the battery, oxygen gas and lithium produce the solid state of the lithium peroxide. When the battery is breathing out during electric charging, the lithium peroxide can decompose and oxygen gas evolved. This breathing in and out process can be repeatable. Let's look at our real image of the electrode. We have used the carbonate to electrode. There are many voids for the oxygen incoming and also outgoing. After discharging, the total die shape of the lithium peroxide can be formed. Unfortunately, they are very weak and insulating property, so they can decompose very slowly, and oxygen evolution rate is also very slow. We have tried to resolve this challenge by the tuning of the lithium peroxide morphology. It was achieved by the chemical modification of the electrode surface, which provides active site where oxygen gas is very easily sitting on, and lithium peroxide can be formed. We found that the more sitting site provides smaller and the ammoprocessed lithium peroxide which can promote oxygen evolution. So we extended our idea to produce the smaller thinner and ammoprocessed lithium peroxide which can rapidly decompose compared to the bigger one, and such idea allow for the fast charging, which is one of the very important issue in electric vehicle. The charge and discharge can be also cycles very long term period. The catalyst, for example, hexagonal nanostructures nickel oxide can enhance the recycling stability. There are still much effort required to getting lower the technical hurdles which we will achieve in the very near future. The next battery I would like to introduce is operated from the iodine electrochemistry. There are already commercial lithium iodine batteries, which are widely used for the cardiac pacemaker. However, they are not rechargeable. Very interestingly, when the iodine meets water, it can be the source of the rechargeable battery. Iodine exists as a triiodide in water with excess iodide, and its high solubility guarantees long-time operation. The dark brown color of the triiodide solution becomes transparent during discharging, and this color goes back during the electric charging. So it is very easy to find the states of the discharging and the recharging from the color change. In this liquid battery, all the reactant and products are solubil molecules. So in this configuration, the battery can be very feasibly scaled up with the liquid reservoir and the circulating pump. In addition, when incorporating with the very low potential of the redox molecule, the battery can be the lithium-free and the safer energy storage system. Further, the iodine has to be widely used for the solar cell, which can guide us how we link with the sustainable energy source. For example, with the solar panel under the roof of the electric vehicle, the battery can be charged from the solar energy, which can lower the dependence of the plug in charging. So such a combination of the sustainable energy source and the storage system is ideal for the future society, especially for green and the safer energy system. So the battery should be developed further for especially the long-lived robot and the long-driving range of the vehicle, which support the successful the first industrial revolution in the coming era. Thank you very much.


Another tutorial guys this one. I'm gonna show you how to edit photos in the just release ios 13 in particular I'm gonna show you how to a couple of the changes that they've made part of me And we'll go through some of the functionality and we're gonna take some of my older pictures of my puppy dog My puppy dog and I'm gonna make it a little bit brighter a little bit better And we'll just go through some of that stuff. So let's do some learning stuff. Oh, there goes a tinder message. I'm lonely Now you guys know someone doesn't please somebody message me All right, anyways enough crying. Let's get right into this.   Stop messaging me people And then as I flip through it here, here's a whole bunch of photos now Here's an interesting fact These are some of the older photos because I just had I bought the new phone in my my Restore was some like years ago. So you can actually go to work on with the new tools We're gonna go to work on an old photo and not only any old photo We're gonna pick up we're gonna take one of my handsome puppy named Kingston. Here we go Kingston Look at that face now. I'll be honest His jaw was a little his bottom jaw was sticking out a little bit because he hadn't grown in His his face and turned into a full bulldog face.  I love them But anyways, let's get in the start editing. So at the top right, you're gonna see the edit button Click that bad boy. And here we go. We're in Ios 13 and we're about to start the editing party Now the beautiful thing about Ios 13 is everything you've got to do is down here Now how cool is this? Everything is here on a row and there's tons of new stuff. So again, I don't know if you guys want I probably won't go through everything, but let's just start with vignette Why not right and then to make it even better? You'll see here that it's just one slider So it's an intensity slider at the bottom and as I go through it as you can see here slowly But surely we start making changes Very very very user-friendly very intuitive. I love it noise reduction There's not a lot of noise reduction not a lot of noise in this but again I'm just gonna start moving it across so you guys can see as I go When we go to a hundred versus zero very very little difference because it was a pretty good shot noise reduction is useful When it's nighttime or when you take a shot at night and you get a lot of grainy artifacts in there and stuff like that That's where you want to kind of make a noise reduction definition Not a big factor here, but you know what you'll see here. It gets a little bit sharper Maybe that's what you would be used to calling it in the photoshop if you're a photoshopper But definition, you know what? Let's just let's turn it up a bit made it a little sharper. Let's keep going through this Sharpness never mind guys definition and shortness. I don't know. I'm not the sharpest ball in the friggin That's for sure. Okay sharpness. Let's increase it here But anyways guys you get the point Tint is a very useful one if you want to start changing the like if you want to make it like an autumn day Right you want to have a little bit of like brown leaves with some red in there Okay, we took that shot in autumn. That's how you would change it just like that And then let's see what we got warmth want to make it a little warmer so it adds some more brownish and colors in again Season to your taste guys Vibrance is another one that I use quite a bit.  It's just awesome guys. So anyways guys go nuts Give it a shot You guys have the exposure is pretty good on this, but maybe I'll make it exposure It makes it a little bit brighter the whites come out Brilliant yes, I am the most brilliant man. I know Then again, I don't know many men. So maybe that's the point. No, I'm actually yeah If I was any if I was any stupider, I'd be on a leash. I gotta edit off that effort. All right guys That's it for this tutorial guys. Thanks for watching. I got a ton more stuff coming up. I'll be back soon. See you soon


But it sounds like we have an opportunity here by thinking agile, by doing agile in our businesses. We actually can employ some really great leadership principles like delegating properly, giving authority to people, pushing authority down to the lower levels. And this is something you and your company, not just with a technology piece, but you help companies do this as well, right? In fact, there's two key agile emphasis areas I'm gonna talk about frequently. Number one is continuous improvement and number two is continuous learning. So I'll talk about, I'll give an example on continuous learning, for example. This is the importance of growing our people.


All right and our last talk of the day in the container room is Jason Jason comes from data dog. He's a technical evangelist and in his free time. He's a travel hacker Jason, let's go it. Thanks Quick question before we get started. How many people are using kubernetes just playing with it? All right, so you've all kind of played with this. How many of you are using it in production? Okay, fair number of people cool So talking about canary deploys. I mean deployments, what could possibly go wrong right like Yeah a lot everything We've all experienced it And so the issue when it comes to deployments We've all seen the most interesting man in the world meme of when I do blank. I do it in production, right fill in the blank Yolo ops But the problem is when we deployed a production we do that in production like as much as we want to dry run things and test it And we try to set up, you know staging environments that exactly match production environments like at the end of the day You still deployed to production and there's no safety net for that So that's why I suspect we're all here and interested in canary deploys So what are ways that we can actually deploy start to get information without just having everything?  I'm a technical evangelist at datadog. I Like to boil that down to saying that I do docs and talks So I help write our technical documentation, which means reading through the code about what datadog does and then writing Useful documentation hopefully useful so that developers engineers anybody that wants to use a product can do so easily And then I come to events and I I talk I'm also as mentioned a travel hacker. I'm currently a nomad. I live nowhere I've been changing where I live like cities around the world every week if you live in some place interesting That you love come talk to me later because I'm interested in exploring that Aside from that, I love whiskey and I'm still addicted to Pokemon go So if you see me wandering around like Pasadena later, I'm not lost That said if you have any questions After this talk, we'll have some Q&A But if you think of something later feel free to hit me up on Twitter and get bisects email is jg at datadoghq.com a little bit about datadog Datadog is a SaaS based monitoring logging tracing platform We essentially try to make it easier for you to gather all the information about your system and have a central place where your developers the rest of Your teams can all get together and understand what's going on in your systems Give you an idea of the scale of what we handle. We do trillions of points of data every day And just in the start of this talk till now. We've probably handled several hundred million data points We are hiring. So that said if you're looking for interesting new opportunities around large-scale systems helping other people monitor their systems We're hiring all over the board and one caveat. So we're not really running Kubernetes in production yet We're moving stuff that direction. So just like many of you Trying things out So how did we used to do deployments or how do most of us do deployments is I think How many people are doing blue-green deployments for stuff? Yeah, wait, that's not very many hands Hmm, how many of you are just What also you guys using what are you doing aside from canary deploys or canary deploys or people everybody else using that? Okay, also very few hands. Are people just not deploying. I Mean that that is the safest way right the most reliable system is just never deploy again Sorry Yeah All right. Yeah, when things go down you just deploy after that and that's when you roll out the new code So blue-green deploys for those who aren't familiar. I think most of you probably are Sometimes are called red black. It doesn't really matter the colors The notion is essentially you've got a load balancer that sits out front and you just flip a switch from version 1 to version 2 or whatever Sometimes this could be in DNS. If you're thinking of code People do this. This is the whole basis of Capestrano, right? Where you have one folder and you just sim link to that and then when you have another folder of new code You just same link to that and make the switch and the nice thing about blue-green deploys And why most of us are using that is that you get these really almost zero downtime deploys Right. You're changing a DNS entry. You're pointing a load balancer somewhere else That doesn't take much time and instantly you're flipping all of your traffic to that and the other reason that we use that is For easy rollbacks, right?  I can just hopefully switch that back We do this because outages cost money We want zero downtime You know, so there's all these statistics about how much money outages cost us 2013 Amazon comm goes down for about 40 minutes People say that they lost about five million dollars a month later Google comm goes down for five minutes and they lose about half a million dollars As mentioned, I'm a travel hacker. So I love the airline industry and the news around that Do people remember the BA outage from last year? So BA had an outage on a Friday. It lasted the entire weekend 800 flights canceled They lost a ton of money from that But one thing that I always like to remind people of when you're having outages is we often think of the time that it takes and The money that we're losing in sales But there are other amplifications right how many people work in highly regulated industries banking things like that Yeah, there are people there are laws That go beyond just that so travel industry one of the fun things is if you operate in the EU You are forced to pay back your customers for things like outages. So BA Estimated that they had to pay out 61 million euros to their customers for this outage on top of that They're a public company. So they're stock dropped 5% which roughly equals about 67 trillion euros But what does this mean to you? Well your last outage according to the Aberdeen research group your last outage probably cost you about $100,000 per hour for that's their average across most businesses But one of the other interesting things is you know, we talk about deployments and we talk about outages But those don't protect us like as good as our deploys are they don't protect us against the bad code that our developers wrote That we're pushing out Slowness cost us money. So if we think about Just the applications You know Walmart comm has correlated that a hundred milliseconds of latency in their application equals about 1% of revenue Mozilla they shave 2.2 seconds off of their their website and that equates to about 10 and a quarter Downloads per year million downloads per year your slowness so interestingly enough If you deploy code if your developers write some code that's slow and you deploy it 28% abandonment rate per second of extra slowness and you compare that to an actual outage outages are actually much better Outages 9% of people will never come back. They'll permanently abandon your product for an outage But if you make it slow if you actually as an ops person did your job and deployed code and the code was bad and Slow that's much worse So when I talk about blue to green deploys like undo right that was the whole point of this was Blue drink green deploys was your flipping switches.  And that means you have limited ramifications. So if things go horribly wrong Great only a few are a subset of your customers have experienced that There's easier rollbacks. So because you're supporting two versions of the application at once You don't have the problems of oh my god We updated the database and now it's incompatible with the last version of the code so we can't roll back It's a load tolerant So one of the nice things about canary deploys is if you deploy new code and that code happens to use more resources Well, great You've only done it for a small subset You can monitor that and it gives you time to scale up your infrastructure to match if it is acceptable for it to use More resources and the last reason that canary deploys are really interesting is that you can do concurrency So you can try out a bunch of new features and deploy them to different canary groups And try to try to speed things up that way that said concurrency is often not recommended because running multiple experiments simultaneously Can lead to some problems So does all of this have to do with Kubernetes you're wondering well Kubernetes is a container orchestrator, right? Wrong actually Lucy who is up here for last talk asked what Kubernetes Kubernetes was and that was the answer your container orchestrator But that's wrong. It's actually a service orchestrator Right because if I were to imagine I built a car out of Legos and gave it to a kid and now some what this is He'd be like that's a toy car. That's a car. You wouldn't say this is Legos Similarly with Kubernetes. Yes, it uses containers, but the base unit the thing that it actually does is services By the way, I have stickers for squirrel nutties if you feel like stickers afterward. I Did say I was addicted to Pokemon go So the interesting thing right is If we wanted if we built our system out of microservices and we have this network of all these different services Well doing canary deploys or blue-green with that like this just doesn't make sense, right? You don't have it. You don't want to maintain an entire Network of microservices as a secondary and have some load balancer out front redirecting traffic so that's where a Kubernetes comes in right because Kubernetes as a service orchestrator allows You to it handles all of that it handles all of the networking communications between those services and What goes to what and so if you needed to change out or if you want to change out a service? Kubernetes makes that really easy So then why service meshes right Istio is a service mesh So what do what do service meshes like Istio provide us or why do we want them on Kubernetes? And the first is they make service discovery easier They also handle all the routing and load balancing so you can start setting up routing and load balancing on your services individually They handle timeouts and retries Right, so we can we can set arbitrary timeouts per service and how many times we actually want to retry and They can handle policy enforcement. So Your developers don't have to worry about how they're communicating to other services. For example They might be just calling, you know using curl or some sort of HTTP API That may not be encrypted the nice thing about service meshes is they can intercept that and put it over a TLS connection And all four of these things are really nice because it abstracts away the network from the application Your application shouldn't have to care about how they communicate to other services They should just make those calls and be able to get that So that's these are four of the big things that service meshes get us and the fifth is that? You get monitoring and tracing right if all network is now going through your mesh Well, your network can now see what services are calling other services. How long is that taking? So you can get a lot of interesting metrics from that So how does it all work we started with kubernetes you've got all the the network traffic going through it for your services First up is do you add the data plane? So with Istio you sidecar Istio? Which means that now it's going to proxy all of the network communications So they all go through Istio But that's actually a lie. It's not actually Istio. It's envoy So envoy is what Istio uses it packages it up automatically for you But what you are actually are it deploying as sidecars is envoy the nice thing about this though is it means that the whole Istio ecosystem is Modular so if there's another data plane that you would like to deploy you can actually use that After you have that data plane then you add a control plane So this is essentially the guts of Istio. It's where all of the logic happens all the configurations go through this and similarly if you don't like Istio, but you want some other service mesh like Container D or linker D. You can implement those So let's talk a little bit about Istio What is Istio actually comprised of the main part that I think most people are interested in for Istio is the mixer The mixer is at the core and it handles three main things and the first is precondition checking precondition checking essentially being access control so The second part is quota management. So quota management being rate limiting So again when we talked before about things like being able to circuit break or being able to do retries things like that so For example with the quota management You could say that a service particular service can only receive 5,000 requests per second And the final is telemetry reporting. So again adding in metrics traces logs All of that data because it can see what's going on over the network So you have the mixer, which is the core of Istio and then you have adapters. So adapters are how If you want to integrate anything or you want to extend the the capabilities of Istio, that's how you do it So for the precondition checking There are there are a bunch of things but as mentioned, it's mostly access control. So right now in Istio The four main ones that it's got is the denier adapter, which is essentially just the angry boss that says no to everything You've got the list adapter, which allows you to do whitelist black lists You have open policy agent OPA and role-blade based access control So these are all of the precondition adapters that are currently in Istio For quota management, there's only a couple mem quota, which is the default which essentially sets up all of your Your quota rules and tracks it in memory The downside of that is if things go down, it's in memory. So that's gone So red is quota is also out there it uses red as a back end for all of that And then telemetry reporting. So there are a ton of adapters most of the adapters for Istio are around telemetry So it started out with Prometheus and stats D But as we all know there are a ton of monitoring companies out there There are a ton of monitoring companies here in the sponsor hall and over in the dev upstay the sponsor hall So a ton of stuff has gotten added recently dog stats D for a data dog fluent D Serconis Solar winds there's just like a god like ton of different monitoring adapters, so whatever you're using there's probably something there All that said go and check them out They're all within the the mixer slash adapter folder on the Istio project. There's a bunch of stuff there So now that we've covered Istio, what should be our container or a canary strategy, right? How should we think about doing canary deploys? Well random is probably the default and That's the default in Istio if you set up a service with multiple versions and you were to tell it What to you know To just split between those it would just do it randomly essentially But random random's pretty decent if you're working in a service-based Configuration particularly if it's a non customer-facing service so a data dog when we canary deploy We typically start out with five to ten percent of traffic for any service. We'll start Being diverted to the canary and then we'll scale up from there but canary strategies like Random is bad when you're doing customer-facing Canaries right because random is uncontrolled real random is really hard So you get weird samples that you actually can't control so what you really want particularly if you're doing canary deploys For things that are customer-facing is representative sets And this requires knowing your user base you have to understand your mix of users So a few things to consider when you're considering your users is think about geography, right? for example Grubhub does canary deploys they will canary deploy to small cities like Detroit and then scale up to larger cities like New York before rolling things out globally But keep in mind that different geographies have different cultures you have to understand your users and how people in various locations Use your application Similarly think of time right different time zones. It's when you're doing canary deploys You have to keep in mind. How long do you actually want to monitor this canary?  And then finally uses patterns right similar to geography or times Understanding that if you canary deploy and you're targeting a subset of users Who all have a proclivity to use a certain feature of your application? How does that actually affect? Your stats or you're you're monitoring about what's going on And the other thing you have to consider is granularity, right? So you have to ensure that you have the right granularity as mentioned when we do services in the back end for data dog We start with five to ten percent and if you're doing essentially random canaries on a percentage that's easy to scale up But if you're starting to do representative sets, how do you scale up? How do you have a? Small size of users and then thinking of growing to a larger size So again thinking of like grub hub when they they deploy to Detroit first small city And then they can deploy to larger cities so thinking about your users how they actually use your application and The final thing that I think a lot of people miss when they're doing canary deploys is thinking about the resource mapping So if you are trying to test a particular feature and you're rolling out a canary to users that Are heavy on that feature How does that map to the resources behind it? What are the the data stores that are running behind it? What are the the the applications that serve that are you going to start hammering those? So think about how The groups that you're you're presenting canaries to will actually use the application and what that means for the resources That are behind it so then monitoring strategies, right? So thinking about now moving from what we're deploying to people to what we need to monitor and The first thing with our monitoring strategies is tags. You absolutely have to be tagging everything Right when we think of a metric we often think of it as a thing a number and a time But if you're canary deploying and you're mixing in this one Experiment with the rest of your stuff. You absolutely have to have a tag to know that that's the canary deployment Other things that you have to do when you're monitoring look at the extremes So looking at your 90th percentile is common I think for a lot of people but when you're thinking of canaries you're deploying to a very small subset So you have to look further at the extremes to start looking at your 95th percentile your 99th percentile And then when you're monitoring think about the outliers Right the things that don't actually match so can compare your canary deployment to prod So I have to throw in more memes but The outliers right the things that don't actually fit they should be Obvious that they're either not performing the way that they should be They're in line with the rest of your services or they're they're actually an outlier The fourth thing to look at when you're when you're monitoring your canaries is anomalies So anomalies I like to say is it wasn't like this before if you've got Tools particularly if you have a monitoring system that uses machine learning. This is a fantastic way or fantastic use for that So taking a look and letting your systems analyze what were things like before what should we expect? How is this behaving differently? And then when it actually comes to the things that you want to watch I like the four golden signals so the four golden signals is how Google does their their monitoring or the things that they look at It's part of the SRE books that they published and the first is latency. So take a look at Changes in latency are things taking longer, right? The next that they look at is errors So not only the error rate how many errors you're getting but take a look when you canary deploy at the types of errors Have the types of errors actually changed? The third of the four golden signals is traffic Has traffic changed and this this can be a big one Particularly if traffic goes down right if traffic goes down, you know people aren't doing the same things that they were So take a look at your canary figure out where traffic ought to be and Judge against that and then the final is saturation. So How are your resources doing are your research is your resource usage the same as it was before is it the same as odds prod Or is your canary doing something different and as said before one of the nice things about canaries is that you can scale up? So if you take a look at it, and you're like, yeah, we're using more resources, but that's expected Then great start scaling up So at this point I was gonna do a live demo And have you all pray to the demo gods? But the demo gods were very unhappy with me But it did bring to mind that Two weeks ago Kelsey high tower it gave this sage advice. It's you as an early project Please don't run out of here and go deploy it in prod because you'll be on the news and not in a good way So it's you as a fantastic project. They're doing a lot of cool things with it. It's changing really really rapidly But that said it's like not even alpha really so Definitely encourage you to play with it, but don't put it in prod.  That's that's how you install it. It's pretty easy So what happens when you when you cube cuddle apply on the Istio YAML? Well, it sets up a few services and they're all namespaced within Istio and the first is the Istio pilot Istio pilot handles all of the envoy API. So Going back to that data plane again Envoy is what's actually sidecarring all of your all of your pods and so That all your pods are talking through envoy Istio needs to understand on voice so the pilot handles the envoy API and that's how it can get the data The pilot also is the the platform interface. So I know we're talking about Kubernetes But Istio actually has integrations now for nomad Eureka cloud foundry and mesos So Istio pilot is actually what would talk to each of those if you wanted to roll Istio out on for example cloud foundry The next piece is the mixer and that's what we talked about before it handles the core logic bits and Then the final service that it'll implement is Istio ingress and this handles all the rules for inbound traffic Yeah So What do you do next so you install Istio? It's set up all these services Well, then we have to let Istio actually do the sidecarring. So this is traditionally how you do it You run Istio CTL cube inject And it will modify your your YAML files your manifests and then you apply those in Kubernetes So what does cube inject actually do well? It it does a bunch of stuff. It adds a bunch of stuff But the main part is this is that it adds an extra container. So again, it's setting up that envoy proxy and Getting that all running It also adds a bunch of annotations arguments that it needs in order to redirect all the traffic to that Brand new though in Kubernetes 1.9. It's beta is the mutating webhook admission controllers Which has a really awesome name. I think because it's super confusing Anybody familiar with admission controllers one person So admission controllers really in kubernetes they Intercept requests so when kubernetes is going to make an object like a pod it does some Authorization authentication and then it has this period of time that it allows Controllers or things to go and modify what's going to be done before to actually persist that So the cool thing is that in kubernetes 1.9 You have these mutating webhooks and mutating webhook doesn't mean that the webhook mutates like itself It means that the webhook mutates other things. So the nice thing about this is this is Brand new to Istio as well, but it allows Istio to not for for you not to have to manually update your YAML file It can simply have this webhook and so whenever you go to deploy a pod or you make a deployment After it gets Authorized but before it actually gets persisted the webhook can go in there and be like oh, yeah Istio should be on this and so it can automatically modify that and add the sidecar So this generally works based on labels You'll label your default namespace with the Istio injection enabled And then pretty much anything that gets deployed in that default namespace will Get a sidecar so canary deploying with Istio. How would you do it? Well, you'd first set up a standard service Istio doesn't actually touch any of your services. So you would have your basic service as a manifest You know pretty straightforward kubernetes and Then you would make your deployments and so when it comes to canary deploys With that one service you would have two deployments if you're you're moving just from one version to another And the main important parts here are that you want to label that with the version So here version one to version two and then obviously that has a different container as well So we've got version one and version two tags on those And then for Istio you set up a route rule so the route rule again is just gonna tell us Where we want to direct traffic so the main part here that we're looking at is the route And we're specifying that the labels of where we want to send traffic for v1 And how much weight so the weight here being a hundred percent We want to send all of our traffic and then in order to canary deploy if we're doing random We would just add another label and say that now we want to send things all to the v2 And we just change those weights so in this case we're sending now 20% of our traffic to the second version of our application Now I did mention like this is all random. So it's just gonna bounce between those You know at random you can't control what users but thankfully there are a ton of route rules out there So you can also do things based on request headers. So for example, you can set a cookie Determine use some IP lookup service to determine where that user is set a cookie and then route based on that So what else can I do? Well, I can do a ton of stuff. So that's the link to the the Istio documentation Circuit breakers are also part of routing Destination policy load balancing all of that is in there There's that is a really really long page of configuration things that you can do with routing So just as a quick recap when you're doing Or when you're considering this what do service meshes get us? Well, they get us more control and I think that's why they're super popular That's why I think most of you are here is trying to figure out how you can get more control over what's going on in Kubernetes When we think about canary deployments recap is Try not to do random particularly if it's customer facing try to think about your users because at the end of the day That's your high-level work metric that you should be driving on so think about how you can get representative sets based on Your particular users and how they do things and think of them in granular ways. How can you scale up because? Canary deploying works best when you have multiple levels of deploys when you can constantly ramp up more and Then when it comes to monitoring ensure that you've got tags Take a look at outliers and anomalies and Finally have to be watching the golden signals So look at the latency on your canaries the errors not only the rates, but the type of errors that you're getting traffic and saturation and That's about it any questions