These files accompany a set of blog posts describing kubernetes custom metrics.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello-world | |
labels: | |
app: hello-world-app | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: DaemonSet | |
metadata: | |
name: nginx | |
labels: | |
app: nginx | |
spec: | |
selector: | |
matchLabels: | |
app: nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
use std::fs; | |
use std::process; | |
use std::io; | |
fn main() { | |
let args: Vec<String> = env::args().collect(); | |
let file_name = &args[1]; | |
let file_content_result = fs::read_to_string(file_name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[dependencies] | |
rusoto_core = "0.44.0" | |
rusoto_dynamodb = "0.44.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct User { | |
id: Option<String>, | |
first_name: String, | |
last_name: String, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[dependencies] | |
rusoto_core = "0.44.0" | |
rusoto_dynamodb = "0.44.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate rusoto_dynamodb; | |
use rusoto_dynamodb::AttributeValue; | |
use std::default::Default; | |
use std::result::Result; | |
impl User { | |
fn from_map(map: HashMap<String, AttributeValue>) -> Result<User, &'static str> { | |
return Ok(User { | |
id: match map.get("id") { |
OlderNewer