This file contains hidden or 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
| # run nginx pods via deployment | |
| $ kubectl run nginx-is-dumb --image=nginx --replicas=2 --port=80 | |
| deployment "nginx-is-dumb" created | |
| $ kubectl get pods | |
| NAME READY STATUS RESTARTS AGE | |
| nginx-is-dumb-2691305027-lmmnb 1/1 Running 0 20m | |
| nginx-is-dumb-2691305027-r0n7c 1/1 Running 0 20m | |
| # back them by a service |
This file contains hidden or 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
| https://github.com/kelseyhightower/kubernetes-the-hard-way/tree/master/docs | |
| systemd: https://www.digitalocean.com/community/tutorials/systemd-essentials-working-with-services-units-and-the-journal | |
| https://www.linuxtrainingacademy.com/systemd-cheat-sheet/ | |
| kubectl: https://kubernetes.io/docs/user-guide/kubectl-cheatsheet/ | |
| worker nodes: | |
| - kube proxy: $ ps ax | grep kubeproxy | |
| - kubelet: systemctl list-units grep hyperkube | kubelet.service | |
| - kubelet: sudo systemctl status kubelet |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <sys/types.h> | |
| #include <sys/socket.h> | |
| #include <netdb.h> | |
| #include <string.h> | |
| int main() { | |
| int ret; | |
| struct addrinfo hints; | |
| struct addrinfo *res; |
This file contains hidden or 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: v1 | |
| kind: Pod | |
| metadata: | |
| name: log-app | |
| labels: | |
| app: log-app | |
| spec: | |
| containers: | |
| - name: log-app | |
| image: quay.io/leahnp/leah_log_app:latest |
This file contains hidden or 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
| 12-8-2016 | K8s SIG Instrumentation meeting | |
| Piotr: Kubelet cli create new logging #33111 issue, what are some solutions? | |
| Patrick: wants to discuss LogDir proposal - status? | |
| Piotr: problem with LogDir, there is no description/plan for finishing task | |
| Patrick: has questions and wants details about solution for LogDir task, wants to avoid re-hashing issues that have already been discussed. Storage SIG doesn’t want to deal with logging details. Can we find someone to flesh this out and implement? | |
| LogDir: field added to volume spec to indicate it's a logging volume and policy ( log rotation, location on disc) Kubelet could expose to host and let aggregator pull logs from connection. | |
| Mik: files for volumes that we want to mount somehow, that would be responsibility of the Kubelet | |
| Piotr: two proposals that are similar - which problem do we want to address. Basically we want to support more logging sources than just STDERR/STDOUT. SOLUTION: add sidecar to pick up logs, |
This file contains hidden or 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
| # Leah Petersen | |
| # HW 2-21-16 Calculator | |
| # Baseline and primary requirments, first three optional enhancements | |
| # Calc performs one operation on two numbers only | |
| puts "Hi, welcome to THE CALCULATOR. You can add/+, subtract/-, multiply/*, divide//, exponent/**, modulo/% two numbers.\n\n" | |
| # get first number | |
| puts "What is the first number in your equation?" | |
| num1 = gets.chomp.strip | |
| # if value is decimal, string to float if whole, string to integer |
This file contains hidden or 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
| # Leah Petersen | |
| # HW 2-19-16 "Account Generator" | |
| ### This program takes in file of names, creates an id and email, inserts name, | |
| # id, email as hash into student data array, prints student roster. | |
| ### This program does not account for multiple last names or hypenated names, | |
| # it justs takes the very last name and uses it as the last name for the email | |
| # prompts user for file name | |
| puts "What file do you want to open?" | |
| file = gets.chomp |
This file contains hidden or 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
| #leah petersen | |
| #homework 2-16-16 "hours-in-a-year" | |
| #format number strings with US-style commas | |
| def separate_comma(number) | |
| whole, decimal = number.to_s.split(".") | |
| whole_with_commas = whole.chars.to_a.reverse.each_slice(3).map(&:join).join(",").reverse | |
| [whole_with_commas, decimal].compact.join(".") | |
| end |